Patch "iio: light: tsl2563: Do not hardcode interrupt trigger type" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iio: light: tsl2563: Do not hardcode interrupt trigger type

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iio-light-tsl2563-do-not-hardcode-interrupt-trigger-.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7a697f0bf3200ec81f3d6382b040ed968a8b591f
Author: Ferry Toth <ftoth@xxxxxxxxxxxxxx>
Date:   Wed Dec 7 21:03:38 2022 +0200

    iio: light: tsl2563: Do not hardcode interrupt trigger type
    
    [ Upstream commit 027641b52fe37b64af61025298ce160c8b9b7a73 ]
    
    Instead of hardcoding IRQ trigger type to IRQF_TRIGGER_RAISING,
    let's respect the settings specified in the firmware description.
    To be compatible with the older firmware descriptions, if trigger
    type is not set up there, we'll set it to default (raising edge).
    
    Fixes: 388be4883952 ("staging:iio: tsl2563 abi fixes and interrupt handling")
    Fixes: bdab1001738f ("staging:iio:light:tsl2563 remove old style event registration.")
    Signed-off-by: Ferry Toth <ftoth@xxxxxxxxxxxxxx>
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221207190348.9347-1-andriy.shevchenko@xxxxxxxxxxxxxxx
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
index 951f35ef3f41d..47a4626e94610 100644
--- a/drivers/iio/light/tsl2563.c
+++ b/drivers/iio/light/tsl2563.c
@@ -705,6 +705,7 @@ static int tsl2563_probe(struct i2c_client *client,
 	struct iio_dev *indio_dev;
 	struct tsl2563_chip *chip;
 	struct tsl2563_platform_data *pdata = client->dev.platform_data;
+	unsigned long irq_flags;
 	int err = 0;
 	u8 id = 0;
 
@@ -760,10 +761,15 @@ static int tsl2563_probe(struct i2c_client *client,
 		indio_dev->info = &tsl2563_info_no_irq;
 
 	if (client->irq) {
+		irq_flags = irq_get_trigger_type(client->irq);
+		if (irq_flags == IRQF_TRIGGER_NONE)
+			irq_flags = IRQF_TRIGGER_RISING;
+		irq_flags |= IRQF_ONESHOT;
+
 		err = devm_request_threaded_irq(&client->dev, client->irq,
 					   NULL,
 					   &tsl2563_event_handler,
-					   IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+					   irq_flags,
 					   "tsl2563_event",
 					   indio_dev);
 		if (err) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux