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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmSF9lMRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0Fohnwg//XxQw7xNTXfH359zXZQmE6G7QVLJWmw/H
 PM08tMYgafeMrNM2ntJ1ZN199yjWyVooqHf6r9Jn7lHaQRLpu0hAbCUG+7FDVMIB
 twsguiVrnZBZt717e4TQDAo6FDzp3fI/cCz6Zebfm38OBUweYANbqK/yuBZ9VDo2
 Rn1ZgYOA8yeSqcC5bJNpmWEfbFHt+DqVSCVn1rEP6pqtpaaoIIHCs7lKFUNJDmfp
 Sh5HvwZHNj/lJ2+Bkw9S802iq6pFp1mpVvvjnFCo/bkvYOTQ5t+GzrGCemI2EoA1
 32+RcWY2FV3NA5S9HYst8jy6Gna0EpR6Pz2FHTuB5MKtnhOHX3BMn+/v7Io6FaYy
 JNY3BMVv+hOeSn7twTmP2+n4KrhntUOEl+INw46icHOaGGIrPJi3Dxv0cEAAKs9R
 nSgYY7pKwkq1+RrZpNgazBF+XQjgPQAb3rdG1yKhS3JW00ucJSb1pMOqMgBwk6au
 XaQY4I+oC0dRuxBKp2s9YNdfZ57saavIwJv6VJt5B7qbt2KGQ+t32rlFupX8R1d3
 r90NyrWB3tkIkMrX9SQmcV8QpogwU+HQLjoQwsehcEd3CfXkbS+rrFhv4pHIXgX3
 08JYBtbhF4vE/c6GAtY1wz7ZcxxLKGRU1EqPw7ocf6r7i8Zw8oYjxMfrvzK9zrKx
 PoIFhm2Yi+g=
 =QmKH
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Greg Kroah-Hartman 2023-06-15 13:01:02 +02:00
commit 6ea65f24f7
5 changed files with 20 additions and 14 deletions

View File

@ -47,6 +47,9 @@ properties:
avdd-supply:
description: AVdd voltage supply
vref-supply:
description: VRef voltage supply
adi,rejection-60-Hz-enable:
description: |
This bit enables a notch at 60 Hz when the first notch of the sinc
@ -89,6 +92,7 @@ required:
- interrupts
- dvdd-supply
- avdd-supply
- vref-supply
- spi-cpol
- spi-cpha
@ -115,6 +119,7 @@ examples:
interrupt-parent = <&gpio>;
dvdd-supply = <&dvdd>;
avdd-supply = <&avdd>;
vref-supply = <&vref>;
adi,refin2-pins-enable;
adi,rejection-60-Hz-enable;

View File

@ -724,8 +724,7 @@ static const struct iio_event_spec fxls8962af_event[] = {
.sign = 's', \
.realbits = 12, \
.storagebits = 16, \
.shift = 4, \
.endianness = IIO_BE, \
.endianness = IIO_LE, \
}, \
.event_spec = fxls8962af_event, \
.num_event_specs = ARRAY_SIZE(fxls8962af_event), \
@ -904,9 +903,10 @@ static int fxls8962af_fifo_transfer(struct fxls8962af_data *data,
int total_length = samples * sample_length;
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
* We have to avoid burst reads on I2C..
*/

View File

@ -367,7 +367,7 @@ static int ad7192_of_clock_select(struct ad7192_state *st)
clock_sel = AD7192_CLK_INT;
/* use internal clock */
if (st->mclk) {
if (!st->mclk) {
if (of_property_read_bool(np, "adi,int-clock-output-enable"))
clock_sel = AD7192_CLK_INT_CO;
} else {
@ -380,9 +380,9 @@ static int ad7192_of_clock_select(struct ad7192_state *st)
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 buf_en, bipolar, burnout_curr_en;
unsigned long long scale_uv;
@ -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)
return ret;

View File

@ -72,7 +72,7 @@
#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_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_MASK GENMASK(7, 0)

View File

@ -1317,13 +1317,14 @@ static int ad74413r_setup_gpios(struct ad74413r_state *st)
}
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;
strength = config->drive_strength;
ret = ad74413r_set_comp_drive_strength(st, i, strength);
if (ret)
return ret;
strength = config->drive_strength;
ret = ad74413r_set_comp_drive_strength(st, i, strength);
if (ret)
return ret;
}
ret = ad74413r_set_gpo_config(st, i, gpo_config);
if (ret)