linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: max8907: Remove IRQF_NO_AUTOEN flag
@ 2021-06-14 22:24 Sergey Larin
  2021-06-15 12:19 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Larin @ 2021-06-14 22:24 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Sergey Larin

IRQF_NO_AUTOEN flag doesn't go well with IRQF_SHARED flag - the
check in request_threaded_irq fails and exits with EINVAL.

So we ignore the flag and enable it on the first IRQ request. No
interrupt should arrive from the chip as all interrupts are masked
by default.

Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
---
 drivers/mfd/max8907.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c
index 40e70ab88956..41f566e6a096 100644
--- a/drivers/mfd/max8907.c
+++ b/drivers/mfd/max8907.c
@@ -229,7 +229,7 @@ static int max8907_i2c_probe(struct i2c_client *i2c,
 	}
 
 	ret = regmap_add_irq_chip(max8907->regmap_gen, max8907->i2c_gen->irq,
-				  IRQF_ONESHOT | IRQF_SHARED | IRQF_NO_AUTOEN,
+				  IRQF_ONESHOT | IRQF_SHARED,
 				  -1, &max8907_chg_irq_chip,
 				  &max8907->irqc_chg);
 	if (ret != 0) {
@@ -253,8 +253,6 @@ static int max8907_i2c_probe(struct i2c_client *i2c,
 		goto err_irqc_rtc;
 	}
 
-	enable_irq(max8907->i2c_gen->irq);
-
 	ret = mfd_add_devices(max8907->dev, -1, max8907_cells,
 			      ARRAY_SIZE(max8907_cells), NULL, 0, NULL);
 	if (ret != 0) {
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-15 12:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-14 22:24 [PATCH] mfd: max8907: Remove IRQF_NO_AUTOEN flag Sergey Larin
2021-06-15 12:19 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).