Skip to content

Commit

Permalink
Merge tag 'iio-for-5.20a' of https://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jic23/iio into char-misc-next

Jonathan writes:

IIO new device support, features and minor fixes for 5.20

Several on-running cleanup efforts dominate this time, plus the DMA
safety alignment issue identified due to improved understanding of
the restrictions as a result of Catalin Marinas' efforts in that area.

One immutable branch in here due to MFD and SPMI elements needed for
the qcom-rradc driver.

Device support
* bmi088
  - Add support for bmi085 (accelerometer part of IMU)
  - Add support for bmi090l (accelerometer part of IMU)
* mcp4922
  - Add support for single channel device MCP4921
* rzg2l-adc
  - Add compatible and minor tweaks to support RZ/G2UL ADC
* sca3300
  - Add support for scl3300 including refactoring driver to support
    multiple device types and cleanup noticed whilst working on driver.
* spmi-rradc
  - New driver for Qualcomm SPMI Round Robin ADC including necessary
    additional utility functions in SPMI core and related MFD driver.
* ti-dac55781
  - Add compatible for DAC121C081 which is very similar to existing parts.

Features
* core
  - Warn on iio_trigger_get() on an unregistered IIO trigger.
* bma400
  - Triggered buffer support
  - Activity and step counting
  - Misc driver improvements such as devm and header ordering
* cm32181
  - Add PM support.
* cros_ec
  - Sensor location support
* sx9324
  - Add precharge resistor setting
  - Add internal compensation resistor setting
  - Add CS idle/sleep mode.
* sx9360
  - Add precharge resistor setting
* vl53l0x
  - Handle reset GPIO, regulator and relax handling of irq type.

Cleanup and minor fixes:

Treewide changes
- Cleanup of error handling in remove functions in many drivers.
- Update dt-binding maintainers for a number of ADI bindings.
- Several sets of conversion of drivers from device tree specific to
  generic device properties. Includes fixing up various related
  header and Kconfig issues.
- Drop include of of.h from iio.h and fix up drivers that need to include
  it directly.
- More moves of clusters of drivers into appropriate IIO_XXX namespaces.
- Tree wide fix of a long running bug around DMA safety requirements.
  IIO was using __cacheline_aligned to pad iio_priv() structures. This
  worked for a long time by coincidence, but correct alignment is
  ARCH_KMALLOC_MINALIGN.  As there is activity around this area, introduce
  an IIO local IIO_DMA_MINALIGN to allow for changing it in one place rather
  than every driver in future. Note, there have been no reports of this
  bug in the wild, and it may not happen on any platforms supported by
  upstream, so no rush to backport these fixes.

Other cleanup
* core
  - Switch to ida_alloc()/free()
  - Drop unused iio_get_time_res()
  - Octal permissions and DEVICE_ATTR_* macros.
  - Cleanup bared unsigned usage.
* MAINTAINERS
  - Add include/dt-bindings/iio/ to the main IIO entry.
* ad5380
  - Comment syntax fix.
* ad74413r
  - Call to for_each_set_bit_from(), with from value as 0 replaced.
* ad7768-1
  - Drop explicit setting of INDIO_BUFFER_TRIGGERED as now done by the core.
* adxl345
  - Fix wrong address in dt-binding example.
* adxl367
  - Drop extra update of FIFO watermark.
* at91-sama5d2
  - Limit requested watermark to the hwfifo size.
* bmg160, bme680
  - Typos
* cio-dac
  - Switch to iomap rather than direct use of ioports
* kxsd9
  - Replace CONFIG_PM guards with new PM macros that let the compiler
    cleanly remove the unused code and structures when !CONFIG_PM
* lsm6dsx
  - Use new pm_sleep_ptr() and EXPORT_SIMPLE_DEV_PM_OPS(). Then move
    to Namespace.
* meson_saradc - general cleanup.
  - Avoid attaching resources to iio_dev->dev
  - Use same struct device for all error messages
  - Convert to dev_err_probe() and use local struct device *dev to
    reduce code complexity.
  - Use devm_clk_get_optional() instead of hand rolling.
  - Use regmap_read_poll_timeout() instead of hand rolling.
* mma7660
  - Drop ACPI_PTR() use that is unhelpful.
* mpu3050
  - Stop exporting symbols not used outside of module
  - Switch to new DEFINE_RUNTIME_DEV_PM_OPS() macro and move to Namespace.
* ping
  - Typo fix
* qcom-spmi-rradc
  - Typo fix
* sc27xx
  - Convert to generic struct u32_fract
* srf08
  - Drop a redundant check on !val
* st_lsm6dsx
  - Limit the requested watermark to the hwfifo size.
* stm32-adc
  - Use generic_handle_domain_irq() instead of opencoding.
  - Fix handling of ADC disable.
* stm32-dac
  - Use str_enabled_disable() instead of open coding.
* stx104
  - Switch to iomap rather than direct use of ioports
* tsc2046
  - Drop explicit setting of INDIO_BUFFER_TRIGGERED as now done by the core.
* tsl2563
  - Replace flush_scheduled_work() with cancel_delayed_work_sync()
  - Replace cancel_delayed_work() with cancel_delayed_work_sync()
* vl53l0x
  - Make the VDD regulator optional by allowing a dummy regulator.

* tag 'iio-for-5.20a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (244 commits)
  iio: adc: xilinx-xadc: Drop duplicate NULL check in xadc_parse_dt()
  iio: adc: xilinx-xadc: Make use of device properties
  iio: light: cm32181: Add PM support
  iio: adc: ad778-1: do not explicity set INDIO_BUFFER_TRIGGERED mode
  iio: adc: ti-tsc2046: do not explicity set INDIO_BUFFER_TRIGGERED mode
  iio: adc: stm32-adc: disable adc before calibration
  iio: adc: stm32-adc: make safe adc disable
  iio: dac: ad5380: align '*' each line and drop unneeded blank line
  iio: adc: qcom-spmi-rradc: Fix spelling mistake "coherrency" -> "coherency"
  iio: Don't use bare "unsigned"
  dt-bindings: iio: dac: mcp4922: expand for mcp4921 support
  iio: dac: mcp4922: add support to mcp4921
  iio: chemical: sps30: Move symbol exports into IIO_SPS30 namespace
  iio: pressure: bmp280: Move symbol exports to IIO_BMP280 namespace
  iio: imu: bmi160: Move exported symbols to IIO_BMI160 namespace
  iio: adc: stm32-adc: Use generic_handle_domain_irq()
  proximity: vl53l0x: Make VDD regulator actually optional
  MAINTAINERS: add include/dt-bindings/iio to IIO SUBSYSTEM AND DRIVERS
  dt-bindings: iio/accel: Fix adi,adxl345/6 example I2C address
  iio: gyro: bmg160: Fix typo in comment
  ...
  • Loading branch information
Greg Kroah-Hartman committed Jul 14, 2022
2 parents bc2c6a5 + 568f686 commit 2a3c8f8
Show file tree
Hide file tree
Showing 223 changed files with 3,287 additions and 909 deletions.
5 changes: 5 additions & 0 deletions Documentation/ABI/testing/sysfs-bus-iio
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ Description:
* "accel-base"
* "accel-display"

For devices where an accelerometer is housed in the swivel camera subassembly
(for AR application), the following standardized label is used:

* "accel-camera"

What: /sys/bus/iio/devices/iio:deviceX/current_timestamp_clock
KernelVersion: 4.5
Contact: linux-iio@vger.kernel.org
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: ADIS16240 Programmable Impact Sensor and Recorder driver

maintainers:
- Alexandru Ardelean <alexandru.ardelean@analog.com>
- Alexandru Tachici <alexandru.tachici@analog.com>

description: |
ADIS16240 Programmable Impact Sensor and Recorder driver that supports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ examples:
/* Example for a I2C device node */
accelerometer@2a {
compatible = "adi,adxl345";
reg = <0x53>;
reg = <0x2a>;
interrupt-parent = <&gpio0>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
};
Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/iio/accel/bosch,bmi088.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ description: |
properties:
compatible:
enum:
- bosch,bmi085-accel
- bosch,bmi088-accel
- bosch,bmi090l-accel

reg:
maxItems: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ properties:
compatible:
enum:
- murata,sca3300
- murata,scl3300

reg:
maxItems: 1
Expand Down
1 change: 0 additions & 1 deletion Documentation/devicetree/bindings/iio/adc/adi,ad9467.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ title: Analog Devices AD9467 and similar High-Speed ADCs

maintainers:
- Michael Hennerich <michael.hennerich@analog.com>
- Alexandru Ardelean <alexandru.ardelean@analog.com>

description: |
The AD9467 and the parts similar with it, are high-speed analog-to-digital
Expand Down
1 change: 0 additions & 1 deletion Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ title: Analog Devices AXI ADC IP core

maintainers:
- Michael Hennerich <michael.hennerich@analog.com>
- Alexandru Ardelean <alexandru.ardelean@analog.com>

description: |
Analog Devices Generic AXI ADC IP core for interfacing an ADC device
Expand Down
51 changes: 51 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/qcom,spmi-rradc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-rradc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm's SPMI PMIC Round Robin ADC

maintainers:
- Caleb Connolly <caleb.connolly@linaro.org>

description: |
The Qualcomm SPMI Round Robin ADC (RRADC) provides interface to clients to
read the voltage, current and temperature for supported peripherals such as
the battery thermistor die temperature, charger temperature, USB and DC input
voltage / current and battery ID resistor.
properties:
compatible:
enum:
- qcom,pmi8998-rradc
- qcom,pm660-rradc

reg:
maxItems: 1

qcom,batt-id-delay-ms:
description: Sets the hardware settling time for the battery ID resistor.
enum: [0, 1, 4, 12, 20, 40, 60, 80]

"#io-channel-cells":
const: 1

required:
- compatible
- reg

additionalProperties: false

examples:
- |
pmic {
#address-cells = <1>;
#size-cells = <0>;
pmic_rradc: adc@4500 {
compatible = "qcom,pmi8998-rradc";
reg = <0x4500>;
#io-channel-cells = <1>;
};
};
28 changes: 24 additions & 4 deletions Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ properties:
compatible:
items:
- enum:
- renesas,r9a07g043-adc # RZ/G2UL
- renesas,r9a07g044-adc # RZ/G2L
- renesas,r9a07g054-adc # RZ/V2L
- const: renesas,rzg2l-adc
Expand Down Expand Up @@ -76,16 +77,35 @@ patternProperties:
properties:
reg:
description: |
The channel number. It can have up to 8 channels numbered from 0 to 7.
items:
- minimum: 0
maximum: 7
The channel number.
required:
- reg

additionalProperties: false

allOf:
- if:
properties:
compatible:
contains:
const: renesas,r9a07g043-adc
then:
patternProperties:
"^channel@[2-7]$": false
"^channel@[0-1]$":
properties:
reg:
minimum: 0
maximum: 1
else:
patternProperties:
"^channel@[0-7]$":
properties:
reg:
minimum: 0
maximum: 7

additionalProperties: false

examples:
Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices AD5770R DAC device driver

maintainers:
- Mircea Caprioru <mircea.caprioru@analog.com>
- Alexandru Tachici <alexandru.tachici@analog.com>

description: |
Bindings for the Analog Devices AD5770R current DAC device. Datasheet can be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ properties:
enum:
- microchip,mcp4902
- microchip,mcp4912
- microchip,mcp4921
- microchip,mcp4922

reg:
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/iio/dac/ti,dac5571.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ properties:
- ti,dac5573
- ti,dac6573
- ti,dac7573
- ti,dac121c081

reg:
maxItems: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices ADIS16480 and similar IMUs

maintainers:
- Alexandru Ardelean <alexandru.ardelean@analog.com>
- Alexandru Tachici <alexandru.tachici@analog.com>

properties:
compatible:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,42 @@ properties:
UINT_MAX (4294967295) represents infinite. Other values
represent 1-1/N.
semtech,cs-idle-sleep:
description:
State of CS pins during sleep mode and idle time.
enum:
- hi-z
- gnd
- vdd

semtech,int-comp-resistor:
description:
Internal resistor setting for compensation.
enum:
- lowest
- low
- high
- highest

semtech,input-precharge-resistor-ohms:
default: 4000
multipleOf: 2000
minimum: 0
maximum: 30000
description:
Pre-charge input resistance in Ohm.

semtech,input-analog-gain:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 0
maximum: 3
description: |
Defines the input antenna analog gain
0: x1.247
1: x1 (default)
2: x0.768
3: x0.552
required:
- compatible
- reg
Expand Down Expand Up @@ -157,5 +193,8 @@ examples:
semtech,ph01-proxraw-strength = <2>;
semtech,ph23-proxraw-strength = <2>;
semtech,avg-pos-strength = <64>;
semtech,int-comp-resistor = "lowest";
semtech,input-precharge-resistor-ohms = <2000>;
semtech,cs-idle-sleep = "gnd";
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ properties:
UINT_MAX (4294967295) represents infinite. Other values
represent 1-1/N.
semtech,input-precharge-resistor-ohms:
default: 0
multipleOf: 2000
minimum: 0
maximum: 30000
description:
Pre-charge input resistance in Ohm.

required:
- compatible
- reg
Expand All @@ -85,5 +93,6 @@ examples:
semtech,resolution = <256>;
semtech,proxraw-strength = <2>;
semtech,avg-pos-strength = <64>;
semtech,input-precharge-resistor-ohms = <4000>;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ properties:
interrupts:
maxItems: 1

reset-gpios:
maxItems: 1

vdd-supply: true

required:
- compatible
- reg
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9724,6 +9724,7 @@ F: Documentation/ABI/testing/sysfs-bus-iio*
F: Documentation/devicetree/bindings/iio/
F: drivers/iio/
F: drivers/staging/iio/
F: include/dt-bindings/iio/
F: include/linux/iio/
F: tools/iio/

Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/accel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ config BMA220
config BMA400
tristate "Bosch BMA400 3-Axis Accelerometer Driver"
select REGMAP
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select BMA400_I2C if I2C
select BMA400_SPI if SPI
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/accel/adxl313_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ EXPORT_SYMBOL_NS_GPL(adxl313_writable_regs_table, IIO_ADXL313);
struct adxl313_data {
struct regmap *regmap;
struct mutex lock; /* lock to protect transf_buf */
__le16 transf_buf ____cacheline_aligned;
__le16 transf_buf __aligned(IIO_DMA_MINALIGN);
};

static const int adxl313_odr_freqs[][2] = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/accel/adxl355_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct adxl355_data {
u8 buf[14];
s64 ts;
} buffer;
} ____cacheline_aligned;
} __aligned(IIO_DMA_MINALIGN);
};

static int adxl355_set_op_mode(struct adxl355_data *data,
Expand Down
Loading

0 comments on commit 2a3c8f8

Please sign in to comment.