Linux-ARM-Kernel Archive on lore.kernel.org
 help / Atom feed
* [PATCH] bluetooth: realtek: devicetree: Add device tree description to bluetooth rtl drivers
@ 2018-12-29 11:55 David Summers
  2018-12-29 16:51 ` David Summers
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: David Summers @ 2018-12-29 11:55 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: mark.rutland, Johan Hedberg, David Summers, linux-bluetooth,
	robh+dt, linux-arm-kernel

This patch add the relevent device tree handles to the bluetooth driver
for serial realtek devices.

Specifically it takes all devices listed in btrtk.c identifes from the
realtek web site which are serial devices (this invariably means
devices that end with and "s" in the device name).

Most of these devices are dual wifi and bluetooth, with wifi on and
sdio connection, and bluetooth on a serial uart. As these two
interfaces will need independent listings in the device tree, the
nodes here have "-bluetooth" added. The only exception is the
rtl8761atv device, which is bluetooth only - and only has a uart
interface.

Can devicetree people revive the naming scheme used here, and confirm
it is acceptable.

Marcel, if the device tree people are happy can you apply to the
bluetooth tree.

Thanks,

David.

Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
---
 drivers/bluetooth/hci_h5.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index 8eede1197cd2..61c9e729efc1 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -925,6 +925,20 @@ static struct h5_vnd rtl_vnd = {
 };
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id h5_of_match[] = {
+       { .compatible = "realtek,rtl8723as-bluetoooth"},
+       { .compatible = "realtek,rtl8723bs-bluetoooth"},
+       { .compatible = "realtek,rtl8723ds-bluetoooth"},
+       { .compatible = "realtek,rtl8761atv"},
+       { .compatible = "realtek,rtl8821as-bluetoooth"},
+       { .compatible = "realtek,rtl8821cs-bluetoooth"},
+       { .compatible = "realtek,rtl8822bs-bluetoooth"},
+       { }
+};
+MODULE_DEVICE_TABLE(of, h5_of_match);
+#endif
+
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id h5_acpi_match[] = {
 #ifdef CONFIG_BT_HCIUART_RTL
-- 
beagleboard@davidjohnsummers.uk


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] bluetooth: realtek: devicetree: Add device tree description to bluetooth rtl drivers
  2018-12-29 11:55 [PATCH] bluetooth: realtek: devicetree: Add device tree description to bluetooth rtl drivers David Summers
@ 2018-12-29 16:51 ` David Summers
  2018-12-30 10:25 ` Marcel Holtmann
  2019-01-03 16:35 ` [PATCHv2] Description of the realtek bluetooth device tree hooks David Summers
  2 siblings, 0 replies; 10+ messages in thread
From: David Summers @ 2018-12-29 16:51 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: mark.rutland, linux-bluetooth, robh+dt, Johan Hedberg, linux-arm-kernel

And just looking at my patch, I remember I wrote this a month or so ago, 
thought it had been checked - but a couple of changes didn't make it in:

1) "bluetoooth" is spelled "bluetooth"
2) The realtek compatible should be wrapped in a "#ifdef 
CONFIG_BT_HCIUART_RTL" as hci_h5 needs that to have the realtek links in

I'll make these changes in a few days, but leave this patch here - in 
case there are any other comments.

Would hope to get basic nod by next week (yes know bad time for people 
over Christmas), as its free time I have to do the device tree that 
needs these in ...

Regards,

David.

On 29/12/2018 11:55, David Summers wrote:
> This patch add the relevent device tree handles to the bluetooth driver
> for serial realtek devices.
>
> Specifically it takes all devices listed in btrtk.c identifes from the
> realtek web site which are serial devices (this invariably means
> devices that end with and "s" in the device name).
>
> Most of these devices are dual wifi and bluetooth, with wifi on and
> sdio connection, and bluetooth on a serial uart. As these two
> interfaces will need independent listings in the device tree, the
> nodes here have "-bluetooth" added. The only exception is the
> rtl8761atv device, which is bluetooth only - and only has a uart
> interface.
>
> Can devicetree people revive the naming scheme used here, and confirm
> it is acceptable.
>
> Marcel, if the device tree people are happy can you apply to the
> bluetooth tree.
>
> Thanks,
>
> David.
>
> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> ---
>   drivers/bluetooth/hci_h5.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
> index 8eede1197cd2..61c9e729efc1 100644
> --- a/drivers/bluetooth/hci_h5.c
> +++ b/drivers/bluetooth/hci_h5.c
> @@ -925,6 +925,20 @@ static struct h5_vnd rtl_vnd = {
>   };
>   #endif
>   
> +#ifdef CONFIG_OF
> +static const struct of_device_id h5_of_match[] = {
> +       { .compatible = "realtek,rtl8723as-bluetoooth"},
> +       { .compatible = "realtek,rtl8723bs-bluetoooth"},
> +       { .compatible = "realtek,rtl8723ds-bluetoooth"},
> +       { .compatible = "realtek,rtl8761atv"},
> +       { .compatible = "realtek,rtl8821as-bluetoooth"},
> +       { .compatible = "realtek,rtl8821cs-bluetoooth"},
> +       { .compatible = "realtek,rtl8822bs-bluetoooth"},
> +       { }
> +};
> +MODULE_DEVICE_TABLE(of, h5_of_match);
> +#endif
> +
>   #ifdef CONFIG_ACPI
>   static const struct acpi_device_id h5_acpi_match[] = {
>   #ifdef CONFIG_BT_HCIUART_RTL



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] bluetooth: realtek: devicetree: Add device tree description to bluetooth rtl drivers
  2018-12-29 11:55 [PATCH] bluetooth: realtek: devicetree: Add device tree description to bluetooth rtl drivers David Summers
  2018-12-29 16:51 ` David Summers
@ 2018-12-30 10:25 ` Marcel Holtmann
  2019-01-03 16:35 ` [PATCHv2] Description of the realtek bluetooth device tree hooks David Summers
  2 siblings, 0 replies; 10+ messages in thread
From: Marcel Holtmann @ 2018-12-30 10:25 UTC (permalink / raw)
  To: David Summers
  Cc: mark.rutland, linux-bluetooth, robh+dt, Johan Hedberg, linux-arm-kernel

Hi David,

> This patch add the relevent device tree handles to the bluetooth driver
> for serial realtek devices.
> 
> Specifically it takes all devices listed in btrtk.c identifes from the
> realtek web site which are serial devices (this invariably means
> devices that end with and "s" in the device name).
> 
> Most of these devices are dual wifi and bluetooth, with wifi on and
> sdio connection, and bluetooth on a serial uart. As these two
> interfaces will need independent listings in the device tree, the
> nodes here have "-bluetooth" added. The only exception is the
> rtl8761atv device, which is bluetooth only - and only has a uart
> interface.
> 
> Can devicetree people revive the naming scheme used here, and confirm
> it is acceptable.
> 
> Marcel, if the device tree people are happy can you apply to the
> bluetooth tree.

where is the email from the DT people acking this and more important also documented it.

Regards

Marcel


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCHv2] Description of the realtek bluetooth device tree hooks
  2018-12-29 11:55 [PATCH] bluetooth: realtek: devicetree: Add device tree description to bluetooth rtl drivers David Summers
  2018-12-29 16:51 ` David Summers
  2018-12-30 10:25 ` Marcel Holtmann
@ 2019-01-03 16:35 ` David Summers
  2019-01-03 16:35   ` [PATCHv2] Patch to add the realtek bluetooth device tree refs to the code David Summers
  2019-01-11 16:34   ` [PATCHv2] Description of the realtek bluetooth device tree hooks Rob Herring
  2 siblings, 2 replies; 10+ messages in thread
From: David Summers @ 2019-01-03 16:35 UTC (permalink / raw)
  To: marcel, johan.hedberg, robh+dt, mark.rutland
  Cc: linux-bluetooth, David Summers, linux-arm-kernel, devicetree

This adds the desrciption file that describes the hooks for the
realtek bluetooth serial devices, as needed to refer to the interface
in the device tree.

Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
---
 .../bindings/net/realtek-bluetooth-serial.txt | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt

diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt b/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
new file mode 100644
index 000000000000..0aabca1fc002
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
@@ -0,0 +1,28 @@
+Realtek bluetooth devices connected via a UART
+
+- compatible: should be "realtek,<name>-bluetooth"
+  except for "realtek,trl8761atv" - which only has a serial bluetooth connection
+       "realtek,rtl8723as-bluetooth"
+       "realtek,rtl8723bs-bluetooth"
+       "realtek,rtl8723ds-bluetooth"
+       "realtek,rtl8761atv"
+       "realtek,rtl8821as-bluetooth"
+       "realtek,rtl8821cs-bluetooth"
+       "realtek,rtl8822bs-bluetooth"
+- These device are bluetooth devices, that connect via a uart
+- all devices (except for rtl8761atv) are also wifi devices, this is connected
+  seperatly via sdio - and is not covered by this compatible node
+- ideally these will be referenced in a device tree serial node via serdev
+ http://events17.linuxfoundation.org/sites/events/files/slides/serdev-elce-2017-2.pdf
+
+Example:
+
+&uart0 {
+	status = "okay";
+       	pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
+       	bluetooth {
+               	  compatible = "realtek,rtl8723bs-bluetooth";
+       	};
+};
+
+this ensures that the bluetooth device is tied to the correct uart
-- 
beagleboard@davidjohnsummers.uk


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCHv2] Patch to add the realtek bluetooth device tree refs to the code
  2019-01-03 16:35 ` [PATCHv2] Description of the realtek bluetooth device tree hooks David Summers
@ 2019-01-03 16:35   ` David Summers
  2019-01-18 10:57     ` Marcel Holtmann
  2019-01-11 16:34   ` [PATCHv2] Description of the realtek bluetooth device tree hooks Rob Herring
  1 sibling, 1 reply; 10+ messages in thread
From: David Summers @ 2019-01-03 16:35 UTC (permalink / raw)
  To: marcel, johan.hedberg, robh+dt, mark.rutland
  Cc: linux-bluetooth, David Summers, linux-arm-kernel, devicetree

This patch adds the necessary device tree hooks to the realtek
bluetooth driver for serial connections.

The realtek devices that are listed btrtl.c are searched on the
realtek web site for the version that have serial connections.

Most of these devices also have wi-fi connected via sdio, that is not
covered by the bluetooth driver - but as that interface will also be
needed in the device tree, the hocks here have "-bluetooth" added. The
exception to this is the rtl8761atv, which only has a serial
bluetooth.

Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
---
 drivers/bluetooth/hci_h5.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index 8eede1197cd2..2fec7ff2ce7c 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -925,6 +925,22 @@ static struct h5_vnd rtl_vnd = {
 };
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id h5_of_match[] = {
+#ifdef CONFIG_BT_HCIUART_RTL
+       { .compatible = "realtek,rtl8723as-bluetooth"},
+       { .compatible = "realtek,rtl8723bs-bluetooth"},
+       { .compatible = "realtek,rtl8723ds-bluetooth"},
+       { .compatible = "realtek,rtl8761atv"},
+       { .compatible = "realtek,rtl8821as-bluetooth"},
+       { .compatible = "realtek,rtl8821cs-bluetooth"},
+       { .compatible = "realtek,rtl8822bs-bluetooth"},
+#endif
+       { }
+};
+MODULE_DEVICE_TABLE(of, h5_of_match);
+#endif
+
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id h5_acpi_match[] = {
 #ifdef CONFIG_BT_HCIUART_RTL
-- 
beagleboard@davidjohnsummers.uk


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv2] Description of the realtek bluetooth device tree hooks
  2019-01-03 16:35 ` [PATCHv2] Description of the realtek bluetooth device tree hooks David Summers
  2019-01-03 16:35   ` [PATCHv2] Patch to add the realtek bluetooth device tree refs to the code David Summers
@ 2019-01-11 16:34   ` Rob Herring
  2019-01-12 15:00     ` David Summers
  1 sibling, 1 reply; 10+ messages in thread
From: Rob Herring @ 2019-01-11 16:34 UTC (permalink / raw)
  To: David Summers
  Cc: mark.rutland, devicetree, johan.hedberg, marcel, linux-bluetooth,
	linux-arm-kernel

On Thu, Jan 03, 2019 at 04:35:37PM +0000, David Summers wrote:
> This adds the desrciption file that describes the hooks for the
> realtek bluetooth serial devices, as needed to refer to the interface
> in the device tree.

Please follow conventions for patch subjects. 'git log --oneline 
--no-merges -- path/to/file' usually gives a good clue. In this case, 
something like:

dt-bindings: net: Add Realtek serial bluetooth binding

> 
> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> ---
>  .../bindings/net/realtek-bluetooth-serial.txt | 28 +++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt b/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
> new file mode 100644
> index 000000000000..0aabca1fc002
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
> @@ -0,0 +1,28 @@
> +Realtek bluetooth devices connected via a UART
> +
> +- compatible: should be "realtek,<name>-bluetooth"
> +  except for "realtek,trl8761atv" - which only has a serial bluetooth connection
> +       "realtek,rtl8723as-bluetooth"
> +       "realtek,rtl8723bs-bluetooth"
> +       "realtek,rtl8723ds-bluetooth"
> +       "realtek,rtl8761atv"
> +       "realtek,rtl8821as-bluetooth"
> +       "realtek,rtl8821cs-bluetooth"
> +       "realtek,rtl8822bs-bluetooth"

Arguably, '-bluetooth' is not necessary as nothing else is attached to 
the serial port. At least shorten it to '-bt'.

> +- These device are bluetooth devices, that connect via a uart

s/device/devices/

> +- all devices (except for rtl8761atv) are also wifi devices, this is connected
> +  seperatly via sdio - and is not covered by this compatible node

Really, this should be up above the property list in a description of 
the device(s).

> +- ideally these will be referenced in a device tree serial node via serdev

Not ideally, but it is only valid for this to be a child of a UART.

serdev is a kernel thing, and shouldn't be part of the binding doc.

> + http://events17.linuxfoundation.org/sites/events/files/slides/serdev-elce-2017-2.pdf

Useful, but again, not part of this binding.

There's no interrupts, GPIO control lines, power supplies, etc. for 
these chips? The binding should be complete even if your platform 
doesn't need these.

> +
> +Example:
> +
> +&uart0 {
> +	status = "okay";

Don't show status in examples.

> +       	pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
> +       	bluetooth {
> +               	  compatible = "realtek,rtl8723bs-bluetooth";
> +       	};

Mixed tabs and spaces. Use tabs.

> +};
> +
> +this ensures that the bluetooth device is tied to the correct uart
> -- 
> beagleboard@davidjohnsummers.uk
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv2] Description of the realtek bluetooth device tree hooks
  2019-01-11 16:34   ` [PATCHv2] Description of the realtek bluetooth device tree hooks Rob Herring
@ 2019-01-12 15:00     ` David Summers
  2019-01-15 19:48       ` Rob Herring
  0 siblings, 1 reply; 10+ messages in thread
From: David Summers @ 2019-01-12 15:00 UTC (permalink / raw)
  To: Rob Herring
  Cc: mark.rutland, devicetree, johan.hedberg, marcel, linux-bluetooth,
	linux-arm-kernel

Thanks Rob,

I'll hopefully make those changes this weekend, and resubmit - just so 
next weekend can move onto the device tree.

Oh yes, on the "-bluetooth" or "-bt"; as these devices have both and 
sdio input for wifi, and uart for bluetooth; I guess they will need to 
be listed twice in a device tree, both under uart and sdio. Now as both 
these parts of the device tree will want to specify the driver used, and 
the driver is different for bluetooth and for wifi - doesn't that mean 
we should specify compatible differently? Otherwise how will the kernel 
know which driver to load for wifi and which for bluetooth?

So question is am I missing something here, and this could be simplified?

On the interrupts, GPIO control lines, power supplies, etc, on the ASUS 
code that I'm basing the patches on (for Tinker Board S) - these bits 
are freestanding in the device tree, and mainly go in with the wifi 
patch (and not bluetooth). I'll put some though into how this is best 
arranged when going mainline. I think if I'm honest, if I wait to get 
all these extras in the documentation, this will only get settled when I 
get the wifi into the device tree - as problem is more natural there. 
This though would delay the bluetooth patch probably a month. I'd prefer 
to get something out there - even if I have to return later to tidy the 
documentation.

Regards, and thanks for the helpful comments.

David.


On 11/01/2019 16:34, Rob Herring wrote:
> On Thu, Jan 03, 2019 at 04:35:37PM +0000, David Summers wrote:
>> This adds the desrciption file that describes the hooks for the
>> realtek bluetooth serial devices, as needed to refer to the interface
>> in the device tree.
> Please follow conventions for patch subjects. 'git log --oneline
> --no-merges -- path/to/file' usually gives a good clue. In this case,
> something like:
>
> dt-bindings: net: Add Realtek serial bluetooth binding
>
>> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
>> ---
>>   .../bindings/net/realtek-bluetooth-serial.txt | 28 +++++++++++++++++++
>>   1 file changed, 28 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt b/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
>> new file mode 100644
>> index 000000000000..0aabca1fc002
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
>> @@ -0,0 +1,28 @@
>> +Realtek bluetooth devices connected via a UART
>> +
>> +- compatible: should be "realtek,<name>-bluetooth"
>> +  except for "realtek,trl8761atv" - which only has a serial bluetooth connection
>> +       "realtek,rtl8723as-bluetooth"
>> +       "realtek,rtl8723bs-bluetooth"
>> +       "realtek,rtl8723ds-bluetooth"
>> +       "realtek,rtl8761atv"
>> +       "realtek,rtl8821as-bluetooth"
>> +       "realtek,rtl8821cs-bluetooth"
>> +       "realtek,rtl8822bs-bluetooth"
> Arguably, '-bluetooth' is not necessary as nothing else is attached to
> the serial port. At least shorten it to '-bt'.
>
>> +- These device are bluetooth devices, that connect via a uart
> s/device/devices/
>
>> +- all devices (except for rtl8761atv) are also wifi devices, this is connected
>> +  seperatly via sdio - and is not covered by this compatible node
> Really, this should be up above the property list in a description of
> the device(s).
>
>> +- ideally these will be referenced in a device tree serial node via serdev
> Not ideally, but it is only valid for this to be a child of a UART.
>
> serdev is a kernel thing, and shouldn't be part of the binding doc.
>
>> + http://events17.linuxfoundation.org/sites/events/files/slides/serdev-elce-2017-2.pdf
> Useful, but again, not part of this binding.
>
> There's no interrupts, GPIO control lines, power supplies, etc. for
> these chips? The binding should be complete even if your platform
> doesn't need these.
>
>> +
>> +Example:
>> +
>> +&uart0 {
>> +	status = "okay";
> Don't show status in examples.
>
>> +       	pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
>> +       	bluetooth {
>> +               	  compatible = "realtek,rtl8723bs-bluetooth";
>> +       	};
> Mixed tabs and spaces. Use tabs.
>
>> +};
>> +
>> +this ensures that the bluetooth device is tied to the correct uart
>> -- 
>> beagleboard@davidjohnsummers.uk
>>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv2] Description of the realtek bluetooth device tree hooks
  2019-01-12 15:00     ` David Summers
@ 2019-01-15 19:48       ` Rob Herring
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Herring @ 2019-01-15 19:48 UTC (permalink / raw)
  To: David Summers
  Cc: Mark Rutland, devicetree, Johan Hedberg, Marcel Holtmann,
	open list:BLUETOOTH DRIVERS,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Sat, Jan 12, 2019 at 9:01 AM David Summers
<beagleboard@davidjohnsummers.uk> wrote:
>
> Thanks Rob,
>
> I'll hopefully make those changes this weekend, and resubmit - just so
> next weekend can move onto the device tree.
>
> Oh yes, on the "-bluetooth" or "-bt"; as these devices have both and
> sdio input for wifi, and uart for bluetooth; I guess they will need to
> be listed twice in a device tree, both under uart and sdio. Now as both
> these parts of the device tree will want to specify the driver used, and
> the driver is different for bluetooth and for wifi - doesn't that mean
> we should specify compatible differently? Otherwise how will the kernel
> know which driver to load for wifi and which for bluetooth?
>
> So question is am I missing something here, and this could be simplified?

The compatibles don't really have to be different as the drivers will
only bind based on the bus interface. But keeping a '-bt' suffix is
fine.

>
> On the interrupts, GPIO control lines, power supplies, etc, on the ASUS
> code that I'm basing the patches on (for Tinker Board S) - these bits
> are freestanding in the device tree, and mainly go in with the wifi
> patch (and not bluetooth). I'll put some though into how this is best
> arranged when going mainline. I think if I'm honest, if I wait to get
> all these extras in the documentation, this will only get settled when I
> get the wifi into the device tree - as problem is more natural there.
> This though would delay the bluetooth patch probably a month. I'd prefer
> to get something out there - even if I have to return later to tidy the
> documentation.

At least for all the combo chips to date, the BT and WiFi halves are
pretty much independent. So we can get away with describing them
separately. If there's a shared supply or clock then we can list them
in both nodes and ref counting makes it all work fine. However, if you
had for example, a single firmware image for both BT and WiFi, then
we'd want to represent this as a single device (and driver with child
drivers). So you need to know if there's any issue like this because
that would affect how we do the BT binding.

Rob

>
> Regards, and thanks for the helpful comments.
>
> David.
>
>
> On 11/01/2019 16:34, Rob Herring wrote:
> > On Thu, Jan 03, 2019 at 04:35:37PM +0000, David Summers wrote:
> >> This adds the desrciption file that describes the hooks for the
> >> realtek bluetooth serial devices, as needed to refer to the interface
> >> in the device tree.
> > Please follow conventions for patch subjects. 'git log --oneline
> > --no-merges -- path/to/file' usually gives a good clue. In this case,
> > something like:
> >
> > dt-bindings: net: Add Realtek serial bluetooth binding
> >
> >> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> >> ---
> >>   .../bindings/net/realtek-bluetooth-serial.txt | 28 +++++++++++++++++++
> >>   1 file changed, 28 insertions(+)
> >>   create mode 100644 Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
> >>
> >> diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt b/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
> >> new file mode 100644
> >> index 000000000000..0aabca1fc002
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/net/realtek-bluetooth-serial.txt
> >> @@ -0,0 +1,28 @@
> >> +Realtek bluetooth devices connected via a UART
> >> +
> >> +- compatible: should be "realtek,<name>-bluetooth"
> >> +  except for "realtek,trl8761atv" - which only has a serial bluetooth connection
> >> +       "realtek,rtl8723as-bluetooth"
> >> +       "realtek,rtl8723bs-bluetooth"
> >> +       "realtek,rtl8723ds-bluetooth"
> >> +       "realtek,rtl8761atv"
> >> +       "realtek,rtl8821as-bluetooth"
> >> +       "realtek,rtl8821cs-bluetooth"
> >> +       "realtek,rtl8822bs-bluetooth"
> > Arguably, '-bluetooth' is not necessary as nothing else is attached to
> > the serial port. At least shorten it to '-bt'.
> >
> >> +- These device are bluetooth devices, that connect via a uart
> > s/device/devices/
> >
> >> +- all devices (except for rtl8761atv) are also wifi devices, this is connected
> >> +  seperatly via sdio - and is not covered by this compatible node
> > Really, this should be up above the property list in a description of
> > the device(s).
> >
> >> +- ideally these will be referenced in a device tree serial node via serdev
> > Not ideally, but it is only valid for this to be a child of a UART.
> >
> > serdev is a kernel thing, and shouldn't be part of the binding doc.
> >
> >> + http://events17.linuxfoundation.org/sites/events/files/slides/serdev-elce-2017-2.pdf
> > Useful, but again, not part of this binding.
> >
> > There's no interrupts, GPIO control lines, power supplies, etc. for
> > these chips? The binding should be complete even if your platform
> > doesn't need these.
> >
> >> +
> >> +Example:
> >> +
> >> +&uart0 {
> >> +    status = "okay";
> > Don't show status in examples.
> >
> >> +            pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
> >> +            bluetooth {
> >> +                      compatible = "realtek,rtl8723bs-bluetooth";
> >> +            };
> > Mixed tabs and spaces. Use tabs.
> >
> >> +};
> >> +
> >> +this ensures that the bluetooth device is tied to the correct uart
> >> --
> >> beagleboard@davidjohnsummers.uk
> >>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv2] Patch to add the realtek bluetooth device tree refs to the code
  2019-01-03 16:35   ` [PATCHv2] Patch to add the realtek bluetooth device tree refs to the code David Summers
@ 2019-01-18 10:57     ` Marcel Holtmann
  2019-01-19 13:18       ` beagleboard
  0 siblings, 1 reply; 10+ messages in thread
From: Marcel Holtmann @ 2019-01-18 10:57 UTC (permalink / raw)
  To: David Summers
  Cc: mark.rutland, devicetree, Johan Hedberg, linux-bluetooth,
	Rob Herring, linux-arm-kernel

Hi David,

> This patch adds the necessary device tree hooks to the realtek
> bluetooth driver for serial connections.
> 
> The realtek devices that are listed btrtl.c are searched on the
> realtek web site for the version that have serial connections.
> 
> Most of these devices also have wi-fi connected via sdio, that is not
> covered by the bluetooth driver - but as that interface will also be
> needed in the device tree, the hocks here have "-bluetooth" added. The
> exception to this is the rtl8761atv, which only has a serial
> bluetooth.
> 
> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
> ---
> drivers/bluetooth/hci_h5.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
> index 8eede1197cd2..2fec7ff2ce7c 100644
> --- a/drivers/bluetooth/hci_h5.c
> +++ b/drivers/bluetooth/hci_h5.c
> @@ -925,6 +925,22 @@ static struct h5_vnd rtl_vnd = {
> };
> #endif
> 
> +#ifdef CONFIG_OF
> +static const struct of_device_id h5_of_match[] = {
> +#ifdef CONFIG_BT_HCIUART_RTL
> +       { .compatible = "realtek,rtl8723as-bluetooth"},
> +       { .compatible = "realtek,rtl8723bs-bluetooth"},
> +       { .compatible = "realtek,rtl8723ds-bluetooth"},
> +       { .compatible = "realtek,rtl8761atv"},
> +       { .compatible = "realtek,rtl8821as-bluetooth"},
> +       { .compatible = "realtek,rtl8821cs-bluetooth"},
> +       { .compatible = "realtek,rtl8822bs-bluetooth"},
> +#endif

I really need an Ack from Rob on the naming here.

Regards

Marcel


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCHv2] Patch to add the realtek bluetooth device tree refs to the code
  2019-01-18 10:57     ` Marcel Holtmann
@ 2019-01-19 13:18       ` beagleboard
  0 siblings, 0 replies; 10+ messages in thread
From: beagleboard @ 2019-01-19 13:18 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: mark.rutland, devicetree, Johan Hedberg, linux-bluetooth,
	Rob Herring, linux-arm-kernel

Hi Marcel,

Yes have been having an email conversation with Rob on the device tree 
email list.

he wants minor changes to the naming, which i agree with. So have much 
of a revised patch set read to send in. Just need to check some things.

Hopefully be able to send later this weekend, and it will replace the 
patch below.

Thanks,

David.

On 18/01/2019 10:57, Marcel Holtmann wrote:
> Hi David,
>
>> This patch adds the necessary device tree hooks to the realtek
>> bluetooth driver for serial connections.
>>
>> The realtek devices that are listed btrtl.c are searched on the
>> realtek web site for the version that have serial connections.
>>
>> Most of these devices also have wi-fi connected via sdio, that is not
>> covered by the bluetooth driver - but as that interface will also be
>> needed in the device tree, the hocks here have "-bluetooth" added. The
>> exception to this is the rtl8761atv, which only has a serial
>> bluetooth.
>>
>> Signed-off-by: David Summers <beagleboard@davidjohnsummers.uk>
>> ---
>> drivers/bluetooth/hci_h5.c | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
>>
>> diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
>> index 8eede1197cd2..2fec7ff2ce7c 100644
>> --- a/drivers/bluetooth/hci_h5.c
>> +++ b/drivers/bluetooth/hci_h5.c
>> @@ -925,6 +925,22 @@ static struct h5_vnd rtl_vnd = {
>> };
>> #endif
>>
>> +#ifdef CONFIG_OF
>> +static const struct of_device_id h5_of_match[] = {
>> +#ifdef CONFIG_BT_HCIUART_RTL
>> +       { .compatible = "realtek,rtl8723as-bluetooth"},
>> +       { .compatible = "realtek,rtl8723bs-bluetooth"},
>> +       { .compatible = "realtek,rtl8723ds-bluetooth"},
>> +       { .compatible = "realtek,rtl8761atv"},
>> +       { .compatible = "realtek,rtl8821as-bluetooth"},
>> +       { .compatible = "realtek,rtl8821cs-bluetooth"},
>> +       { .compatible = "realtek,rtl8822bs-bluetooth"},
>> +#endif
> I really need an Ack from Rob on the naming here.
>
> Regards
>
> Marcel
>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29 11:55 [PATCH] bluetooth: realtek: devicetree: Add device tree description to bluetooth rtl drivers David Summers
2018-12-29 16:51 ` David Summers
2018-12-30 10:25 ` Marcel Holtmann
2019-01-03 16:35 ` [PATCHv2] Description of the realtek bluetooth device tree hooks David Summers
2019-01-03 16:35   ` [PATCHv2] Patch to add the realtek bluetooth device tree refs to the code David Summers
2019-01-18 10:57     ` Marcel Holtmann
2019-01-19 13:18       ` beagleboard
2019-01-11 16:34   ` [PATCHv2] Description of the realtek bluetooth device tree hooks Rob Herring
2019-01-12 15:00     ` David Summers
2019-01-15 19:48       ` Rob Herring

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox