diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-25 23:03:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-25 23:03:10 -0400 |
commit | b0de415aa7469606ddf618caf3e2fdc94fa28733 (patch) | |
tree | 0a1e20791b9af10e99cb9cf47e9653cddefbc773 | |
parent | e433b6560dd4e83a4241b702c2890bbf2eac64e7 (diff) | |
parent | 00243b1d180b7de3cf38a69948ea46aa0308f8c8 (diff) |
Merge tag 'staging-4.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver fixes from Greg KH:
"Here are a number of iio and staging driver fixes for reported issues
for 4.2-rc4.
All have been in linux-next for a while with no problems"
* tag 'staging-4.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (34 commits)
iio:light:stk3310: make endianness independent of host
iio:light:stk3310: move device register to end of probe
iio: mma8452: use iio event type IIO_EV_TYPE_MAG
iio: mcp320x: Fix NULL pointer dereference
iio: adc: vf610: fix the adc register read fail issue
iio: mlx96014: Replace offset sign
iio: magnetometer: mmc35240: fix SET/RESET sequence
iio: magnetometer: mmc35240: Fix SET/RESET mask
iio: magnetometer: mmc35240: Fix crash in pm suspend
iio:magnetometer:bmc150_magn: output intended variable
iio:magnetometer:bmc150_magn: add regmap dependency
staging: vt6656: check ieee80211_bss_conf bssid not NULL
staging: vt6655: check ieee80211_bss_conf bssid not NULL
iio: tmp006: Check channel info on write
iio: sx9500: Add missing init in sx9500_buffer_pre{en,dis}able()
iio:light:ltr501: fix regmap dependency
iio:light:ltr501: fix variable in ltr501_init
iio: sx9500: fix bug in compensation code
iio: sx9500: rework error handling of raw readings
iio: magnetometer: mmc35240: fix available sampling frequencies
...
-rw-r--r-- | drivers/iio/accel/mma8452.c | 8 | ||||
-rw-r--r-- | drivers/iio/adc/mcp320x.c | 2 | ||||
-rw-r--r-- | drivers/iio/adc/vf610_adc.c | 2 | ||||
-rw-r--r-- | drivers/iio/light/stk3310.c | 26 | ||||
-rw-r--r-- | drivers/iio/magnetometer/Kconfig | 1 | ||||
-rw-r--r-- | drivers/iio/magnetometer/bmc150_magn.c | 4 | ||||
-rw-r--r-- | drivers/iio/magnetometer/mmc35240.c | 12 | ||||
-rw-r--r-- | drivers/iio/temperature/mlx90614.c | 2 |
8 files changed, 31 insertions, 26 deletions
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index e8e2077c7244..13ea1ea23328 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c | |||
@@ -557,21 +557,21 @@ static void mma8452_transient_interrupt(struct iio_dev *indio_dev) | |||
557 | if (src & MMA8452_TRANSIENT_SRC_XTRANSE) | 557 | if (src & MMA8452_TRANSIENT_SRC_XTRANSE) |
558 | iio_push_event(indio_dev, | 558 | iio_push_event(indio_dev, |
559 | IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_X, | 559 | IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_X, |
560 | IIO_EV_TYPE_THRESH, | 560 | IIO_EV_TYPE_MAG, |
561 | IIO_EV_DIR_RISING), | 561 | IIO_EV_DIR_RISING), |
562 | ts); | 562 | ts); |
563 | 563 | ||
564 | if (src & MMA8452_TRANSIENT_SRC_YTRANSE) | 564 | if (src & MMA8452_TRANSIENT_SRC_YTRANSE) |
565 | iio_push_event(indio_dev, | 565 | iio_push_event(indio_dev, |
566 | IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Y, | 566 | IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Y, |
567 | IIO_EV_TYPE_THRESH, | 567 | IIO_EV_TYPE_MAG, |
568 | IIO_EV_DIR_RISING), | 568 | IIO_EV_DIR_RISING), |
569 | ts); | 569 | ts); |
570 | 570 | ||
571 | if (src & MMA8452_TRANSIENT_SRC_ZTRANSE) | 571 | if (src & MMA8452_TRANSIENT_SRC_ZTRANSE) |
572 | iio_push_event(indio_dev, | 572 | iio_push_event(indio_dev, |
573 | IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Z, | 573 | IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Z, |
574 | IIO_EV_TYPE_THRESH, | 574 | IIO_EV_TYPE_MAG, |
575 | IIO_EV_DIR_RISING), | 575 | IIO_EV_DIR_RISING), |
576 | ts); | 576 | ts); |
577 | } | 577 | } |
@@ -644,7 +644,7 @@ static int mma8452_reg_access_dbg(struct iio_dev *indio_dev, | |||
644 | 644 | ||
645 | static const struct iio_event_spec mma8452_transient_event[] = { | 645 | static const struct iio_event_spec mma8452_transient_event[] = { |
646 | { | 646 | { |
647 | .type = IIO_EV_TYPE_THRESH, | 647 | .type = IIO_EV_TYPE_MAG, |
648 | .dir = IIO_EV_DIR_RISING, | 648 | .dir = IIO_EV_DIR_RISING, |
649 | .mask_separate = BIT(IIO_EV_INFO_ENABLE), | 649 | .mask_separate = BIT(IIO_EV_INFO_ENABLE), |
650 | .mask_shared_by_type = BIT(IIO_EV_INFO_VALUE) | | 650 | .mask_shared_by_type = BIT(IIO_EV_INFO_VALUE) | |
diff --git a/drivers/iio/adc/mcp320x.c b/drivers/iio/adc/mcp320x.c index 8d9c9b9215dd..d819823f7257 100644 --- a/drivers/iio/adc/mcp320x.c +++ b/drivers/iio/adc/mcp320x.c | |||
@@ -299,6 +299,8 @@ static int mcp320x_probe(struct spi_device *spi) | |||
299 | indio_dev->channels = chip_info->channels; | 299 | indio_dev->channels = chip_info->channels; |
300 | indio_dev->num_channels = chip_info->num_channels; | 300 | indio_dev->num_channels = chip_info->num_channels; |
301 | 301 | ||
302 | adc->chip_info = chip_info; | ||
303 | |||
302 | adc->transfer[0].tx_buf = &adc->tx_buf; | 304 | adc->transfer[0].tx_buf = &adc->tx_buf; |
303 | adc->transfer[0].len = sizeof(adc->tx_buf); | 305 | adc->transfer[0].len = sizeof(adc->tx_buf); |
304 | adc->transfer[1].rx_buf = adc->rx_buf; | 306 | adc->transfer[1].rx_buf = adc->rx_buf; |
diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c index 480f335a0f9f..819632bf1fda 100644 --- a/drivers/iio/adc/vf610_adc.c +++ b/drivers/iio/adc/vf610_adc.c | |||
@@ -635,7 +635,7 @@ static int vf610_adc_reg_access(struct iio_dev *indio_dev, | |||
635 | struct vf610_adc *info = iio_priv(indio_dev); | 635 | struct vf610_adc *info = iio_priv(indio_dev); |
636 | 636 | ||
637 | if ((readval == NULL) || | 637 | if ((readval == NULL) || |
638 | (!(reg % 4) || (reg > VF610_REG_ADC_PCTL))) | 638 | ((reg % 4) || (reg > VF610_REG_ADC_PCTL))) |
639 | return -EINVAL; | 639 | return -EINVAL; |
640 | 640 | ||
641 | *readval = readl(info->regs + reg); | 641 | *readval = readl(info->regs + reg); |
diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index c1a218236be5..11a027adc204 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c | |||
@@ -200,7 +200,7 @@ static int stk3310_read_event(struct iio_dev *indio_dev, | |||
200 | int *val, int *val2) | 200 | int *val, int *val2) |
201 | { | 201 | { |
202 | u8 reg; | 202 | u8 reg; |
203 | u16 buf; | 203 | __be16 buf; |
204 | int ret; | 204 | int ret; |
205 | struct stk3310_data *data = iio_priv(indio_dev); | 205 | struct stk3310_data *data = iio_priv(indio_dev); |
206 | 206 | ||
@@ -222,7 +222,7 @@ static int stk3310_read_event(struct iio_dev *indio_dev, | |||
222 | dev_err(&data->client->dev, "register read failed\n"); | 222 | dev_err(&data->client->dev, "register read failed\n"); |
223 | return ret; | 223 | return ret; |
224 | } | 224 | } |
225 | *val = swab16(buf); | 225 | *val = be16_to_cpu(buf); |
226 | 226 | ||
227 | return IIO_VAL_INT; | 227 | return IIO_VAL_INT; |
228 | } | 228 | } |
@@ -235,7 +235,7 @@ static int stk3310_write_event(struct iio_dev *indio_dev, | |||
235 | int val, int val2) | 235 | int val, int val2) |
236 | { | 236 | { |
237 | u8 reg; | 237 | u8 reg; |
238 | u16 buf; | 238 | __be16 buf; |
239 | int ret; | 239 | int ret; |
240 | unsigned int index; | 240 | unsigned int index; |
241 | struct stk3310_data *data = iio_priv(indio_dev); | 241 | struct stk3310_data *data = iio_priv(indio_dev); |
@@ -252,7 +252,7 @@ static int stk3310_write_event(struct iio_dev *indio_dev, | |||
252 | else | 252 | else |
253 | return -EINVAL; | 253 | return -EINVAL; |
254 | 254 | ||
255 | buf = swab16(val); | 255 | buf = cpu_to_be16(val); |
256 | ret = regmap_bulk_write(data->regmap, reg, &buf, 2); | 256 | ret = regmap_bulk_write(data->regmap, reg, &buf, 2); |
257 | if (ret < 0) | 257 | if (ret < 0) |
258 | dev_err(&client->dev, "failed to set PS threshold!\n"); | 258 | dev_err(&client->dev, "failed to set PS threshold!\n"); |
@@ -301,7 +301,7 @@ static int stk3310_read_raw(struct iio_dev *indio_dev, | |||
301 | int *val, int *val2, long mask) | 301 | int *val, int *val2, long mask) |
302 | { | 302 | { |
303 | u8 reg; | 303 | u8 reg; |
304 | u16 buf; | 304 | __be16 buf; |
305 | int ret; | 305 | int ret; |
306 | unsigned int index; | 306 | unsigned int index; |
307 | struct stk3310_data *data = iio_priv(indio_dev); | 307 | struct stk3310_data *data = iio_priv(indio_dev); |
@@ -322,7 +322,7 @@ static int stk3310_read_raw(struct iio_dev *indio_dev, | |||
322 | mutex_unlock(&data->lock); | 322 | mutex_unlock(&data->lock); |
323 | return ret; | 323 | return ret; |
324 | } | 324 | } |
325 | *val = swab16(buf); | 325 | *val = be16_to_cpu(buf); |
326 | mutex_unlock(&data->lock); | 326 | mutex_unlock(&data->lock); |
327 | return IIO_VAL_INT; | 327 | return IIO_VAL_INT; |
328 | case IIO_CHAN_INFO_INT_TIME: | 328 | case IIO_CHAN_INFO_INT_TIME: |
@@ -608,13 +608,7 @@ static int stk3310_probe(struct i2c_client *client, | |||
608 | if (ret < 0) | 608 | if (ret < 0) |
609 | return ret; | 609 | return ret; |
610 | 610 | ||
611 | ret = iio_device_register(indio_dev); | 611 | if (client->irq < 0) |
612 | if (ret < 0) { | ||
613 | dev_err(&client->dev, "device_register failed\n"); | ||
614 | stk3310_set_state(data, STK3310_STATE_STANDBY); | ||
615 | } | ||
616 | |||
617 | if (client->irq <= 0) | ||
618 | client->irq = stk3310_gpio_probe(client); | 612 | client->irq = stk3310_gpio_probe(client); |
619 | 613 | ||
620 | if (client->irq >= 0) { | 614 | if (client->irq >= 0) { |
@@ -629,6 +623,12 @@ static int stk3310_probe(struct i2c_client *client, | |||
629 | client->irq); | 623 | client->irq); |
630 | } | 624 | } |
631 | 625 | ||
626 | ret = iio_device_register(indio_dev); | ||
627 | if (ret < 0) { | ||
628 | dev_err(&client->dev, "device_register failed\n"); | ||
629 | stk3310_set_state(data, STK3310_STATE_STANDBY); | ||
630 | } | ||
631 | |||
632 | return ret; | 632 | return ret; |
633 | } | 633 | } |
634 | 634 | ||
diff --git a/drivers/iio/magnetometer/Kconfig b/drivers/iio/magnetometer/Kconfig index dcadfc4f0661..efb9350b0d76 100644 --- a/drivers/iio/magnetometer/Kconfig +++ b/drivers/iio/magnetometer/Kconfig | |||
@@ -90,6 +90,7 @@ config IIO_ST_MAGN_SPI_3AXIS | |||
90 | config BMC150_MAGN | 90 | config BMC150_MAGN |
91 | tristate "Bosch BMC150 Magnetometer Driver" | 91 | tristate "Bosch BMC150 Magnetometer Driver" |
92 | depends on I2C | 92 | depends on I2C |
93 | select REGMAP_I2C | ||
93 | select IIO_BUFFER | 94 | select IIO_BUFFER |
94 | select IIO_TRIGGERED_BUFFER | 95 | select IIO_TRIGGERED_BUFFER |
95 | help | 96 | help |
diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c index d4c178869991..1347a1f2e46f 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c | |||
@@ -706,11 +706,11 @@ static int bmc150_magn_init(struct bmc150_magn_data *data) | |||
706 | goto err_poweroff; | 706 | goto err_poweroff; |
707 | } | 707 | } |
708 | if (chip_id != BMC150_MAGN_CHIP_ID_VAL) { | 708 | if (chip_id != BMC150_MAGN_CHIP_ID_VAL) { |
709 | dev_err(&data->client->dev, "Invalid chip id 0x%x\n", ret); | 709 | dev_err(&data->client->dev, "Invalid chip id 0x%x\n", chip_id); |
710 | ret = -ENODEV; | 710 | ret = -ENODEV; |
711 | goto err_poweroff; | 711 | goto err_poweroff; |
712 | } | 712 | } |
713 | dev_dbg(&data->client->dev, "Chip id %x\n", ret); | 713 | dev_dbg(&data->client->dev, "Chip id %x\n", chip_id); |
714 | 714 | ||
715 | preset = bmc150_magn_presets_table[BMC150_MAGN_DEFAULT_PRESET]; | 715 | preset = bmc150_magn_presets_table[BMC150_MAGN_DEFAULT_PRESET]; |
716 | ret = bmc150_magn_set_odr(data, preset.odr); | 716 | ret = bmc150_magn_set_odr(data, preset.odr); |
diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c index d927397a6ef7..706ebfd6297f 100644 --- a/drivers/iio/magnetometer/mmc35240.c +++ b/drivers/iio/magnetometer/mmc35240.c | |||
@@ -202,8 +202,8 @@ static int mmc35240_hw_set(struct mmc35240_data *data, bool set) | |||
202 | coil_bit = MMC35240_CTRL0_RESET_BIT; | 202 | coil_bit = MMC35240_CTRL0_RESET_BIT; |
203 | 203 | ||
204 | return regmap_update_bits(data->regmap, MMC35240_REG_CTRL0, | 204 | return regmap_update_bits(data->regmap, MMC35240_REG_CTRL0, |
205 | MMC35240_CTRL0_REFILL_BIT, | 205 | coil_bit, coil_bit); |
206 | coil_bit); | 206 | |
207 | } | 207 | } |
208 | 208 | ||
209 | static int mmc35240_init(struct mmc35240_data *data) | 209 | static int mmc35240_init(struct mmc35240_data *data) |
@@ -222,14 +222,15 @@ static int mmc35240_init(struct mmc35240_data *data) | |||
222 | 222 | ||
223 | /* | 223 | /* |
224 | * make sure we restore sensor characteristics, by doing | 224 | * make sure we restore sensor characteristics, by doing |
225 | * a RESET/SET sequence | 225 | * a SET/RESET sequence, the axis polarity being naturally |
226 | * aligned after RESET | ||
226 | */ | 227 | */ |
227 | ret = mmc35240_hw_set(data, false); | 228 | ret = mmc35240_hw_set(data, true); |
228 | if (ret < 0) | 229 | if (ret < 0) |
229 | return ret; | 230 | return ret; |
230 | usleep_range(MMC53240_WAIT_SET_RESET, MMC53240_WAIT_SET_RESET + 1); | 231 | usleep_range(MMC53240_WAIT_SET_RESET, MMC53240_WAIT_SET_RESET + 1); |
231 | 232 | ||
232 | ret = mmc35240_hw_set(data, true); | 233 | ret = mmc35240_hw_set(data, false); |
233 | if (ret < 0) | 234 | if (ret < 0) |
234 | return ret; | 235 | return ret; |
235 | 236 | ||
@@ -503,6 +504,7 @@ static int mmc35240_probe(struct i2c_client *client, | |||
503 | } | 504 | } |
504 | 505 | ||
505 | data = iio_priv(indio_dev); | 506 | data = iio_priv(indio_dev); |
507 | i2c_set_clientdata(client, indio_dev); | ||
506 | data->client = client; | 508 | data->client = client; |
507 | data->regmap = regmap; | 509 | data->regmap = regmap; |
508 | data->res = MMC35240_16_BITS_SLOW; | 510 | data->res = MMC35240_16_BITS_SLOW; |
diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c index cb2e8ad8bfdc..7a2b639eaa96 100644 --- a/drivers/iio/temperature/mlx90614.c +++ b/drivers/iio/temperature/mlx90614.c | |||
@@ -204,7 +204,7 @@ static int mlx90614_read_raw(struct iio_dev *indio_dev, | |||
204 | *val = ret; | 204 | *val = ret; |
205 | return IIO_VAL_INT; | 205 | return IIO_VAL_INT; |
206 | case IIO_CHAN_INFO_OFFSET: | 206 | case IIO_CHAN_INFO_OFFSET: |
207 | *val = 13657; | 207 | *val = -13657; |
208 | *val2 = 500000; | 208 | *val2 = 500000; |
209 | return IIO_VAL_INT_PLUS_MICRO; | 209 | return IIO_VAL_INT_PLUS_MICRO; |
210 | case IIO_CHAN_INFO_SCALE: | 210 | case IIO_CHAN_INFO_SCALE: |