summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2015-04-10 12:49:24 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-01-10 23:11:20 +0100
commite4d913a9dcbae4bc68205d091166dde4bb12357b (patch)
tree6be5d31bc5783f8be972c6e06e318ccb3dd2ea79 /drivers/staging
parentaf6cf450b1f47ddd8e7f8ac0f3b2be5a85725357 (diff)
iio:stmpe-adc.c: Switch to new event config interface
Switch the stmpe-adc driver to the new IIO event config interface as the old one is going to be removed. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 928ac1ed52919ba6f2ec06aa45269bc15913ba87)
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/iio/adc/stmpe-adc.c56
1 files changed, 33 insertions, 23 deletions
diff --git a/drivers/staging/iio/adc/stmpe-adc.c b/drivers/staging/iio/adc/stmpe-adc.c
index 64d081a0d98a..783297f09e65 100644
--- a/drivers/staging/iio/adc/stmpe-adc.c
+++ b/drivers/staging/iio/adc/stmpe-adc.c
@@ -166,53 +166,63 @@ static const struct iio_info stmpe_adc_iio_info = {
.driver_module = THIS_MODULE,
};
-#define STMPE_EV_M \
- (IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING) \
- | IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING))
-#define STMPE_VOLTAGE_CHAN(_chan) \
+static const struct iio_event_spec stmpe_adc_events[] = {
+ {
+ .type = IIO_EV_TYPE_THRESH,
+ .dir = IIO_EV_DIR_RISING,
+ .mask_separate = BIT(IIO_EV_INFO_VALUE) |
+ BIT(IIO_EV_INFO_ENABLE),
+ }, {
+ .type = IIO_EV_TYPE_THRESH,
+ .dir = IIO_EV_DIR_FALLING,
+ .mask_separate = BIT(IIO_EV_INFO_VALUE) |
+ BIT(IIO_EV_INFO_ENABLE),
+ },
+};
+
+#define STMPE_VOLTAGE_CHAN(_chan, ev_spec, num_ev_spec) \
{ \
.type = IIO_VOLTAGE, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
.indexed = 1, \
.channel = _chan, \
- .event_mask = STMPE_EV_M, \
+ .event_spec = ev_spec, \
+ .num_event_specs = num_ev_spec, \
}
static const struct iio_chan_spec stmpe_adc_all_iio_channels[] = {
- STMPE_VOLTAGE_CHAN(0),
- STMPE_VOLTAGE_CHAN(1),
- STMPE_VOLTAGE_CHAN(2),
- STMPE_VOLTAGE_CHAN(3),
- STMPE_VOLTAGE_CHAN(4),
- STMPE_VOLTAGE_CHAN(5),
- STMPE_VOLTAGE_CHAN(6),
- STMPE_VOLTAGE_CHAN(7),
+ STMPE_VOLTAGE_CHAN(0, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(1, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(2, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(3, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(4, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(5, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(6, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(7, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
{
.type = IIO_TEMP,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
.indexed = 1,
.channel = 8,
- .event_mask =
- IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING)|
- IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING)
+ .event_spec = stmpe_adc_events,
+ .num_event_specs = ARRAY_SIZE(stmpe_adc_events),
}
};
static const struct iio_chan_spec stmpe_adc_iio_channels[] = {
- STMPE_VOLTAGE_CHAN(4),
- STMPE_VOLTAGE_CHAN(5),
- STMPE_VOLTAGE_CHAN(6),
- STMPE_VOLTAGE_CHAN(7),
+ STMPE_VOLTAGE_CHAN(4, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(5, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(6, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
+ STMPE_VOLTAGE_CHAN(7, stmpe_adc_events, ARRAY_SIZE(stmpe_adc_events)),
{
.type = IIO_TEMP,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
.indexed = 1,
.channel = 8,
- .event_mask =
- IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING)|
- IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING)
+ .event_spec = stmpe_adc_events,
+ .num_event_specs = ARRAY_SIZE(stmpe_adc_events),
}
};