summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorTsz Shan Chan <tsz.chan.dev@gmail.com>2026-08-05 15:55:16 +1000
committerLinus Walleij <linusw@kernel.org>2026-08-06 23:37:39 +0200
commitd4f32b8b8a3bcc7c07603b097d16320015af8e3c (patch)
tree37ab0bd68643c9a013245ae3eb47aa9aa54c6f50 /drivers/pinctrl
parentc04957d2fc45af6f637cb21b21a15e05aa8bddfc (diff)
downloadlinux-next-d4f32b8b8a3bcc7c07603b097d16320015af8e3c.tar.gz
linux-next-d4f32b8b8a3bcc7c07603b097d16320015af8e3c.zip
pinctrl: sx150x: get parent IRQ trigger type from firmware
The driver currently hardcodes the parent interrupt trigger type to IRQF_TRIGGER_FALLING. Use the trigger type configured by firmware instead. If no trigger type is specified, fall back to IRQF_TRIGGER_FALLING to maintain current behaviour. Support IRQF_TRIGGER_FALLING and IRQF_TRIGGER_LOW, which match the sx150x open drain active low interrupt output. Reject unsupported trigger types. Signed-off-by: Tsz Shan Chan <tchan@jacques.com.au> Signed-off-by: Linus Walleij <linusw@kernel.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/pinctrl-sx150x.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c
index 3c1309e8a844..5eb6cc476eb3 100644
--- a/drivers/pinctrl/pinctrl-sx150x.c
+++ b/drivers/pinctrl/pinctrl-sx150x.c
@@ -1126,6 +1126,7 @@ static int sx150x_probe(struct i2c_client *client)
I2C_FUNC_SMBUS_WRITE_WORD_DATA;
struct device *dev = &client->dev;
struct sx150x_pinctrl *pctl;
+ u32 irq_type;
int ret;
if (!i2c_check_functionality(client->adapter, i2c_funcs))
@@ -1225,10 +1226,24 @@ static int sx150x_probe(struct i2c_client *client)
girq->handler = handle_bad_irq;
girq->threaded = true;
+ irq_type = irq_get_trigger_type(client->irq);
+ switch (irq_type) {
+ case IRQF_TRIGGER_FALLING:
+ case IRQF_TRIGGER_LOW:
+ break;
+ case IRQF_TRIGGER_NONE:
+ irq_type = IRQF_TRIGGER_FALLING;
+ break;
+ default:
+ return dev_err_probe(dev, -EINVAL,
+ "unsupported irq trigger type %x\n",
+ irq_type);
+ }
+
ret = devm_request_threaded_irq(dev, client->irq, NULL,
sx150x_irq_thread_fn,
IRQF_ONESHOT | IRQF_SHARED |
- IRQF_TRIGGER_FALLING,
+ irq_type,
client->name, pctl);
if (ret < 0)
return ret;