Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

extcon: usbc-tusb320: Set interrupt polarity based on device-tree

Remove 'IRQF_TRIGGER_FALLING' request which is not allowed on
every interrupt controller (i.e. arm64 GIC). Replace flag by a
request that depends on the actual device-tree setting.

Link: https://lore.kernel.org/all/02a701da2717$48abf150$da03d3f0$@samsung.com/
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311221355.yxYpTIw3-lkp@intel.com/
Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Lukas Funke and committed by
Chanwoo Choi
d03a7005 e66523c7

+8 -1
+8 -1
drivers/extcon/extcon-usbc-tusb320.c
··· 17 17 #include <linux/usb/typec.h> 18 18 #include <linux/usb/typec_altmode.h> 19 19 #include <linux/usb/role.h> 20 + #include <linux/irq.h> 20 21 21 22 #define TUSB320_REG8 0x8 22 23 #define TUSB320_REG8_CURRENT_MODE_ADVERTISE GENMASK(7, 6) ··· 516 515 const void *match_data; 517 516 unsigned int revision; 518 517 int ret; 518 + u32 irq_trigger_type = IRQF_TRIGGER_FALLING; 519 + struct irq_data *irq_d; 519 520 520 521 priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); 521 522 if (!priv) ··· 571 568 */ 572 569 tusb320_state_update_handler(priv, true); 573 570 571 + irq_d = irq_get_irq_data(client->irq); 572 + if (irq_d) 573 + irq_trigger_type = irqd_get_trigger_type(irq_d); 574 + 574 575 ret = devm_request_threaded_irq(priv->dev, client->irq, NULL, 575 576 tusb320_irq_handler, 576 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 577 + IRQF_ONESHOT | irq_trigger_type, 577 578 client->name, priv); 578 579 if (ret) 579 580 tusb320_typec_remove(priv);