Skip to content

Commit bbf6327

Browse files
Xu Yanggregkh
authored andcommitted
extcon: ptn5150: handle pending IRQ events during system resume
commit 4652fef upstream. When the system is suspended and ptn5150 wakeup interrupt is disabled, any changes on ptn5150 will only be record in interrupt status registers and won't fire an IRQ since its trigger type is falling edge. So the HW interrupt line will keep at low state and any further changes won't trigger IRQ anymore. To fix it, this will schedule a work to check whether any IRQ are pending and handle it accordingly. Fixes: 4ed754d ("extcon: Add support for ptn5150 extcon driver") Cc: stable@vger.kernel.org Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Link: https://lore.kernel.org/lkml/20251115025905.1395347-1-xu.yang_2@nxp.com/ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 196efa8 commit bbf6327

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/extcon/extcon-ptn5150.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,19 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c)
331331
return 0;
332332
}
333333

334+
static int ptn5150_resume(struct device *dev)
335+
{
336+
struct i2c_client *i2c = to_i2c_client(dev);
337+
struct ptn5150_info *info = i2c_get_clientdata(i2c);
338+
339+
/* Need to check possible pending interrupt events */
340+
schedule_work(&info->irq_work);
341+
342+
return 0;
343+
}
344+
345+
static DEFINE_SIMPLE_DEV_PM_OPS(ptn5150_pm_ops, NULL, ptn5150_resume);
346+
334347
static const struct of_device_id ptn5150_dt_match[] = {
335348
{ .compatible = "nxp,ptn5150" },
336349
{ },
@@ -346,6 +359,7 @@ MODULE_DEVICE_TABLE(i2c, ptn5150_i2c_id);
346359
static struct i2c_driver ptn5150_i2c_driver = {
347360
.driver = {
348361
.name = "ptn5150",
362+
.pm = pm_sleep_ptr(&ptn5150_pm_ops),
349363
.of_match_table = ptn5150_dt_match,
350364
},
351365
.probe = ptn5150_i2c_probe,

0 commit comments

Comments
 (0)