* [PATCH 1/2] Bluetooth: btbcm: Rewrite bindings i YAML and add reset
@ 2020-11-03 12:09 Linus Walleij
2020-11-04 19:01 ` Rob Herring
2020-11-04 19:03 ` Rob Herring
0 siblings, 2 replies; 3+ messages in thread
From: Linus Walleij @ 2020-11-03 12:09 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg; +Cc: linux-bluetooth, Linus Walleij, devicetree
This rewrites the Broadcom bluetooth bindings in YAML and
adds a GPIO handle for the BT_RST_N line as used on some
platforms.
Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
.../bindings/net/broadcom-bluetooth.txt | 56 ---------
.../bindings/net/broadcom-bluetooth.yaml | 117 ++++++++++++++++++
2 files changed, 117 insertions(+), 56 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
create mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
deleted file mode 100644
index a7d57ba5f2ac..000000000000
--- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-Broadcom Bluetooth Chips
----------------------
-
-This documents the binding structure and common properties for serial
-attached Broadcom devices.
-
-Serial attached Broadcom devices shall be a child node of the host UART
-device the slave device is attached to.
-
-Required properties:
-
- - compatible: should contain one of the following:
- * "brcm,bcm20702a1"
- * "brcm,bcm4329-bt"
- * "brcm,bcm4330-bt"
- * "brcm,bcm43438-bt"
- * "brcm,bcm4345c5"
- * "brcm,bcm43540-bt"
- * "brcm,bcm4335a0"
-
-Optional properties:
-
- - max-speed: see Documentation/devicetree/bindings/serial/serial.yaml
- - shutdown-gpios: GPIO specifier, used to enable the BT module
- - device-wakeup-gpios: GPIO specifier, used to wakeup the controller
- - host-wakeup-gpios: GPIO specifier, used to wakeup the host processor.
- deprecated, replaced by interrupts and
- "host-wakeup" interrupt-names
- - clocks: 1 or 2 clocks as defined in clock-names below, in that order
- - clock-names: names for clock inputs, matching the clocks given
- - "extclk": deprecated, replaced by "txco"
- - "txco": external reference clock (not a standalone crystal)
- - "lpo": external low power 32.768 kHz clock
- - vbat-supply: phandle to regulator supply for VBAT
- - vddio-supply: phandle to regulator supply for VDDIO
- - brcm,bt-pcm-int-params: configure PCM parameters via a 5-byte array
- - sco-routing: 0 = PCM, 1 = Transport, 2 = Codec, 3 = I2S
- - pcm-interface-rate: 128KBps, 256KBps, 512KBps, 1024KBps, 2048KBps
- - pcm-frame-type: short, long
- - pcm-sync-mode: slave, master
- - pcm-clock-mode: slave, master
- - interrupts: must be one, used to wakeup the host processor
- - interrupt-names: must be "host-wakeup"
-
-Example:
-
-&uart2 {
- pinctrl-names = "default";
- pinctrl-0 = <&uart2_pins>;
-
- bluetooth {
- compatible = "brcm,bcm43438-bt";
- max-speed = <921600>;
- brcm,bt-pcm-int-params = [01 02 00 01 01];
- };
-};
diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
new file mode 100644
index 000000000000..bdd6ca617e23
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
@@ -0,0 +1,117 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/broadcom-bluetooth.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom Bluetooth Chips
+
+maintainers:
+ - Linus Walleij <linus.walleij@linaro.org>
+
+description:
+ This binding describes Broadcom UART-attached bluetooth chips.
+
+properties:
+ compatible:
+ enum:
+ - brcm,bcm20702a1
+ - brcm,bcm4329-bt
+ - brcm,bcm4330-bt
+ - brcm,bcm43438-bt
+ - brcm,bcm4345c5
+ - brcm,bcm43540-bt
+ - brcm,bcm4335a0
+
+ shutdown-gpios:
+ maxItems: 1
+ description: GPIO specifier for the line BT_REG_ON used to
+ power on the BT module
+
+ reset-gpios:
+ maxItems: 1
+ description: GPIO specifier for the line BT_RST_N used to
+ reset the BT module. This should be marked as
+ GPIO_ACTIVE_LOW.
+
+ device-wakeup-gpios:
+ maxItems: 1
+ description: GPIO specifier for the line BT_WAKE used to
+ wakeup the controller. This is using the BT_GPIO_0
+ pin on the chip when in use.
+
+ host-wakeup-gpios:
+ maxItems: 1
+ deprecated: true
+ description: GPIO specifier for the line HOST_WAKE used
+ to wakeup the host processor. This is using he BT_GPIO_1
+ pin on the chip when in use. This is deprecated and replaced
+ by interrupts and "host-wakeup" interrupt-names
+
+ clocks:
+ maxItems: 2
+ description: 1 or 2 clocks as defined in clock-names below,
+ in that order
+
+ clock-names:
+ description: Names of the 1 to 2 supplied clocks
+ items:
+ - const: txco
+ - const: lpo
+ - const: extclk
+
+ vbat-supply:
+ description: phandle to regulator supply for VBAT
+
+ vddio-supply:
+ description: phandle to regulator supply for VDDIO
+
+ brcm,bt-pcm-int-params:
+ $ref: /schemas/types.yaml#/definitions/uint8-array
+ minItems: 5
+ maxItems: 5
+ description: |-
+ configure PCM parameters via a 5-byte array:
+ sco-routing: 0 = PCM, 1 = Transport, 2 = Codec, 3 = I2S
+ pcm-interface-rate: 128KBps, 256KBps, 512KBps, 1024KBps, 2048KBps
+ pcm-frame-type: short, long
+ pcm-sync-mode: slave, master
+ pcm-clock-mode: slave, master
+
+ interrupts:
+ items:
+ - description: Handle to the line HOST_WAKE used to wake
+ up the host processor. This uses the BT_GPIO_1 pin on
+ the chip when in use.
+
+ interrupt-names:
+ items:
+ - const: host-wakeup
+
+ max-speed: true
+ current-speed: true
+
+required:
+ - compatible
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ uart {
+ uart-has-rtscts;
+
+ bluetooth {
+ compatible = "brcm,bcm4330-bt";
+ max-speed = <921600>;
+ brcm,bt-pcm-int-params = [01 02 00 01 01];
+ shutdown-gpios = <&gpio 30 GPIO_ACTIVE_HIGH>;
+ device-wakeup-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
+ interrupt-parent = <&gpio>;
+ interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
+ };
+ };
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] Bluetooth: btbcm: Rewrite bindings i YAML and add reset
2020-11-03 12:09 [PATCH 1/2] Bluetooth: btbcm: Rewrite bindings i YAML and add reset Linus Walleij
@ 2020-11-04 19:01 ` Rob Herring
2020-11-04 19:03 ` Rob Herring
1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2020-11-04 19:01 UTC (permalink / raw)
To: Linus Walleij; +Cc: devicetree, Marcel Holtmann, linux-bluetooth, Johan Hedberg
On Tue, 03 Nov 2020 13:09:42 +0100, Linus Walleij wrote:
> This rewrites the Broadcom bluetooth bindings in YAML and
> adds a GPIO handle for the BT_RST_N line as used on some
> platforms.
>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> .../bindings/net/broadcom-bluetooth.txt | 56 ---------
> .../bindings/net/broadcom-bluetooth.yaml | 117 ++++++++++++++++++
> 2 files changed, 117 insertions(+), 56 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> create mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/serial/ingenic,uart.example.dt.yaml: bluetooth: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
See https://patchwork.ozlabs.org/patch/1392981
The base for the patch is generally the last rc1. Any dependencies
should be noted.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] Bluetooth: btbcm: Rewrite bindings i YAML and add reset
2020-11-03 12:09 [PATCH 1/2] Bluetooth: btbcm: Rewrite bindings i YAML and add reset Linus Walleij
2020-11-04 19:01 ` Rob Herring
@ 2020-11-04 19:03 ` Rob Herring
1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2020-11-04 19:03 UTC (permalink / raw)
To: Linus Walleij; +Cc: Marcel Holtmann, Johan Hedberg, linux-bluetooth, devicetree
On Tue, Nov 03, 2020 at 01:09:42PM +0100, Linus Walleij wrote:
> This rewrites the Broadcom bluetooth bindings in YAML and
> adds a GPIO handle for the BT_RST_N line as used on some
> platforms.
Typo in subject.
>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> .../bindings/net/broadcom-bluetooth.txt | 56 ---------
> .../bindings/net/broadcom-bluetooth.yaml | 117 ++++++++++++++++++
> 2 files changed, 117 insertions(+), 56 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> create mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
>
> diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> deleted file mode 100644
> index a7d57ba5f2ac..000000000000
> --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> +++ /dev/null
> @@ -1,56 +0,0 @@
> -Broadcom Bluetooth Chips
> ----------------------
> -
> -This documents the binding structure and common properties for serial
> -attached Broadcom devices.
> -
> -Serial attached Broadcom devices shall be a child node of the host UART
> -device the slave device is attached to.
> -
> -Required properties:
> -
> - - compatible: should contain one of the following:
> - * "brcm,bcm20702a1"
> - * "brcm,bcm4329-bt"
> - * "brcm,bcm4330-bt"
> - * "brcm,bcm43438-bt"
> - * "brcm,bcm4345c5"
> - * "brcm,bcm43540-bt"
> - * "brcm,bcm4335a0"
> -
> -Optional properties:
> -
> - - max-speed: see Documentation/devicetree/bindings/serial/serial.yaml
> - - shutdown-gpios: GPIO specifier, used to enable the BT module
> - - device-wakeup-gpios: GPIO specifier, used to wakeup the controller
> - - host-wakeup-gpios: GPIO specifier, used to wakeup the host processor.
> - deprecated, replaced by interrupts and
> - "host-wakeup" interrupt-names
> - - clocks: 1 or 2 clocks as defined in clock-names below, in that order
> - - clock-names: names for clock inputs, matching the clocks given
> - - "extclk": deprecated, replaced by "txco"
> - - "txco": external reference clock (not a standalone crystal)
> - - "lpo": external low power 32.768 kHz clock
> - - vbat-supply: phandle to regulator supply for VBAT
> - - vddio-supply: phandle to regulator supply for VDDIO
> - - brcm,bt-pcm-int-params: configure PCM parameters via a 5-byte array
> - - sco-routing: 0 = PCM, 1 = Transport, 2 = Codec, 3 = I2S
> - - pcm-interface-rate: 128KBps, 256KBps, 512KBps, 1024KBps, 2048KBps
> - - pcm-frame-type: short, long
> - - pcm-sync-mode: slave, master
> - - pcm-clock-mode: slave, master
> - - interrupts: must be one, used to wakeup the host processor
> - - interrupt-names: must be "host-wakeup"
> -
> -Example:
> -
> -&uart2 {
> - pinctrl-names = "default";
> - pinctrl-0 = <&uart2_pins>;
> -
> - bluetooth {
> - compatible = "brcm,bcm43438-bt";
> - max-speed = <921600>;
> - brcm,bt-pcm-int-params = [01 02 00 01 01];
> - };
> -};
> diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
> new file mode 100644
> index 000000000000..bdd6ca617e23
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
> @@ -0,0 +1,117 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/broadcom-bluetooth.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom Bluetooth Chips
> +
> +maintainers:
> + - Linus Walleij <linus.walleij@linaro.org>
> +
> +description:
> + This binding describes Broadcom UART-attached bluetooth chips.
> +
> +properties:
> + compatible:
> + enum:
> + - brcm,bcm20702a1
> + - brcm,bcm4329-bt
> + - brcm,bcm4330-bt
> + - brcm,bcm43438-bt
> + - brcm,bcm4345c5
> + - brcm,bcm43540-bt
> + - brcm,bcm4335a0
> +
> + shutdown-gpios:
> + maxItems: 1
> + description: GPIO specifier for the line BT_REG_ON used to
> + power on the BT module
> +
> + reset-gpios:
> + maxItems: 1
> + description: GPIO specifier for the line BT_RST_N used to
> + reset the BT module. This should be marked as
> + GPIO_ACTIVE_LOW.
> +
> + device-wakeup-gpios:
> + maxItems: 1
> + description: GPIO specifier for the line BT_WAKE used to
> + wakeup the controller. This is using the BT_GPIO_0
> + pin on the chip when in use.
> +
> + host-wakeup-gpios:
> + maxItems: 1
> + deprecated: true
> + description: GPIO specifier for the line HOST_WAKE used
> + to wakeup the host processor. This is using he BT_GPIO_1
> + pin on the chip when in use. This is deprecated and replaced
> + by interrupts and "host-wakeup" interrupt-names
> +
> + clocks:
> + maxItems: 2
> + description: 1 or 2 clocks as defined in clock-names below,
> + in that order
> +
> + clock-names:
> + description: Names of the 1 to 2 supplied clocks
> + items:
> + - const: txco
> + - const: lpo
> + - const: extclk
> +
> + vbat-supply:
> + description: phandle to regulator supply for VBAT
> +
> + vddio-supply:
> + description: phandle to regulator supply for VDDIO
> +
> + brcm,bt-pcm-int-params:
> + $ref: /schemas/types.yaml#/definitions/uint8-array
> + minItems: 5
> + maxItems: 5
> + description: |-
> + configure PCM parameters via a 5-byte array:
> + sco-routing: 0 = PCM, 1 = Transport, 2 = Codec, 3 = I2S
> + pcm-interface-rate: 128KBps, 256KBps, 512KBps, 1024KBps, 2048KBps
> + pcm-frame-type: short, long
> + pcm-sync-mode: slave, master
> + pcm-clock-mode: slave, master
> +
> + interrupts:
> + items:
> + - description: Handle to the line HOST_WAKE used to wake
> + up the host processor. This uses the BT_GPIO_1 pin on
> + the chip when in use.
> +
> + interrupt-names:
> + items:
> + - const: host-wakeup
> +
> + max-speed: true
> + current-speed: true
> +
> +required:
> + - compatible
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> +
> + uart {
> + uart-has-rtscts;
> +
> + bluetooth {
> + compatible = "brcm,bcm4330-bt";
> + max-speed = <921600>;
> + brcm,bt-pcm-int-params = [01 02 00 01 01];
> + shutdown-gpios = <&gpio 30 GPIO_ACTIVE_HIGH>;
> + device-wakeup-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
> + reset-gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
> + interrupt-parent = <&gpio>;
> + interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
> + };
> + };
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-04 19:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 12:09 [PATCH 1/2] Bluetooth: btbcm: Rewrite bindings i YAML and add reset Linus Walleij
2020-11-04 19:01 ` Rob Herring
2020-11-04 19:03 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).