Skip to content

Commit 5e54b3a

Browse files
author
Hu Yeqing
committed
iio: adc: Add Phytium ADC support
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 <yangliu2021@phytium.com.cn> Signed-off-by: Zhou Yulin <zhouyulin1283@phytium.com.cn> Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn> Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn> Signed-off-by: Hu Yeqing <huyeqing2074@phytium.com.cn>
1 parent 255e26b commit 5e54b3a

4 files changed

Lines changed: 782 additions & 0 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
# Copyright 2019 Analog Devices Inc.
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/iio/adc/phytium,adi.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Phytium ADC
9+
10+
maintainers:
11+
- Chen Baozi <chenbaozi@phytium.com.cn>
12+
13+
description: |
14+
This device is a 10-bit converter for 8 voltage channels. All inputs are
15+
single ended.
16+
17+
properties:
18+
compatible:
19+
const: phytium,adc
20+
21+
reg:
22+
maxItems: 1
23+
24+
clocks:
25+
maxItems: 1
26+
description: Input clock used to derive the sample clock.
27+
28+
interrupts:
29+
maxItems: 1
30+
31+
'#address-cells':
32+
const: 1
33+
34+
'#size-cells':
35+
const: 0
36+
37+
38+
required:
39+
- compatible
40+
- reg
41+
- clocks
42+
- interrupts
43+
- '#address-cells'
44+
- '#size-cells'
45+
46+
examples:
47+
- |
48+
adc0: adc@2807b000 {
49+
compatible = "phytium,adc";
50+
reg = <0x0 0x2807b000 0x0 0x1000>;
51+
interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>;
52+
clocks = <&sysclk_48mhz>;
53+
54+
#address-cells = <1>;
55+
#size-cells = <0>;
56+
57+
channel@0 {
58+
reg = <0>;
59+
};
60+
channel@1 {
61+
reg = <1>;
62+
};
63+
channel@2 {
64+
reg = <2>;
65+
};
66+
channel@3 {
67+
reg = <3>;
68+
};
69+
channel@4 {
70+
reg = <4>;
71+
};
72+
channel@5 {
73+
reg = <5>;
74+
};
75+
channel@6 {
76+
reg = <5>;
77+
};
78+
channel@7 {
79+
reg = <7>;
80+
};
81+
};

drivers/iio/adc/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,18 @@ config PALMAS_GPADC
886886
is used in smartphones and tablets and supports a 16 channel
887887
general purpose ADC.
888888

889+
config PHYTIUM_ADC
890+
tristate "Phytium ADC driver"
891+
depends on ARCH_PHYTIUM || COMPILE_TEST
892+
select IIO_BUFFER
893+
select IIO_TRIGGERED_BUFFER
894+
help
895+
Say yes here to build support for Phytium analog to digital
896+
converters (ADC).
897+
898+
To compile this driver as a module, choose M here: the module
899+
will be called phytium-adc.
900+
889901
config QCOM_VADC_COMMON
890902
tristate
891903

drivers/iio/adc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ obj-$(CONFIG_MXS_LRADC_ADC) += mxs-lradc-adc.o
8282
obj-$(CONFIG_NAU7802) += nau7802.o
8383
obj-$(CONFIG_NPCM_ADC) += npcm_adc.o
8484
obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
85+
obj-$(CONFIG_PHYTIUM_ADC) += phytium-adc.o
8586
obj-$(CONFIG_QCOM_SPMI_ADC5) += qcom-spmi-adc5.o
8687
obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
8788
obj-$(CONFIG_QCOM_SPMI_RRADC) += qcom-spmi-rradc.o

0 commit comments

Comments
 (0)