From: Linus Walleij Date: Tue, 18 May 2021 23:07:18 +0000 (+0200) Subject: iio: st_sensors: Create extended attr macro X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=42ef8aa2263b19b06e69a318dbd8f1639013ded3;p=linux.git 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 Cc: Denis Ciocca Cc: Daniel Drake Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold Signed-off-by: Linus Walleij Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron --- diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 0b9aeb479f486..8e0d76b42db9b 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h @@ -48,8 +48,8 @@ #define ST_SENSORS_MAX_NAME 17 #define ST_SENSORS_MAX_4WAI 8 -#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \ - ch2, s, endian, rbits, sbits, addr) \ +#define ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod, \ + ch2, s, endian, rbits, sbits, addr, ext) \ { \ .type = device_type, \ .modified = mod, \ @@ -65,8 +65,14 @@ .storagebits = sbits, \ .endianness = endian, \ }, \ + .ext_info = ext, \ } +#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \ + ch2, s, endian, rbits, sbits, addr) \ + ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod, \ + ch2, s, endian, rbits, sbits, addr, NULL) + #define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \ IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \ st_sensors_sysfs_sampling_frequency_avail)