Commit 6ea65f24 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'iio-fixes-for-6.4b' of...

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
parents 5959fe74 c57fa003
...@@ -47,6 +47,9 @@ properties: ...@@ -47,6 +47,9 @@ properties:
avdd-supply: avdd-supply:
description: AVdd voltage supply description: AVdd voltage supply
vref-supply:
description: VRef voltage supply
adi,rejection-60-Hz-enable: adi,rejection-60-Hz-enable:
description: | description: |
This bit enables a notch at 60 Hz when the first notch of the sinc This bit enables a notch at 60 Hz when the first notch of the sinc
...@@ -89,6 +92,7 @@ required: ...@@ -89,6 +92,7 @@ required:
- interrupts - interrupts
- dvdd-supply - dvdd-supply
- avdd-supply - avdd-supply
- vref-supply
- spi-cpol - spi-cpol
- spi-cpha - spi-cpha
...@@ -115,6 +119,7 @@ examples: ...@@ -115,6 +119,7 @@ examples:
interrupt-parent = <&gpio>; interrupt-parent = <&gpio>;
dvdd-supply = <&dvdd>; dvdd-supply = <&dvdd>;
avdd-supply = <&avdd>; avdd-supply = <&avdd>;
vref-supply = <&vref>;
adi,refin2-pins-enable; adi,refin2-pins-enable;
adi,rejection-60-Hz-enable; adi,rejection-60-Hz-enable;
......
...@@ -724,8 +724,7 @@ static const struct iio_event_spec fxls8962af_event[] = { ...@@ -724,8 +724,7 @@ static const struct iio_event_spec fxls8962af_event[] = {
.sign = 's', \ .sign = 's', \
.realbits = 12, \ .realbits = 12, \
.storagebits = 16, \ .storagebits = 16, \
.shift = 4, \ .endianness = IIO_LE, \
.endianness = IIO_BE, \
}, \ }, \
.event_spec = fxls8962af_event, \ .event_spec = fxls8962af_event, \
.num_event_specs = ARRAY_SIZE(fxls8962af_event), \ .num_event_specs = ARRAY_SIZE(fxls8962af_event), \
...@@ -904,9 +903,10 @@ static int fxls8962af_fifo_transfer(struct fxls8962af_data *data, ...@@ -904,9 +903,10 @@ static int fxls8962af_fifo_transfer(struct fxls8962af_data *data,
int total_length = samples * sample_length; int total_length = samples * sample_length;
int ret; int ret;
if (i2c_verify_client(dev)) if (i2c_verify_client(dev) &&
data->chip_info->chip_id == FXLS8962AF_DEVICE_ID)
/* /*
* Due to errata bug: * Due to errata bug (only applicable on fxls8962af):
* E3: FIFO burst read operation error using I2C interface * E3: FIFO burst read operation error using I2C interface
* We have to avoid burst reads on I2C.. * We have to avoid burst reads on I2C..
*/ */
......
...@@ -367,7 +367,7 @@ static int ad7192_of_clock_select(struct ad7192_state *st) ...@@ -367,7 +367,7 @@ static int ad7192_of_clock_select(struct ad7192_state *st)
clock_sel = AD7192_CLK_INT; clock_sel = AD7192_CLK_INT;
/* use internal clock */ /* use internal clock */
if (st->mclk) { if (!st->mclk) {
if (of_property_read_bool(np, "adi,int-clock-output-enable")) if (of_property_read_bool(np, "adi,int-clock-output-enable"))
clock_sel = AD7192_CLK_INT_CO; clock_sel = AD7192_CLK_INT_CO;
} else { } else {
...@@ -380,9 +380,9 @@ static int ad7192_of_clock_select(struct ad7192_state *st) ...@@ -380,9 +380,9 @@ static int ad7192_of_clock_select(struct ad7192_state *st)
return clock_sel; return clock_sel;
} }
static int ad7192_setup(struct ad7192_state *st, struct device_node *np) static int ad7192_setup(struct iio_dev *indio_dev, struct device_node *np)
{ {
struct iio_dev *indio_dev = spi_get_drvdata(st->sd.spi); struct ad7192_state *st = iio_priv(indio_dev);
bool rej60_en, refin2_en; bool rej60_en, refin2_en;
bool buf_en, bipolar, burnout_curr_en; bool buf_en, bipolar, burnout_curr_en;
unsigned long long scale_uv; unsigned long long scale_uv;
...@@ -1069,7 +1069,7 @@ static int ad7192_probe(struct spi_device *spi) ...@@ -1069,7 +1069,7 @@ static int ad7192_probe(struct spi_device *spi)
} }
} }
ret = ad7192_setup(st, spi->dev.of_node); ret = ad7192_setup(indio_dev, spi->dev.of_node);
if (ret) if (ret)
return ret; return ret;
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
#define MESON_SAR_ADC_REG3_PANEL_DETECT_COUNT_MASK GENMASK(20, 18) #define MESON_SAR_ADC_REG3_PANEL_DETECT_COUNT_MASK GENMASK(20, 18)
#define MESON_SAR_ADC_REG3_PANEL_DETECT_FILTER_TB_MASK GENMASK(17, 16) #define MESON_SAR_ADC_REG3_PANEL_DETECT_FILTER_TB_MASK GENMASK(17, 16)
#define MESON_SAR_ADC_REG3_ADC_CLK_DIV_SHIFT 10 #define MESON_SAR_ADC_REG3_ADC_CLK_DIV_SHIFT 10
#define MESON_SAR_ADC_REG3_ADC_CLK_DIV_WIDTH 5 #define MESON_SAR_ADC_REG3_ADC_CLK_DIV_WIDTH 6
#define MESON_SAR_ADC_REG3_BLOCK_DLY_SEL_MASK GENMASK(9, 8) #define MESON_SAR_ADC_REG3_BLOCK_DLY_SEL_MASK GENMASK(9, 8)
#define MESON_SAR_ADC_REG3_BLOCK_DLY_MASK GENMASK(7, 0) #define MESON_SAR_ADC_REG3_BLOCK_DLY_MASK GENMASK(7, 0)
......
...@@ -1317,13 +1317,14 @@ static int ad74413r_setup_gpios(struct ad74413r_state *st) ...@@ -1317,13 +1317,14 @@ static int ad74413r_setup_gpios(struct ad74413r_state *st)
} }
if (config->func == CH_FUNC_DIGITAL_INPUT_LOGIC || if (config->func == CH_FUNC_DIGITAL_INPUT_LOGIC ||
config->func == CH_FUNC_DIGITAL_INPUT_LOOP_POWER) config->func == CH_FUNC_DIGITAL_INPUT_LOOP_POWER) {
st->comp_gpio_offsets[comp_gpio_i++] = i; st->comp_gpio_offsets[comp_gpio_i++] = i;
strength = config->drive_strength; strength = config->drive_strength;
ret = ad74413r_set_comp_drive_strength(st, i, strength); ret = ad74413r_set_comp_drive_strength(st, i, strength);
if (ret) if (ret)
return ret; return ret;
}
ret = ad74413r_set_gpo_config(st, i, gpo_config); ret = ad74413r_set_gpo_config(st, i, gpo_config);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment