diff options
-rw-r--r-- | Documentation/ABI/testing/sysfs-bus-iio | 11 | ||||
-rw-r--r-- | drivers/iio/industrialio-core.c | 1 | ||||
-rw-r--r-- | include/linux/iio/iio.h | 1 | ||||
-rw-r--r-- | include/linux/iio/sysfs.h | 15 |
4 files changed, 28 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 39c8de0e53d0..ab1047c20495 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio | |||
@@ -811,3 +811,14 @@ Description: | |||
811 | Writing '1' stores the current device configuration into | 811 | Writing '1' stores the current device configuration into |
812 | on-chip EEPROM. After power-up or chip reset the device will | 812 | on-chip EEPROM. After power-up or chip reset the device will |
813 | automatically load the saved configuration. | 813 | automatically load the saved configuration. |
814 | |||
815 | What: /sys/.../iio:deviceX/in_intensity_red_integration_time | ||
816 | What: /sys/.../iio:deviceX/in_intensity_green_integration_time | ||
817 | What: /sys/.../iio:deviceX/in_intensity_blue_integration_time | ||
818 | What: /sys/.../iio:deviceX/in_intensity_clear_integration_time | ||
819 | What: /sys/.../iio:deviceX/in_illuminance_integration_time | ||
820 | KernelVersion: 3.12 | ||
821 | Contact: linux-iio@vger.kernel.org | ||
822 | Description: | ||
823 | This attribute is used to get/set the integration time in | ||
824 | seconds. | ||
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 97f0297b120f..2cb4841d5357 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
@@ -101,6 +101,7 @@ static const char * const iio_chan_info_postfix[] = { | |||
101 | [IIO_CHAN_INFO_PHASE] = "phase", | 101 | [IIO_CHAN_INFO_PHASE] = "phase", |
102 | [IIO_CHAN_INFO_HARDWAREGAIN] = "hardwaregain", | 102 | [IIO_CHAN_INFO_HARDWAREGAIN] = "hardwaregain", |
103 | [IIO_CHAN_INFO_HYSTERESIS] = "hysteresis", | 103 | [IIO_CHAN_INFO_HYSTERESIS] = "hysteresis", |
104 | [IIO_CHAN_INFO_INT_TIME] = "integration_time", | ||
104 | }; | 105 | }; |
105 | 106 | ||
106 | const struct iio_chan_spec | 107 | const struct iio_chan_spec |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 8e7a8132b109..01edd6795550 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -36,6 +36,7 @@ enum iio_chan_info_enum { | |||
36 | IIO_CHAN_INFO_PHASE, | 36 | IIO_CHAN_INFO_PHASE, |
37 | IIO_CHAN_INFO_HARDWAREGAIN, | 37 | IIO_CHAN_INFO_HARDWAREGAIN, |
38 | IIO_CHAN_INFO_HYSTERESIS, | 38 | IIO_CHAN_INFO_HYSTERESIS, |
39 | IIO_CHAN_INFO_INT_TIME, | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | enum iio_endian { | 42 | enum iio_endian { |
diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h index 2958c960003a..8a1d18640ab9 100644 --- a/include/linux/iio/sysfs.h +++ b/include/linux/iio/sysfs.h | |||
@@ -100,6 +100,21 @@ struct iio_const_attr { | |||
100 | #define IIO_CONST_ATTR_SAMP_FREQ_AVAIL(_string) \ | 100 | #define IIO_CONST_ATTR_SAMP_FREQ_AVAIL(_string) \ |
101 | IIO_CONST_ATTR(sampling_frequency_available, _string) | 101 | IIO_CONST_ATTR(sampling_frequency_available, _string) |
102 | 102 | ||
103 | /** | ||
104 | * IIO_DEV_ATTR_INT_TIME_AVAIL - list available integration times | ||
105 | * @_show: output method for the attribute | ||
106 | **/ | ||
107 | #define IIO_DEV_ATTR_INT_TIME_AVAIL(_show) \ | ||
108 | IIO_DEVICE_ATTR(integration_time_available, S_IRUGO, _show, NULL, 0) | ||
109 | /** | ||
110 | * IIO_CONST_ATTR_INT_TIME_AVAIL - list available integration times | ||
111 | * @_string: frequency string for the attribute | ||
112 | * | ||
113 | * Constant version | ||
114 | **/ | ||
115 | #define IIO_CONST_ATTR_INT_TIME_AVAIL(_string) \ | ||
116 | IIO_CONST_ATTR(integration_time_available, _string) | ||
117 | |||
103 | #define IIO_DEV_ATTR_TEMP_RAW(_show) \ | 118 | #define IIO_DEV_ATTR_TEMP_RAW(_show) \ |
104 | IIO_DEVICE_ATTR(in_temp_raw, S_IRUGO, _show, NULL, 0) | 119 | IIO_DEVICE_ATTR(in_temp_raw, S_IRUGO, _show, NULL, 0) |
105 | 120 | ||