Message ID | 20240705-btaml-v1-0-7f1538f98cef@amlogic.com |
---|---|
Headers | show |
Series | Add support for Amlogic HCI UART | expand |
On 05/07/2024 13:20, Yang Li via B4 Relay wrote: > From: Yang Li <yang.li@amlogic.com> > > Add binding document for Amlogic Bluetooth chipsets attached over UART. > > Signed-off-by: Yang Li <yang.li@amlogic.com> > --- > .../bindings/net/bluetooth/amlogic,w155s2-bt.yaml | 62 ++++++++++++++++++++++ > 1 file changed, 62 insertions(+) > > diff --git a/Documentation/devicetree/bindings/net/bluetooth/amlogic,w155s2-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/amlogic,w155s2-bt.yaml > new file mode 100644 > index 000000000000..d59e3206af62 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/bluetooth/amlogic,w155s2-bt.yaml > @@ -0,0 +1,62 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +# Copyright (C) 2024 Amlogic, Inc. All rights reserved > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/bluetooth/amlogic,w155s2-bt.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Amlogic Bluetooth chips > + > +description: > + This binding describes UART-attached Amlogic bluetooth chips. Do not say that binding describes a binding. It is not helpful. Describe the hardware instead. > + > +maintainers: > + - Yang Li <yang.li@amlogic.com> > + > +properties: > + compatible: > + oneOf: > + - const: amlogic,w155s2-bt > + - items: > + - enum: > + - amlogic,w265s1-bt > + - amlogic,w265p1-bt > + - amlogic,w265s2-bt > + - const: amlogic,w155s2-bt > + > + amlogic,wcn-pwrseq: ?? > + default: 0 > + description: specify the power sequence used to power on Bluetooth > + $ref: /schemas/types.yaml#/definitions/uint32 What? I have no clue what is this and have no clue what to say here. Drop. > + > + amlogic,firmware: > + description: specify the path of firmware bin to load > + $ref: /schemas/types.yaml#/definitions/string-array Srsly, it's third case in your bindings. Do not re-invent the wheel but use existing, common properties. How to find them? Well, git grep or ask your colleagues... > + > + amlogic,antenna-number: > + default: 1 > + description: number of antenna Useless description. Do not repeat the property name but explain what is it and how it is used. Or drop the property. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + amlogic,a2dp-sink-enable: > + default: 0 > + description: enable sink mode with controller Again, not possible to figure out. NAK > + $ref: /schemas/types.yaml#/definitions/uint32 > + > +required: > + - compatible > + - amlogic,wcn-pwrseq > + - amlogic,firmware > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/gpio/gpio.h> > + serial { Drop > + bluetooth { > + compatible = "amlogic,w155s2-bt"; > + amlogic,wcn-pwrseq = <1>; Joking, right? Best regards, Krzysztof
On 05/07/2024 13:20, Yang Li via B4 Relay wrote: > From: Yang Li <yang.li@amlogic.com> > > This patch introduces support for Amlogic Bluetooth controller over > UART. In order to send the final firmware at full speed. It is a pretty > straight forward H4 driver with exception of actually having it's own > setup address configuration. > > Co-developed-by: Ye He <ye.he@amlogic.com> Read submitting patches. Missing SoB. > Signed-off-by: Yang Li <yang.li@amlogic.com> > --- > drivers/bluetooth/Kconfig | 13 + > + > +static void aml_serdev_remove(struct serdev_device *serdev) > +{ > + struct aml_serdev *amldev = serdev_device_get_drvdata(serdev); > + > + hci_uart_unregister_device(&amldev->serdev_hu); > +} > + > +static const struct aml_device_data data_w155s2 __maybe_unused = { > + .iccm_offset = 256 * 1024, > +}; > + > +static const struct aml_device_data data_w265s2 __maybe_unused = { How this can be "maybe_unused" while it is referenced always? This is buggy. Either everything in OF chain can be unused or not. Not half yes, half not. > + .iccm_offset = 384 * 1024, > +}; > + > +static const struct of_device_id aml_bluetooth_of_match[] = { > + { .compatible = "amlogic,w155s2-bt", .data = &data_w155s2 }, > + { .compatible = "amlogic,w265s2-bt", .data = &data_w265s2 }, > + { /* sentinel */ }, > +}; > + > +static struct serdev_device_driver aml_serdev_driver = { > + .probe = aml_serdev_probe, > + .remove = aml_serdev_remove, > + .driver = { > + .name = "hci_uart_aml", > + .of_match_table = of_match_ptr(aml_bluetooth_of_match), So now you have warnings... drop of_match_ptr. Best regards, Krzysztof
On 05/07/2024 13:20, Yang Li via B4 Relay wrote: > From: Yang Li <yang.li@amlogic.com> > > Add Amlogic Bluetooth driver and driver document. > > Signed-off-by: Yang Li <yang.li@amlogic.com> > --- > MAINTAINERS | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index cd3277a98cfe..b81089290930 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1140,6 +1140,14 @@ S: Supported > F: arch/arm64/boot/dts/amd/amd-seattle-xgbe*.dtsi > F: drivers/net/ethernet/amd/xgbe/ > > +AMLOGIC BLUETOOTH DRIVER > +M: Yang Li <yang.li@amlogic.com> > +L: linux-bluetooth@vger.kernel.org > +S: Maintained > +W: http://www.amlogic.com Same as in your other patches. Drop. It's not a place for marketing. Or provide useful link. Best regards, Krzysztof
On 2024/7/7 21:10, Krzysztof Kozlowski wrote: > [Some people who received this message don't often get email from krzk@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > > On 05/07/2024 13:20, Yang Li via B4 Relay wrote: >> From: Yang Li <yang.li@amlogic.com> >> >> This patch introduces support for Amlogic Bluetooth controller over >> UART. In order to send the final firmware at full speed. It is a pretty >> straight forward H4 driver with exception of actually having it's own >> setup address configuration. >> >> Co-developed-by: Ye He <ye.he@amlogic.com> > Read submitting patches. Missing SoB. Will do. > >> Signed-off-by: Yang Li <yang.li@amlogic.com> >> --- >> drivers/bluetooth/Kconfig | 13 + > > >> + >> +static void aml_serdev_remove(struct serdev_device *serdev) >> +{ >> + struct aml_serdev *amldev = serdev_device_get_drvdata(serdev); >> + >> + hci_uart_unregister_device(&amldev->serdev_hu); >> +} >> + >> +static const struct aml_device_data data_w155s2 __maybe_unused = { >> + .iccm_offset = 256 * 1024, >> +}; >> + >> +static const struct aml_device_data data_w265s2 __maybe_unused = { > How this can be "maybe_unused" while it is referenced always? This is > buggy. Either everything in OF chain can be unused or not. Not half yes, > half not. well, i will remove __maybe_unused. > >> + .iccm_offset = 384 * 1024, >> +}; >> + >> +static const struct of_device_id aml_bluetooth_of_match[] = { >> + { .compatible = "amlogic,w155s2-bt", .data = &data_w155s2 }, >> + { .compatible = "amlogic,w265s2-bt", .data = &data_w265s2 }, >> + { /* sentinel */ }, >> +}; >> + >> +static struct serdev_device_driver aml_serdev_driver = { >> + .probe = aml_serdev_probe, >> + .remove = aml_serdev_remove, >> + .driver = { >> + .name = "hci_uart_aml", >> + .of_match_table = of_match_ptr(aml_bluetooth_of_match), > So now you have warnings... drop of_match_ptr. Will do. > > Best regards, > Krzysztof >
On 2024/7/7 21:08, Krzysztof Kozlowski wrote: > [你通常不会收到来自 krzk@kernel.org 的电子邮件。请访问 https://aka.ms/LearnAboutSenderIdentification,以了解这一点为什么很重要] > > [ EXTERNAL EMAIL ] > > On 05/07/2024 13:20, Yang Li via B4 Relay wrote: >> From: Yang Li <yang.li@amlogic.com> >> >> Add binding document for Amlogic Bluetooth chipsets attached over UART. >> >> Signed-off-by: Yang Li <yang.li@amlogic.com> >> --- >> .../bindings/net/bluetooth/amlogic,w155s2-bt.yaml | 62 ++++++++++++++++++++++ >> 1 file changed, 62 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/net/bluetooth/amlogic,w155s2-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/amlogic,w155s2-bt.yaml >> new file mode 100644 >> index 000000000000..d59e3206af62 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/net/bluetooth/amlogic,w155s2-bt.yaml >> @@ -0,0 +1,62 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +# Copyright (C) 2024 Amlogic, Inc. All rights reserved >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/net/bluetooth/amlogic,w155s2-bt.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Amlogic Bluetooth chips >> + >> +description: >> + This binding describes UART-attached Amlogic bluetooth chips. > Do not say that binding describes a binding. It is not helpful. Describe > the hardware instead. Well do. > >> + >> +maintainers: >> + - Yang Li <yang.li@amlogic.com> >> + >> +properties: >> + compatible: >> + oneOf: >> + - const: amlogic,w155s2-bt >> + - items: >> + - enum: >> + - amlogic,w265s1-bt >> + - amlogic,w265p1-bt >> + - amlogic,w265s2-bt >> + - const: amlogic,w155s2-bt >> + >> + amlogic,wcn-pwrseq: > ?? I will remove this line, add regolator. > >> + default: 0 >> + description: specify the power sequence used to power on Bluetooth >> + $ref: /schemas/types.yaml#/definitions/uint32 > What? I have no clue what is this and have no clue what to say here. Drop. will do. >> + >> + amlogic,firmware: >> + description: specify the path of firmware bin to load >> + $ref: /schemas/types.yaml#/definitions/string-array > Srsly, it's third case in your bindings. Do not re-invent the wheel but > use existing, common properties. How to find them? Well, git grep or ask > your colleagues... I will change "amlogic,firmware" to " firmware-name". >> + >> + amlogic,antenna-number: >> + default: 1 >> + description: number of antenna > Useless description. Do not repeat the property name but explain what is > it and how it is used. > > Or drop the property. I will change the description. > >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + >> + amlogic,a2dp-sink-enable: >> + default: 0 >> + description: enable sink mode with controller > Again, not possible to figure out. > > NAK Well do. > >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + >> +required: >> + - compatible >> + - amlogic,wcn-pwrseq >> + - amlogic,firmware >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/gpio/gpio.h> >> + serial { > Drop Will do. > >> + bluetooth { >> + compatible = "amlogic,w155s2-bt"; >> + amlogic,wcn-pwrseq = <1>; > Joking, right? Well, I will remove it. > > > > Best regards, > Krzysztof >
On 2024/7/7 21:11, Krzysztof Kozlowski wrote: > On 05/07/2024 13:20, Yang Li via B4 Relay wrote: >> From: Yang Li <yang.li@amlogic.com> >> >> Add Amlogic Bluetooth driver and driver document. >> >> Signed-off-by: Yang Li <yang.li@amlogic.com> >> --- >> MAINTAINERS | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/MAINTAINERS b/MAINTAINERS >> index cd3277a98cfe..b81089290930 100644 >> --- a/MAINTAINERS >> +++ b/MAINTAINERS >> @@ -1140,6 +1140,14 @@ S: Supported >> F: arch/arm64/boot/dts/amd/amd-seattle-xgbe*.dtsi >> F: drivers/net/ethernet/amd/xgbe/ >> >> +AMLOGIC BLUETOOTH DRIVER >> +M: Yang Li <yang.li@amlogic.com> >> +L: linux-bluetooth@vger.kernel.org >> +S: Maintained >> +W: http://www.amlogic.com > Same as in your other patches. Drop. It's not a place for marketing. Or > provide useful link. Will do. > > > Best regards, > Krzysztof >
Add support for Amlogic HCI UART, including dt-binding, Amlogic Bluetooth driver and enable HCIUART_AML in defconfig. Signed-off-by: Yang Li <yang.li@amlogic.com> --- Yang Li (4): dt-bindings: net: bluetooth: Add support for Amlogic Bluetooth Bluetooth: hci_uart: Add support for Amlogic HCI UART arm64: defconfig: Enable hci_uart for Amlogic Bluetooth MAINTAINERS: Add an entry for Amlogic HCI UART .../bindings/net/bluetooth/amlogic,w155s2-bt.yaml | 62 ++ MAINTAINERS | 8 + arch/arm64/configs/defconfig | 1 + drivers/bluetooth/Kconfig | 13 + drivers/bluetooth/Makefile | 1 + drivers/bluetooth/hci_aml.c | 749 +++++++++++++++++++++ drivers/bluetooth/hci_ldisc.c | 8 +- drivers/bluetooth/hci_uart.h | 8 +- 8 files changed, 847 insertions(+), 3 deletions(-) --- base-commit: e3203b17771757fdcd259d6378673f1590e36694 change-id: 20240418-btaml-f9d7b19724ab Best regards,