16be33864SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 26be33864SEmmanuel Vadot%YAML 1.2 36be33864SEmmanuel Vadot--- 46be33864SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/adc/sprd,sc2720-adc.yaml# 56be33864SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 66be33864SEmmanuel Vadot 7*8bab661aSEmmanuel Vadottitle: Spreadtrum SC27XX series PMICs ADC 86be33864SEmmanuel Vadot 96be33864SEmmanuel Vadotmaintainers: 106be33864SEmmanuel Vadot - Baolin Wang <baolin.wang7@gmail.com> 116be33864SEmmanuel Vadot 126be33864SEmmanuel Vadotdescription: 136be33864SEmmanuel Vadot Supports the ADC found on these PMICs. 146be33864SEmmanuel Vadot 156be33864SEmmanuel Vadotproperties: 166be33864SEmmanuel Vadot compatible: 176be33864SEmmanuel Vadot enum: 186be33864SEmmanuel Vadot - sprd,sc2720-adc 196be33864SEmmanuel Vadot - sprd,sc2721-adc 206be33864SEmmanuel Vadot - sprd,sc2723-adc 216be33864SEmmanuel Vadot - sprd,sc2730-adc 226be33864SEmmanuel Vadot - sprd,sc2731-adc 23d5b0e70fSEmmanuel Vadot - sprd,ump9620-adc 246be33864SEmmanuel Vadot 256be33864SEmmanuel Vadot reg: 266be33864SEmmanuel Vadot maxItems: 1 276be33864SEmmanuel Vadot 286be33864SEmmanuel Vadot interrupts: 296be33864SEmmanuel Vadot maxItems: 1 306be33864SEmmanuel Vadot 316be33864SEmmanuel Vadot "#io-channel-cells": 326be33864SEmmanuel Vadot const: 1 336be33864SEmmanuel Vadot 346be33864SEmmanuel Vadot hwlocks: 356be33864SEmmanuel Vadot maxItems: 1 366be33864SEmmanuel Vadot 37d5b0e70fSEmmanuel Vadot nvmem-cells: true 38d5b0e70fSEmmanuel Vadot 39d5b0e70fSEmmanuel Vadot nvmem-cell-names: true 40d5b0e70fSEmmanuel Vadot 41d5b0e70fSEmmanuel VadotallOf: 42d5b0e70fSEmmanuel Vadot - if: 43d5b0e70fSEmmanuel Vadot not: 44d5b0e70fSEmmanuel Vadot properties: 45d5b0e70fSEmmanuel Vadot compatible: 46d5b0e70fSEmmanuel Vadot contains: 47d5b0e70fSEmmanuel Vadot enum: 48d5b0e70fSEmmanuel Vadot - sprd,ump9620-adc 49d5b0e70fSEmmanuel Vadot then: 50d5b0e70fSEmmanuel Vadot properties: 516be33864SEmmanuel Vadot nvmem-cells: 526be33864SEmmanuel Vadot maxItems: 2 536be33864SEmmanuel Vadot nvmem-cell-names: 546be33864SEmmanuel Vadot items: 556be33864SEmmanuel Vadot - const: big_scale_calib 566be33864SEmmanuel Vadot - const: small_scale_calib 576be33864SEmmanuel Vadot 58d5b0e70fSEmmanuel Vadot else: 59d5b0e70fSEmmanuel Vadot properties: 60d5b0e70fSEmmanuel Vadot nvmem-cells: 61d5b0e70fSEmmanuel Vadot maxItems: 6 62d5b0e70fSEmmanuel Vadot nvmem-cell-names: 63d5b0e70fSEmmanuel Vadot items: 64d5b0e70fSEmmanuel Vadot - const: big_scale_calib1 65d5b0e70fSEmmanuel Vadot - const: big_scale_calib2 66d5b0e70fSEmmanuel Vadot - const: small_scale_calib1 67d5b0e70fSEmmanuel Vadot - const: small_scale_calib2 68d5b0e70fSEmmanuel Vadot - const: vbat_det_cal1 69d5b0e70fSEmmanuel Vadot - const: vbat_det_cal2 70d5b0e70fSEmmanuel Vadot 716be33864SEmmanuel Vadotrequired: 726be33864SEmmanuel Vadot - compatible 736be33864SEmmanuel Vadot - reg 746be33864SEmmanuel Vadot - interrupts 756be33864SEmmanuel Vadot - "#io-channel-cells" 766be33864SEmmanuel Vadot - hwlocks 776be33864SEmmanuel Vadot - nvmem-cells 786be33864SEmmanuel Vadot - nvmem-cell-names 796be33864SEmmanuel Vadot 806be33864SEmmanuel VadotadditionalProperties: false 816be33864SEmmanuel Vadot 826be33864SEmmanuel Vadotexamples: 836be33864SEmmanuel Vadot - | 846be33864SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 856be33864SEmmanuel Vadot pmic { 866be33864SEmmanuel Vadot #address-cells = <1>; 876be33864SEmmanuel Vadot #size-cells = <0>; 886be33864SEmmanuel Vadot adc@480 { 896be33864SEmmanuel Vadot compatible = "sprd,sc2731-adc"; 906be33864SEmmanuel Vadot reg = <0x480>; 916be33864SEmmanuel Vadot interrupt-parent = <&sc2731_pmic>; 926be33864SEmmanuel Vadot interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; 936be33864SEmmanuel Vadot #io-channel-cells = <1>; 946be33864SEmmanuel Vadot hwlocks = <&hwlock 4>; 956be33864SEmmanuel Vadot nvmem-cells = <&adc_big_scale>, <&adc_small_scale>; 966be33864SEmmanuel Vadot nvmem-cell-names = "big_scale_calib", "small_scale_calib"; 976be33864SEmmanuel Vadot }; 986be33864SEmmanuel Vadot }; 99d5b0e70fSEmmanuel Vadot 100d5b0e70fSEmmanuel Vadot - | 101d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 102d5b0e70fSEmmanuel Vadot pmic { 103d5b0e70fSEmmanuel Vadot #address-cells = <1>; 104d5b0e70fSEmmanuel Vadot #size-cells = <0>; 105d5b0e70fSEmmanuel Vadot adc@504 { 106d5b0e70fSEmmanuel Vadot compatible = "sprd,ump9620-adc"; 107d5b0e70fSEmmanuel Vadot reg = <0x504>; 108d5b0e70fSEmmanuel Vadot interrupt-parent = <&ump9620_pmic>; 109d5b0e70fSEmmanuel Vadot interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; 110d5b0e70fSEmmanuel Vadot #io-channel-cells = <1>; 111d5b0e70fSEmmanuel Vadot hwlocks = <&hwlock 4>; 112d5b0e70fSEmmanuel Vadot nvmem-cells = <&adc_bcal1>, <&adc_bcal2>, 113d5b0e70fSEmmanuel Vadot <&adc_scal1>, <&adc_scal2>, 114d5b0e70fSEmmanuel Vadot <&vbat_det_cal1>, <&vbat_det_cal2>; 115d5b0e70fSEmmanuel Vadot nvmem-cell-names = "big_scale_calib1", "big_scale_calib2", 116d5b0e70fSEmmanuel Vadot "small_scale_calib1", "small_scale_calib2", 117d5b0e70fSEmmanuel Vadot "vbat_det_cal1", "vbat_det_cal2"; 118d5b0e70fSEmmanuel Vadot }; 119d5b0e70fSEmmanuel Vadot }; 1206be33864SEmmanuel Vadot... 121