Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461574 > unrolled thread

[RFC 3/7] dt: bindings: Add nokia-bluetooth

Started bySebastian Reichel <sre@kernel.org>
First post2016-08-13 05:20 +0200
Last post2016-08-17 18:00 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC 3/7] dt: bindings: Add nokia-bluetooth Sebastian Reichel <sre@kernel.org> - 2016-08-13 05:20 +0200
    Re: [RFC 3/7] dt: bindings: Add nokia-bluetooth Rob Herring <robh@kernel.org> - 2016-08-16 16:00 +0200
      Re: [RFC 3/7] dt: bindings: Add nokia-bluetooth Sebastian Reichel <sre@kernel.org> - 2016-08-17 01:30 +0200
        Re: [RFC 3/7] dt: bindings: Add nokia-bluetooth Rob Herring <robh@kernel.org> - 2016-08-17 15:20 +0200
          Re: [RFC 3/7] dt: bindings: Add nokia-bluetooth Pavel Machek <pavel@ucw.cz> - 2016-08-17 18:00 +0200

#1461574 — [RFC 3/7] dt: bindings: Add nokia-bluetooth

FromSebastian Reichel <sre@kernel.org>
Date2016-08-13 05:20 +0200
Subject[RFC 3/7] dt: bindings: Add nokia-bluetooth
Message-ID<s5xEl-2xg-1@gated-at.bofh.it>
---
 .../devicetree/bindings/net/nokia-bluetooth.txt    | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/nokia-bluetooth.txt

diff --git a/Documentation/devicetree/bindings/net/nokia-bluetooth.txt b/Documentation/devicetree/bindings/net/nokia-bluetooth.txt
new file mode 100644
index 000000000000..a0fceabb4cce
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/nokia-bluetooth.txt
@@ -0,0 +1,43 @@
+Nokia bluetooth UART devices
+------
+
+Some vendors have custom versions of their chips, that can be found in Nokia
+devices. These chips are controlled differently, than the non-Nokia version,
+so a different binding is required. All chips listed here implement the Nokia
+H4+ protocol.
+
+Required properties:
+
+  - compatible: should be one of the following:
+	* "nokia,brcm,bcm2048"
+	* "nokia,ti,wl1271-bluetooth"
+  - reset-gpios:		Should specify the gpio for bluetooth reset
+  - host-wakeup-gpios:		Should specify the gpio for host wakeup
+  - bluetooth-wakeup-gpios:	Should specify the gpio for bluetooth wakeup
+  - clock-names:		Should be "sysclk"
+  - clocks:			Should contain a clock phandle for system clock
+
+Example:
+
+/ {
+	/* controlled (enabled/disabled) directly by wl1271 */
+	vctcxo: vctcxo {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <38400000>;
+	};
+};
+
+&uart2 {
+	bluetooth {
+		compatible = "nokia,ti,wl1271-bluetooth";
+
+		reset-gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>; /* 26 */
+		host-wakeup-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* 101 */
+		bluetooth-wakeup-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; /* 37 */
+
+		clocks = <&vctcxo>;
+		clock-names = "sysclk";
+	};
+
+};
-- 
2.8.1

[toc] | [next] | [standalone]


#1463830

FromRob Herring <robh@kernel.org>
Date2016-08-16 16:00 +0200
Message-ID<s6N4m-3Ny-27@gated-at.bofh.it>
In reply to#1461574
On Sat, Aug 13, 2016 at 05:14:34AM +0200, Sebastian Reichel wrote:
> ---
>  .../devicetree/bindings/net/nokia-bluetooth.txt    | 43 ++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/nokia-bluetooth.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/nokia-bluetooth.txt b/Documentation/devicetree/bindings/net/nokia-bluetooth.txt
> new file mode 100644
> index 000000000000..a0fceabb4cce
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/nokia-bluetooth.txt
> @@ -0,0 +1,43 @@
> +Nokia bluetooth UART devices
> +------
> +
> +Some vendors have custom versions of their chips, that can be found in Nokia
> +devices. These chips are controlled differently, than the non-Nokia version,
> +so a different binding is required. All chips listed here implement the Nokia
> +H4+ protocol.
> +
> +Required properties:
> +
> +  - compatible: should be one of the following:
> +	* "nokia,brcm,bcm2048"
> +	* "nokia,ti,wl1271-bluetooth"

Perhaps these should be 2 separate strings. Something like 
'"nokia,n900-bt", "brcm,bcm2048"'. However, if they are in no way 
compatible with the default version from the vendors, then just a single 
string is fine, but it doesn't need to be aligned to the vendor 
compatible string. So just "nokia,n900-bcm2048" or similar is fine.

> +  - reset-gpios:		Should specify the gpio for bluetooth reset
> +  - host-wakeup-gpios:		Should specify the gpio for host wakeup

Should be interrupt instead?

> +  - bluetooth-wakeup-gpios:	Should specify the gpio for bluetooth wakeup

State direction and active state for gpios.

> +  - clock-names:		Should be "sysclk"
> +  - clocks:			Should contain a clock phandle for system clock
> +
> +Example:
> +
> +/ {
> +	/* controlled (enabled/disabled) directly by wl1271 */
> +	vctcxo: vctcxo {
> +		compatible = "fixed-clock";
> +		#clock-cells = <0>;
> +		clock-frequency = <38400000>;
> +	};
> +};
> +
> +&uart2 {

I want to see a common serial device binding doc before accepting any 
device bindings. It's not going to say much initially other than devices 
are child nodes of uarts. Perhaps something on baudrate settings.

> +	bluetooth {
> +		compatible = "nokia,ti,wl1271-bluetooth";
> +
> +		reset-gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>; /* 26 */
> +		host-wakeup-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* 101 */
> +		bluetooth-wakeup-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; /* 37 */
> +
> +		clocks = <&vctcxo>;
> +		clock-names = "sysclk";
> +	};
> +
> +};
> -- 
> 2.8.1
> 

[toc] | [prev] | [next] | [standalone]


#1464236

FromSebastian Reichel <sre@kernel.org>
Date2016-08-17 01:30 +0200
Message-ID<s6VXY-19x-7@gated-at.bofh.it>
In reply to#1463830

[Multipart message — attachments visible in raw view] — view raw

Hi Rob,

On Tue, Aug 16, 2016 at 08:51:55AM -0500, Rob Herring wrote:
> On Sat, Aug 13, 2016 at 05:14:34AM +0200, Sebastian Reichel wrote:
> > ---
> >  .../devicetree/bindings/net/nokia-bluetooth.txt    | 43 ++++++++++++++++++++++
> >  1 file changed, 43 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/net/nokia-bluetooth.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/net/nokia-bluetooth.txt b/Documentation/devicetree/bindings/net/nokia-bluetooth.txt
> > new file mode 100644
> > index 000000000000..a0fceabb4cce
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/nokia-bluetooth.txt
> > @@ -0,0 +1,43 @@
> > +Nokia bluetooth UART devices
> > +------
> > +
> > +Some vendors have custom versions of their chips, that can be found in Nokia
> > +devices. These chips are controlled differently, than the non-Nokia version,
> > +so a different binding is required. All chips listed here implement the Nokia
> > +H4+ protocol.
> > +
> > +Required properties:
> > +
> > +  - compatible: should be one of the following:
> > +	* "nokia,brcm,bcm2048"
> > +	* "nokia,ti,wl1271-bluetooth"
> 
> Perhaps these should be 2 separate strings. Something like 
> '"nokia,n900-bt", "brcm,bcm2048"'. However, if they are in no way 
> compatible with the default version from the vendors, then just a single 
> string is fine, but it doesn't need to be aligned to the vendor 
> compatible string. So just "nokia,n900-bcm2048" or similar is fine.

The default bcm2048 variant uses different initialization process
and does not use word alignment as far as I know. I think having
"brcm,bcm2048" in the compatible string is wrong.

I guess "brcm,bcm2048-nokia" would also be an option, since the
chip has been built buy broadcom, but it has a custom Nokia
interface.

> > +  - reset-gpios:		Should specify the gpio for bluetooth reset
> > +  - host-wakeup-gpios:		Should specify the gpio for host wakeup
> 
> Should be interrupt instead?

Yes this is mostly an interrupt, but I need to read the current
line state.

> > +  - bluetooth-wakeup-gpios:	Should specify the gpio for bluetooth wakeup
> 
> State direction and active state for gpios.

ok.

> > +  - clock-names:		Should be "sysclk"
> > +  - clocks:			Should contain a clock phandle for system clock
> > +
> > +Example:
> > +
> > +/ {
> > +	/* controlled (enabled/disabled) directly by wl1271 */
> > +	vctcxo: vctcxo {
> > +		compatible = "fixed-clock";
> > +		#clock-cells = <0>;
> > +		clock-frequency = <38400000>;
> > +	};
> > +};
> > +
> > +&uart2 {
> 
> I want to see a common serial device binding doc before accepting any 
> device bindings. It's not going to say much initially other than devices 
> are child nodes of uarts. Perhaps something on baudrate settings.

Neil added a short sentence about this in "[RFC 2/7] tty: add
support for "tty slave" devices". I just took the unmodified patch
from Neil (*), so it's not in its own patch.

> > +	bluetooth {
> > +		compatible = "nokia,ti,wl1271-bluetooth";
> > +
> > +		reset-gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>; /* 26 */
> > +		host-wakeup-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* 101 */
> > +		bluetooth-wakeup-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; /* 37 */
> > +
> > +		clocks = <&vctcxo>;
> > +		clock-names = "sysclk";
> > +	};
> > +
> > +};

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1464574

FromRob Herring <robh@kernel.org>
Date2016-08-17 15:20 +0200
Message-ID<s78Vb-1vG-17@gated-at.bofh.it>
In reply to#1464236
On Tue, Aug 16, 2016 at 6:28 PM, Sebastian Reichel <sre@kernel.org> wrote:
> Hi Rob,
>
> On Tue, Aug 16, 2016 at 08:51:55AM -0500, Rob Herring wrote:
>> On Sat, Aug 13, 2016 at 05:14:34AM +0200, Sebastian Reichel wrote:
>> > ---
>> >  .../devicetree/bindings/net/nokia-bluetooth.txt    | 43 ++++++++++++++++++++++
>> >  1 file changed, 43 insertions(+)
>> >  create mode 100644 Documentation/devicetree/bindings/net/nokia-bluetooth.txt
>> >
>> > diff --git a/Documentation/devicetree/bindings/net/nokia-bluetooth.txt b/Documentation/devicetree/bindings/net/nokia-bluetooth.txt
>> > new file mode 100644
>> > index 000000000000..a0fceabb4cce
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/net/nokia-bluetooth.txt
>> > @@ -0,0 +1,43 @@
>> > +Nokia bluetooth UART devices
>> > +------
>> > +
>> > +Some vendors have custom versions of their chips, that can be found in Nokia
>> > +devices. These chips are controlled differently, than the non-Nokia version,
>> > +so a different binding is required. All chips listed here implement the Nokia
>> > +H4+ protocol.
>> > +
>> > +Required properties:
>> > +
>> > +  - compatible: should be one of the following:
>> > +   * "nokia,brcm,bcm2048"
>> > +   * "nokia,ti,wl1271-bluetooth"
>>
>> Perhaps these should be 2 separate strings. Something like
>> '"nokia,n900-bt", "brcm,bcm2048"'. However, if they are in no way
>> compatible with the default version from the vendors, then just a single
>> string is fine, but it doesn't need to be aligned to the vendor
>> compatible string. So just "nokia,n900-bcm2048" or similar is fine.
>
> The default bcm2048 variant uses different initialization process
> and does not use word alignment as far as I know. I think having
> "brcm,bcm2048" in the compatible string is wrong.

Okay.

> I guess "brcm,bcm2048-nokia" would also be an option, since the
> chip has been built buy broadcom, but it has a custom Nokia
> interface.

That would be okay. Though, in theory Nokia could have different
products with bcm2048 all with different versions.

I was going with defining it as a board level compatible string. Even
if chips are the same, s/w can need to know board level differences so
using the board vendor and name are common.

>> > +  - reset-gpios:           Should specify the gpio for bluetooth reset
>> > +  - host-wakeup-gpios:             Should specify the gpio for host wakeup
>>
>> Should be interrupt instead?
>
> Yes this is mostly an interrupt, but I need to read the current
> line state.

When? If the interrupt is level triggered, then you can get the line
state based on whether you get an interrupt or not. If this needs to
be a wakeup source (see the wakeup source binding), then it needs to
be an interrupt.

Reading the line state is a common problem. It would be nice if the
irq API provided a function to read the line state though that is not
always possible.

>
>> > +  - bluetooth-wakeup-gpios:        Should specify the gpio for bluetooth wakeup
>>
>> State direction and active state for gpios.
>
> ok.
>
>> > +  - clock-names:           Should be "sysclk"
>> > +  - clocks:                        Should contain a clock phandle for system clock
>> > +
>> > +Example:
>> > +
>> > +/ {
>> > +   /* controlled (enabled/disabled) directly by wl1271 */
>> > +   vctcxo: vctcxo {
>> > +           compatible = "fixed-clock";
>> > +           #clock-cells = <0>;
>> > +           clock-frequency = <38400000>;
>> > +   };
>> > +};
>> > +
>> > +&uart2 {
>>
>> I want to see a common serial device binding doc before accepting any
>> device bindings. It's not going to say much initially other than devices
>> are child nodes of uarts. Perhaps something on baudrate settings.
>
> Neil added a short sentence about this in "[RFC 2/7] tty: add
> support for "tty slave" devices". I just took the unmodified patch
> from Neil (*), so it's not in its own patch.

But that is in the 8250 binding. It needs to be a common binding.

Rob

[toc] | [prev] | [next] | [standalone]


#1464636

FromPavel Machek <pavel@ucw.cz>
Date2016-08-17 18:00 +0200
Message-ID<s7bq2-32y-15@gated-at.bofh.it>
In reply to#1464574
Hi!

> >> > +  - reset-gpios:           Should specify the gpio for bluetooth reset
> >> > +  - host-wakeup-gpios:             Should specify the gpio for host wakeup
> >>
> >> Should be interrupt instead?
> >
> > Yes this is mostly an interrupt, but I need to read the current
> > line state.
> 
> When? If the interrupt is level triggered, then you can get the line
> state based on whether you get an interrupt or not. If this needs to
> be a wakeup source (see the wakeup source binding), then it needs to
> be an interrupt.

What is wrong with GPIO? It is simply a piece of wire. Yes, we'll
configure it to generate an interrupt, or maybe not, but that's
software detail, the device tree just should not care....
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web