mbox series

[00/11] iio: adc: Add support for QCOM SPMI PMIC5 Gen3 ADC

Message ID 20230708072835.3035398-1-quic_jprakash@quicinc.com
Headers show
Series iio: adc: Add support for QCOM SPMI PMIC5 Gen3 ADC | expand

Message

Jishnu Prakash July 8, 2023, 7:28 a.m. UTC
PMIC5 Gen3 has a similar ADC architecture to that on PMIC5 Gen2,
with all SW communication to ADC going through PMK8550 which
communicates with other PMICs through PBS. The major difference is
that the register interface used here is that of an SDAM present on
PMK8550, rather than a dedicated ADC peripheral. There may be more than one
SDAM used for ADC5 Gen3. Each ADC SDAM has eight channels, each of which may
be used for either immediate reads (same functionality as previous PMIC5 and
PMIC5 Gen2 ADC peripherals) or recurring measurements (same as PMIC5 and PMIC5
Gen2 ADC_TM functionality). In this case, we have VADC and ADC_TM functionality
combined into the same driver.

Patches 1-5 update the name of the previous generation of PMIC5 ADC peripherals
from ADC7 to ADC5 Gen2, as this is the correct name and it makes more sense now
to update it, with the addition of the latest ADC5 Gen3 peripheral support.

Patches 6 and 7 add bindings and driver support respectively for ADC5 Gen3.

Patches 8-11 are for an additional change, where the QCOM ADC dt-bindings files
are moved from dt-bindings/iio to dt-bindings/iio/adc folder, as they are
specifically for ADC devices.

Jishnu Prakash (11):
  iio: adc: Update bindings for ADC7 name used on QCOM PMICs
  iio: adc: Update driver files for ADC7 rename for QCOM PMICs
  ARM: dts: qcom: Update devicetree for ADC7 rename for QCOM PMICs
  iio: adc: Update bindings to remove support for ADC7 name used on QCOM
    PMICs
  iio: adc: qcom-spmi-adc5: remove support for ADC7 compatible string
  iio: adc: Add QCOM PMIC5 Gen3 ADC bindings
  iio: adc: Add support for QCOM PMIC5 Gen3 ADC
  dt-bindings: iio: adc: Copy QCOM ADC bindings files
  iio: adc: Update QCOM ADC drivers for bindings path change
  ARM: dts: qcom: Update devicetree for QCOM ADC bindings path change
  dt-bindings: iio: remove QCOM ADC files from iio folder

 .../bindings/iio/adc/qcom,spmi-vadc.yaml      |  131 +-
 .../bindings/thermal/qcom-spmi-adc-tm5.yaml   |   19 +-
 arch/arm64/boot/dts/qcom/pm6125.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pm6150.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pm6150l.dtsi         |    2 +-
 arch/arm64/boot/dts/qcom/pm660.dtsi           |    2 +-
 arch/arm64/boot/dts/qcom/pm660l.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pm7250b.dtsi         |    2 +-
 arch/arm64/boot/dts/qcom/pm8150.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pm8150b.dtsi         |    2 +-
 arch/arm64/boot/dts/qcom/pm8150l.dtsi         |    2 +-
 arch/arm64/boot/dts/qcom/pm8916.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pm8950.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pm8953.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pm8994.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pm8998.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pmi632.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/pmi8950.dtsi         |    2 +-
 arch/arm64/boot/dts/qcom/pmk8350.dtsi         |    4 +-
 arch/arm64/boot/dts/qcom/pmm8155au_1.dtsi     |    2 +-
 arch/arm64/boot/dts/qcom/pmp8074.dtsi         |    2 +-
 arch/arm64/boot/dts/qcom/pms405.dtsi          |    2 +-
 arch/arm64/boot/dts/qcom/sc7280-idp.dts       |    4 +-
 arch/arm64/boot/dts/qcom/sc7280-idp.dtsi      |    4 +-
 arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi    |    8 +-
 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    |   48 +-
 arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi  |    2 +-
 .../boot/dts/qcom/sm7225-fairphone-fp4.dts    |    4 +-
 drivers/iio/adc/Kconfig                       |   25 +
 drivers/iio/adc/Makefile                      |    1 +
 drivers/iio/adc/qcom-spmi-adc5-gen3.c         | 1193 +++++++++++++++++
 drivers/iio/adc/qcom-spmi-adc5.c              |   93 +-
 drivers/iio/adc/qcom-spmi-vadc.c              |    2 +-
 drivers/iio/adc/qcom-vadc-common.c            |   36 +-
 .../iio/adc/qcom,spmi-adc5-gen2-pm8350.h      |   64 +
 .../iio/adc/qcom,spmi-adc5-gen2-pm8350b.h     |   89 ++
 .../iio/adc/qcom,spmi-adc5-gen2-pmk8350.h     |   47 +
 .../iio/adc/qcom,spmi-adc5-gen2-pmr735a.h     |   29 +
 .../iio/adc/qcom,spmi-adc5-gen2-pmr735b.h     |   28 +
 .../iio/adc/qcom,spmi-adc5-gen3-pm8550.h      |   48 +
 .../iio/adc/qcom,spmi-adc5-gen3-pm8550b.h     |   97 ++
 .../iio/adc/qcom,spmi-adc5-gen3-pm8550vx.h    |   20 +
 .../iio/adc/qcom,spmi-adc5-gen3-pmk8550.h     |   54 +
 .../iio/{ => adc}/qcom,spmi-vadc.h            |  209 ++-
 .../dt-bindings/iio/qcom,spmi-adc7-pm8350.h   |   63 -
 .../dt-bindings/iio/qcom,spmi-adc7-pm8350b.h  |   88 --
 .../dt-bindings/iio/qcom,spmi-adc7-pmk8350.h  |   46 -
 .../dt-bindings/iio/qcom,spmi-adc7-pmr735a.h  |   28 -
 .../dt-bindings/iio/qcom,spmi-adc7-pmr735b.h  |   28 -
 include/linux/iio/adc/qcom-vadc-common.h      |   12 +-
 50 files changed, 2088 insertions(+), 474 deletions(-)
 create mode 100644 drivers/iio/adc/qcom-spmi-adc5-gen3.c
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen2-pm8350.h
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen2-pm8350b.h
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen2-pmk8350.h
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen2-pmr735a.h
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen2-pmr735b.h
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen3-pm8550.h
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen3-pm8550b.h
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen3-pm8550vx.h
 create mode 100644 include/dt-bindings/iio/adc/qcom,spmi-adc5-gen3-pmk8550.h
 rename include/dt-bindings/iio/{ => adc}/qcom,spmi-vadc.h (59%)
 delete mode 100644 include/dt-bindings/iio/qcom,spmi-adc7-pm8350.h
 delete mode 100644 include/dt-bindings/iio/qcom,spmi-adc7-pm8350b.h
 delete mode 100644 include/dt-bindings/iio/qcom,spmi-adc7-pmk8350.h
 delete mode 100644 include/dt-bindings/iio/qcom,spmi-adc7-pmr735a.h
 delete mode 100644 include/dt-bindings/iio/qcom,spmi-adc7-pmr735b.h