xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/ingenic,adc.yaml (revision cb7aa33ac6cd46a5434798e50363136e64f3ae98)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot# Copyright 2019-2020 Artur Rojek
3c66ec88fSEmmanuel Vadot%YAML 1.2
4c66ec88fSEmmanuel Vadot---
5*cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/iio/adc/ingenic,adc.yaml#
6*cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7c66ec88fSEmmanuel Vadot
88bab661aSEmmanuel Vadottitle: Ingenic JZ47xx ADC controller IIO
9c66ec88fSEmmanuel Vadot
10c66ec88fSEmmanuel Vadotmaintainers:
11c66ec88fSEmmanuel Vadot  - Artur Rojek <contact@artur-rojek.eu>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription: >
14c66ec88fSEmmanuel Vadot  Industrial I/O subsystem bindings for ADC controller found in
15c66ec88fSEmmanuel Vadot  Ingenic JZ47xx SoCs.
16c66ec88fSEmmanuel Vadot
1782ea1a07SEmmanuel Vadot  ADC clients must use the format described in
1882ea1a07SEmmanuel Vadot  https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml,
1982ea1a07SEmmanuel Vadot  giving a phandle and IIO specifier pair ("io-channels") to the ADC controller.
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadotproperties:
22c66ec88fSEmmanuel Vadot  compatible:
23c66ec88fSEmmanuel Vadot    enum:
24c66ec88fSEmmanuel Vadot      - ingenic,jz4725b-adc
25c66ec88fSEmmanuel Vadot      - ingenic,jz4740-adc
26354d7675SEmmanuel Vadot      - ingenic,jz4760-adc
27354d7675SEmmanuel Vadot      - ingenic,jz4760b-adc
28c66ec88fSEmmanuel Vadot      - ingenic,jz4770-adc
29c66ec88fSEmmanuel Vadot
30c66ec88fSEmmanuel Vadot  '#io-channel-cells':
31c66ec88fSEmmanuel Vadot    const: 1
32c66ec88fSEmmanuel Vadot    description:
33c66ec88fSEmmanuel Vadot      Must be set to <1> to indicate channels are selected by index.
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot  reg:
36c66ec88fSEmmanuel Vadot    maxItems: 1
37c66ec88fSEmmanuel Vadot
38c66ec88fSEmmanuel Vadot  clocks:
39c66ec88fSEmmanuel Vadot    maxItems: 1
40c66ec88fSEmmanuel Vadot
41c66ec88fSEmmanuel Vadot  clock-names:
42c66ec88fSEmmanuel Vadot    items:
43c66ec88fSEmmanuel Vadot      - const: adc
44c66ec88fSEmmanuel Vadot
45c66ec88fSEmmanuel Vadot  interrupts:
46c66ec88fSEmmanuel Vadot    maxItems: 1
47c66ec88fSEmmanuel Vadot
48354d7675SEmmanuel Vadot  ingenic,use-internal-divider:
49354d7675SEmmanuel Vadot    description:
50354d7675SEmmanuel Vadot      If present, battery voltage is read from the VBAT_IR pin, which has an
51354d7675SEmmanuel Vadot      internal 1/4 divider. If absent, it is read through the VBAT_ER pin,
52354d7675SEmmanuel Vadot      which does not have such a divider.
53354d7675SEmmanuel Vadot    type: boolean
54354d7675SEmmanuel Vadot
55354d7675SEmmanuel Vadotif:
56354d7675SEmmanuel Vadot  not:
57354d7675SEmmanuel Vadot    properties:
58354d7675SEmmanuel Vadot      compatible:
59354d7675SEmmanuel Vadot        contains:
60354d7675SEmmanuel Vadot          const: ingenic,jz4760b-adc
61354d7675SEmmanuel Vadotthen:
62354d7675SEmmanuel Vadot  properties:
63354d7675SEmmanuel Vadot    ingenic,use-internal-divider: false
64354d7675SEmmanuel Vadot
65c66ec88fSEmmanuel Vadotrequired:
66c66ec88fSEmmanuel Vadot  - compatible
67c66ec88fSEmmanuel Vadot  - '#io-channel-cells'
68c66ec88fSEmmanuel Vadot  - reg
69c66ec88fSEmmanuel Vadot  - clocks
70c66ec88fSEmmanuel Vadot  - clock-names
71c66ec88fSEmmanuel Vadot  - interrupts
72c66ec88fSEmmanuel Vadot
73c66ec88fSEmmanuel VadotadditionalProperties: false
74c66ec88fSEmmanuel Vadot
75c66ec88fSEmmanuel Vadotexamples:
76c66ec88fSEmmanuel Vadot  - |
778cc087a1SEmmanuel Vadot    #include <dt-bindings/clock/ingenic,jz4740-cgu.h>
78c66ec88fSEmmanuel Vadot    #include <dt-bindings/iio/adc/ingenic,adc.h>
79c66ec88fSEmmanuel Vadot
80c66ec88fSEmmanuel Vadot    adc@10070000 {
81c66ec88fSEmmanuel Vadot        compatible = "ingenic,jz4740-adc";
82c66ec88fSEmmanuel Vadot        #io-channel-cells = <1>;
83c66ec88fSEmmanuel Vadot
84c66ec88fSEmmanuel Vadot        reg = <0x10070000 0x30>;
85c66ec88fSEmmanuel Vadot
86c66ec88fSEmmanuel Vadot        clocks = <&cgu JZ4740_CLK_ADC>;
87c66ec88fSEmmanuel Vadot        clock-names = "adc";
88c66ec88fSEmmanuel Vadot
89c66ec88fSEmmanuel Vadot        interrupt-parent = <&intc>;
90c66ec88fSEmmanuel Vadot        interrupts = <18>;
91c66ec88fSEmmanuel Vadot    };
92