Skip to content

Commit

Permalink
Merge tag 'iio-fixes-for-6.12a' of ssh://gitolite.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/jic23/iio into char-misc-linus

Jonathan writes:

IIO: 1st set of fixes for the 6.12 cycle.

Most of this pull request is the result of Javier Carrasco doing a
careful audit for missing Kconfig dependencies that luck has meant
the random builds have never hit. The rest is the usual mix of old
bugs that have surfaced and some fallout from the recent merge window.

adi,ad5686
 - Fix binding duplication of compatible strings.
bosch,bma400
 - Fix an uninitialized variable in the event tap handling.
bosch,bmi323
 - Fix several issues in the register saving and restore on suspend/resume
sensiron,spd500
 - Fix missing CRC8 dependency
ti,op3001
 - Fix a missing full-scale range value (values above this point were
   all reported wrongly)
vishay,veml6030
 - Fix a segmentation fault due to some type confusion.
 - Fix wrong ambient light sensor resolution.

* tag 'iio-fixes-for-6.12a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (34 commits)
  iio: frequency: admv4420: fix missing select REMAP_SPI in Kconfig
  iio: frequency: {admv4420,adrf6780}: format Kconfig entries
  iio: adc: ad4695: Add missing Kconfig select
  iio: adc: ti-ads8688: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
  iio: hid-sensors: Fix an error handling path in _hid_sensor_set_report_latency()
  iioc: dac: ltc2664: Fix span variable usage in ltc2664_channel_config()
  iio: dac: stm32-dac-core: add missing select REGMAP_MMIO in Kconfig
  iio: dac: ltc1660: add missing select REGMAP_SPI in Kconfig
  iio: dac: ad5770r: add missing select REGMAP_SPI in Kconfig
  iio: amplifiers: ada4250: add missing select REGMAP_SPI in Kconfig
  iio: frequency: adf4377: add missing select REMAP_SPI in Kconfig
  iio: resolver: ad2s1210: add missing select (TRIGGERED_)BUFFER in Kconfig
  iio: resolver: ad2s1210 add missing select REGMAP in Kconfig
  iio: proximity: mb1232: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
  iio: pressure: bm1390: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
  iio: magnetometer: af8133j: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
  iio: light: bu27008: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
  iio: chemical: ens160: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
  iio: dac: ad5766: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
  iio: dac: ad3552r: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig
  ...
  • Loading branch information
gregkh committed Oct 13, 2024
2 parents 8cf0b93 + 6b8e9db commit 7528cb0
Show file tree
Hide file tree
Showing 19 changed files with 102 additions and 78 deletions.
53 changes: 17 additions & 36 deletions Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,30 @@
$id: http://devicetree.org/schemas/iio/dac/adi,ad5686.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5360 and similar DACs
title: Analog Devices AD5360 and similar SPI DACs

maintainers:
- Michael Hennerich <[email protected]>
- Jonathan Cameron <[email protected]>

properties:
compatible:
oneOf:
- description: SPI devices
enum:
- adi,ad5310r
- adi,ad5672r
- adi,ad5674r
- adi,ad5676
- adi,ad5676r
- adi,ad5679r
- adi,ad5681r
- adi,ad5682r
- adi,ad5683
- adi,ad5683r
- adi,ad5684
- adi,ad5684r
- adi,ad5685r
- adi,ad5686
- adi,ad5686r
- description: I2C devices
enum:
- adi,ad5311r
- adi,ad5337r
- adi,ad5338r
- adi,ad5671r
- adi,ad5675r
- adi,ad5691r
- adi,ad5692r
- adi,ad5693
- adi,ad5693r
- adi,ad5694
- adi,ad5694r
- adi,ad5695r
- adi,ad5696
- adi,ad5696r

enum:
- adi,ad5310r
- adi,ad5672r
- adi,ad5674r
- adi,ad5676
- adi,ad5676r
- adi,ad5679r
- adi,ad5681r
- adi,ad5682r
- adi,ad5683
- adi,ad5683r
- adi,ad5684
- adi,ad5684r
- adi,ad5685r
- adi,ad5686
- adi,ad5686r

reg:
maxItems: 1
Expand Down
3 changes: 2 additions & 1 deletion Documentation/devicetree/bindings/iio/dac/adi,ad5696.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/iio/dac/adi,ad5696.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5696 and similar multi-channel DACs
title: Analog Devices AD5696 and similar I2C multi-channel DACs

maintainers:
- Michael Auchter <[email protected]>
Expand All @@ -16,6 +16,7 @@ properties:
compatible:
enum:
- adi,ad5311r
- adi,ad5337r
- adi,ad5338r
- adi,ad5671r
- adi,ad5675r
Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/accel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ config IIO_ST_ACCEL_SPI_3AXIS

config IIO_KX022A
tristate
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER

config IIO_KX022A_SPI
tristate "Kionix KX022A tri-axis digital accelerometer SPI interface"
Expand Down
3 changes: 2 additions & 1 deletion drivers/iio/accel/bma400_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,8 @@ static int bma400_activity_event_en(struct bma400_data *data,
static int bma400_tap_event_en(struct bma400_data *data,
enum iio_event_direction dir, int state)
{
unsigned int mask, field_value;
unsigned int mask;
unsigned int field_value = 0;
int ret;

/*
Expand Down
11 changes: 11 additions & 0 deletions drivers/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ config AD4695
tristate "Analog Device AD4695 ADC Driver"
depends on SPI
select REGMAP_SPI
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for Analog Devices AD4695 and similar
analog to digital converters (ADC).
Expand Down Expand Up @@ -328,6 +330,8 @@ config AD7923
config AD7944
tristate "Analog Devices AD7944 and similar ADCs driver"
depends on SPI
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for Analog Devices
AD7944, AD7985, AD7986 ADCs.
Expand Down Expand Up @@ -1481,6 +1485,8 @@ config TI_ADS8344
config TI_ADS8688
tristate "Texas Instruments ADS8688"
depends on SPI
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
If you say yes here you get support for Texas Instruments ADS8684 and
and ADS8688 ADC chips
Expand All @@ -1491,6 +1497,8 @@ config TI_ADS8688
config TI_ADS124S08
tristate "Texas Instruments ADS124S08"
depends on SPI
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
If you say yes here you get support for Texas Instruments ADS124S08
and ADS124S06 ADC chips
Expand Down Expand Up @@ -1525,6 +1533,9 @@ config TI_AM335X_ADC
config TI_LMP92064
tristate "Texas Instruments LMP92064 ADC driver"
depends on SPI
select REGMAP_SPI
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for the LMP92064 Precision Current and Voltage
sensor.
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/amplifiers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ config AD8366
config ADA4250
tristate "Analog Devices ADA4250 Instrumentation Amplifier"
depends on SPI
select REGMAP_SPI
help
Say yes here to build support for Analog Devices ADA4250
SPI Amplifier's support. The driver provides direct access via
Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/chemical/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ config ENS160
tristate "ScioSense ENS160 sensor driver"
depends on (I2C || SPI)
select REGMAP
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select ENS160_I2C if I2C
select ENS160_SPI if SPI
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/common/hid-sensors/hid-sensor-trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static ssize_t _hid_sensor_set_report_latency(struct device *dev,
latency = integer * 1000 + fract / 1000;
ret = hid_sensor_set_report_latency(attrb, latency);
if (ret < 0)
return len;
return ret;

attrb->latency_ms = hid_sensor_get_report_latency(attrb);

Expand Down
7 changes: 7 additions & 0 deletions drivers/iio/dac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ menu "Digital to analog converters"
config AD3552R
tristate "Analog Devices AD3552R DAC driver"
depends on SPI_MASTER
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for Analog Devices AD3552R
Digital to Analog Converter.
Expand Down Expand Up @@ -252,6 +254,8 @@ config AD5764
config AD5766
tristate "Analog Devices AD5766/AD5767 DAC driver"
depends on SPI_MASTER
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for Analog Devices AD5766, AD5767
Digital to Analog Converter.
Expand All @@ -262,6 +266,7 @@ config AD5766
config AD5770R
tristate "Analog Devices AD5770R IDAC driver"
depends on SPI_MASTER
select REGMAP_SPI
help
Say yes here to build support for Analog Devices AD5770R Digital to
Analog Converter.
Expand Down Expand Up @@ -353,6 +358,7 @@ config LPC18XX_DAC
config LTC1660
tristate "Linear Technology LTC1660/LTC1665 DAC SPI driver"
depends on SPI
select REGMAP_SPI
help
Say yes here to build support for Linear Technology
LTC1660 and LTC1665 Digital to Analog Converters.
Expand Down Expand Up @@ -483,6 +489,7 @@ config STM32_DAC

config STM32_DAC_CORE
tristate
select REGMAP_MMIO

config TI_DAC082S085
tristate "Texas Instruments 8/10/12-bit 2/4-channel DAC driver"
Expand Down
17 changes: 9 additions & 8 deletions drivers/iio/dac/ltc2664.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static int ltc2664_channel_config(struct ltc2664_state *st)
const struct ltc2664_chip_info *chip_info = st->chip_info;
struct device *dev = &st->spi->dev;
u32 reg, tmp[2], mspan;
int ret, span = 0;
int ret;

mspan = LTC2664_MSPAN_SOFTSPAN;
ret = device_property_read_u32(dev, "adi,manual-span-operation-config",
Expand Down Expand Up @@ -579,20 +579,21 @@ static int ltc2664_channel_config(struct ltc2664_state *st)
ret = fwnode_property_read_u32_array(child, "output-range-microvolt",
tmp, ARRAY_SIZE(tmp));
if (!ret && mspan == LTC2664_MSPAN_SOFTSPAN) {
chan->span = ltc2664_set_span(st, tmp[0] / 1000,
tmp[1] / 1000, reg);
if (span < 0)
return dev_err_probe(dev, span,
ret = ltc2664_set_span(st, tmp[0] / 1000, tmp[1] / 1000, reg);
if (ret < 0)
return dev_err_probe(dev, ret,
"Failed to set span\n");
chan->span = ret;
}

ret = fwnode_property_read_u32_array(child, "output-range-microamp",
tmp, ARRAY_SIZE(tmp));
if (!ret) {
chan->span = ltc2664_set_span(st, 0, tmp[1] / 1000, reg);
if (span < 0)
return dev_err_probe(dev, span,
ret = ltc2664_set_span(st, 0, tmp[1] / 1000, reg);
if (ret < 0)
return dev_err_probe(dev, ret,
"Failed to set span\n");
chan->span = ret;
}
}

Expand Down
34 changes: 18 additions & 16 deletions drivers/iio/frequency/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ config ADF4371
config ADF4377
tristate "Analog Devices ADF4377 Microwave Wideband Synthesizer"
depends on SPI && COMMON_CLK
select REGMAP_SPI
help
Say yes here to build support for Analog Devices ADF4377 Microwave
Wideband Synthesizer.
Expand Down Expand Up @@ -91,25 +92,26 @@ config ADMV1014
module will be called admv1014.

config ADMV4420
tristate "Analog Devices ADMV4420 K Band Downconverter"
depends on SPI
help
Say yes here to build support for Analog Devices K Band
Downconverter with integrated Fractional-N PLL and VCO.
tristate "Analog Devices ADMV4420 K Band Downconverter"
depends on SPI
select REGMAP_SPI
help
Say yes here to build support for Analog Devices K Band
Downconverter with integrated Fractional-N PLL and VCO.

To compile this driver as a module, choose M here: the
module will be called admv4420.
To compile this driver as a module, choose M here: the
module will be called admv4420.

config ADRF6780
tristate "Analog Devices ADRF6780 Microwave Upconverter"
depends on SPI
depends on COMMON_CLK
help
Say yes here to build support for Analog Devices ADRF6780
5.9 GHz to 23.6 GHz, Wideband, Microwave Upconverter.

To compile this driver as a module, choose M here: the
module will be called adrf6780.
tristate "Analog Devices ADRF6780 Microwave Upconverter"
depends on SPI
depends on COMMON_CLK
help
Say yes here to build support for Analog Devices ADRF6780
5.9 GHz to 23.6 GHz, Wideband, Microwave Upconverter.

To compile this driver as a module, choose M here: the
module will be called adrf6780.

endmenu
endmenu
23 changes: 11 additions & 12 deletions drivers/iio/imu/bmi323/bmi323_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,6 @@ int bmi323_core_probe(struct device *dev)
}
EXPORT_SYMBOL_NS_GPL(bmi323_core_probe, IIO_BMI323);

#if defined(CONFIG_PM)
static int bmi323_core_runtime_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
Expand All @@ -2199,12 +2198,12 @@ static int bmi323_core_runtime_suspend(struct device *dev)
}

for (unsigned int i = 0; i < ARRAY_SIZE(bmi323_ext_reg_savestate); i++) {
ret = bmi323_read_ext_reg(data, bmi323_reg_savestate[i],
&savestate->reg_settings[i]);
ret = bmi323_read_ext_reg(data, bmi323_ext_reg_savestate[i],
&savestate->ext_reg_settings[i]);
if (ret) {
dev_err(data->dev,
"Error reading bmi323 external reg 0x%x: %d\n",
bmi323_reg_savestate[i], ret);
bmi323_ext_reg_savestate[i], ret);
return ret;
}
}
Expand Down Expand Up @@ -2232,8 +2231,10 @@ static int bmi323_core_runtime_resume(struct device *dev)
* after being reset in the lower power state by runtime-pm.
*/
ret = bmi323_init(data);
if (!ret)
if (ret) {
dev_err(data->dev, "Device power-on and init failed: %d", ret);
return ret;
}

/* Register must be cleared before changing an active config */
ret = regmap_write(data->regmap, BMI323_FEAT_IO0_REG, 0);
Expand All @@ -2243,12 +2244,12 @@ static int bmi323_core_runtime_resume(struct device *dev)
}

for (unsigned int i = 0; i < ARRAY_SIZE(bmi323_ext_reg_savestate); i++) {
ret = bmi323_write_ext_reg(data, bmi323_reg_savestate[i],
savestate->reg_settings[i]);
ret = bmi323_write_ext_reg(data, bmi323_ext_reg_savestate[i],
savestate->ext_reg_settings[i]);
if (ret) {
dev_err(data->dev,
"Error writing bmi323 external reg 0x%x: %d\n",
bmi323_reg_savestate[i], ret);
bmi323_ext_reg_savestate[i], ret);
return ret;
}
}
Expand Down Expand Up @@ -2293,11 +2294,9 @@ static int bmi323_core_runtime_resume(struct device *dev)
return iio_device_resume_triggering(indio_dev);
}

#endif

const struct dev_pm_ops bmi323_core_pm_ops = {
SET_RUNTIME_PM_OPS(bmi323_core_runtime_suspend,
bmi323_core_runtime_resume, NULL)
RUNTIME_PM_OPS(bmi323_core_runtime_suspend,
bmi323_core_runtime_resume, NULL)
};
EXPORT_SYMBOL_NS_GPL(bmi323_core_pm_ops, IIO_BMI323);

Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/light/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ config ROHM_BU27008
depends on I2C
select REGMAP_I2C
select IIO_GTS_HELPER
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Enable support for the ROHM BU27008 color sensor.
The ROHM BU27008 is a sensor with 5 photodiodes (red, green,
Expand Down
4 changes: 4 additions & 0 deletions drivers/iio/light/opt3001.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ static const struct opt3001_scale opt3001_scales[] = {
.val = 20966,
.val2 = 400000,
},
{
.val = 41932,
.val2 = 800000,
},
{
.val = 83865,
.val2 = 600000,
Expand Down
Loading

0 comments on commit 7528cb0

Please sign in to comment.