Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings:iio:adc:brcm,iproc-static-adc: txt to yaml conversion

A few questions came up in this one.
1) Why does the txt file document io-channel-ranges as a required property.
That property is for iio-channel consumers, and this is a provider.
I have dropped it.
2) The example had an @180a6000 for the ADC but given it uses syscon for
all access, it doesn't have its own reg etc. I've dropped that from
the binding example.

Note this example was lifted directly from bcm-cygnus.dtsi so both
issues are present there as well.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Link: https://lore.kernel.org/r/20201031184854.745828-33-jic23@kernel.org

+70 -40
-40
Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.txt
··· 1 - * Broadcom's IPROC Static ADC controller 2 - 3 - Broadcom iProc ADC controller has 8 channels 10bit ADC. 4 - Allows user to convert analog input voltage values to digital. 5 - 6 - Required properties: 7 - 8 - - compatible: Must be "brcm,iproc-static-adc" 9 - 10 - - adc-syscon: Handler of syscon node defining physical base address of the 11 - controller and length of memory mapped region. 12 - 13 - - #io-channel-cells = <1>; As ADC has multiple outputs 14 - refer to Documentation/devicetree/bindings/iio/iio-bindings.txt for details. 15 - 16 - - io-channel-ranges: 17 - refer to Documentation/devicetree/bindings/iio/iio-bindings.txt for details. 18 - 19 - - clocks: Clock used for this block. 20 - 21 - - clock-names: Clock name should be given as tsc_clk. 22 - 23 - - interrupts: interrupt line number. 24 - 25 - For example: 26 - 27 - ts_adc_syscon: ts_adc_syscon@180a6000 { 28 - compatible = "brcm,iproc-ts-adc-syscon","syscon"; 29 - reg = <0x180a6000 0xc30>; 30 - }; 31 - 32 - adc: adc@180a6000 { 33 - compatible = "brcm,iproc-static-adc"; 34 - adc-syscon = <&ts_adc_syscon>; 35 - #io-channel-cells = <1>; 36 - io-channel-ranges; 37 - clocks = <&asiu_clks BCM_CYGNUS_ASIU_ADC_CLK>; 38 - clock-names = "tsc_clk"; 39 - interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>; 40 - };
+70
Documentation/devicetree/bindings/iio/adc/brcm,iproc-static-adc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/adc/brcm,iproc-static-adc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Broadcom's IPROC Static ADC controller 8 + 9 + maintainers: 10 + - Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> 11 + 12 + description: | 13 + Broadcom iProc ADC controller has 8 10bit channels 14 + 15 + properties: 16 + compatible: 17 + const: brcm,iproc-static-adc 18 + 19 + adc-syscon: 20 + $ref: /schemas/types.yaml#/definitions/phandle 21 + description: 22 + syscon node defining physical base address of the controller and length 23 + of memory mapped region. 24 + 25 + "#io-channel-cells": 26 + const: 1 27 + 28 + clocks: 29 + maxItems: 1 30 + 31 + clock-names: 32 + const: tsc_clk 33 + 34 + interrupts: 35 + maxItems: 1 36 + 37 + additionalProperties: false 38 + 39 + required: 40 + - compatible 41 + - adc-syscon 42 + - "#io-channel-cells" 43 + - clocks 44 + - clock-names 45 + - interrupts 46 + 47 + examples: 48 + - | 49 + #include <dt-bindings/clock/bcm-cygnus.h> 50 + #include <dt-bindings/interrupt-controller/arm-gic.h> 51 + #include <dt-bindings/interrupt-controller/irq.h> 52 + soc { 53 + #address-cells = <1>; 54 + #size-cells = <1>; 55 + 56 + ts_adc_syscon: ts_adc_syscon@180a6000 { 57 + compatible = "brcm,iproc-ts-adc-syscon","syscon"; 58 + reg = <0x180a6000 0xc30>; 59 + }; 60 + 61 + adc { 62 + compatible = "brcm,iproc-static-adc"; 63 + adc-syscon = <&ts_adc_syscon>; 64 + #io-channel-cells = <1>; 65 + clocks = <&asiu_clks BCM_CYGNUS_ASIU_ADC_CLK>; 66 + clock-names = "tsc_clk"; 67 + interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>; 68 + }; 69 + }; 70 + ...