Skip to content

Commit 42ef8aa

Browse files
Linus WalleijJonathan Cameron
authored andcommitted
iio: st_sensors: Create extended attr macro
Extend ST_SENSORS_LSM_CHANNELS() to a version that will accept extended attributes named ST_SENSORS_LSM_CHANNELS_EXT() and wrap the former as a specialized version of the former. Cc: Hans de Goede <hdegoede@redhat.com> Cc: Denis Ciocca <denis.ciocca@st.com> Cc: Daniel Drake <drake@endlessm.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 5d142d4 commit 42ef8aa

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎include/linux/iio/common/st_sensors.h‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
#define ST_SENSORS_MAX_NAME 17
4949
#define ST_SENSORS_MAX_4WAI 8
5050

51-
#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
52-
ch2, s, endian, rbits, sbits, addr) \
51+
#define ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod, \
52+
ch2, s, endian, rbits, sbits, addr, ext) \
5353
{ \
5454
.type = device_type, \
5555
.modified = mod, \
@@ -65,8 +65,14 @@
6565
.storagebits = sbits, \
6666
.endianness = endian, \
6767
}, \
68+
.ext_info = ext, \
6869
}
6970

71+
#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
72+
ch2, s, endian, rbits, sbits, addr) \
73+
ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod, \
74+
ch2, s, endian, rbits, sbits, addr, NULL)
75+
7076
#define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \
7177
IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \
7278
st_sensors_sysfs_sampling_frequency_avail)

0 commit comments

Comments
 (0)