Commit 0bae0685 authored by Bárbara Fernandes's avatar Bárbara Fernandes Committed by Jonathan Cameron

staging: iio: cdc: ad7150: create macro for capacitance channels

Create macro for capacitance channels in order to remove the repeated
code and improve its readability.
Signed-off-by: default avatarBárbara Fernandes <barbara.fernandes@usp.br>
Signed-off-by: default avatarWilson Sales <spoonm@spoonm.org>
Co-developed-by: default avatarWilson Sales <spoonm@spoonm.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 1f48d056
...@@ -465,24 +465,19 @@ static const struct iio_event_spec ad7150_events[] = { ...@@ -465,24 +465,19 @@ static const struct iio_event_spec ad7150_events[] = {
}, },
}; };
#define AD7150_CAPACITANCE_CHAN(_chan) { \
.type = IIO_CAPACITANCE, \
.indexed = 1, \
.channel = _chan, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
BIT(IIO_CHAN_INFO_AVERAGE_RAW), \
.event_spec = ad7150_events, \
.num_event_specs = ARRAY_SIZE(ad7150_events), \
}
static const struct iio_chan_spec ad7150_channels[] = { static const struct iio_chan_spec ad7150_channels[] = {
{ AD7150_CAPACITANCE_CHAN(0),
.type = IIO_CAPACITANCE, AD7150_CAPACITANCE_CHAN(1)
.indexed = 1,
.channel = 0,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
BIT(IIO_CHAN_INFO_AVERAGE_RAW),
.event_spec = ad7150_events,
.num_event_specs = ARRAY_SIZE(ad7150_events),
}, {
.type = IIO_CAPACITANCE,
.indexed = 1,
.channel = 1,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
BIT(IIO_CHAN_INFO_AVERAGE_RAW),
.event_spec = ad7150_events,
.num_event_specs = ARRAY_SIZE(ad7150_events),
},
}; };
/* /*
......
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