Skip to content
Snippets Groups Projects
Commit 53b4d591 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull IIO driver fixes from Greg KH:
 "Here are some small IIO driver fixes for 4.11-rc4 that resolve a
  number of tiny reported issues. All of these have been in linux-next
  for a while with no reported issues"

* tag 'staging-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  iio: imu: st_lsm6dsx: fix FIFO_CTRL2 overwrite during watermark configuration
  iio: adc: ti_am335x_adc: fix fifo overrun recovery
  iio: sw-device: Fix config group initialization
  iio: magnetometer: ak8974: remove incorrect __exit markups
  iio: hid-sensor-trigger: Change get poll value function order to avoid sensor properties losing after resume from S3
parents e431e0e4 43c49938
No related branches found
No related tags found
No related merge requests found
...@@ -169,7 +169,9 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) ...@@ -169,7 +169,9 @@ static irqreturn_t tiadc_irq_h(int irq, void *private)
{ {
struct iio_dev *indio_dev = private; struct iio_dev *indio_dev = private;
struct tiadc_device *adc_dev = iio_priv(indio_dev); struct tiadc_device *adc_dev = iio_priv(indio_dev);
unsigned int status, config; unsigned int status, config, adc_fsm;
unsigned short count = 0;
status = tiadc_readl(adc_dev, REG_IRQSTATUS); status = tiadc_readl(adc_dev, REG_IRQSTATUS);
/* /*
...@@ -183,6 +185,15 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) ...@@ -183,6 +185,15 @@ static irqreturn_t tiadc_irq_h(int irq, void *private)
tiadc_writel(adc_dev, REG_CTRL, config); tiadc_writel(adc_dev, REG_CTRL, config);
tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN
| IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES); | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES);
/* wait for idle state.
* ADC needs to finish the current conversion
* before disabling the module
*/
do {
adc_fsm = tiadc_readl(adc_dev, REG_ADCFSM);
} while (adc_fsm != 0x10 && count++ < 100);
tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB)); tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB));
return IRQ_HANDLED; return IRQ_HANDLED;
} else if (status & IRQENB_FIFO1THRES) { } else if (status & IRQENB_FIFO1THRES) {
......
...@@ -51,8 +51,6 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) ...@@ -51,8 +51,6 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state)
st->report_state.report_id, st->report_state.report_id,
st->report_state.index, st->report_state.index,
HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM); HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM);
poll_value = hid_sensor_read_poll_value(st);
} else { } else {
int val; int val;
...@@ -89,7 +87,9 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) ...@@ -89,7 +87,9 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state)
sensor_hub_get_feature(st->hsdev, st->power_state.report_id, sensor_hub_get_feature(st->hsdev, st->power_state.report_id,
st->power_state.index, st->power_state.index,
sizeof(state_val), &state_val); sizeof(state_val), &state_val);
if (state && poll_value) if (state)
poll_value = hid_sensor_read_poll_value(st);
if (poll_value > 0)
msleep_interruptible(poll_value * 2); msleep_interruptible(poll_value * 2);
return 0; return 0;
......
...@@ -193,8 +193,8 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark) ...@@ -193,8 +193,8 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
if (err < 0) if (err < 0)
goto out; goto out;
fifo_watermark = ((data & ~ST_LSM6DSX_FIFO_TH_MASK) << 8) | fifo_watermark = ((data << 8) & ~ST_LSM6DSX_FIFO_TH_MASK) |
(fifo_watermark & ST_LSM6DSX_FIFO_TH_MASK); (fifo_watermark & ST_LSM6DSX_FIFO_TH_MASK);
wdata = cpu_to_le16(fifo_watermark); wdata = cpu_to_le16(fifo_watermark);
err = hw->tf->write(hw->dev, ST_LSM6DSX_REG_FIFO_THL_ADDR, err = hw->tf->write(hw->dev, ST_LSM6DSX_REG_FIFO_THL_ADDR,
......
...@@ -763,7 +763,7 @@ static int ak8974_probe(struct i2c_client *i2c, ...@@ -763,7 +763,7 @@ static int ak8974_probe(struct i2c_client *i2c,
return ret; return ret;
} }
static int __exit ak8974_remove(struct i2c_client *i2c) static int ak8974_remove(struct i2c_client *i2c)
{ {
struct iio_dev *indio_dev = i2c_get_clientdata(i2c); struct iio_dev *indio_dev = i2c_get_clientdata(i2c);
struct ak8974 *ak8974 = iio_priv(indio_dev); struct ak8974 *ak8974 = iio_priv(indio_dev);
...@@ -845,7 +845,7 @@ static struct i2c_driver ak8974_driver = { ...@@ -845,7 +845,7 @@ static struct i2c_driver ak8974_driver = {
.of_match_table = of_match_ptr(ak8974_of_match), .of_match_table = of_match_ptr(ak8974_of_match),
}, },
.probe = ak8974_probe, .probe = ak8974_probe,
.remove = __exit_p(ak8974_remove), .remove = ak8974_remove,
.id_table = ak8974_id, .id_table = ak8974_id,
}; };
module_i2c_driver(ak8974_driver); module_i2c_driver(ak8974_driver);
......
...@@ -62,7 +62,7 @@ void iio_swd_group_init_type_name(struct iio_sw_device *d, ...@@ -62,7 +62,7 @@ void iio_swd_group_init_type_name(struct iio_sw_device *d,
const char *name, const char *name,
struct config_item_type *type) struct config_item_type *type)
{ {
#ifdef CONFIG_CONFIGFS_FS #if IS_ENABLED(CONFIG_CONFIGFS_FS)
config_group_init_type_name(&d->group, name, type); config_group_init_type_name(&d->group, name, type);
#endif #endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment