Skip to content

Commit

Permalink
Merge tag 'staging-4.2-rc4' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  ...
  • Loading branch information
Linus Torvalds committed Jul 26, 2015
2 parents e433b65 + 00243b1 commit b0de415
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 26 deletions.
8 changes: 4 additions & 4 deletions drivers/iio/accel/mma8452.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,21 +557,21 @@ static void mma8452_transient_interrupt(struct iio_dev *indio_dev)
if (src & MMA8452_TRANSIENT_SRC_XTRANSE)
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_X,
IIO_EV_TYPE_THRESH,
IIO_EV_TYPE_MAG,
IIO_EV_DIR_RISING),
ts);

if (src & MMA8452_TRANSIENT_SRC_YTRANSE)
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Y,
IIO_EV_TYPE_THRESH,
IIO_EV_TYPE_MAG,
IIO_EV_DIR_RISING),
ts);

if (src & MMA8452_TRANSIENT_SRC_ZTRANSE)
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_Z,
IIO_EV_TYPE_THRESH,
IIO_EV_TYPE_MAG,
IIO_EV_DIR_RISING),
ts);
}
Expand Down Expand Up @@ -644,7 +644,7 @@ static int mma8452_reg_access_dbg(struct iio_dev *indio_dev,

static const struct iio_event_spec mma8452_transient_event[] = {
{
.type = IIO_EV_TYPE_THRESH,
.type = IIO_EV_TYPE_MAG,
.dir = IIO_EV_DIR_RISING,
.mask_separate = BIT(IIO_EV_INFO_ENABLE),
.mask_shared_by_type = BIT(IIO_EV_INFO_VALUE) |
Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/adc/mcp320x.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ static int mcp320x_probe(struct spi_device *spi)
indio_dev->channels = chip_info->channels;
indio_dev->num_channels = chip_info->num_channels;

adc->chip_info = chip_info;

adc->transfer[0].tx_buf = &adc->tx_buf;
adc->transfer[0].len = sizeof(adc->tx_buf);
adc->transfer[1].rx_buf = adc->rx_buf;
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/adc/vf610_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ static int vf610_adc_reg_access(struct iio_dev *indio_dev,
struct vf610_adc *info = iio_priv(indio_dev);

if ((readval == NULL) ||
(!(reg % 4) || (reg > VF610_REG_ADC_PCTL)))
((reg % 4) || (reg > VF610_REG_ADC_PCTL)))
return -EINVAL;

*readval = readl(info->regs + reg);
Expand Down
26 changes: 13 additions & 13 deletions drivers/iio/light/stk3310.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static int stk3310_read_event(struct iio_dev *indio_dev,
int *val, int *val2)
{
u8 reg;
u16 buf;
__be16 buf;
int ret;
struct stk3310_data *data = iio_priv(indio_dev);

Expand All @@ -222,7 +222,7 @@ static int stk3310_read_event(struct iio_dev *indio_dev,
dev_err(&data->client->dev, "register read failed\n");
return ret;
}
*val = swab16(buf);
*val = be16_to_cpu(buf);

return IIO_VAL_INT;
}
Expand All @@ -235,7 +235,7 @@ static int stk3310_write_event(struct iio_dev *indio_dev,
int val, int val2)
{
u8 reg;
u16 buf;
__be16 buf;
int ret;
unsigned int index;
struct stk3310_data *data = iio_priv(indio_dev);
Expand All @@ -252,7 +252,7 @@ static int stk3310_write_event(struct iio_dev *indio_dev,
else
return -EINVAL;

buf = swab16(val);
buf = cpu_to_be16(val);
ret = regmap_bulk_write(data->regmap, reg, &buf, 2);
if (ret < 0)
dev_err(&client->dev, "failed to set PS threshold!\n");
Expand Down Expand Up @@ -301,7 +301,7 @@ static int stk3310_read_raw(struct iio_dev *indio_dev,
int *val, int *val2, long mask)
{
u8 reg;
u16 buf;
__be16 buf;
int ret;
unsigned int index;
struct stk3310_data *data = iio_priv(indio_dev);
Expand All @@ -322,7 +322,7 @@ static int stk3310_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&data->lock);
return ret;
}
*val = swab16(buf);
*val = be16_to_cpu(buf);
mutex_unlock(&data->lock);
return IIO_VAL_INT;
case IIO_CHAN_INFO_INT_TIME:
Expand Down Expand Up @@ -608,13 +608,7 @@ static int stk3310_probe(struct i2c_client *client,
if (ret < 0)
return ret;

ret = iio_device_register(indio_dev);
if (ret < 0) {
dev_err(&client->dev, "device_register failed\n");
stk3310_set_state(data, STK3310_STATE_STANDBY);
}

if (client->irq <= 0)
if (client->irq < 0)
client->irq = stk3310_gpio_probe(client);

if (client->irq >= 0) {
Expand All @@ -629,6 +623,12 @@ static int stk3310_probe(struct i2c_client *client,
client->irq);
}

ret = iio_device_register(indio_dev);
if (ret < 0) {
dev_err(&client->dev, "device_register failed\n");
stk3310_set_state(data, STK3310_STATE_STANDBY);
}

return ret;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/iio/magnetometer/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ config IIO_ST_MAGN_SPI_3AXIS
config BMC150_MAGN
tristate "Bosch BMC150 Magnetometer Driver"
depends on I2C
select REGMAP_I2C
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Expand Down
4 changes: 2 additions & 2 deletions drivers/iio/magnetometer/bmc150_magn.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,11 @@ static int bmc150_magn_init(struct bmc150_magn_data *data)
goto err_poweroff;
}
if (chip_id != BMC150_MAGN_CHIP_ID_VAL) {
dev_err(&data->client->dev, "Invalid chip id 0x%x\n", ret);
dev_err(&data->client->dev, "Invalid chip id 0x%x\n", chip_id);
ret = -ENODEV;
goto err_poweroff;
}
dev_dbg(&data->client->dev, "Chip id %x\n", ret);
dev_dbg(&data->client->dev, "Chip id %x\n", chip_id);

preset = bmc150_magn_presets_table[BMC150_MAGN_DEFAULT_PRESET];
ret = bmc150_magn_set_odr(data, preset.odr);
Expand Down
12 changes: 7 additions & 5 deletions drivers/iio/magnetometer/mmc35240.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ static int mmc35240_hw_set(struct mmc35240_data *data, bool set)
coil_bit = MMC35240_CTRL0_RESET_BIT;

return regmap_update_bits(data->regmap, MMC35240_REG_CTRL0,
MMC35240_CTRL0_REFILL_BIT,
coil_bit);
coil_bit, coil_bit);

}

static int mmc35240_init(struct mmc35240_data *data)
Expand All @@ -222,14 +222,15 @@ static int mmc35240_init(struct mmc35240_data *data)

/*
* make sure we restore sensor characteristics, by doing
* a RESET/SET sequence
* a SET/RESET sequence, the axis polarity being naturally
* aligned after RESET
*/
ret = mmc35240_hw_set(data, false);
ret = mmc35240_hw_set(data, true);
if (ret < 0)
return ret;
usleep_range(MMC53240_WAIT_SET_RESET, MMC53240_WAIT_SET_RESET + 1);

ret = mmc35240_hw_set(data, true);
ret = mmc35240_hw_set(data, false);
if (ret < 0)
return ret;

Expand Down Expand Up @@ -503,6 +504,7 @@ static int mmc35240_probe(struct i2c_client *client,
}

data = iio_priv(indio_dev);
i2c_set_clientdata(client, indio_dev);
data->client = client;
data->regmap = regmap;
data->res = MMC35240_16_BITS_SLOW;
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/temperature/mlx90614.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static int mlx90614_read_raw(struct iio_dev *indio_dev,
*val = ret;
return IIO_VAL_INT;
case IIO_CHAN_INFO_OFFSET:
*val = 13657;
*val = -13657;
*val2 = 500000;
return IIO_VAL_INT_PLUS_MICRO;
case IIO_CHAN_INFO_SCALE:
Expand Down

0 comments on commit b0de415

Please sign in to comment.