diff options
-rw-r--r-- | Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935 | 2 | ||||
-rw-r--r-- | drivers/iio/proximity/as3935.c | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935 b/Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935 index 6708c5e264aa..33e96f740639 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935 +++ b/Documentation/ABI/testing/sysfs-bus-iio-proximity-as3935 | |||
@@ -1,4 +1,4 @@ | |||
1 | What /sys/bus/iio/devices/iio:deviceX/in_proximity_raw | 1 | What /sys/bus/iio/devices/iio:deviceX/in_proximity_input |
2 | Date: March 2014 | 2 | Date: March 2014 |
3 | KernelVersion: 3.15 | 3 | KernelVersion: 3.15 |
4 | Contact: Matt Ranostay <mranostay@gmail.com> | 4 | Contact: Matt Ranostay <mranostay@gmail.com> |
diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index f4d29d5dbd5f..f0a0defb68a4 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c | |||
@@ -72,7 +72,8 @@ static const struct iio_chan_spec as3935_channels[] = { | |||
72 | .type = IIO_PROXIMITY, | 72 | .type = IIO_PROXIMITY, |
73 | .info_mask_separate = | 73 | .info_mask_separate = |
74 | BIT(IIO_CHAN_INFO_RAW) | | 74 | BIT(IIO_CHAN_INFO_RAW) | |
75 | BIT(IIO_CHAN_INFO_PROCESSED), | 75 | BIT(IIO_CHAN_INFO_PROCESSED) | |
76 | BIT(IIO_CHAN_INFO_SCALE), | ||
76 | .scan_index = 0, | 77 | .scan_index = 0, |
77 | .scan_type = { | 78 | .scan_type = { |
78 | .sign = 'u', | 79 | .sign = 'u', |
@@ -181,7 +182,12 @@ static int as3935_read_raw(struct iio_dev *indio_dev, | |||
181 | /* storm out of range */ | 182 | /* storm out of range */ |
182 | if (*val == AS3935_DATA_MASK) | 183 | if (*val == AS3935_DATA_MASK) |
183 | return -EINVAL; | 184 | return -EINVAL; |
184 | *val *= 1000; | 185 | |
186 | if (m == IIO_CHAN_INFO_PROCESSED) | ||
187 | *val *= 1000; | ||
188 | break; | ||
189 | case IIO_CHAN_INFO_SCALE: | ||
190 | *val = 1000; | ||
185 | break; | 191 | break; |
186 | default: | 192 | default: |
187 | return -EINVAL; | 193 | return -EINVAL; |