* Re: Re: [PATCH 2/3] dt: rfkill-gpio: add bindings documentation [not found] ` <CAOesGMhXZLRHw+TSVqHZFQcYLeu995EKaG_hNFRkgOnPFdmq6g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2012-02-06 10:16 ` Marc Dietrich 0 siblings, 0 replies; 2+ messages in thread From: Marc Dietrich @ 2012-02-06 10:16 UTC (permalink / raw) To: Olof Johansson Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren, Colin Cross, linux-wireless-u79uwXL29TY76Z2rM5mHXA, John W. Linville, Johannes Berg, Rhyland Klein, Grant Likely, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ Hi Olof, Am Sonntag, 5. Februar 2012, 14:00:25 schrieb Olof Johansson: > Hi, > > On Sun, Feb 5, 2012 at 9:18 AM, Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> wrote: > > Add device tree bindings information for rfkill gpio switches. > > > > Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > Cc: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> > > Cc: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> > > Cc: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > > Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> > > Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> > > Please cc devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org on device tree bindings; > not everyone monitors the linux mailing lists. done. > > diff --git a/Documentation/devicetree/bindings/gpio/rfkill.txt > > b/Documentation/devicetree/bindings/gpio/rfkill.txt new file mode 100644 > > index 0000000..22bf22a > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/gpio/rfkill.txt > > @@ -0,0 +1,38 @@ > > +RFKILL switches connected to GPIO lines > > + > > +Required properties: > > +- compatible : should be "rfkill-gpio". > > + > > +Each rfkill switch is represented as a sub-node of the rfkill-gpio device. > > +Each node has a label property which represents the name of the corresponding > > +rfkill device. > > + > > +RFKILL sub-node properties: > > +- label : (optional) The label for this rfkill switch. If omitted, the label > > is + taken from the node name (excluding the unit address). > > +- reset-gpio, shutdown-gpio : Should specify the rfkill gpios for reset and > > + shutdown (see "Specifying GPIO information for devices" in > > + Documentation/devicetree/booting-without-of.txt). > > +- type : enumerated type of the gpio (see include/linux/rfkill.h). > > +- clock : (optional) name of the clock name associated with the rfkill switch > > + (see include/linux/rfkill-gpio.h) > > Sorry, but this is going about things the wrong way. > > A device tree binding is meant to describe hardware. For example, the > type and clock properties are clearly linux specifics that shouldn't > be expressed that way in the device tree. > > instead, think about what you actually need to provide for a driver to > do its work. Does the wifi device have a gpio to control power (and > one for providing reset outside of the standard interface)? Well, then > that should probably be defined in the node that describes the device > -- i.e. under the sdhci node in question here. well, that doesn't work in case of paz00 because nearly all devices (including wifi) are connected via usb. Only the rfkill switch is controlled via the gpios. > That doesn't fit the rfkill device/driver model perfectly, since it > doesn't have something to bind against, so the rfkill platform device > needs to be instantiated from somewhere else. It's possible that best > match is to have the wifi driver handle it, which should be OK, I > think? You are right, but in case of usb devices which are not instantiated via device tree there is no parent. It doesn't make much sense for me to put it under the usb controller because it is independent to it. One may argue that the rfkill switch is a separate device, which is controlled via gpio lines. The wifi driver itself has no way to modify the gpios itself, it can only read out its status. I'm a bit lost here, maybe you have a better solution. Thanks Marc ^ permalink raw reply [flat|nested] 2+ messages in thread
[parent not found: <1ec0e63a7453072689618430ebc2bdd7b62542a2.1329073559.git.marvin24@gmx.de>]
* Re: [PATCH 2/3] dt: rfkill-gpio: add bindings documentation @ 2012-02-13 13:47 ` Rob Herring 2012-02-13 19:43 ` Olof Johansson 0 siblings, 1 reply; 2+ messages in thread From: Rob Herring @ 2012-02-13 13:47 UTC (permalink / raw) To: Simon Glass Cc: Marc Dietrich, linux-wireless-u79uwXL29TY76Z2rM5mHXA, John W. Linville, Colin Cross, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Johannes Berg, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ On 02/12/2012 02:21 PM, Simon Glass wrote: > Hi Marc, > > On Sun, Feb 12, 2012 at 11:13 AM, Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> wrote: >> Add device tree bindings information for rfkill gpio switches. >> >> Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> Cc: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> >> Cc: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> >> Cc: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> >> Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> >> Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org >> Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> >> --- >> Documentation/devicetree/bindings/gpio/rfkill.txt | 38 +++++++++++++++++++++ >> 1 files changed, 38 insertions(+), 0 deletions(-) >> create mode 100644 Documentation/devicetree/bindings/gpio/rfkill.txt >> >> diff --git a/Documentation/devicetree/bindings/gpio/rfkill.txt b/Documentation/devicetree/bindings/gpio/rfkill.txt >> new file mode 100644 >> index 0000000..22bf22a >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/gpio/rfkill.txt >> @@ -0,0 +1,38 @@ >> +RFKILL switches connected to GPIO lines >> + >> +Required properties: >> +- compatible : should be "rfkill-gpio". >> + >> +Each rfkill switch is represented as a sub-node of the rfkill-gpio device. >> +Each node has a label property which represents the name of the corresponding >> +rfkill device. >> + >> +RFKILL sub-node properties: >> +- label : (optional) The label for this rfkill switch. If omitted, the label is >> + taken from the node name (excluding the unit address). >> +- reset-gpio, shutdown-gpio : Should specify the rfkill gpios for reset and >> + shutdown (see "Specifying GPIO information for devices" in > > Should that be reset-gpios, shutdown-gpios? Even though you have only > one it seems that people put an 's' on the end. > >> + Documentation/devicetree/booting-without-of.txt). >> +- type : enumerated type of the gpio (see include/linux/rfkill.h). > > It would be better I think if this were explicit here. If you have a > number, then what values does it take and what do they mean? > >> +- clock : (optional) name of the clock name associated with the rfkill switch > > Can this be a phandle instead of a string? > This seems to be in the wrong place altogether. The gpio controller would have a clock, not particular gpio line. >> + (see include/linux/rfkill-gpio.h) > > IMO device tree bindings should be fully documented in this file, > rather than needing to look at a separate header. This is particularly > true if the binding is used in another project. > Correct. A binding should not be Linux specific. It should describe the h/w. >> + >> +Examples: >> + >> +rfkill-switches { >> + compatible = "rfkill-gpio"; >> + >> + wifi { >> + label = "wifi"; >> + reset-gpio = <&gpio 25 0>; /* Active high */ >> + shutdown-gpio = <&gpio 85 0>; /* Active high */ >> + type = <1>; >> + }; >> + >> + bt { >> + label = "bluetooth"; >> + reset-gpio = <&gpio 17 0>; /* Active high */ >> + shutdown-gpio = <&gpio 35 0>; /* Active high */ >> + type = <1>; >> + }; Why wouldn't the gpio lines just be part of the bt and wifi device nodes themselves? The DT is supposed to describe h/w connections. Rob >> +}; >> -- >> 1.7.5.4 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in >> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > Regards, > Simon > _______________________________________________ > devicetree-discuss mailing list > devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org > https://lists.ozlabs.org/listinfo/devicetree-discuss ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2/3] dt: rfkill-gpio: add bindings documentation @ 2012-02-13 19:43 ` Olof Johansson [not found] ` <CAOesGMjofzC9pp1H9SXS693QR7JU9XjvVLVi6gBSGuqVNJ-rKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 2+ messages in thread From: Olof Johansson @ 2012-02-13 19:43 UTC (permalink / raw) To: Rob Herring Cc: Simon Glass, Marc Dietrich, linux-wireless-u79uwXL29TY76Z2rM5mHXA, John W. Linville, Colin Cross, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Johannes Berg, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ Hi, On Mon, Feb 13, 2012 at 5:47 AM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > On 02/12/2012 02:21 PM, Simon Glass wrote: >> Hi Marc, >> >> On Sun, Feb 12, 2012 at 11:13 AM, Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> wrote: >>> Add device tree bindings information for rfkill gpio switches. >>> >>> Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >>> Cc: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> >>> Cc: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> >>> Cc: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> >>> Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> >>> Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org >>> Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> >>> --- >>> Documentation/devicetree/bindings/gpio/rfkill.txt | 38 +++++++++++++++++++++ >>> 1 files changed, 38 insertions(+), 0 deletions(-) >>> create mode 100644 Documentation/devicetree/bindings/gpio/rfkill.txt >>> >>> diff --git a/Documentation/devicetree/bindings/gpio/rfkill.txt b/Documentation/devicetree/bindings/gpio/rfkill.txt >>> new file mode 100644 >>> index 0000000..22bf22a >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/gpio/rfkill.txt >>> @@ -0,0 +1,38 @@ >>> +RFKILL switches connected to GPIO lines >>> + >>> +Required properties: >>> +- compatible : should be "rfkill-gpio". >>> + >>> +Each rfkill switch is represented as a sub-node of the rfkill-gpio device. >>> +Each node has a label property which represents the name of the corresponding >>> +rfkill device. >>> + >>> +RFKILL sub-node properties: >>> +- label : (optional) The label for this rfkill switch. If omitted, the label is >>> + taken from the node name (excluding the unit address). >>> +- reset-gpio, shutdown-gpio : Should specify the rfkill gpios for reset and >>> + shutdown (see "Specifying GPIO information for devices" in >> >> Should that be reset-gpios, shutdown-gpios? Even though you have only >> one it seems that people put an 's' on the end. Agreed. >> >>> + Documentation/devicetree/booting-without-of.txt). >>> +- type : enumerated type of the gpio (see include/linux/rfkill.h). >> >> It would be better I think if this were explicit here. If you have a >> number, then what values does it take and what do they mean? This should most likely be moved to a set of properties instad of an enumerated type, I agree. And/or use a string to encode the type simiar to how powerpc does some of the USB interfaces. >>> +- clock : (optional) name of the clock name associated with the rfkill switch >> >> Can this be a phandle instead of a string? > > This seems to be in the wrong place altogether. The gpio controller > would have a clock, not particular gpio line. And either way, this should conform to the standard clock binding, not use something locally hacked up. >>> + (see include/linux/rfkill-gpio.h) >> >> IMO device tree bindings should be fully documented in this file, >> rather than needing to look at a separate header. This is particularly >> true if the binding is used in another project. >> > > Correct. A binding should not be Linux specific. It should describe the h/w. > >>> + >>> +Examples: >>> + >>> +rfkill-switches { >>> + compatible = "rfkill-gpio"; >>> + >>> + wifi { >>> + label = "wifi"; >>> + reset-gpio = <&gpio 25 0>; /* Active high */ >>> + shutdown-gpio = <&gpio 85 0>; /* Active high */ >>> + type = <1>; >>> + }; >>> + >>> + bt { >>> + label = "bluetooth"; >>> + reset-gpio = <&gpio 17 0>; /* Active high */ >>> + shutdown-gpio = <&gpio 35 0>; /* Active high */ >>> + type = <1>; >>> + }; > > Why wouldn't the gpio lines just be part of the bt and wifi device nodes > themselves? The DT is supposed to describe h/w connections. The thing is, that "rfkill" isn't a _device_, and Marc is trying to describe it as one. It's really just a software abstraction of a collection of power supplies and/or GPIO lines that are used to power up/down specific peripherals. I know that the USB modem, for example, is probed through autoprobing the USB bus. So there's no device to associate it with, per se. But the USB slot that the modem is connected to, which is also the connector that the GPIO controls the power supplies and reset line to, are connected directly to one of the USB host controllers, right? So maybe describing it there is a better option. That still leaves the issue of actually having something to bind it against. As I already said, rfkill isn't a device, so crafting one just because linux wants one is the wrong way to go about. Maybe using /chosen to refer to the device nodes for the GPIO lines under USB instead, and have rfkill look for those and create a device if they're found is a better way to go about it. -Olof ^ permalink raw reply [flat|nested] 2+ messages in thread
[parent not found: <CAOesGMjofzC9pp1H9SXS693QR7JU9XjvVLVi6gBSGuqVNJ-rKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: Re: [PATCH 2/3] dt: rfkill-gpio: add bindings documentation [not found] ` <CAOesGMjofzC9pp1H9SXS693QR7JU9XjvVLVi6gBSGuqVNJ-rKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2012-02-16 10:29 ` Marc Dietrich 0 siblings, 0 replies; 2+ messages in thread From: Marc Dietrich @ 2012-02-16 10:29 UTC (permalink / raw) To: Olof Johansson Cc: Rob Herring, Simon Glass, linux-wireless-u79uwXL29TY76Z2rM5mHXA, John W. Linville, Colin Cross, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Johannes Berg, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ Am Montag, 13. Februar 2012, 11:43:17 schrieb Olof Johansson: > Hi, > > On Mon, Feb 13, 2012 at 5:47 AM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 02/12/2012 02:21 PM, Simon Glass wrote: > >> Hi Marc, > >> > >> On Sun, Feb 12, 2012 at 11:13 AM, Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> wrote: > >>> Add device tree bindings information for rfkill gpio switches. > >>> > >>> Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > >>> Cc: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org> > >>> Cc: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> > >>> Cc: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > >>> Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> > >>> Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org > >>> Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> > >>> --- > >>> Documentation/devicetree/bindings/gpio/rfkill.txt | 38 > >>> +++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) > >>> create mode 100644 Documentation/devicetree/bindings/gpio/rfkill.txt > >>> > >>> diff --git a/Documentation/devicetree/bindings/gpio/rfkill.txt > >>> b/Documentation/devicetree/bindings/gpio/rfkill.txt new file mode 100644 > >>> index 0000000..22bf22a > >>> --- /dev/null > >>> +++ b/Documentation/devicetree/bindings/gpio/rfkill.txt > >>> @@ -0,0 +1,38 @@ > >>> +RFKILL switches connected to GPIO lines > >>> + > >>> +Required properties: > >>> +- compatible : should be "rfkill-gpio". > >>> + > >>> +Each rfkill switch is represented as a sub-node of the rfkill-gpio device. > >>> +Each node has a label property which represents the name of the > >>> corresponding > >>> +rfkill device. > >>> + > >>> +RFKILL sub-node properties: > >>> +- label : (optional) The label for this rfkill switch. If omitted, the > >>> label is + taken from the node name (excluding the unit address). > >>> +- reset-gpio, shutdown-gpio : Should specify the rfkill gpios for reset > >>> and > >>> + shutdown (see "Specifying GPIO information for devices" in > >> > >> Should that be reset-gpios, shutdown-gpios? Even though you have only > >> one it seems that people put an 's' on the end. > > Agreed. > > >>> + Documentation/devicetree/booting-without-of.txt). > >>> +- type : enumerated type of the gpio (see include/linux/rfkill.h). > >> > >> It would be better I think if this were explicit here. If you have a > >> number, then what values does it take and what do they mean? > > This should most likely be moved to a set of properties instad of an > enumerated type, I agree. And/or use a string to encode the type > simiar to how powerpc does some of the USB interfaces. > > >>> +- clock : (optional) name of the clock name associated with the rfkill > >>> switch > >> > >> Can this be a phandle instead of a string? > > > > This seems to be in the wrong place altogether. The gpio controller > > would have a clock, not particular gpio line. > > And either way, this should conform to the standard clock binding, not > use something locally hacked up. > > >>> + (see include/linux/rfkill-gpio.h) > >> > >> IMO device tree bindings should be fully documented in this file, > >> rather than needing to look at a separate header. This is particularly > >> true if the binding is used in another project. > > > > Correct. A binding should not be Linux specific. It should describe the h/w. > > > >>> + > >>> +Examples: > >>> + > >>> +rfkill-switches { > >>> + compatible = "rfkill-gpio"; > >>> + > >>> + wifi { > >>> + label = "wifi"; > >>> + reset-gpio = <&gpio 25 0>; /* Active high */ > >>> + shutdown-gpio = <&gpio 85 0>; /* Active high */ > >>> + type = <1>; > >>> + }; > >>> + > >>> + bt { > >>> + label = "bluetooth"; > >>> + reset-gpio = <&gpio 17 0>; /* Active high */ > >>> + shutdown-gpio = <&gpio 35 0>; /* Active high */ > >>> + type = <1>; > >>> + }; > > > > Why wouldn't the gpio lines just be part of the bt and wifi device nodes > > themselves? The DT is supposed to describe h/w connections. > > The thing is, that "rfkill" isn't a _device_, and Marc is trying to > describe it as one. It's really just a software abstraction of a > collection of power supplies and/or GPIO lines that are used to power > up/down specific peripherals. > > I know that the USB modem, for example, is probed through autoprobing > the USB bus. So there's no device to associate it with, per se. But > the USB slot that the modem is connected to, which is also the > connector that the GPIO controls the power supplies and reset line to, > are connected directly to one of the USB host controllers, right? So > maybe describing it there is a better option. > > That still leaves the issue of actually having something to bind it > against. As I already said, rfkill isn't a device, so crafting one > just because linux wants one is the wrong way to go about. Maybe using > /chosen to refer to the device nodes for the GPIO lines under USB > instead, and have rfkill look for those and create a device if they're > found is a better way to go about it. So to move forward, what about a "fake" device like this? usb@c5000000 { wifi-card@1 { /* 1nd port on usb bus 1 */ compatible = "rfkill-gpio"; wifi { label = "internal wifi"; reset-gpios = <&gpio 25 0>; /* Active high */ shutdown-gpios = <&gpio 85 0>; /* Active high */ type = "wlan"; clocks = <&tegra-car 17>; }; }; bt-card@2 { /* 2rd port on usb bus 1 */ compatible = "rfkill-gpio"; bt { label = "internal bluetooth"; reset-gpios = <&gpio 17 0>; /* Active high */ shutdown-gpios = <&gpio 35 0>; /* Active high */ type = "bluetooth"; }; }; }; I hope this won't confuse the usb controller. Marc ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-16 10:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <215249735783e9fe35db1c594d901f591725de50.1328461986.git.marvin24@gmx.de>
[not found] ` <a2291f385edf9692f4a946fd78a7ee7cca29e3b4.1328461986.git.marvin24@gmx.de>
[not found] ` <CAOesGMhXZLRHw+TSVqHZFQcYLeu995EKaG_hNFRkgOnPFdmq6g@mail.gmail.com>
[not found] ` <CAOesGMhXZLRHw+TSVqHZFQcYLeu995EKaG_hNFRkgOnPFdmq6g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 10:16 ` Re: [PATCH 2/3] dt: rfkill-gpio: add bindings documentation Marc Dietrich
[not found] <1ec0e63a7453072689618430ebc2bdd7b62542a2.1329073559.git.marvin24@gmx.de>
2012-02-13 13:47 ` Rob Herring
2012-02-13 19:43 ` Olof Johansson
[not found] ` <CAOesGMjofzC9pp1H9SXS693QR7JU9XjvVLVi6gBSGuqVNJ-rKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-16 10:29 ` Marc Dietrich
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox