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

Configure Feed

Select the types of activity you want to include in your feed.

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

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@exalondelft.nl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221207190348.9347-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Ferry Toth and committed by
Jonathan Cameron
027641b5 22cd9320

+7 -1
+7 -1
drivers/iio/light/tsl2563.c
··· 704 704 struct iio_dev *indio_dev; 705 705 struct tsl2563_chip *chip; 706 706 struct tsl2563_platform_data *pdata = client->dev.platform_data; 707 + unsigned long irq_flags; 707 708 int err = 0; 708 709 u8 id = 0; 709 710 ··· 760 759 indio_dev->info = &tsl2563_info_no_irq; 761 760 762 761 if (client->irq) { 762 + irq_flags = irq_get_trigger_type(client->irq); 763 + if (irq_flags == IRQF_TRIGGER_NONE) 764 + irq_flags = IRQF_TRIGGER_RISING; 765 + irq_flags |= IRQF_ONESHOT; 766 + 763 767 err = devm_request_threaded_irq(&client->dev, client->irq, 764 768 NULL, 765 769 &tsl2563_event_handler, 766 - IRQF_TRIGGER_RISING | IRQF_ONESHOT, 770 + irq_flags, 767 771 "tsl2563_event", 768 772 indio_dev); 769 773 if (err) {