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

spi: Convert spi-slave-mt27xx to json-schema

Convert Mediatek ARM SOC's SPI Slave controller binding
to json-schema format.

Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220125012330.13449-2-leilk.liu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Leilk Liu and committed by
Mark Brown
60edd652 4e28b222

+58 -33
+58
Documentation/devicetree/bindings/spi/mediatek,spi-slave-mt27xx.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/spi/mediatek,spi-slave-mt27xx.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: SPI Slave controller for MediaTek ARM SoCs 8 + 9 + maintainers: 10 + - Leilk Liu <leilk.liu@mediatek.com> 11 + 12 + allOf: 13 + - $ref: "/schemas/spi/spi-controller.yaml#" 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - mediatek,mt2712-spi-slave 19 + - mediatek,mt8195-spi-slave 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + interrupts: 25 + maxItems: 1 26 + 27 + clocks: 28 + maxItems: 1 29 + 30 + clock-names: 31 + items: 32 + - const: spi 33 + 34 + required: 35 + - compatible 36 + - reg 37 + - interrupts 38 + - clocks 39 + - clock-names 40 + 41 + unevaluatedProperties: false 42 + 43 + examples: 44 + - | 45 + #include <dt-bindings/clock/mt2712-clk.h> 46 + #include <dt-bindings/gpio/gpio.h> 47 + #include <dt-bindings/interrupt-controller/arm-gic.h> 48 + #include <dt-bindings/interrupt-controller/irq.h> 49 + 50 + spi@10013000 { 51 + compatible = "mediatek,mt2712-spi-slave"; 52 + reg = <0x10013000 0x100>; 53 + interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>; 54 + clocks = <&infracfg CLK_INFRA_AO_SPI1>; 55 + clock-names = "spi"; 56 + assigned-clocks = <&topckgen CLK_TOP_SPISLV_SEL>; 57 + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL1_D2>; 58 + };
-33
Documentation/devicetree/bindings/spi/spi-slave-mt27xx.txt
··· 1 - Binding for MTK SPI Slave controller 2 - 3 - Required properties: 4 - - compatible: should be one of the following. 5 - - mediatek,mt2712-spi-slave: for mt2712 platforms 6 - - mediatek,mt8195-spi-slave: for mt8195 platforms 7 - - reg: Address and length of the register set for the device. 8 - - interrupts: Should contain spi interrupt. 9 - - clocks: phandles to input clocks. 10 - It's clock gate, and should be <&infracfg CLK_INFRA_AO_SPI1>. 11 - - clock-names: should be "spi" for the clock gate. 12 - 13 - Optional properties: 14 - - assigned-clocks: it's mux clock, should be <&topckgen CLK_TOP_SPISLV_SEL>. 15 - - assigned-clock-parents: parent of mux clock. 16 - It's PLL, and should be one of the following. 17 - - <&topckgen CLK_TOP_UNIVPLL1_D2>: specify parent clock 312MHZ. 18 - It's the default one. 19 - - <&topckgen CLK_TOP_UNIVPLL1_D4>: specify parent clock 156MHZ. 20 - - <&topckgen CLK_TOP_UNIVPLL2_D4>: specify parent clock 104MHZ. 21 - - <&topckgen CLK_TOP_UNIVPLL1_D8>: specify parent clock 78MHZ. 22 - 23 - Example: 24 - - SoC Specific Portion: 25 - spis1: spi@10013000 { 26 - compatible = "mediatek,mt2712-spi-slave"; 27 - reg = <0 0x10013000 0 0x100>; 28 - interrupts = <GIC_SPI 283 IRQ_TYPE_LEVEL_LOW>; 29 - clocks = <&infracfg CLK_INFRA_AO_SPI1>; 30 - clock-names = "spi"; 31 - assigned-clocks = <&topckgen CLK_TOP_SPISLV_SEL>; 32 - assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL1_D2>; 33 - };