diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-26 14:02:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-26 14:02:00 -0400 |
commit | 53b4d5911d6adef3f543e1ad23643068c5c343ac (patch) | |
tree | 28cf1c9c7fb38406c61f929ee1de07abab9946b4 | |
parent | e431e0e427799805461390df1db1e3478d4c475c (diff) | |
parent | 43c49938bf72b2862aa12b5d66e710e15ce0f7b7 (diff) |
Merge tag 'staging-4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
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
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 13 | ||||
-rw-r--r-- | drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 6 | ||||
-rw-r--r-- | drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 | ||||
-rw-r--r-- | drivers/iio/magnetometer/ak8974.c | 4 | ||||
-rw-r--r-- | include/linux/iio/sw_device.h | 2 |
5 files changed, 20 insertions, 9 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index ad9dec30bb30..4282ceca3d8f 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c | |||
@@ -169,7 +169,9 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) | |||
169 | { | 169 | { |
170 | struct iio_dev *indio_dev = private; | 170 | struct iio_dev *indio_dev = private; |
171 | struct tiadc_device *adc_dev = iio_priv(indio_dev); | 171 | struct tiadc_device *adc_dev = iio_priv(indio_dev); |
172 | unsigned int status, config; | 172 | unsigned int status, config, adc_fsm; |
173 | unsigned short count = 0; | ||
174 | |||
173 | status = tiadc_readl(adc_dev, REG_IRQSTATUS); | 175 | status = tiadc_readl(adc_dev, REG_IRQSTATUS); |
174 | 176 | ||
175 | /* | 177 | /* |
@@ -183,6 +185,15 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) | |||
183 | tiadc_writel(adc_dev, REG_CTRL, config); | 185 | tiadc_writel(adc_dev, REG_CTRL, config); |
184 | tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN | 186 | tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN |
185 | | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES); | 187 | | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES); |
188 | |||
189 | /* wait for idle state. | ||
190 | * ADC needs to finish the current conversion | ||
191 | * before disabling the module | ||
192 | */ | ||
193 | do { | ||
194 | adc_fsm = tiadc_readl(adc_dev, REG_ADCFSM); | ||
195 | } while (adc_fsm != 0x10 && count++ < 100); | ||
196 | |||
186 | tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB)); | 197 | tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB)); |
187 | return IRQ_HANDLED; | 198 | return IRQ_HANDLED; |
188 | } else if (status & IRQENB_FIFO1THRES) { | 199 | } else if (status & IRQENB_FIFO1THRES) { |
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index a3cce3a38300..ecf592d69043 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c | |||
@@ -51,8 +51,6 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) | |||
51 | st->report_state.report_id, | 51 | st->report_state.report_id, |
52 | st->report_state.index, | 52 | st->report_state.index, |
53 | HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM); | 53 | HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM); |
54 | |||
55 | poll_value = hid_sensor_read_poll_value(st); | ||
56 | } else { | 54 | } else { |
57 | int val; | 55 | int val; |
58 | 56 | ||
@@ -89,7 +87,9 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) | |||
89 | sensor_hub_get_feature(st->hsdev, st->power_state.report_id, | 87 | sensor_hub_get_feature(st->hsdev, st->power_state.report_id, |
90 | st->power_state.index, | 88 | st->power_state.index, |
91 | sizeof(state_val), &state_val); | 89 | sizeof(state_val), &state_val); |
92 | if (state && poll_value) | 90 | if (state) |
91 | poll_value = hid_sensor_read_poll_value(st); | ||
92 | if (poll_value > 0) | ||
93 | msleep_interruptible(poll_value * 2); | 93 | msleep_interruptible(poll_value * 2); |
94 | 94 | ||
95 | return 0; | 95 | return 0; |
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c index 78532ce07449..81b572d7699a 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | |||
@@ -193,8 +193,8 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark) | |||
193 | if (err < 0) | 193 | if (err < 0) |
194 | goto out; | 194 | goto out; |
195 | 195 | ||
196 | fifo_watermark = ((data & ~ST_LSM6DSX_FIFO_TH_MASK) << 8) | | 196 | fifo_watermark = ((data << 8) & ~ST_LSM6DSX_FIFO_TH_MASK) | |
197 | (fifo_watermark & ST_LSM6DSX_FIFO_TH_MASK); | 197 | (fifo_watermark & ST_LSM6DSX_FIFO_TH_MASK); |
198 | 198 | ||
199 | wdata = cpu_to_le16(fifo_watermark); | 199 | wdata = cpu_to_le16(fifo_watermark); |
200 | err = hw->tf->write(hw->dev, ST_LSM6DSX_REG_FIFO_THL_ADDR, | 200 | err = hw->tf->write(hw->dev, ST_LSM6DSX_REG_FIFO_THL_ADDR, |
diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index 6dd8cbd7ce95..e13370dc9b1c 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c | |||
@@ -763,7 +763,7 @@ power_off: | |||
763 | return ret; | 763 | return ret; |
764 | } | 764 | } |
765 | 765 | ||
766 | static int __exit ak8974_remove(struct i2c_client *i2c) | 766 | static int ak8974_remove(struct i2c_client *i2c) |
767 | { | 767 | { |
768 | struct iio_dev *indio_dev = i2c_get_clientdata(i2c); | 768 | struct iio_dev *indio_dev = i2c_get_clientdata(i2c); |
769 | struct ak8974 *ak8974 = iio_priv(indio_dev); | 769 | struct ak8974 *ak8974 = iio_priv(indio_dev); |
@@ -845,7 +845,7 @@ static struct i2c_driver ak8974_driver = { | |||
845 | .of_match_table = of_match_ptr(ak8974_of_match), | 845 | .of_match_table = of_match_ptr(ak8974_of_match), |
846 | }, | 846 | }, |
847 | .probe = ak8974_probe, | 847 | .probe = ak8974_probe, |
848 | .remove = __exit_p(ak8974_remove), | 848 | .remove = ak8974_remove, |
849 | .id_table = ak8974_id, | 849 | .id_table = ak8974_id, |
850 | }; | 850 | }; |
851 | module_i2c_driver(ak8974_driver); | 851 | module_i2c_driver(ak8974_driver); |
diff --git a/include/linux/iio/sw_device.h b/include/linux/iio/sw_device.h index 23ca41515527..fa7931933067 100644 --- a/include/linux/iio/sw_device.h +++ b/include/linux/iio/sw_device.h | |||
@@ -62,7 +62,7 @@ void iio_swd_group_init_type_name(struct iio_sw_device *d, | |||
62 | const char *name, | 62 | const char *name, |
63 | struct config_item_type *type) | 63 | struct config_item_type *type) |
64 | { | 64 | { |
65 | #ifdef CONFIG_CONFIGFS_FS | 65 | #if IS_ENABLED(CONFIG_CONFIGFS_FS) |
66 | config_group_init_type_name(&d->group, name, type); | 66 | config_group_init_type_name(&d->group, name, type); |
67 | #endif | 67 | #endif |
68 | } | 68 | } |