diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-13 18:35:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-13 18:35:56 -0400 |
commit | 589e1d10ff27c61669cc74a43620e6e769ea79dd (patch) | |
tree | 63c23b1407944f136b44949c7b03da74823ae757 /drivers/iio/light | |
parent | db7c17ecbf4d6328597047c4e4d6e8914945477c (diff) | |
parent | 1795cd9b3a91d4b5473c97f491d63892442212ab (diff) |
Merge 3.16-rc5 into staging-next
We want the fixes in -rc5 in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/light')
-rw-r--r-- | drivers/iio/light/hid-sensor-als.c | 7 | ||||
-rw-r--r-- | drivers/iio/light/hid-sensor-prox.c | 7 | ||||
-rw-r--r-- | drivers/iio/light/tcs3472.c | 11 |
3 files changed, 14 insertions, 11 deletions
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index f34c94380b41..96e71e103ea7 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c | |||
@@ -79,7 +79,6 @@ static int als_read_raw(struct iio_dev *indio_dev, | |||
79 | struct als_state *als_state = iio_priv(indio_dev); | 79 | struct als_state *als_state = iio_priv(indio_dev); |
80 | int report_id = -1; | 80 | int report_id = -1; |
81 | u32 address; | 81 | u32 address; |
82 | int ret; | ||
83 | int ret_type; | 82 | int ret_type; |
84 | s32 poll_value; | 83 | s32 poll_value; |
85 | 84 | ||
@@ -129,14 +128,12 @@ static int als_read_raw(struct iio_dev *indio_dev, | |||
129 | ret_type = IIO_VAL_INT; | 128 | ret_type = IIO_VAL_INT; |
130 | break; | 129 | break; |
131 | case IIO_CHAN_INFO_SAMP_FREQ: | 130 | case IIO_CHAN_INFO_SAMP_FREQ: |
132 | ret = hid_sensor_read_samp_freq_value( | 131 | ret_type = hid_sensor_read_samp_freq_value( |
133 | &als_state->common_attributes, val, val2); | 132 | &als_state->common_attributes, val, val2); |
134 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
135 | break; | 133 | break; |
136 | case IIO_CHAN_INFO_HYSTERESIS: | 134 | case IIO_CHAN_INFO_HYSTERESIS: |
137 | ret = hid_sensor_read_raw_hyst_value( | 135 | ret_type = hid_sensor_read_raw_hyst_value( |
138 | &als_state->common_attributes, val, val2); | 136 | &als_state->common_attributes, val, val2); |
139 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
140 | break; | 137 | break; |
141 | default: | 138 | default: |
142 | ret_type = -EINVAL; | 139 | ret_type = -EINVAL; |
diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c index d203ef4d892f..412bae86d6ae 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c | |||
@@ -74,7 +74,6 @@ static int prox_read_raw(struct iio_dev *indio_dev, | |||
74 | struct prox_state *prox_state = iio_priv(indio_dev); | 74 | struct prox_state *prox_state = iio_priv(indio_dev); |
75 | int report_id = -1; | 75 | int report_id = -1; |
76 | u32 address; | 76 | u32 address; |
77 | int ret; | ||
78 | int ret_type; | 77 | int ret_type; |
79 | s32 poll_value; | 78 | s32 poll_value; |
80 | 79 | ||
@@ -125,14 +124,12 @@ static int prox_read_raw(struct iio_dev *indio_dev, | |||
125 | ret_type = IIO_VAL_INT; | 124 | ret_type = IIO_VAL_INT; |
126 | break; | 125 | break; |
127 | case IIO_CHAN_INFO_SAMP_FREQ: | 126 | case IIO_CHAN_INFO_SAMP_FREQ: |
128 | ret = hid_sensor_read_samp_freq_value( | 127 | ret_type = hid_sensor_read_samp_freq_value( |
129 | &prox_state->common_attributes, val, val2); | 128 | &prox_state->common_attributes, val, val2); |
130 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
131 | break; | 129 | break; |
132 | case IIO_CHAN_INFO_HYSTERESIS: | 130 | case IIO_CHAN_INFO_HYSTERESIS: |
133 | ret = hid_sensor_read_raw_hyst_value( | 131 | ret_type = hid_sensor_read_raw_hyst_value( |
134 | &prox_state->common_attributes, val, val2); | 132 | &prox_state->common_attributes, val, val2); |
135 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
136 | break; | 133 | break; |
137 | default: | 134 | default: |
138 | ret_type = -EINVAL; | 135 | ret_type = -EINVAL; |
diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index fe063a0a21cd..752569985d1d 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c | |||
@@ -52,6 +52,7 @@ | |||
52 | 52 | ||
53 | struct tcs3472_data { | 53 | struct tcs3472_data { |
54 | struct i2c_client *client; | 54 | struct i2c_client *client; |
55 | struct mutex lock; | ||
55 | u8 enable; | 56 | u8 enable; |
56 | u8 control; | 57 | u8 control; |
57 | u8 atime; | 58 | u8 atime; |
@@ -116,10 +117,17 @@ static int tcs3472_read_raw(struct iio_dev *indio_dev, | |||
116 | 117 | ||
117 | switch (mask) { | 118 | switch (mask) { |
118 | case IIO_CHAN_INFO_RAW: | 119 | case IIO_CHAN_INFO_RAW: |
120 | if (iio_buffer_enabled(indio_dev)) | ||
121 | return -EBUSY; | ||
122 | |||
123 | mutex_lock(&data->lock); | ||
119 | ret = tcs3472_req_data(data); | 124 | ret = tcs3472_req_data(data); |
120 | if (ret < 0) | 125 | if (ret < 0) { |
126 | mutex_unlock(&data->lock); | ||
121 | return ret; | 127 | return ret; |
128 | } | ||
122 | ret = i2c_smbus_read_word_data(data->client, chan->address); | 129 | ret = i2c_smbus_read_word_data(data->client, chan->address); |
130 | mutex_unlock(&data->lock); | ||
123 | if (ret < 0) | 131 | if (ret < 0) |
124 | return ret; | 132 | return ret; |
125 | *val = ret; | 133 | *val = ret; |
@@ -255,6 +263,7 @@ static int tcs3472_probe(struct i2c_client *client, | |||
255 | data = iio_priv(indio_dev); | 263 | data = iio_priv(indio_dev); |
256 | i2c_set_clientdata(client, indio_dev); | 264 | i2c_set_clientdata(client, indio_dev); |
257 | data->client = client; | 265 | data->client = client; |
266 | mutex_init(&data->lock); | ||
258 | 267 | ||
259 | indio_dev->dev.parent = &client->dev; | 268 | indio_dev->dev.parent = &client->dev; |
260 | indio_dev->info = &tcs3472_info; | 269 | indio_dev->info = &tcs3472_info; |