Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(kernel-rolling) iio: adc: Add Phytium ADC support #206

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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