1st set of IIO new device support, features and cleanup for the 6.5 cycle.

New device support
 - honeywell,mprls0025pa
   * New driver and dt-bindings for this series of pressure sensors.
 - invensense,mpu6050
   * Add support for ICM 20600 IMU (ID, bindings and device data).
 - melexis,mlx90614
   * Add support for mlx90615 Infra Red Thermometer after driver cleanup
     and refactoring to support the differences in this device.
 - renesas,x9250
   * New driver and bindings for this quad potentiometer.
 - rockchip,saradc
   * Add support for RK3588. Also included is a bunch of refactoring and
     cleanup for that driver.
 - rohm,bu27008
   * New driver bindings etc for this 5 photodiode color sensor.
 - st,lsm9ds0/st,st-sensors
   * ID added for LSM303D accelerometer and magnetometer including ACPI binding.
 - ti,opt4001
   * New driver and bindings for this ambient light sensor.
 
 Features
 - core
   * Introduce iio_validate_own_trigger() for cases where a driver can only
     consumer a trigger it registered (detected via same parent device).
     Use it in the kionix,kx022a driver and new rohm,by27008 driver.
 - dynaimage,al3320a
   * ACPI binding CALS0001 seen on Lenovo Yoga Table 2 devices.
 - kionix,kx002a
   * Enable asynchronous probe.
 - rohm,bu27034
   * Enable asynchronous probe.
 - ti,tmp006
   * Explicit support for DT including binding documentation.
 
 Cleanups, minor fixes and misc improvements.
 - treewide
   * Switch I2C drivers from probe_new() back to probe() - part of the
     long process of getting rid of a parameter from probe()
   * Various whitespace and typo fixes not otherwise called out.
 - core
   * industrialio-buffer,Style cleanup.
   * Add documentation to extend_name field of struct iio_chan_spec to
     direct people using it towards the label infrastructure instead.
     extend_name was a design mistake a long time back so directly people
     away from it may be useful.
 - adi,ad7606
   * Add HAS_IOPORT dependency to prepare for some Kconfig changes.
 - bosch,bma400
   * Drop pointless print of ret in a dev_err_probe() message.
 - invensense,icm42600
   * Rework timestamp handling to reduce jitter.
 - mediatek,mt7986-auxdac
   * Add DT binding for this part.
 - qcom,spmi-vadc
   * Allow for 1/16th prescaling used on a few devices.
   * Various changes to channel labeling and naming, including dropping
     use of fwnode_name which generates odd channel names. Small ABI
     change as a result, but not thought to be a problem for users of this
     platform.
 - st,lsm6dsx
   * dt-binding: Use common schema for mount-matrix via a reference.
 - st,stm32
   * Add a debug print for when legacy channel config is used.
 - ti,palmas-adc
   * Drop unused i2c.h include.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmSF83ARHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0Foi+NRAAi8E2NRkzxteTuiFRsAokm/8HbAc/9rDq
 2Xyj8zT5B6jmqpbNKPtIbxxAxLV/JY+3HBIorvDNcOVfmOfshMpT31eaKpehxPJ3
 A00WaJ6bi7CTp0h/7QOZnZ27yr3tuJ2jpCiGKWERmTZ60kn3S/5JRrXWbfKVccyU
 DR1SrsiVSbtDhD9w6kA7HBRsL0EmTQOP/ARlUcO4SB5BOC7rj9akaN6Q6LYSafOa
 BFfTd2suekRA94mB/ugm25xAWLsl4Rdr1iNkHyaGcXaMOJZ/zWXq14y1eLbqIJIc
 am8Wu2zvo+umNzuG5DMi3gxP2B57Zhcieh6sJ5egdbxB4kh5z3jrsAFiw/MLTEME
 4Tc7uHBPFuXDdb8saxtmV2FVbC43+31FgCLivD0BGHtv0DndP7i//KCdp2aztmHo
 juyxRCw40xiul5Ihzh3NjukM0pb1inuhgblcEZVKOyaCjhur8NXoTEEcSqXczDVU
 BLHBmhQY2cKwqKWt1hbLXDs9iGlJBg0+P+P0VBsvy7WWOlvc9Hw8SryYwyBRJMYH
 LW/Wh85eIcyKaaGGEd+HQAyXwGSlrhycUSJzwdcc1IrK8TrIxn5k4BpQpeToQPjJ
 wBRRDigeciIN0K7L09N4hg+qTxtpLwFY945meAS0N60o5hZM4P40hnzL8m/Co0pH
 gx8SugY1NGk=
 =0gJ9
 -----END PGP SIGNATURE-----

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

Jonathan writes:

1st set of IIO new device support, features and cleanup for the 6.5 cycle.

New device support
- honeywell,mprls0025pa
  * New driver and dt-bindings for this series of pressure sensors.
- invensense,mpu6050
  * Add support for ICM 20600 IMU (ID, bindings and device data).
- melexis,mlx90614
  * Add support for mlx90615 Infra Red Thermometer after driver cleanup
    and refactoring to support the differences in this device.
- renesas,x9250
  * New driver and bindings for this quad potentiometer.
- rockchip,saradc
  * Add support for RK3588. Also included is a bunch of refactoring and
    cleanup for that driver.
- rohm,bu27008
  * New driver bindings etc for this 5 photodiode color sensor.
- st,lsm9ds0/st,st-sensors
  * ID added for LSM303D accelerometer and magnetometer including ACPI binding.
- ti,opt4001
  * New driver and bindings for this ambient light sensor.

Features
- core
  * Introduce iio_validate_own_trigger() for cases where a driver can only
    consumer a trigger it registered (detected via same parent device).
    Use it in the kionix,kx022a driver and new rohm,by27008 driver.
- dynaimage,al3320a
  * ACPI binding CALS0001 seen on Lenovo Yoga Table 2 devices.
- kionix,kx002a
  * Enable asynchronous probe.
- rohm,bu27034
  * Enable asynchronous probe.
- ti,tmp006
  * Explicit support for DT including binding documentation.

Cleanups, minor fixes and misc improvements.
- treewide
  * Switch I2C drivers from probe_new() back to probe() - part of the
    long process of getting rid of a parameter from probe()
  * Various whitespace and typo fixes not otherwise called out.
- core
  * industrialio-buffer,Style cleanup.
  * Add documentation to extend_name field of struct iio_chan_spec to
    direct people using it towards the label infrastructure instead.
    extend_name was a design mistake a long time back so directly people
    away from it may be useful.
- adi,ad7606
  * Add HAS_IOPORT dependency to prepare for some Kconfig changes.
- bosch,bma400
  * Drop pointless print of ret in a dev_err_probe() message.
- invensense,icm42600
  * Rework timestamp handling to reduce jitter.
- mediatek,mt7986-auxdac
  * Add DT binding for this part.
- qcom,spmi-vadc
  * Allow for 1/16th prescaling used on a few devices.
  * Various changes to channel labeling and naming, including dropping
    use of fwnode_name which generates odd channel names. Small ABI
    change as a result, but not thought to be a problem for users of this
    platform.
- st,lsm6dsx
  * dt-binding: Use common schema for mount-matrix via a reference.
- st,stm32
  * Add a debug print for when legacy channel config is used.
- ti,palmas-adc
  * Drop unused i2c.h include.

* tag 'iio-for-6.5a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (59 commits)
  dt-bindings: iio: rockchip: Fix 'oneOf' condition failed warning
  dt-bindings: iio: afe: voltage-divider: Spelling s/curcuit/circuit/
  dt-bindings: iio: adc: Add rockchip,rk3588-saradc string
  iio: adc: rockchip_saradc: Use dev_err_probe
  iio: adc: rockchip_saradc: Match alignment with open parenthesis
  iio: adc: rockchip_saradc: Use of_device_get_match_data
  iio: adc: rockchip_saradc: Make use of devm_clk_get_enabled
  iio: adc: rockchip_saradc: Add support for RK3588
  iio: adc: rockchip_saradc: Add callback functions
  iio: temperature: tmp006: Add OF device matching support
  dt-bindings: iio: temperature: Add support for tmp006
  staging: iio: Switch i2c drivers back to use .probe()
  iio: amplifiers: ad8366 Fix whitespace issue
  iio: imu: inv_icm42600: avoid frequent timestamp jitter
  MAINTAINERS: Add ROHM BU27008
  iio: light: ROHM BU27008 color sensor
  iio: kx022a: Use new iio_validate_own_trigger()
  iio: trigger: Add simple trigger_validation helper
  dt-bindings: iio: light: ROHM BU27008
  iio: mlx90614: Add MLX90615 support
  ...
This commit is contained in:
Greg Kroah-Hartman 2023-06-15 13:01:55 +02:00
commit 269b9d8faf
242 changed files with 3314 additions and 474 deletions

View File

@ -26,6 +26,7 @@ properties:
- mediatek,mt2712-auxadc
- mediatek,mt6765-auxadc
- mediatek,mt7622-auxadc
- mediatek,mt7986-auxadc
- mediatek,mt8173-auxadc
- items:
- enum:

View File

@ -54,7 +54,7 @@ required:
- '#io-channel-cells'
patternProperties:
"^.*@[0-9a-f]+$":
"^channel@[0-9a-f]+$":
type: object
additionalProperties: false
description: |
@ -101,7 +101,7 @@ patternProperties:
oneOf:
- items:
- const: 1
- enum: [ 1, 3, 4, 6, 20, 8, 10 ]
- enum: [ 1, 3, 4, 6, 20, 8, 10, 16 ]
- items:
- const: 10
- const: 81
@ -148,7 +148,7 @@ allOf:
then:
patternProperties:
"^.*@[0-9a-f]+$":
"^channel@[0-9a-f]+$":
properties:
qcom,decimation:
enum: [ 512, 1024, 2048, 4096 ]
@ -171,7 +171,7 @@ allOf:
then:
patternProperties:
"^.*@[0-9a-f]+$":
"^channel@[0-9a-f]+$":
properties:
qcom,decimation:
enum: [ 256, 512, 1024 ]
@ -194,7 +194,7 @@ allOf:
then:
patternProperties:
"^.*@[0-9a-f]+$":
"^channel@[0-9a-f]+$":
properties:
qcom,decimation:
enum: [ 250, 420, 840 ]
@ -217,7 +217,7 @@ allOf:
then:
patternProperties:
"^.*@[0-9a-f]+$":
"^channel@[0-9a-f]+$":
properties:
qcom,decimation:
enum: [ 85, 340, 1360 ]
@ -249,7 +249,7 @@ examples:
#io-channel-cells = <1>;
/* Channel node */
adc-chan@39 {
channel@39 {
reg = <0x39>;
qcom,decimation = <512>;
qcom,ratiometric;
@ -258,19 +258,19 @@ examples:
qcom,pre-scaling = <1 3>;
};
adc-chan@9 {
channel@9 {
reg = <0x9>;
};
adc-chan@a {
channel@a {
reg = <0xa>;
};
adc-chan@e {
channel@e {
reg = <0xe>;
};
adc-chan@f {
channel@f {
reg = <0xf>;
};
};
@ -292,16 +292,18 @@ examples:
#io-channel-cells = <1>;
/* Other properties are omitted */
xo-therm@44 {
channel@44 {
reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
label = "xo_therm";
};
conn-therm@47 {
channel@47 {
reg = <PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
label = "conn_therm";
};
};
};

View File

@ -15,6 +15,7 @@ properties:
- const: rockchip,saradc
- const: rockchip,rk3066-tsadc
- const: rockchip,rk3399-saradc
- const: rockchip,rk3588-saradc
- items:
- enum:
- rockchip,px30-saradc

View File

@ -13,7 +13,7 @@ description: |
When an io-channel measures the midpoint of a voltage divider, the
interesting voltage is often the voltage over the full resistance
of the divider. This binding describes the voltage divider in such
a curcuit.
a circuit.
Vin ----.
|

View File

@ -30,6 +30,9 @@ properties:
- invensense,mpu9150
- invensense,mpu9250
- invensense,mpu9255
- items:
- const: invensense,icm20600
- const: invensense,icm20602
- items:
- const: invensense,icm20608d
- const: invensense,icm20608

View File

@ -98,6 +98,7 @@ required:
- reg
allOf:
- $ref: /schemas/iio/iio.yaml#
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false

View File

@ -0,0 +1,49 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/light/rohm,bu27008.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ROHM BU27008 color sensor
maintainers:
- Matti Vaittinen <mazziesaccount@gmail.com>
description:
The ROHM BU27008 is a sensor with 5 photodiodes (red, green, blue, clear
and IR) with four configurable channels. Red and green being always
available and two out of the rest three (blue, clear, IR) can be
selected to be simultaneously measured. Typical application is adjusting
LCD backlight of TVs, mobile phones and tablet PCs.
properties:
compatible:
const: rohm,bu27008
reg:
maxItems: 1
interrupts:
maxItems: 1
vdd-supply: true
required:
- compatible
- reg
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
light-sensor@38 {
compatible = "rohm,bu27008";
reg = <0x38>;
};
};
...

View File

@ -0,0 +1,68 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/light/ti,opt4001.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Texas Instruments OPT4001 Ambient Light Sensor
maintainers:
- Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@axis.com>
description:
Ambient light sensor with an i2c interface.
Last part of compatible is for the packaging used.
Picostar is a 4 pinned SMT and sot-5x3 is a 8 pinned SOT.
https://www.ti.com/lit/gpn/opt4001
properties:
compatible:
enum:
- ti,opt4001-picostar
- ti,opt4001-sot-5x3
reg:
maxItems: 1
interrupts:
maxItems: 1
vdd-supply:
description: Regulator that provides power to the sensor
required:
- compatible
- reg
allOf:
- if:
properties:
compatible:
contains:
const: ti,opt4001-sot-5x3
then:
properties:
interrupts:
maxItems: 1
else:
properties:
interrupts: false
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
light-sensor@44 {
compatible = "ti,opt4001-sot-5x3";
reg = <0x44>;
vdd-supply = <&vdd_reg>;
interrupt-parent = <&gpio1>;
interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
};
};
...

View File

@ -0,0 +1,78 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/potentiometer/renesas,x9250.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Renesas X9250 quad potentiometers
maintainers:
- Herve Codina <herve.codina@bootlin.com>
description:
The Renesas X9250 integrates four digitally controlled potentiometers.
On each potentiometer, the X9250T has a 100 kOhms total resistance and the
X9250U has a 50 kOhms total resistance.
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml
properties:
compatible:
enum:
- renesas,x9250t
- renesas,x9250u
reg:
maxItems: 1
vcc-supply:
description:
Regulator for the VCC power supply.
avp-supply:
description:
Regulator for the analog V+ power supply.
avn-supply:
description:
Regulator for the analog V- power supply.
'#io-channel-cells':
const: 1
spi-max-frequency:
maximum: 2000000
wp-gpios:
maxItems: 1
description:
GPIO connected to the write-protect pin.
required:
- compatible
- reg
- vcc-supply
- avp-supply
- avn-supply
- '#io-channel-cells'
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
potentiometer@0 {
compatible = "renesas,x9250t";
reg = <0>;
vcc-supply = <&vcc_regulator>;
avp-supply = <&avp_regulator>;
avn-supply = <&avp_regulator>;
wp-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
spi-max-frequency = <2000000>;
#io-channel-cells = <1>;
};
};

View File

@ -0,0 +1,104 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/pressure/honeywell,mprls0025pa.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Honeywell mprls0025pa pressure sensor
maintainers:
- Andreas Klinger <ak@it-klinger.de>
description: |
Honeywell pressure sensor of model mprls0025pa.
This sensor has an I2C and SPI interface. Only the I2C interface is
implemented.
There are many models with different pressure ranges available. The vendor
calls them "mpr series". All of them have the identical programming model and
differ in the pressure range, unit and transfer function.
To support different models one need to specify the pressure range as well as
the transfer function. Pressure range needs to be converted from its unit to
pascal.
The transfer function defines the ranges of numerical values delivered by the
sensor. The minimal range value stands for the minimum pressure and the
maximum value also for the maximum pressure with linear relation inside the
range.
Specifications about the devices can be found at:
https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/
products/sensors/pressure-sensors/board-mount-pressure-sensors/
micropressure-mpr-series/documents/
sps-siot-mpr-series-datasheet-32332628-ciid-172626.pdf
properties:
compatible:
const: honeywell,mprls0025pa
reg:
maxItems: 1
interrupts:
maxItems: 1
reset-gpios:
description:
Optional GPIO for resetting the device.
If not present the device is not resetted during the probe.
maxItems: 1
honeywell,pmin-pascal:
description:
Minimum pressure value the sensor can measure in pascal.
$ref: /schemas/types.yaml#/definitions/uint32
honeywell,pmax-pascal:
description:
Maximum pressure value the sensor can measure in pascal.
$ref: /schemas/types.yaml#/definitions/uint32
honeywell,transfer-function:
description: |
Transfer function which defines the range of valid values delivered by the
sensor.
1 - A, 10% to 90% of 2^24 (1677722 .. 15099494)
2 - B, 2.5% to 22.5% of 2^24 (419430 .. 3774874)
3 - C, 20% to 80% of 2^24 (3355443 .. 13421773)
$ref: /schemas/types.yaml#/definitions/uint32
vdd-supply:
description: provide VDD power to the sensor.
required:
- compatible
- reg
- honeywell,pmin-pascal
- honeywell,pmax-pascal
- honeywell,transfer-function
- vdd-supply
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pressure@18 {
compatible = "honeywell,mprls0025pa";
reg = <0x18>;
reset-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>;
interrupt-parent = <&gpio3>;
interrupts = <21 IRQ_TYPE_EDGE_FALLING>;
honeywell,pmin-pascal = <0>;
honeywell,pmax-pascal = <172369>;
honeywell,transfer-function = <1>;
vdd-supply = <&vcc_3v3>;
};
};

View File

@ -84,6 +84,7 @@ properties:
- st,lps35hw
- description: IMUs
enum:
- st,lsm303d-imu
- st,lsm9ds0-imu
- description: Deprecated bindings
enum:

View File

@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/iio/temperature/melexis,mlx90614.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Melexis MLX90614 contactless IR temperature sensor
title: Melexis MLX90614/MLX90615 contactless IR temperature sensor
maintainers:
- Peter Meerwald <pmeerw@pmeerw.net>
@ -15,7 +15,9 @@ description: |
properties:
compatible:
const: melexis,mlx90614
enum:
- melexis,mlx90614
- melexis,mlx90615
reg:
maxItems: 1

View File

@ -0,0 +1,42 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/temperature/ti,tmp006.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI TMP006 IR thermopile sensor
maintainers:
- Peter Meerwald <pmeerw@pmeerw.net>
description: |
TI TMP006 - Infrared Thermopile Sensor in Chip-Scale Package.
https://cdn.sparkfun.com/datasheets/Sensors/Temp/tmp006.pdf
properties:
compatible:
const: ti,tmp006
reg:
maxItems: 1
vdd-supply:
description: provide VDD power to the sensor.
required:
- compatible
- reg
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
temperature-sensor@40 {
compatible = "ti,tmp006";
reg = <0x40>;
vdd-supply = <&ldo4_reg>;
};
};

View File

@ -9418,6 +9418,13 @@ F: lib/test_hmm*
F: mm/hmm*
F: tools/testing/selftests/mm/*hmm*
HONEYWELL MPRLS0025PA PRESSURE SENSOR SERIES IIO DRIVER
M: Andreas Klinger <ak@it-klinger.de>
L: linux-iio@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/iio/pressure/honeywell,mprls0025pa.yaml
F: drivers/iio/pressure/mprls0025pa.c
HOST AP DRIVER
M: Jouni Malinen <j@w1.fi>
L: linux-wireless@vger.kernel.org
@ -18050,6 +18057,13 @@ S: Maintained
F: Documentation/devicetree/bindings/clock/renesas,versaclock7.yaml
F: drivers/clk/clk-versaclock7.c
RENESAS X9250 DIGITAL POTENTIOMETERS DRIVER
M: Herve Codina <herve.codina@bootlin.com>
L: linux-iio@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml
F: drivers/iio/potentiometer/x9250.c
RESET CONTROLLER FRAMEWORK
M: Philipp Zabel <p.zabel@pengutronix.de>
S: Maintained
@ -18252,10 +18266,11 @@ S: Maintained
F: Documentation/devicetree/bindings/iio/light/bh1750.yaml
F: drivers/iio/light/bh1750.c
ROHM BU27034 AMBIENT LIGHT SENSOR DRIVER
ROHM BU270xx LIGHT SENSOR DRIVERs
M: Matti Vaittinen <mazziesaccount@gmail.com>
L: linux-iio@vger.kernel.org
S: Supported
F: drivers/iio/light/rohm-bu27008.c
F: drivers/iio/light/rohm-bu27034.c
ROHM MULTIFUNCTION BD9571MWV-M PMIC DEVICE DRIVERS

View File

@ -85,7 +85,7 @@ static struct i2c_driver adxl313_i2c_driver = {
.name = "adxl313_i2c",
.of_match_table = adxl313_of_match,
},
.probe_new = adxl313_i2c_probe,
.probe = adxl313_i2c_probe,
.id_table = adxl313_i2c_id,
};

View File

@ -56,7 +56,7 @@ static struct i2c_driver adxl345_i2c_driver = {
.of_match_table = adxl345_of_match,
.acpi_match_table = adxl345_acpi_match,
},
.probe_new = adxl345_i2c_probe,
.probe = adxl345_i2c_probe,
.id_table = adxl345_i2c_id,
};
module_i2c_driver(adxl345_i2c_driver);

View File

@ -68,7 +68,7 @@ static struct i2c_driver adxl355_i2c_driver = {
.name = "adxl355_i2c",
.of_match_table = adxl355_of_match,
},
.probe_new = adxl355_i2c_probe,
.probe = adxl355_i2c_probe,
.id_table = adxl355_i2c_id,
};
module_i2c_driver(adxl355_i2c_driver);

View File

@ -77,7 +77,7 @@ static struct i2c_driver adxl367_i2c_driver = {
.name = "adxl367_i2c",
.of_match_table = adxl367_of_match,
},
.probe_new = adxl367_i2c_probe,
.probe = adxl367_i2c_probe,
.id_table = adxl367_i2c_id,
};

View File

@ -58,7 +58,7 @@ static struct i2c_driver adxl372_i2c_driver = {
.name = "adxl372_i2c",
.of_match_table = adxl372_of_match,
},
.probe_new = adxl372_i2c_probe,
.probe = adxl372_i2c_probe,
.id_table = adxl372_i2c_id,
};

View File

@ -1134,7 +1134,7 @@ static struct i2c_driver bma180_driver = {
.pm = pm_sleep_ptr(&bma180_pm_ops),
.of_match_table = bma180_of_match,
},
.probe_new = bma180_probe,
.probe = bma180_probe,
.remove = bma180_remove,
.id_table = bma180_ids,
};

View File

@ -868,8 +868,7 @@ static int bma400_init(struct bma400_data *data)
ARRAY_SIZE(regulator_names),
regulator_names);
if (ret)
return dev_err_probe(data->dev, ret, "Failed to get regulators: %d\n",
ret);
return dev_err_probe(data->dev, ret, "Failed to get regulators\n");
/* Try to read chip_id register. It must return 0x90. */
ret = regmap_read(data->regmap, BMA400_CHIP_ID_REG, &val);

View File

@ -44,7 +44,7 @@ static struct i2c_driver bma400_i2c_driver = {
.name = "bma400",
.of_match_table = bma400_of_i2c_match,
},
.probe_new = bma400_i2c_probe,
.probe = bma400_i2c_probe,
.id_table = bma400_i2c_ids,
};

View File

@ -269,7 +269,7 @@ static struct i2c_driver bmc150_accel_driver = {
.acpi_match_table = ACPI_PTR(bmc150_accel_acpi_match),
.pm = &bmc150_accel_pm_ops,
},
.probe_new = bmc150_accel_probe,
.probe = bmc150_accel_probe,
.remove = bmc150_accel_remove,
.id_table = bmc150_accel_id,
};

View File

@ -184,7 +184,7 @@ static struct i2c_driver da280_driver = {
.acpi_match_table = ACPI_PTR(da280_acpi_match),
.pm = pm_sleep_ptr(&da280_pm_ops),
},
.probe_new = da280_probe,
.probe = da280_probe,
.id_table = da280_i2c_id,
};

View File

@ -278,7 +278,7 @@ static struct i2c_driver da311_driver = {
.name = "da311",
.pm = pm_sleep_ptr(&da311_pm_ops),
},
.probe_new = da311_probe,
.probe = da311_probe,
.id_table = da311_i2c_id,
};

View File

@ -217,7 +217,7 @@ static const struct of_device_id dmard06_of_match[] = {
MODULE_DEVICE_TABLE(of, dmard06_of_match);
static struct i2c_driver dmard06_driver = {
.probe_new = dmard06_probe,
.probe = dmard06_probe,
.id_table = dmard06_id,
.driver = {
.name = DMARD06_DRV_NAME,

View File

@ -135,7 +135,7 @@ static struct i2c_driver dmard09_driver = {
.driver = {
.name = DMARD09_DRV_NAME
},
.probe_new = dmard09_probe,
.probe = dmard09_probe,
.id_table = dmard09_id,
};

View File

@ -241,7 +241,7 @@ static struct i2c_driver dmard10_driver = {
.name = "dmard10",
.pm = pm_sleep_ptr(&dmard10_pm_ops),
},
.probe_new = dmard10_probe,
.probe = dmard10_probe,
.id_table = dmard10_i2c_id,
};

View File

@ -47,7 +47,7 @@ static struct i2c_driver fxls8962af_driver = {
.of_match_table = fxls8962af_of_match,
.pm = pm_ptr(&fxls8962af_pm_ops),
},
.probe_new = fxls8962af_probe,
.probe = fxls8962af_probe,
.id_table = fxls8962af_id,
};
module_i2c_driver(fxls8962af_driver);

View File

@ -40,8 +40,9 @@ static struct i2c_driver kx022a_i2c_driver = {
.driver = {
.name = "kx022a-i2c",
.of_match_table = kx022a_of_match,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
.probe_new = kx022a_i2c_probe,
.probe = kx022a_i2c_probe,
};
module_i2c_driver(kx022a_i2c_driver);

View File

@ -46,6 +46,7 @@ static struct spi_driver kx022a_spi_driver = {
.driver = {
.name = "kx022a-spi",
.of_match_table = kx022a_of_match,
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
.probe = kx022a_spi_probe,
.id_table = kx022a_id,

View File

@ -516,17 +516,6 @@ static int kx022a_read_raw(struct iio_dev *idev,
return -EINVAL;
};
static int kx022a_validate_trigger(struct iio_dev *idev,
struct iio_trigger *trig)
{
struct kx022a_data *data = iio_priv(idev);
if (data->trig != trig)
return -EINVAL;
return 0;
}
static int kx022a_set_watermark(struct iio_dev *idev, unsigned int val)
{
struct kx022a_data *data = iio_priv(idev);
@ -725,7 +714,7 @@ static const struct iio_info kx022a_info = {
.write_raw = &kx022a_write_raw,
.read_avail = &kx022a_read_avail,
.validate_trigger = kx022a_validate_trigger,
.validate_trigger = iio_validate_own_trigger,
.hwfifo_set_watermark = kx022a_set_watermark,
.hwfifo_flush_to_buffer = kx022a_fifo_flush,
};

View File

@ -1732,7 +1732,7 @@ static struct i2c_driver kxcjk1013_driver = {
.of_match_table = kxcjk1013_of_match,
.pm = &kxcjk1013_pm_ops,
},
.probe_new = kxcjk1013_probe,
.probe = kxcjk1013_probe,
.remove = kxcjk1013_remove,
.id_table = kxcjk1013_id,
};

View File

@ -54,7 +54,7 @@ static struct i2c_driver kxsd9_i2c_driver = {
.of_match_table = kxsd9_of_match,
.pm = pm_ptr(&kxsd9_dev_pm_ops),
},
.probe_new = kxsd9_i2c_probe,
.probe = kxsd9_i2c_probe,
.remove = kxsd9_i2c_remove,
.id_table = kxsd9_i2c_id,
};

View File

@ -190,7 +190,7 @@ static struct i2c_driver mc3230_driver = {
.name = "mc3230",
.pm = pm_sleep_ptr(&mc3230_pm_ops),
},
.probe_new = mc3230_probe,
.probe = mc3230_probe,
.remove = mc3230_remove,
.id_table = mc3230_i2c_id,
};

View File

@ -46,7 +46,7 @@ static const struct of_device_id mma7455_of_match[] = {
MODULE_DEVICE_TABLE(of, mma7455_of_match);
static struct i2c_driver mma7455_i2c_driver = {
.probe_new = mma7455_i2c_probe,
.probe = mma7455_i2c_probe,
.remove = mma7455_i2c_remove,
.id_table = mma7455_i2c_ids,
.driver = {

View File

@ -266,7 +266,7 @@ static struct i2c_driver mma7660_driver = {
.of_match_table = mma7660_of_match,
.acpi_match_table = mma7660_acpi_id,
},
.probe_new = mma7660_probe,
.probe = mma7660_probe,
.remove = mma7660_remove,
.id_table = mma7660_i2c_id,
};

View File

@ -1846,7 +1846,7 @@ static struct i2c_driver mma8452_driver = {
.of_match_table = mma8452_dt_ids,
.pm = &mma8452_pm_ops,
},
.probe_new = mma8452_probe,
.probe = mma8452_probe,
.remove = mma8452_remove,
.id_table = mma8452_id,
};

View File

@ -607,7 +607,7 @@ static struct i2c_driver mma9551_driver = {
.acpi_match_table = ACPI_PTR(mma9551_acpi_match),
.pm = pm_ptr(&mma9551_pm_ops),
},
.probe_new = mma9551_probe,
.probe = mma9551_probe,
.remove = mma9551_remove,
.id_table = mma9551_id,
};

View File

@ -1246,7 +1246,7 @@ static struct i2c_driver mma9553_driver = {
.acpi_match_table = ACPI_PTR(mma9553_acpi_match),
.pm = pm_ptr(&mma9553_pm_ops),
},
.probe_new = mma9553_probe,
.probe = mma9553_probe,
.remove = mma9553_remove,
.id_table = mma9553_id,
};

View File

@ -1294,7 +1294,7 @@ static struct i2c_driver msa311_driver = {
.of_match_table = msa311_of_match,
.pm = pm_ptr(&msa311_pm_ops),
},
.probe_new = msa311_probe,
.probe = msa311_probe,
.id_table = msa311_i2c_id,
};
module_i2c_driver(msa311_driver);

View File

@ -488,7 +488,7 @@ static struct i2c_driver mxc4005_driver = {
.name = MXC4005_DRV_NAME,
.acpi_match_table = ACPI_PTR(mxc4005_acpi_match),
},
.probe_new = mxc4005_probe,
.probe = mxc4005_probe,
.id_table = mxc4005_id,
};

View File

@ -183,7 +183,7 @@ static struct i2c_driver mxc6255_driver = {
.name = MXC6255_DRV_NAME,
.acpi_match_table = ACPI_PTR(mxc6255_acpi_match),
},
.probe_new = mxc6255_probe,
.probe = mxc6255_probe,
.id_table = mxc6255_id,
};

View File

@ -1007,6 +1007,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
.sensors_supported = {
[0] = LSM9DS0_IMU_DEV_NAME,
[1] = LSM303D_IMU_DEV_NAME,
},
.ch = (struct iio_chan_spec *)st_accel_16bit_channels,
.odr = {

View File

@ -206,7 +206,7 @@ static struct i2c_driver st_accel_driver = {
.of_match_table = st_accel_of_match,
.acpi_match_table = ACPI_PTR(st_accel_acpi_match),
},
.probe_new = st_accel_i2c_probe,
.probe = st_accel_i2c_probe,
.id_table = st_accel_id_table,
};
module_i2c_driver(st_accel_driver);

View File

@ -644,7 +644,7 @@ static struct i2c_driver stk8312_driver = {
.name = STK8312_DRIVER_NAME,
.pm = pm_sleep_ptr(&stk8312_pm_ops),
},
.probe_new = stk8312_probe,
.probe = stk8312_probe,
.remove = stk8312_remove,
.id_table = stk8312_i2c_id,
};

View File

@ -543,7 +543,7 @@ static struct i2c_driver stk8ba50_driver = {
.pm = pm_sleep_ptr(&stk8ba50_pm_ops),
.acpi_match_table = ACPI_PTR(stk8ba50_acpi_id),
},
.probe_new = stk8ba50_probe,
.probe = stk8ba50_probe,
.remove = stk8ba50_remove,
.id_table = stk8ba50_i2c_id,
};

View File

@ -145,7 +145,7 @@ config AD7606
config AD7606_IFACE_PARALLEL
tristate "Analog Devices AD7606 ADC driver with parallel interface support"
depends on HAS_IOMEM
depends on HAS_IOPORT
select AD7606
help
Say yes here to build parallel interface support for Analog Devices:

View File

@ -103,7 +103,7 @@ static struct i2c_driver ad7091r5_driver = {
.name = "ad7091r5",
.of_match_table = ad7091r5_dt_ids,
},
.probe_new = ad7091r5_i2c_probe,
.probe = ad7091r5_i2c_probe,
.id_table = ad7091r5_i2c_ids,
};
module_i2c_driver(ad7091r5_driver);

View File

@ -553,7 +553,7 @@ static struct i2c_driver ad7291_driver = {
.name = KBUILD_MODNAME,
.of_match_table = ad7291_of_match,
},
.probe_new = ad7291_probe,
.probe = ad7291_probe,
.id_table = ad7291_id,
};
module_i2c_driver(ad7291_driver);

View File

@ -968,7 +968,7 @@ static struct i2c_driver ad799x_driver = {
.name = "ad799x",
.pm = pm_sleep_ptr(&ad799x_pm_ops),
},
.probe_new = ad799x_probe,
.probe = ad799x_probe,
.remove = ad799x_remove,
.id_table = ad799x_id,
};

View File

@ -1090,7 +1090,7 @@ static struct i2c_driver ina2xx_driver = {
.name = KBUILD_MODNAME,
.of_match_table = ina2xx_of_match,
},
.probe_new = ina2xx_probe,
.probe = ina2xx_probe,
.remove = ina2xx_remove,
.id_table = ina2xx_id,
};

View File

@ -146,7 +146,7 @@ static struct i2c_driver ltc2471_i2c_driver = {
.driver = {
.name = "ltc2471",
},
.probe_new = ltc2471_i2c_probe,
.probe = ltc2471_i2c_probe,
.id_table = ltc2471_i2c_id,
};

View File

@ -133,7 +133,7 @@ static struct i2c_driver ltc2485_driver = {
.driver = {
.name = "ltc2485",
},
.probe_new = ltc2485_probe,
.probe = ltc2485_probe,
.id_table = ltc2485_id,
};
module_i2c_driver(ltc2485_driver);

View File

@ -163,7 +163,7 @@ static struct i2c_driver ltc2497_driver = {
.name = "ltc2497",
.of_match_table = ltc2497_of_match,
},
.probe_new = ltc2497_probe,
.probe = ltc2497_probe,
.remove = ltc2497_remove,
.id_table = ltc2497_id,
};

View File

@ -1718,7 +1718,7 @@ static struct i2c_driver max1363_driver = {
.name = "max1363",
.of_match_table = max1363_of_match,
},
.probe_new = max1363_probe,
.probe = max1363_probe,
.id_table = max1363_id,
};
module_i2c_driver(max1363_driver);

View File

@ -556,7 +556,7 @@ static struct i2c_driver max9611_driver = {
.name = DRIVER_NAME,
.of_match_table = max9611_of_table,
},
.probe_new = max9611_probe,
.probe = max9611_probe,
};
module_i2c_driver(max9611_driver);

View File

@ -417,7 +417,7 @@ static struct i2c_driver mcp3422_driver = {
.name = "mcp3422",
.of_match_table = mcp3422_of_match,
},
.probe_new = mcp3422_probe,
.probe = mcp3422_probe,
.id_table = mcp3422_id,
};
module_i2c_driver(mcp3422_driver);

View File

@ -544,7 +544,7 @@ static const struct of_device_id nau7802_dt_ids[] = {
MODULE_DEVICE_TABLE(of, nau7802_dt_ids);
static struct i2c_driver nau7802_driver = {
.probe_new = nau7802_probe,
.probe = nau7802_probe,
.id_table = nau7802_i2c_id,
.driver = {
.name = "nau7802",

View File

@ -14,7 +14,6 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/pm.h>
#include <linux/mfd/palmas.h>
#include <linux/completion.h>

View File

@ -114,7 +114,7 @@ enum adc5_cal_val {
* that is an average of multiple measurements.
* @scale_fn_type: Represents the scaling function to convert voltage
* physical units desired by the client for the channel.
* @datasheet_name: Channel name used in device tree.
* @channel_name: Channel name used in device tree.
*/
struct adc5_channel_prop {
unsigned int channel;
@ -126,7 +126,7 @@ struct adc5_channel_prop {
unsigned int hw_settle_time;
unsigned int avg_samples;
enum vadc_scale_fn_type scale_fn_type;
const char *datasheet_name;
const char *channel_name;
};
/**
@ -657,8 +657,7 @@ static int adc5_get_fw_channel_data(struct adc5_chip *adc,
chan = chan & ADC_CHANNEL_MASK;
}
if (chan > ADC5_PARALLEL_ISENSE_VBAT_IDATA ||
!data->adc_chans[chan].datasheet_name) {
if (chan > ADC5_PARALLEL_ISENSE_VBAT_IDATA) {
dev_err(dev, "%s invalid channel number %d\n", name, chan);
return -EINVAL;
}
@ -669,9 +668,9 @@ static int adc5_get_fw_channel_data(struct adc5_chip *adc,
ret = fwnode_property_read_string(fwnode, "label", &channel_name);
if (ret)
channel_name = name;
channel_name = data->adc_chans[chan].datasheet_name;
prop->datasheet_name = channel_name;
prop->channel_name = channel_name;
ret = fwnode_property_read_u32(fwnode, "qcom,decimation", &value);
if (!ret) {
@ -861,8 +860,8 @@ static int adc5_get_fw_data(struct adc5_chip *adc)
adc_chan = &adc->data->adc_chans[prop.channel];
iio_chan->channel = prop.channel;
iio_chan->datasheet_name = prop.datasheet_name;
iio_chan->extend_name = prop.datasheet_name;
iio_chan->datasheet_name = adc_chan->datasheet_name;
iio_chan->extend_name = prop.channel_name;
iio_chan->info_mask_separate = adc_chan->info_mask;
iio_chan->type = adc_chan->type;
iio_chan->address = index;

View File

@ -84,6 +84,7 @@
* that is an average of multiple measurements.
* @scale_fn_type: Represents the scaling function to convert voltage
* physical units desired by the client for the channel.
* @channel_name: Channel name used in device tree.
*/
struct vadc_channel_prop {
unsigned int channel;
@ -93,6 +94,7 @@ struct vadc_channel_prop {
unsigned int hw_settle_time;
unsigned int avg_samples;
enum vadc_scale_fn_type scale_fn_type;
const char *channel_name;
};
/**
@ -495,8 +497,18 @@ static int vadc_fwnode_xlate(struct iio_dev *indio_dev,
return -EINVAL;
}
static int vadc_read_label(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, char *label)
{
struct vadc_priv *vadc = iio_priv(indio_dev);
const char *name = vadc->chan_props[chan->address].channel_name;
return sysfs_emit(label, "%s\n", name);
}
static const struct iio_info vadc_info = {
.read_raw = vadc_read_raw,
.read_label = vadc_read_label,
.fwnode_xlate = vadc_fwnode_xlate,
};
@ -652,7 +664,7 @@ static int vadc_get_fw_channel_data(struct device *dev,
struct vadc_channel_prop *prop,
struct fwnode_handle *fwnode)
{
const char *name = fwnode_get_name(fwnode);
const char *name = fwnode_get_name(fwnode), *label;
u32 chan, value, varr[2];
int ret;
@ -667,6 +679,11 @@ static int vadc_get_fw_channel_data(struct device *dev,
return -EINVAL;
}
ret = fwnode_property_read_string(fwnode, "label", &label);
if (ret)
label = vadc_chans[chan].datasheet_name;
prop->channel_name = label;
/* the channel has DT description */
prop->channel = chan;

View File

@ -4,6 +4,7 @@
* Copyright (C) 2014 ROCKCHIP, Inc.
*/
#include <linux/bitfield.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
@ -38,10 +39,31 @@
#define SARADC_TIMEOUT msecs_to_jiffies(100)
#define SARADC_MAX_CHANNELS 8
/* v2 registers */
#define SARADC2_CONV_CON 0x000
#define SARADC_T_PD_SOC 0x004
#define SARADC_T_DAS_SOC 0x00c
#define SARADC2_END_INT_EN 0x104
#define SARADC2_ST_CON 0x108
#define SARADC2_STATUS 0x10c
#define SARADC2_END_INT_ST 0x110
#define SARADC2_DATA_BASE 0x120
#define SARADC2_EN_END_INT BIT(0)
#define SARADC2_START BIT(4)
#define SARADC2_SINGLE_MODE BIT(5)
#define SARADC2_CONV_CHANNELS GENMASK(15, 0)
struct rockchip_saradc;
struct rockchip_saradc_data {
const struct iio_chan_spec *channels;
int num_channels;
unsigned long clk_rate;
void (*start)(struct rockchip_saradc *info, int chn);
int (*read)(struct rockchip_saradc *info);
void (*power_down)(struct rockchip_saradc *info);
};
struct rockchip_saradc {
@ -60,27 +82,81 @@ struct rockchip_saradc {
struct notifier_block nb;
};
static void rockchip_saradc_power_down(struct rockchip_saradc *info)
static void rockchip_saradc_reset_controller(struct reset_control *reset);
static void rockchip_saradc_start_v1(struct rockchip_saradc *info, int chn)
{
/* 8 clock periods as delay between power up and start cmd */
writel_relaxed(8, info->regs + SARADC_DLY_PU_SOC);
/* Select the channel to be used and trigger conversion */
writel(SARADC_CTRL_POWER_CTRL | (chn & SARADC_CTRL_CHN_MASK) |
SARADC_CTRL_IRQ_ENABLE, info->regs + SARADC_CTRL);
}
static void rockchip_saradc_start_v2(struct rockchip_saradc *info, int chn)
{
int val;
if (info->reset)
rockchip_saradc_reset_controller(info->reset);
writel_relaxed(0xc, info->regs + SARADC_T_DAS_SOC);
writel_relaxed(0x20, info->regs + SARADC_T_PD_SOC);
val = FIELD_PREP(SARADC2_EN_END_INT, 1);
val |= val << 16;
writel_relaxed(val, info->regs + SARADC2_END_INT_EN);
val = FIELD_PREP(SARADC2_START, 1) |
FIELD_PREP(SARADC2_SINGLE_MODE, 1) |
FIELD_PREP(SARADC2_CONV_CHANNELS, chn);
val |= val << 16;
writel(val, info->regs + SARADC2_CONV_CON);
}
static void rockchip_saradc_start(struct rockchip_saradc *info, int chn)
{
info->data->start(info, chn);
}
static int rockchip_saradc_read_v1(struct rockchip_saradc *info)
{
return readl_relaxed(info->regs + SARADC_DATA);
}
static int rockchip_saradc_read_v2(struct rockchip_saradc *info)
{
int offset;
/* Clear irq */
writel_relaxed(0x1, info->regs + SARADC2_END_INT_ST);
offset = SARADC2_DATA_BASE + info->last_chan->channel * 0x4;
return readl_relaxed(info->regs + offset);
}
static int rockchip_saradc_read(struct rockchip_saradc *info)
{
return info->data->read(info);
}
static void rockchip_saradc_power_down_v1(struct rockchip_saradc *info)
{
/* Clear irq & power down adc */
writel_relaxed(0, info->regs + SARADC_CTRL);
}
static void rockchip_saradc_power_down(struct rockchip_saradc *info)
{
if (info->data->power_down)
info->data->power_down(info);
}
static int rockchip_saradc_conversion(struct rockchip_saradc *info,
struct iio_chan_spec const *chan)
struct iio_chan_spec const *chan)
{
reinit_completion(&info->completion);
/* 8 clock periods as delay between power up and start cmd */
writel_relaxed(8, info->regs + SARADC_DLY_PU_SOC);
info->last_chan = chan;
/* Select the channel to be used and trigger conversion */
writel(SARADC_CTRL_POWER_CTRL
| (chan->channel & SARADC_CTRL_CHN_MASK)
| SARADC_CTRL_IRQ_ENABLE,
info->regs + SARADC_CTRL);
rockchip_saradc_start(info, chan->channel);
if (!wait_for_completion_timeout(&info->completion, SARADC_TIMEOUT))
return -ETIMEDOUT;
@ -123,7 +199,7 @@ static irqreturn_t rockchip_saradc_isr(int irq, void *dev_id)
struct rockchip_saradc *info = dev_id;
/* Read value */
info->last_val = readl_relaxed(info->regs + SARADC_DATA);
info->last_val = rockchip_saradc_read(info);
info->last_val &= GENMASK(info->last_chan->scan_type.realbits - 1, 0);
rockchip_saradc_power_down(info);
@ -163,6 +239,9 @@ static const struct rockchip_saradc_data saradc_data = {
.channels = rockchip_saradc_iio_channels,
.num_channels = ARRAY_SIZE(rockchip_saradc_iio_channels),
.clk_rate = 1000000,
.start = rockchip_saradc_start_v1,
.read = rockchip_saradc_read_v1,
.power_down = rockchip_saradc_power_down_v1,
};
static const struct iio_chan_spec rockchip_rk3066_tsadc_iio_channels[] = {
@ -174,6 +253,9 @@ static const struct rockchip_saradc_data rk3066_tsadc_data = {
.channels = rockchip_rk3066_tsadc_iio_channels,
.num_channels = ARRAY_SIZE(rockchip_rk3066_tsadc_iio_channels),
.clk_rate = 50000,
.start = rockchip_saradc_start_v1,
.read = rockchip_saradc_read_v1,
.power_down = rockchip_saradc_power_down_v1,
};
static const struct iio_chan_spec rockchip_rk3399_saradc_iio_channels[] = {
@ -189,6 +271,9 @@ static const struct rockchip_saradc_data rk3399_saradc_data = {
.channels = rockchip_rk3399_saradc_iio_channels,
.num_channels = ARRAY_SIZE(rockchip_rk3399_saradc_iio_channels),
.clk_rate = 1000000,
.start = rockchip_saradc_start_v1,
.read = rockchip_saradc_read_v1,
.power_down = rockchip_saradc_power_down_v1,
};
static const struct iio_chan_spec rockchip_rk3568_saradc_iio_channels[] = {
@ -206,6 +291,28 @@ static const struct rockchip_saradc_data rk3568_saradc_data = {
.channels = rockchip_rk3568_saradc_iio_channels,
.num_channels = ARRAY_SIZE(rockchip_rk3568_saradc_iio_channels),
.clk_rate = 1000000,
.start = rockchip_saradc_start_v1,
.read = rockchip_saradc_read_v1,
.power_down = rockchip_saradc_power_down_v1,
};
static const struct iio_chan_spec rockchip_rk3588_saradc_iio_channels[] = {
SARADC_CHANNEL(0, "adc0", 12),
SARADC_CHANNEL(1, "adc1", 12),
SARADC_CHANNEL(2, "adc2", 12),
SARADC_CHANNEL(3, "adc3", 12),
SARADC_CHANNEL(4, "adc4", 12),
SARADC_CHANNEL(5, "adc5", 12),
SARADC_CHANNEL(6, "adc6", 12),
SARADC_CHANNEL(7, "adc7", 12),
};
static const struct rockchip_saradc_data rk3588_saradc_data = {
.channels = rockchip_rk3588_saradc_iio_channels,
.num_channels = ARRAY_SIZE(rockchip_rk3588_saradc_iio_channels),
.clk_rate = 1000000,
.start = rockchip_saradc_start_v2,
.read = rockchip_saradc_read_v2,
};
static const struct of_device_id rockchip_saradc_match[] = {
@ -221,6 +328,9 @@ static const struct of_device_id rockchip_saradc_match[] = {
}, {
.compatible = "rockchip,rk3568-saradc",
.data = &rk3568_saradc_data,
}, {
.compatible = "rockchip,rk3588-saradc",
.data = &rk3588_saradc_data,
},
{},
};
@ -236,20 +346,6 @@ static void rockchip_saradc_reset_controller(struct reset_control *reset)
reset_control_deassert(reset);
}
static void rockchip_saradc_clk_disable(void *data)
{
struct rockchip_saradc *info = data;
clk_disable_unprepare(info->clk);
}
static void rockchip_saradc_pclk_disable(void *data)
{
struct rockchip_saradc *info = data;
clk_disable_unprepare(info->pclk);
}
static void rockchip_saradc_regulator_disable(void *data)
{
struct rockchip_saradc *info = data;
@ -298,8 +394,7 @@ out:
}
static int rockchip_saradc_volt_notify(struct notifier_block *nb,
unsigned long event,
void *data)
unsigned long event, void *data)
{
struct rockchip_saradc *info =
container_of(nb, struct rockchip_saradc, nb);
@ -319,10 +414,10 @@ static void rockchip_saradc_regulator_unreg_notifier(void *data)
static int rockchip_saradc_probe(struct platform_device *pdev)
{
const struct rockchip_saradc_data *match_data;
struct rockchip_saradc *info = NULL;
struct device_node *np = pdev->dev.of_node;
struct iio_dev *indio_dev = NULL;
const struct of_device_id *match;
int ret;
int irq;
@ -330,25 +425,23 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
return -ENODEV;
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*info));
if (!indio_dev) {
dev_err(&pdev->dev, "failed allocating iio device\n");
return -ENOMEM;
}
if (!indio_dev)
return dev_err_probe(&pdev->dev, -ENOMEM,
"failed allocating iio device\n");
info = iio_priv(indio_dev);
match = of_match_device(rockchip_saradc_match, &pdev->dev);
if (!match) {
dev_err(&pdev->dev, "failed to match device\n");
return -ENODEV;
}
match_data = of_device_get_match_data(&pdev->dev);
if (!match_data)
return dev_err_probe(&pdev->dev, -ENODEV,
"failed to match device\n");
info->data = match->data;
info->data = match_data;
/* Sanity check for possible later IP variants with more channels */
if (info->data->num_channels > SARADC_MAX_CHANNELS) {
dev_err(&pdev->dev, "max channels exceeded");
return -EINVAL;
}
if (info->data->num_channels > SARADC_MAX_CHANNELS)
return dev_err_probe(&pdev->dev, -EINVAL,
"max channels exceeded");
info->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(info->regs))
@ -383,16 +476,6 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
return ret;
}
info->pclk = devm_clk_get(&pdev->dev, "apb_pclk");
if (IS_ERR(info->pclk))
return dev_err_probe(&pdev->dev, PTR_ERR(info->pclk),
"failed to get pclk\n");
info->clk = devm_clk_get(&pdev->dev, "saradc");
if (IS_ERR(info->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(info->clk),
"failed to get adc clock\n");
info->vref = devm_regulator_get(&pdev->dev, "vref");
if (IS_ERR(info->vref))
return dev_err_probe(&pdev->dev, PTR_ERR(info->vref),
@ -406,23 +489,20 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
* This may become user-configurable in the future.
*/
ret = clk_set_rate(info->clk, info->data->clk_rate);
if (ret < 0) {
dev_err(&pdev->dev, "failed to set adc clk rate, %d\n", ret);
return ret;
}
if (ret < 0)
return dev_err_probe(&pdev->dev, ret,
"failed to set adc clk rate\n");
ret = regulator_enable(info->vref);
if (ret < 0) {
dev_err(&pdev->dev, "failed to enable vref regulator\n");
return ret;
}
if (ret < 0)
return dev_err_probe(&pdev->dev, ret,
"failed to enable vref regulator\n");
ret = devm_add_action_or_reset(&pdev->dev,
rockchip_saradc_regulator_disable, info);
if (ret) {
dev_err(&pdev->dev, "failed to register devm action, %d\n",
ret);
return ret;
}
if (ret)
return dev_err_probe(&pdev->dev, ret,
"failed to register devm action\n");
ret = regulator_get_voltage(info->vref);
if (ret < 0)
@ -430,31 +510,15 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
info->uv_vref = ret;
ret = clk_prepare_enable(info->pclk);
if (ret < 0) {
dev_err(&pdev->dev, "failed to enable pclk\n");
return ret;
}
ret = devm_add_action_or_reset(&pdev->dev,
rockchip_saradc_pclk_disable, info);
if (ret) {
dev_err(&pdev->dev, "failed to register devm action, %d\n",
ret);
return ret;
}
info->pclk = devm_clk_get_enabled(&pdev->dev, "apb_pclk");
if (IS_ERR(info->pclk))
return dev_err_probe(&pdev->dev, PTR_ERR(info->pclk),
"failed to get pclk\n");
ret = clk_prepare_enable(info->clk);
if (ret < 0) {
dev_err(&pdev->dev, "failed to enable converter clock\n");
return ret;
}
ret = devm_add_action_or_reset(&pdev->dev,
rockchip_saradc_clk_disable, info);
if (ret) {
dev_err(&pdev->dev, "failed to register devm action, %d\n",
ret);
return ret;
}
info->clk = devm_clk_get_enabled(&pdev->dev, "saradc");
if (IS_ERR(info->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(info->clk),
"failed to get adc clock\n");
platform_set_drvdata(pdev, indio_dev);

View File

@ -652,7 +652,7 @@ static struct i2c_driver rtq6056_driver = {
.of_match_table = rtq6056_device_match,
.pm = pm_ptr(&rtq6056_pm_ops),
},
.probe_new = rtq6056_probe,
.probe = rtq6056_probe,
};
module_i2c_driver(rtq6056_driver);

View File

@ -1993,6 +1993,8 @@ static int stm32_adc_get_legacy_chan_count(struct iio_dev *indio_dev, struct stm
const struct stm32_adc_info *adc_info = adc->cfg->adc_info;
int num_channels = 0, ret;
dev_dbg(&indio_dev->dev, "using legacy channel config\n");
ret = device_property_count_u32(dev, "st,adc-channels");
if (ret > adc_info->max_channels) {
dev_err(&indio_dev->dev, "Bad st,adc-channels?\n");

View File

@ -235,7 +235,7 @@ static struct i2c_driver adc081c_driver = {
.of_match_table = adc081c_of_match,
.acpi_match_table = adc081c_acpi_match,
},
.probe_new = adc081c_probe,
.probe = adc081c_probe,
.id_table = adc081c_id,
};
module_i2c_driver(adc081c_driver);

View File

@ -1195,7 +1195,7 @@ static struct i2c_driver ads1015_driver = {
.of_match_table = ads1015_of_match,
.pm = &ads1015_pm_ops,
},
.probe_new = ads1015_probe,
.probe = ads1015_probe,
.remove = ads1015_remove,
.id_table = ads1015_id,
};

View File

@ -434,7 +434,7 @@ static struct i2c_driver ads1100_driver = {
.of_match_table = ads1100_of_match,
.pm = pm_ptr(&ads1100_pm_ops),
},
.probe_new = ads1100_probe,
.probe = ads1100_probe,
.id_table = ads1100_id,
};

View File

@ -463,7 +463,7 @@ static struct i2c_driver ads7924_driver = {
.name = "ads7924",
.of_match_table = ads7924_of_match,
},
.probe_new = ads7924_probe,
.probe = ads7924_probe,
.id_table = ads7924_id,
};

View File

@ -281,7 +281,7 @@ static int ad8366_probe(struct spi_device *spi)
indio_dev->info = &ad8366_info;
indio_dev->modes = INDIO_DIRECT_MODE;
ret = ad8366_write(indio_dev, 0 , 0);
ret = ad8366_write(indio_dev, 0, 0);
if (ret < 0)
goto error_disable_reg;

View File

@ -647,7 +647,7 @@ static struct i2c_driver ad7150_driver = {
.name = "ad7150",
.of_match_table = ad7150_of_match,
},
.probe_new = ad7150_probe,
.probe = ad7150_probe,
.id_table = ad7150_id,
};
module_i2c_driver(ad7150_driver);

View File

@ -809,7 +809,7 @@ static struct i2c_driver ad7746_driver = {
.name = KBUILD_MODNAME,
.of_match_table = ad7746_of_match,
},
.probe_new = ad7746_probe,
.probe = ad7746_probe,
.id_table = ad7746_id,
};
module_i2c_driver(ad7746_driver);

View File

@ -179,7 +179,7 @@ static struct i2c_driver ams_iaqcore_driver = {
.name = "ams-iaq-core",
.of_match_table = ams_iaqcore_dt_ids,
},
.probe_new = ams_iaqcore_probe,
.probe = ams_iaqcore_probe,
.id_table = ams_iaqcore_id,
};
module_i2c_driver(ams_iaqcore_driver);

View File

@ -238,7 +238,7 @@ static struct i2c_driver atlas_ezo_driver = {
.name = ATLAS_EZO_DRV_NAME,
.of_match_table = atlas_ezo_dt_ids,
},
.probe_new = atlas_ezo_probe,
.probe = atlas_ezo_probe,
.id_table = atlas_ezo_id,
};
module_i2c_driver(atlas_ezo_driver);

View File

@ -767,7 +767,7 @@ static struct i2c_driver atlas_driver = {
.of_match_table = atlas_dt_ids,
.pm = pm_ptr(&atlas_pm_ops),
},
.probe_new = atlas_probe,
.probe = atlas_probe,
.remove = atlas_remove,
.id_table = atlas_id,
};

View File

@ -52,7 +52,7 @@ static struct i2c_driver bme680_i2c_driver = {
.name = "bme680_i2c",
.of_match_table = bme680_of_i2c_match,
},
.probe_new = bme680_i2c_probe,
.probe = bme680_i2c_probe,
.id_table = bme680_i2c_id,
};
module_i2c_driver(bme680_i2c_driver);

View File

@ -567,7 +567,7 @@ static struct i2c_driver ccs811_driver = {
.name = "ccs811",
.of_match_table = ccs811_dt_ids,
},
.probe_new = ccs811_probe,
.probe = ccs811_probe,
.remove = ccs811_remove,
.id_table = ccs811_id,
};

View File

@ -130,7 +130,7 @@ static struct i2c_driver scd30_i2c_driver = {
.of_match_table = scd30_i2c_of_match,
.pm = pm_sleep_ptr(&scd30_pm_ops),
},
.probe_new = scd30_i2c_probe,
.probe = scd30_i2c_probe,
};
module_i2c_driver(scd30_i2c_driver);

View File

@ -690,7 +690,7 @@ static struct i2c_driver scd4x_i2c_driver = {
.of_match_table = scd4x_dt_ids,
.pm = pm_sleep_ptr(&scd4x_pm_ops),
},
.probe_new = scd4x_probe,
.probe = scd4x_probe,
};
module_i2c_driver(scd4x_i2c_driver);

View File

@ -575,7 +575,7 @@ static struct i2c_driver sgp_driver = {
.name = "sgp30",
.of_match_table = sgp_dt_ids,
},
.probe_new = sgp_probe,
.probe = sgp_probe,
.remove = sgp_remove,
.id_table = sgp_id,
};

View File

@ -368,7 +368,7 @@ static struct i2c_driver sgp40_driver = {
.name = "sgp40",
.of_match_table = sgp40_dt_ids,
},
.probe_new = sgp40_probe,
.probe = sgp40_probe,
.id_table = sgp40_id,
};
module_i2c_driver(sgp40_driver);

View File

@ -249,7 +249,7 @@ static struct i2c_driver sps30_i2c_driver = {
.of_match_table = sps30_i2c_of_match,
},
.id_table = sps30_i2c_id,
.probe_new = sps30_i2c_probe,
.probe = sps30_i2c_probe,
};
module_i2c_driver(sps30_i2c_driver);

View File

@ -528,7 +528,7 @@ static struct i2c_driver sunrise_driver = {
.name = DRIVER_NAME,
.of_match_table = sunrise_of_match,
},
.probe_new = sunrise_probe,
.probe = sunrise_probe,
};
module_i2c_driver(sunrise_driver);

View File

@ -402,7 +402,7 @@ static struct i2c_driver vz89x_driver = {
.name = "vz89x",
.of_match_table = vz89x_dt_ids,
},
.probe_new = vz89x_probe,
.probe = vz89x_probe,
.id_table = vz89x_id,
};
module_i2c_driver(vz89x_driver);

View File

@ -1056,7 +1056,7 @@ static struct i2c_driver ad5064_i2c_driver = {
.driver = {
.name = "ad5064",
},
.probe_new = ad5064_i2c_probe,
.probe = ad5064_i2c_probe,
.id_table = ad5064_i2c_ids,
};

View File

@ -589,7 +589,7 @@ static struct i2c_driver ad5380_i2c_driver = {
.driver = {
.name = "ad5380",
},
.probe_new = ad5380_i2c_probe,
.probe = ad5380_i2c_probe,
.remove = ad5380_i2c_remove,
.id_table = ad5380_i2c_ids,
};

View File

@ -595,7 +595,7 @@ static struct i2c_driver ad5446_i2c_driver = {
.driver = {
.name = "ad5446",
},
.probe_new = ad5446_i2c_probe,
.probe = ad5446_i2c_probe,
.remove = ad5446_i2c_remove,
.id_table = ad5446_i2c_ids,
};

View File

@ -138,7 +138,7 @@ static struct i2c_driver ad5593r_driver = {
.of_match_table = ad5593r_of_match,
.acpi_match_table = ad5593r_acpi_match,
},
.probe_new = ad5593r_i2c_probe,
.probe = ad5593r_i2c_probe,
.remove = ad5593r_i2c_remove,
.id_table = ad5593r_i2c_ids,
};

View File

@ -115,7 +115,7 @@ static struct i2c_driver ad5686_i2c_driver = {
.name = "ad5696",
.of_match_table = ad5686_of_match,
},
.probe_new = ad5686_i2c_probe,
.probe = ad5686_i2c_probe,
.remove = ad5686_i2c_remove,
.id_table = ad5686_i2c_id,
};

View File

@ -312,7 +312,7 @@ static struct i2c_driver ds4424_driver = {
.of_match_table = ds4424_of_match,
.pm = pm_sleep_ptr(&ds4424_pm_ops),
},
.probe_new = ds4424_probe,
.probe = ds4424_probe,
.remove = ds4424_remove,
.id_table = ds4424_id,
};

View File

@ -238,7 +238,7 @@ static struct i2c_driver m62332_driver = {
.name = "m62332",
.pm = pm_sleep_ptr(&m62332_pm_ops),
},
.probe_new = m62332_probe,
.probe = m62332_probe,
.remove = m62332_remove,
.id_table = m62332_id,
};

View File

@ -203,7 +203,7 @@ static struct i2c_driver max517_driver = {
.name = MAX517_DRV_NAME,
.pm = pm_sleep_ptr(&max517_pm_ops),
},
.probe_new = max517_probe,
.probe = max517_probe,
.id_table = max517_id,
};
module_i2c_driver(max517_driver);

View File

@ -377,7 +377,7 @@ static struct i2c_driver max5821_driver = {
.of_match_table = max5821_of_match,
.pm = pm_sleep_ptr(&max5821_pm_ops),
},
.probe_new = max5821_probe,
.probe = max5821_probe,
.id_table = max5821_id,
};
module_i2c_driver(max5821_driver);

View File

@ -536,7 +536,7 @@ static struct i2c_driver mcp4725_driver = {
.of_match_table = mcp4725_of_match,
.pm = pm_sleep_ptr(&mcp4725_pm_ops),
},
.probe_new = mcp4725_probe,
.probe = mcp4725_probe,
.remove = mcp4725_remove,
.id_table = mcp4725_id,
};

View File

@ -426,7 +426,7 @@ static struct i2c_driver dac5571_driver = {
.name = "ti-dac5571",
.of_match_table = dac5571_of_id,
},
.probe_new = dac5571_probe,
.probe = dac5571_probe,
.remove = dac5571_remove,
.id_table = dac5571_id,
};

View File

@ -70,7 +70,7 @@ static struct i2c_driver bmg160_i2c_driver = {
.of_match_table = bmg160_of_match,
.pm = &bmg160_pm_ops,
},
.probe_new = bmg160_i2c_probe,
.probe = bmg160_i2c_probe,
.remove = bmg160_i2c_remove,
.id_table = bmg160_i2c_id,
};

View File

@ -56,7 +56,7 @@ static struct i2c_driver fxas21002c_i2c_driver = {
.pm = pm_ptr(&fxas21002c_pm_ops),
.of_match_table = fxas21002c_i2c_of_match,
},
.probe_new = fxas21002c_i2c_probe,
.probe = fxas21002c_i2c_probe,
.remove = fxas21002c_i2c_remove,
.id_table = fxas21002c_i2c_id,
};

View File

@ -405,7 +405,7 @@ static struct i2c_driver itg3200_driver = {
.pm = pm_sleep_ptr(&itg3200_pm_ops),
},
.id_table = itg3200_id,
.probe_new = itg3200_probe,
.probe = itg3200_probe,
.remove = itg3200_remove,
};

View File

@ -108,7 +108,7 @@ static const struct of_device_id mpu3050_i2c_of_match[] = {
MODULE_DEVICE_TABLE(of, mpu3050_i2c_of_match);
static struct i2c_driver mpu3050_i2c_driver = {
.probe_new = mpu3050_i2c_probe,
.probe = mpu3050_i2c_probe,
.remove = mpu3050_i2c_remove,
.id_table = mpu3050_i2c_id,
.driver = {

View File

@ -111,7 +111,7 @@ static struct i2c_driver st_gyro_driver = {
.name = "st-gyro-i2c",
.of_match_table = st_gyro_of_match,
},
.probe_new = st_gyro_i2c_probe,
.probe = st_gyro_i2c_probe,
.id_table = st_gyro_id_table,
};
module_i2c_driver(st_gyro_driver);

Some files were not shown because too many files have changed in this diff Show More