Skip to content

Commit eafe5cf

Browse files
committed
Merge tag 'iio-fixes-for-4.8a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into work-linus
Jonathan writes: First round of IIO fixes for the 4.8 cycle. This is somewhat of a bumper set due to my unavailabilty earlier in the month. The only slightly unusual ones are the dts updates for the rockchip adc reset. The fix in the driver only makes sense with these and the rockchip maintainer is happy with them going through IIO to reach mainline. Core stuff * Fix an issue with a blocking op when !TASK_RUNNING. This been there a while and snuck in with seemingly minor additions to some core code paths. * Tools - generic_buffer failed to initialize the channel array pointer thus in the case of no channels blows up trying to free a random memory address. * sw-trigger: - Fix config group initialization when configfs is built as a module. Drivers * ad5933 - Fix an incorrect overwrite of an error value. * ad799x - A missed assignment of the update_scan_mode callback means buffered mode doesn't work on the ad7991, ad7995 or ad7999. * ads1015 - wrong pointer returned from i2c_get_clientdata (missmatch of assumptions) * am2315 - Timestamps are reported, but never actually acquired from anywhere (so always 0) - missing buffer selects in Kconfig * am335x adc - Protect fifo1 from concurrent access. - Increase timeout waiting for ADC to be long enough in all cases. * as3935 - Timestamps are reported, but never actually acquired from anywhere (so always 0) * at91 - Fix reading of channel 3. * atlas-ph-sensor - Typo means that the scale of electrical conductivity readings is way off. * bma220 - Timestamps are reported, but never actually acquired from anywhere (so always 0) - Missing buffer selects in Kconfig * bmp280 - pass the write pointer to PTR_ERR (i.e. the one that was just checked with IS_ERR). - suspend /resume crash due to wrong assumption about what dev_get_drvdata would return. * hdc100x - It superficially appeared that smbus_read_byte commands would allow reading of the outputs in two goes. In reality it doesn't work, but instead returns the same for the upper and lower bytes (nice catch from Alison!) * kxsd9 - Fix raw read return value to ensure it actually reports the value rather than a blank string. * max44000 - Missing buffer selects in Kconfig * rockchip_saradc - Add use of reset controller to enforce a clean state of the ADC. Some bootloaders can leave it in an 'intersting' state and effectively frozen without this. A couple of associated dts updates. * stk8ba50 - Missing buffer selects in Kconfig * stx104 - Fix a possible race due to use of devm_iio_device_register when there was other stuff in the remove function.
2 parents c0678b2 + 3d4267a commit eafe5cf

27 files changed

Lines changed: 141 additions & 57 deletions

File tree

‎Documentation/devicetree/bindings/iio/adc/rockchip-saradc.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ Required properties:
1616
- vref-supply: The regulator supply ADC reference voltage.
1717
- #io-channel-cells: Should be 1, see ../iio-bindings.txt
1818

19+
Optional properties:
20+
- resets: Must contain an entry for each entry in reset-names if need support
21+
this option. See ../reset/reset.txt for details.
22+
- reset-names: Must include the name "saradc-apb".
23+
1924
Example:
2025
saradc: saradc@2006c000 {
2126
compatible = "rockchip,saradc";
2227
reg = <0x2006c000 0x100>;
2328
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
2429
clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
2530
clock-names = "saradc", "apb_pclk";
31+
resets = <&cru SRST_SARADC>;
32+
reset-names = "saradc-apb";
2633
#io-channel-cells = <1>;
2734
vref-supply = <&vcc18>;
2835
};

‎arch/arm/boot/dts/rk3066a.dtsi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@
197197
clock-names = "saradc", "apb_pclk";
198198
interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
199199
#io-channel-cells = <1>;
200+
resets = <&cru SRST_SARADC>;
201+
reset-names = "saradc-apb";
200202
status = "disabled";
201203
};
202204

‎arch/arm/boot/dts/rk3288.dtsi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@
279279
#io-channel-cells = <1>;
280280
clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
281281
clock-names = "saradc", "apb_pclk";
282+
resets = <&cru SRST_SARADC>;
283+
reset-names = "saradc-apb";
282284
status = "disabled";
283285
};
284286

‎arch/arm/boot/dts/rk3xxx.dtsi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@
399399
#io-channel-cells = <1>;
400400
clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
401401
clock-names = "saradc", "apb_pclk";
402+
resets = <&cru SRST_SARADC>;
403+
reset-names = "saradc-apb";
402404
status = "disabled";
403405
};
404406

‎arch/arm64/boot/dts/rockchip/rk3368.dtsi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@
270270
#io-channel-cells = <1>;
271271
clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
272272
clock-names = "saradc", "apb_pclk";
273+
resets = <&cru SRST_SARADC>;
274+
reset-names = "saradc-apb";
273275
status = "disabled";
274276
};
275277

‎drivers/iio/accel/Kconfig‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ config BMA180
2020
config BMA220
2121
tristate "Bosch BMA220 3-Axis Accelerometer Driver"
2222
depends on SPI
23+
select IIO_BUFFER
24+
select IIO_TRIGGERED_BUFFER
2325
help
2426
Say yes here to add support for the Bosch BMA220 triaxial
2527
acceleration sensor.
@@ -234,7 +236,8 @@ config STK8312
234236
config STK8BA50
235237
tristate "Sensortek STK8BA50 3-Axis Accelerometer Driver"
236238
depends on I2C
237-
depends on IIO_TRIGGER
239+
select IIO_BUFFER
240+
select IIO_TRIGGERED_BUFFER
238241
help
239242
Say yes here to get support for the Sensortek STK8BA50 3-axis
240243
accelerometer.

‎drivers/iio/accel/bma220_spi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static int bma220_probe(struct spi_device *spi)
253253
if (ret < 0)
254254
return ret;
255255

256-
ret = iio_triggered_buffer_setup(indio_dev, NULL,
256+
ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time,
257257
bma220_trigger_handler, NULL);
258258
if (ret < 0) {
259259
dev_err(&spi->dev, "iio triggered buffer setup failed\n");

‎drivers/iio/accel/kxsd9.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ static int kxsd9_read_raw(struct iio_dev *indio_dev,
160160
if (ret < 0)
161161
goto error_ret;
162162
*val = ret;
163+
ret = IIO_VAL_INT;
163164
break;
164165
case IIO_CHAN_INFO_SCALE:
165166
ret = spi_w8r8(st->us, KXSD9_READ(KXSD9_REG_CTRL_C));

‎drivers/iio/adc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ config QCOM_SPMI_VADC
389389
config ROCKCHIP_SARADC
390390
tristate "Rockchip SARADC driver"
391391
depends on ARCH_ROCKCHIP || (ARM && COMPILE_TEST)
392+
depends on RESET_CONTROLLER
392393
help
393394
Say yes here to build support for the SARADC found in SoCs from
394395
Rockchip.

‎drivers/iio/adc/ad799x.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ static struct attribute_group ad799x_event_attrs_group = {
527527
static const struct iio_info ad7991_info = {
528528
.read_raw = &ad799x_read_raw,
529529
.driver_module = THIS_MODULE,
530+
.update_scan_mode = ad799x_update_scan_mode,
530531
};
531532

532533
static const struct iio_info ad7993_4_7_8_noirq_info = {

0 commit comments

Comments
 (0)