* [PATCH v3] extcon: usbc-tusb320: Set interrupt polarity based on device-tree
[not found] <CGME20231205010631epcas1p48036e1b3f087f23807f69cc9c465cb07@epcas1p4.samsung.com>
@ 2023-12-05 1:06 ` Chanwoo Choi
2023-12-05 1:14 ` Chanwoo Choi
0 siblings, 1 reply; 2+ messages in thread
From: Chanwoo Choi @ 2023-12-05 1:06 UTC (permalink / raw
To: linux-kernel
Cc: 'Lukas Funke', 'Signed-off-by: Chanwoo Choi',
'Chanwoo Choi', 'MyungJoo Ham',
'Reported-by: kernel test robot'
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.
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>
---
Changes from v2
- Use IRQF_TRIGGER_FALLING if there are no irq_data on devicetree
drivers/extcon/extcon-usbc-tusb320.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/extcon/extcon-usbc-tusb320.c
b/drivers/extcon/extcon-usbc-tusb320.c
index 4d08c2123e59..2eab341de6b7 100644
--- a/drivers/extcon/extcon-usbc-tusb320.c
+++ b/drivers/extcon/extcon-usbc-tusb320.c
@@ -17,6 +17,7 @@
#include <linux/usb/typec.h>
#include <linux/usb/typec_altmode.h>
#include <linux/usb/role.h>
+#include <linux/irq.h>
#define TUSB320_REG8 0x8
#define TUSB320_REG8_CURRENT_MODE_ADVERTISE GENMASK(7, 6)
@@ -515,6 +516,8 @@ static int tusb320_probe(struct i2c_client *client)
const void *match_data;
unsigned int revision;
int ret;
+ u32 irq_trigger_type = IRQF_TRIGGER_FALLING;
+ struct irq_data *irq_d;
priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
@@ -568,9 +571,13 @@ static int tusb320_probe(struct i2c_client *client)
*/
tusb320_state_update_handler(priv, true);
+ irq_d = irq_get_irq_data(client->irq);
+ if (irq_d)
+ irq_trigger_type = irqd_get_trigger_type(irq_d);
+
ret = devm_request_threaded_irq(priv->dev, client->irq, NULL,
tusb320_irq_handler,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ IRQF_ONESHOT | irq_trigger_type,
client->name, priv);
if (ret)
tusb320_typec_remove(priv);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH v3] extcon: usbc-tusb320: Set interrupt polarity based on device-tree
2023-12-05 1:06 ` [PATCH v3] extcon: usbc-tusb320: Set interrupt polarity based on device-tree Chanwoo Choi
@ 2023-12-05 1:14 ` Chanwoo Choi
0 siblings, 0 replies; 2+ messages in thread
From: Chanwoo Choi @ 2023-12-05 1:14 UTC (permalink / raw
To: linux-kernel
Cc: 'Lukas Funke', 'Chanwoo Choi',
'MyungJoo Ham', 'Reported-by: kernel test robot'
> -----Original Message-----
> From: Chanwoo Choi <cw00.choi@samsung.com>
> Sent: Tuesday, December 5, 2023 10:07 AM
> To: linux-kernel@vger.kernel.org
> Cc: 'Lukas Funke' <lukas.funke-oss@weidmueller.com>; 'Signed-off-by:
> Chanwoo Choi' <cw00.choi@samsung.com>; 'Chanwoo Choi' <chanwoo@kernel.org>;
> 'MyungJoo Ham' <myungjoo.ham@samsung.com>; 'Reported-by: kernel test robot'
> <lkp@intel.com>
> Subject: [PATCH v3] 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.
>
> 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>
> ---
> Changes from v2
> - Use IRQF_TRIGGER_FALLING if there are no irq_data on devicetree
>
> drivers/extcon/extcon-usbc-tusb320.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/extcon/extcon-usbc-tusb320.c
> b/drivers/extcon/extcon-usbc-tusb320.c
> index 4d08c2123e59..2eab341de6b7 100644
> --- a/drivers/extcon/extcon-usbc-tusb320.c
> +++ b/drivers/extcon/extcon-usbc-tusb320.c
> @@ -17,6 +17,7 @@
> #include <linux/usb/typec.h>
> #include <linux/usb/typec_altmode.h>
> #include <linux/usb/role.h>
> +#include <linux/irq.h>
>
> #define TUSB320_REG8 0x8
> #define TUSB320_REG8_CURRENT_MODE_ADVERTISE GENMASK(7, 6)
> @@ -515,6 +516,8 @@ static int tusb320_probe(struct i2c_client *client)
> const void *match_data;
> unsigned int revision;
> int ret;
> + u32 irq_trigger_type = IRQF_TRIGGER_FALLING;
> + struct irq_data *irq_d;
>
> priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
> if (!priv)
> @@ -568,9 +571,13 @@ static int tusb320_probe(struct i2c_client *client)
> */
> tusb320_state_update_handler(priv, true);
>
> + irq_d = irq_get_irq_data(client->irq);
> + if (irq_d)
> + irq_trigger_type = irqd_get_trigger_type(irq_d);
> +
> ret = devm_request_threaded_irq(priv->dev, client->irq, NULL,
> tusb320_irq_handler,
> - IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> + IRQF_ONESHOT | irq_trigger_type,
> client->name, priv);
> if (ret)
> tusb320_typec_remove(priv);
> --
> 2.25.1
Applied it. Thanks.
Best Regards,
Chanwoo Choi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-05 1:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20231205010631epcas1p48036e1b3f087f23807f69cc9c465cb07@epcas1p4.samsung.com>
2023-12-05 1:06 ` [PATCH v3] extcon: usbc-tusb320: Set interrupt polarity based on device-tree Chanwoo Choi
2023-12-05 1:14 ` Chanwoo Choi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.