Skip to contentSkip to conversation

iio: adc: ti-ads1015: Add edge trigger support

PATCH In review Marek Vasut 2 participants 3 messages Aug 31, 2023 – Sep 3, 2023 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: adc: ti-ads1015: Add edge trigger support

The comparator generates an edge on the IRQ like and stays in the configured state until cleared. Support edge triggered IRQs as well as not all controllers do support level triggered IRQ.

---
Cc: "Uwe Kleine-König" <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: [email protected]

---
 drivers/iio/adc/ti-ads1015.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/adc/ti-ads1015.c +2 -0
index 075c75a875449..addee45ed40ad 100644
@@ -1047,11 +1047,13 @@ static int ads1015_probe(struct i2c_client *client)
 			1 << ADS1015_CFG_COMP_LAT_SHIFT;
 
 		switch (irq_trig) {
+		case IRQF_TRIGGER_FALLING:
 		case IRQF_TRIGGER_LOW:
 			cfg_comp |= ADS1015_CFG_COMP_POL_LOW <<
 					ADS1015_CFG_COMP_POL_SHIFT;
 			break;
 		case IRQF_TRIGGER_HIGH:
+		case IRQF_TRIGGER_RISING:
 			cfg_comp |= ADS1015_CFG_COMP_POL_HIGH <<
 					ADS1015_CFG_COMP_POL_SHIFT;
 			break;
Signature · 1 line
2.40.1
maintainer
#1 lore raw
Quoted 5 lines · On Thu, 31 Aug 2023 20:25:02 +0200 Marek Vasut <[email protected]> wrote:

The comparator generates an edge on the IRQ like and stays in the configured state until cleared. Support edge triggered IRQs as well as not all controllers do support level triggered IRQ.

Hi Marek,

Seems safe enough change given the latch is enabled.

I guess it's not really a fix, but I'd be fine with a request for this to be added to stable if you like.

Applied to the togreg branch of iio.git and pushed out as testing only until I can rebase on rc1.

Thanks,

Jonathan

Quoted 29 lines

---
Cc: "Uwe Kleine-König" <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: [email protected]

---
 drivers/iio/adc/ti-ads1015.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/adc/ti-ads1015.c +2 -0
index 075c75a875449..addee45ed40ad 100644
@@ -1047,11 +1047,13 @@ static int ads1015_probe(struct i2c_client *client)
 			1 << ADS1015_CFG_COMP_LAT_SHIFT;
 
 		switch (irq_trig) {
+		case IRQF_TRIGGER_FALLING:
 		case IRQF_TRIGGER_LOW:
 			cfg_comp |= ADS1015_CFG_COMP_POL_LOW <<
 					ADS1015_CFG_COMP_POL_SHIFT;
 			break;
 		case IRQF_TRIGGER_HIGH:
+		case IRQF_TRIGGER_RISING:
 			cfg_comp |= ADS1015_CFG_COMP_POL_HIGH <<
 					ADS1015_CFG_COMP_POL_SHIFT;
 			break;
#2 lore raw
Quoted 7 lines · Jonathan Cameron
Quoted 4 lines · On Thu, 31 Aug 2023 20:25:02 +0200 Marek Vasut <[email protected]> wrote:

The comparator generates an edge on the IRQ like and stays in the configured state until cleared. Support edge triggered IRQs as well as not all controllers do support level triggered IRQ.

Quoted 8 lines
Quoted 1 line

Hi Marek,

Seems safe enough change given the latch is enabled.

I guess it's not really a fix, but I'd be fine with a request for this to be added to stable if you like.

It isn't really a fix, so next release is fine.

Quoted 2 lines

Applied to the togreg branch of iio.git and pushed out as testing only until I can rebase on rc1.

Thanks