summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-13 18:35:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-13 18:35:56 -0400
commit589e1d10ff27c61669cc74a43620e6e769ea79dd (patch)
tree63c23b1407944f136b44949c7b03da74823ae757 /drivers/iio
parentdb7c17ecbf4d6328597047c4e4d6e8914945477c (diff)
parent1795cd9b3a91d4b5473c97f491d63892442212ab (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')
-rw-r--r--drivers/iio/accel/hid-sensor-accel-3d.c7
-rw-r--r--drivers/iio/adc/ti_am335x_adc.c2
-rw-r--r--drivers/iio/gyro/hid-sensor-gyro-3d.c7
-rw-r--r--drivers/iio/light/hid-sensor-als.c7
-rw-r--r--drivers/iio/light/hid-sensor-prox.c7
-rw-r--r--drivers/iio/light/tcs3472.c11
-rw-r--r--drivers/iio/magnetometer/hid-sensor-magn-3d.c7
-rw-r--r--drivers/iio/pressure/hid-sensor-press.c7
8 files changed, 23 insertions, 32 deletions
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index 69abf9163df7..54e464e4bb72 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -110,7 +110,6 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
110 struct accel_3d_state *accel_state = iio_priv(indio_dev); 110 struct accel_3d_state *accel_state = iio_priv(indio_dev);
111 int report_id = -1; 111 int report_id = -1;
112 u32 address; 112 u32 address;
113 int ret;
114 int ret_type; 113 int ret_type;
115 s32 poll_value; 114 s32 poll_value;
116 115
@@ -151,14 +150,12 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
151 ret_type = IIO_VAL_INT; 150 ret_type = IIO_VAL_INT;
152 break; 151 break;
153 case IIO_CHAN_INFO_SAMP_FREQ: 152 case IIO_CHAN_INFO_SAMP_FREQ:
154 ret = hid_sensor_read_samp_freq_value( 153 ret_type = hid_sensor_read_samp_freq_value(
155 &accel_state->common_attributes, val, val2); 154 &accel_state->common_attributes, val, val2);
156 ret_type = IIO_VAL_INT_PLUS_MICRO;
157 break; 155 break;
158 case IIO_CHAN_INFO_HYSTERESIS: 156 case IIO_CHAN_INFO_HYSTERESIS:
159 ret = hid_sensor_read_raw_hyst_value( 157 ret_type = hid_sensor_read_raw_hyst_value(
160 &accel_state->common_attributes, val, val2); 158 &accel_state->common_attributes, val, val2);
161 ret_type = IIO_VAL_INT_PLUS_MICRO;
162 break; 159 break;
163 default: 160 default:
164 ret_type = -EINVAL; 161 ret_type = -EINVAL;
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index a4db3026bec6..d5dc4c6ce86c 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -374,7 +374,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev,
374 return -EAGAIN; 374 return -EAGAIN;
375 } 375 }
376 } 376 }
377 map_val = chan->channel + TOTAL_CHANNELS; 377 map_val = adc_dev->channel_step[chan->scan_index];
378 378
379 /* 379 /*
380 * We check the complete FIFO. We programmed just one entry but in case 380 * We check the complete FIFO. We programmed just one entry but in case
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index 40f4e4935d0d..fa034a3dad78 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -110,7 +110,6 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
110 struct gyro_3d_state *gyro_state = iio_priv(indio_dev); 110 struct gyro_3d_state *gyro_state = iio_priv(indio_dev);
111 int report_id = -1; 111 int report_id = -1;
112 u32 address; 112 u32 address;
113 int ret;
114 int ret_type; 113 int ret_type;
115 s32 poll_value; 114 s32 poll_value;
116 115
@@ -151,14 +150,12 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
151 ret_type = IIO_VAL_INT; 150 ret_type = IIO_VAL_INT;
152 break; 151 break;
153 case IIO_CHAN_INFO_SAMP_FREQ: 152 case IIO_CHAN_INFO_SAMP_FREQ:
154 ret = hid_sensor_read_samp_freq_value( 153 ret_type = hid_sensor_read_samp_freq_value(
155 &gyro_state->common_attributes, val, val2); 154 &gyro_state->common_attributes, val, val2);
156 ret_type = IIO_VAL_INT_PLUS_MICRO;
157 break; 155 break;
158 case IIO_CHAN_INFO_HYSTERESIS: 156 case IIO_CHAN_INFO_HYSTERESIS:
159 ret = hid_sensor_read_raw_hyst_value( 157 ret_type = hid_sensor_read_raw_hyst_value(
160 &gyro_state->common_attributes, val, val2); 158 &gyro_state->common_attributes, val, val2);
161 ret_type = IIO_VAL_INT_PLUS_MICRO;
162 break; 159 break;
163 default: 160 default:
164 ret_type = -EINVAL; 161 ret_type = -EINVAL;
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
53struct tcs3472_data { 53struct 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;
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index 41cf29e2a371..b2b0937d5133 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -110,7 +110,6 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev,
110 struct magn_3d_state *magn_state = iio_priv(indio_dev); 110 struct magn_3d_state *magn_state = iio_priv(indio_dev);
111 int report_id = -1; 111 int report_id = -1;
112 u32 address; 112 u32 address;
113 int ret;
114 int ret_type; 113 int ret_type;
115 s32 poll_value; 114 s32 poll_value;
116 115
@@ -153,14 +152,12 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev,
153 ret_type = IIO_VAL_INT; 152 ret_type = IIO_VAL_INT;
154 break; 153 break;
155 case IIO_CHAN_INFO_SAMP_FREQ: 154 case IIO_CHAN_INFO_SAMP_FREQ:
156 ret = hid_sensor_read_samp_freq_value( 155 ret_type = hid_sensor_read_samp_freq_value(
157 &magn_state->common_attributes, val, val2); 156 &magn_state->common_attributes, val, val2);
158 ret_type = IIO_VAL_INT_PLUS_MICRO;
159 break; 157 break;
160 case IIO_CHAN_INFO_HYSTERESIS: 158 case IIO_CHAN_INFO_HYSTERESIS:
161 ret = hid_sensor_read_raw_hyst_value( 159 ret_type = hid_sensor_read_raw_hyst_value(
162 &magn_state->common_attributes, val, val2); 160 &magn_state->common_attributes, val, val2);
163 ret_type = IIO_VAL_INT_PLUS_MICRO;
164 break; 161 break;
165 default: 162 default:
166 ret_type = -EINVAL; 163 ret_type = -EINVAL;
diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
index 1cd190c73788..2c0d2a4fed8c 100644
--- a/drivers/iio/pressure/hid-sensor-press.c
+++ b/drivers/iio/pressure/hid-sensor-press.c
@@ -78,7 +78,6 @@ static int press_read_raw(struct iio_dev *indio_dev,
78 struct press_state *press_state = iio_priv(indio_dev); 78 struct press_state *press_state = iio_priv(indio_dev);
79 int report_id = -1; 79 int report_id = -1;
80 u32 address; 80 u32 address;
81 int ret;
82 int ret_type; 81 int ret_type;
83 s32 poll_value; 82 s32 poll_value;
84 83
@@ -128,14 +127,12 @@ static int press_read_raw(struct iio_dev *indio_dev,
128 ret_type = IIO_VAL_INT; 127 ret_type = IIO_VAL_INT;
129 break; 128 break;
130 case IIO_CHAN_INFO_SAMP_FREQ: 129 case IIO_CHAN_INFO_SAMP_FREQ:
131 ret = hid_sensor_read_samp_freq_value( 130 ret_type = hid_sensor_read_samp_freq_value(
132 &press_state->common_attributes, val, val2); 131 &press_state->common_attributes, val, val2);
133 ret_type = IIO_VAL_INT_PLUS_MICRO;
134 break; 132 break;
135 case IIO_CHAN_INFO_HYSTERESIS: 133 case IIO_CHAN_INFO_HYSTERESIS:
136 ret = hid_sensor_read_raw_hyst_value( 134 ret_type = hid_sensor_read_raw_hyst_value(
137 &press_state->common_attributes, val, val2); 135 &press_state->common_attributes, val, val2);
138 ret_type = IIO_VAL_INT_PLUS_MICRO;
139 break; 136 break;
140 default: 137 default:
141 ret_type = -EINVAL; 138 ret_type = -EINVAL;