Commit 17f961a6 authored by Marek Vasut's avatar Marek Vasut Committed by Jonathan Cameron

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.
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20230831182502.154899-1-marex@denx.deSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 33ec3e5f
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment