Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'iio-fixes-for-6.4b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next

Jonathan writes:

2nd set of IIO fixes for the 6.4 cycle.

Given how late this pull request is, I'm expecting these to get queued
up for the 6.5 merge window.

- adi,ad7192
* Fix a null pointer as spi_set_drvdata() is no longer called.
* Fix wrong check prior to using internal clock.
* Fix dt-binding to make it clear the voltage reference is required.
- adi,ad74413
* DIN_SINK should not be set for functions other than digital inputs.
Enforce that in the driver.
- amlogic,meson-saradc
* Fix clock divider mask length - affects only meson 8 family.
- freescale,fxls8962af
* Fix endian type and shift of channels to match with default device setup.
* Narrow errata handling to FXLS8962AF only as doesn't affect other devices
supported by this driver.

* tag 'iio-fixes-for-6.4b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
meson saradc: fix clock divider mask length
iio: accel: fxls8962af: errata bug only applicable for FXLS8962AF
iio: accel: fxls8962af: fixup buffer scan element type
dt-bindings: iio: ad7192: Add mandatory reference voltage source
iio: adc: ad7192: Fix internal/external clock selection
iio: adc: ad7192: Fix null ad7192_state pointer access
iio: addac: ad74413: don't set DIN_SINK for functions other than digital input

+20 -14
+5
Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml
··· 47 47 avdd-supply: 48 48 description: AVdd voltage supply 49 49 50 + vref-supply: 51 + description: VRef voltage supply 52 + 50 53 adi,rejection-60-Hz-enable: 51 54 description: | 52 55 This bit enables a notch at 60 Hz when the first notch of the sinc ··· 92 89 - interrupts 93 90 - dvdd-supply 94 91 - avdd-supply 92 + - vref-supply 95 93 - spi-cpol 96 94 - spi-cpha 97 95 ··· 119 115 interrupt-parent = <&gpio>; 120 116 dvdd-supply = <&dvdd>; 121 117 avdd-supply = <&avdd>; 118 + vref-supply = <&vref>; 122 119 123 120 adi,refin2-pins-enable; 124 121 adi,rejection-60-Hz-enable;
+4 -4
drivers/iio/accel/fxls8962af-core.c
··· 724 724 .sign = 's', \ 725 725 .realbits = 12, \ 726 726 .storagebits = 16, \ 727 - .shift = 4, \ 728 - .endianness = IIO_BE, \ 727 + .endianness = IIO_LE, \ 729 728 }, \ 730 729 .event_spec = fxls8962af_event, \ 731 730 .num_event_specs = ARRAY_SIZE(fxls8962af_event), \ ··· 903 904 int total_length = samples * sample_length; 904 905 int ret; 905 906 906 - if (i2c_verify_client(dev)) 907 + if (i2c_verify_client(dev) && 908 + data->chip_info->chip_id == FXLS8962AF_DEVICE_ID) 907 909 /* 908 - * Due to errata bug: 910 + * Due to errata bug (only applicable on fxls8962af): 909 911 * E3: FIFO burst read operation error using I2C interface 910 912 * We have to avoid burst reads on I2C.. 911 913 */
+4 -4
drivers/iio/adc/ad7192.c
··· 367 367 clock_sel = AD7192_CLK_INT; 368 368 369 369 /* use internal clock */ 370 - if (st->mclk) { 370 + if (!st->mclk) { 371 371 if (of_property_read_bool(np, "adi,int-clock-output-enable")) 372 372 clock_sel = AD7192_CLK_INT_CO; 373 373 } else { ··· 380 380 return clock_sel; 381 381 } 382 382 383 - static int ad7192_setup(struct ad7192_state *st, struct device_node *np) 383 + static int ad7192_setup(struct iio_dev *indio_dev, struct device_node *np) 384 384 { 385 - struct iio_dev *indio_dev = spi_get_drvdata(st->sd.spi); 385 + struct ad7192_state *st = iio_priv(indio_dev); 386 386 bool rej60_en, refin2_en; 387 387 bool buf_en, bipolar, burnout_curr_en; 388 388 unsigned long long scale_uv; ··· 1069 1069 } 1070 1070 } 1071 1071 1072 - ret = ad7192_setup(st, spi->dev.of_node); 1072 + ret = ad7192_setup(indio_dev, spi->dev.of_node); 1073 1073 if (ret) 1074 1074 return ret; 1075 1075
+1 -1
drivers/iio/adc/meson_saradc.c
··· 72 72 #define MESON_SAR_ADC_REG3_PANEL_DETECT_COUNT_MASK GENMASK(20, 18) 73 73 #define MESON_SAR_ADC_REG3_PANEL_DETECT_FILTER_TB_MASK GENMASK(17, 16) 74 74 #define MESON_SAR_ADC_REG3_ADC_CLK_DIV_SHIFT 10 75 - #define MESON_SAR_ADC_REG3_ADC_CLK_DIV_WIDTH 5 75 + #define MESON_SAR_ADC_REG3_ADC_CLK_DIV_WIDTH 6 76 76 #define MESON_SAR_ADC_REG3_BLOCK_DLY_SEL_MASK GENMASK(9, 8) 77 77 #define MESON_SAR_ADC_REG3_BLOCK_DLY_MASK GENMASK(7, 0) 78 78
+6 -5
drivers/iio/addac/ad74413r.c
··· 1317 1317 } 1318 1318 1319 1319 if (config->func == CH_FUNC_DIGITAL_INPUT_LOGIC || 1320 - config->func == CH_FUNC_DIGITAL_INPUT_LOOP_POWER) 1320 + config->func == CH_FUNC_DIGITAL_INPUT_LOOP_POWER) { 1321 1321 st->comp_gpio_offsets[comp_gpio_i++] = i; 1322 1322 1323 - strength = config->drive_strength; 1324 - ret = ad74413r_set_comp_drive_strength(st, i, strength); 1325 - if (ret) 1326 - return ret; 1323 + strength = config->drive_strength; 1324 + ret = ad74413r_set_comp_drive_strength(st, i, strength); 1325 + if (ret) 1326 + return ret; 1327 + } 1327 1328 1328 1329 ret = ad74413r_set_gpo_config(st, i, gpo_config); 1329 1330 if (ret)