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

dt-bindings: nfc: marvell,nci: convert to dtschema

Convert the Marvell NCI NFC controller to DT schema format.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20211011073934.34340-9-krzysztof.kozlowski@canonical.com
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Rob Herring
a997377a 3470d69b

+170 -84
+170
Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/nfc/marvell,nci.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell International Ltd. NCI NFC controller 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - marvell,nfc-i2c 16 + - marvell,nfc-spi 17 + - marvell,nfc-uart 18 + 19 + hci-muxed: 20 + type: boolean 21 + description: | 22 + Specifies that the chip is muxing NCI over HCI frames 23 + 24 + interrupts: 25 + maxItems: 1 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + reset-n-io: 31 + $ref: "/schemas/types.yaml#/definitions/phandle-array" 32 + maxItems: 1 33 + description: | 34 + Output GPIO pin used to reset the chip (active low) 35 + 36 + i2c-int-falling: 37 + type: boolean 38 + description: | 39 + For I2C type of connection. Specifies that the chip read event shall be 40 + trigged on falling edge. 41 + 42 + i2c-int-rising: 43 + type: boolean 44 + description: | 45 + For I2C type of connection. Specifies that the chip read event shall be 46 + trigged on rising edge. 47 + 48 + break-control: 49 + type: boolean 50 + description: | 51 + For UART type of connection. Specifies that the chip needs specific break 52 + management. 53 + 54 + flow-control: 55 + type: boolean 56 + description: | 57 + For UART type of connection. Specifies that the chip is using RTS/CTS. 58 + 59 + spi-cpha: true 60 + spi-cpol: true 61 + spi-max-frequency: true 62 + 63 + required: 64 + - compatible 65 + 66 + allOf: 67 + - if: 68 + properties: 69 + compatible: 70 + contains: 71 + const: marvell,nfc-i2c 72 + then: 73 + properties: 74 + break-control: false 75 + flow-control: false 76 + spi-cpha: false 77 + spi-cpol: false 78 + spi-max-frequency: false 79 + required: 80 + - reg 81 + 82 + - if: 83 + properties: 84 + compatible: 85 + contains: 86 + const: marvell,nfc-spi 87 + then: 88 + properties: 89 + break-control: false 90 + flow-control: false 91 + i2c-int-falling: false 92 + i2c-int-rising: false 93 + required: 94 + - reg 95 + 96 + - if: 97 + properties: 98 + compatible: 99 + contains: 100 + const: marvell,nfc-uart 101 + then: 102 + properties: 103 + i2c-int-falling: false 104 + i2c-int-rising: false 105 + interrupts: false 106 + spi-cpha: false 107 + spi-cpol: false 108 + spi-max-frequency: false 109 + reg: false 110 + 111 + additionalProperties: false 112 + 113 + examples: 114 + - | 115 + #include <dt-bindings/gpio/gpio.h> 116 + #include <dt-bindings/interrupt-controller/irq.h> 117 + 118 + i2c { 119 + #address-cells = <1>; 120 + #size-cells = <0>; 121 + 122 + nfc@8 { 123 + compatible = "marvell,nfc-i2c"; 124 + reg = <0x8>; 125 + 126 + interrupt-parent = <&gpio3>; 127 + interrupts = <21 IRQ_TYPE_EDGE_RISING>; 128 + 129 + i2c-int-rising; 130 + 131 + reset-n-io = <&gpio3 19 GPIO_ACTIVE_HIGH>; 132 + }; 133 + }; 134 + 135 + - | 136 + #include <dt-bindings/gpio/gpio.h> 137 + #include <dt-bindings/interrupt-controller/irq.h> 138 + 139 + spi { 140 + #address-cells = <1>; 141 + #size-cells = <0>; 142 + 143 + nfc@0 { 144 + compatible = "marvell,nfc-spi"; 145 + reg = <0>; 146 + 147 + spi-max-frequency = <3000000>; 148 + spi-cpha; 149 + spi-cpol; 150 + 151 + interrupt-parent = <&gpio1>; 152 + interrupts = <17 IRQ_TYPE_EDGE_RISING>; 153 + 154 + reset-n-io = <&gpio3 19 GPIO_ACTIVE_HIGH>; 155 + }; 156 + }; 157 + 158 + - | 159 + #include <dt-bindings/gpio/gpio.h> 160 + 161 + uart { 162 + nfc { 163 + compatible = "marvell,nfc-uart"; 164 + 165 + reset-n-io = <&gpio3 16 GPIO_ACTIVE_HIGH>; 166 + 167 + hci-muxed; 168 + flow-control; 169 + }; 170 + };
-84
Documentation/devicetree/bindings/net/nfc/nfcmrvl.txt
··· 1 - * Marvell International Ltd. NCI NFC Controller 2 - 3 - Required properties: 4 - - compatible: Should be: 5 - - "marvell,nfc-uart" or "mrvl,nfc-uart" for UART devices 6 - - "marvell,nfc-i2c" for I2C devices 7 - - "marvell,nfc-spi" for SPI devices 8 - 9 - Optional SoC specific properties: 10 - - pinctrl-names: Contains only one value - "default". 11 - - pintctrl-0: Specifies the pin control groups used for this controller. 12 - - reset-n-io: Output GPIO pin used to reset the chip (active low). 13 - - hci-muxed: Specifies that the chip is muxing NCI over HCI frames. 14 - 15 - Optional UART-based chip specific properties: 16 - - flow-control: Specifies that the chip is using RTS/CTS. 17 - - break-control: Specifies that the chip needs specific break management. 18 - 19 - Optional I2C-based chip specific properties: 20 - - i2c-int-falling: Specifies that the chip read event shall be trigged on 21 - falling edge. 22 - - i2c-int-rising: Specifies that the chip read event shall be trigged on 23 - rising edge. 24 - 25 - Example (for ARM-based BeagleBoard Black with 88W8887 on UART5): 26 - 27 - &uart5 { 28 - 29 - nfcmrvluart: nfcmrvluart@5 { 30 - compatible = "marvell,nfc-uart"; 31 - 32 - reset-n-io = <&gpio3 16 0>; 33 - 34 - hci-muxed; 35 - flow-control; 36 - } 37 - }; 38 - 39 - 40 - Example (for ARM-based BeagleBoard Black with 88W8887 on I2C1): 41 - 42 - &i2c1 { 43 - clock-frequency = <400000>; 44 - 45 - nfcmrvli2c0: i2c@1 { 46 - compatible = "marvell,nfc-i2c"; 47 - 48 - reg = <0x8>; 49 - 50 - /* I2C INT configuration */ 51 - interrupt-parent = <&gpio3>; 52 - interrupts = <21 0>; 53 - 54 - /* I2C INT trigger configuration */ 55 - i2c-int-rising; 56 - 57 - /* Reset IO */ 58 - reset-n-io = <&gpio3 19 0>; 59 - }; 60 - }; 61 - 62 - 63 - Example (for ARM-based BeagleBoard Black on SPI0): 64 - 65 - &spi0 { 66 - 67 - mrvlnfcspi0: spi@0 { 68 - compatible = "marvell,nfc-spi"; 69 - 70 - reg = <0>; 71 - 72 - /* SPI Bus configuration */ 73 - spi-max-frequency = <3000000>; 74 - spi-cpha; 75 - spi-cpol; 76 - 77 - /* SPI INT configuration */ 78 - interrupt-parent = <&gpio1>; 79 - interrupts = <17 0>; 80 - 81 - /* Reset IO */ 82 - reset-n-io = <&gpio3 19 0>; 83 - }; 84 - };