Skip to content

Commit

Permalink
iio: adc: Add Phytium ADC support
Browse files Browse the repository at this point in the history
Phytium Pe220x SoCs includes an 8-channel, 10-bit single ended ADC.
This patch add this ADC's driver support.

Signed-off-by: Yang Liu <[email protected]>
Signed-off-by: Zhou Yulin <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
Signed-off-by: Hu Yeqing <[email protected]>
  • Loading branch information
Hu Yeqing authored and Avenger-285714 committed Jun 1, 2024
1 parent d39fbb4 commit 3b5e588
Show file tree
Hide file tree
Showing 4 changed files with 782 additions and 0 deletions.
81 changes: 81 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/phytium,adc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2019 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/phytium,adi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Phytium ADC

maintainers:
- Chen Baozi <[email protected]>

description: |
This device is a 10-bit converter for 8 voltage channels. All inputs are
single ended.
properties:
compatible:
const: phytium,adc

reg:
maxItems: 1

clocks:
maxItems: 1
description: Input clock used to derive the sample clock.

interrupts:
maxItems: 1

'#address-cells':
const: 1

'#size-cells':
const: 0


required:
- compatible
- reg
- clocks
- interrupts
- '#address-cells'
- '#size-cells'

examples:
- |
adc0: adc@2807b000 {
compatible = "phytium,adc";
reg = <0x0 0x2807b000 0x0 0x1000>;
interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&sysclk_48mhz>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
};
channel@1 {
reg = <1>;
};
channel@2 {
reg = <2>;
};
channel@3 {
reg = <3>;
};
channel@4 {
reg = <4>;
};
channel@5 {
reg = <5>;
};
channel@6 {
reg = <5>;
};
channel@7 {
reg = <7>;
};
};
12 changes: 12 additions & 0 deletions drivers/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,18 @@ config PALMAS_GPADC
is used in smartphones and tablets and supports a 16 channel
general purpose ADC.

config PHYTIUM_ADC
tristate "Phytium ADC driver"
depends on ARCH_PHYTIUM || COMPILE_TEST
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for Phytium analog to digital
converters (ADC).

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

config QCOM_VADC_COMMON
tristate

Expand Down
1 change: 1 addition & 0 deletions drivers/iio/adc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ obj-$(CONFIG_MXS_LRADC_ADC) += mxs-lradc-adc.o
obj-$(CONFIG_NAU7802) += nau7802.o
obj-$(CONFIG_NPCM_ADC) += npcm_adc.o
obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
obj-$(CONFIG_PHYTIUM_ADC) += phytium-adc.o
obj-$(CONFIG_QCOM_SPMI_ADC5) += qcom-spmi-adc5.o
obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
obj-$(CONFIG_QCOM_SPMI_RRADC) += qcom-spmi-rradc.o
Expand Down
Loading

0 comments on commit 3b5e588

Please sign in to comment.