* Re: [PATCH v3 1/6] ARM: tegra: add gpiod_lookup table for paz00
[not found] ` <20131128093224.GA26634@ulmo.nvidia.com>
@ 2013-11-28 10:20 ` Marc Dietrich
2013-11-28 11:06 ` Thierry Reding
0 siblings, 1 reply; 4+ messages in thread
From: Marc Dietrich @ 2013-11-28 10:20 UTC (permalink / raw)
To: Thierry Reding
Cc: Alexandre Courbot, Rhyland Klein, Mika Westerberg,
linux-acpi@vger.kernel.org, Rafael J. Wysocki, Linus Walleij,
Chris Ball, Johannes Berg, Adrian Hunter, Alex Courbot,
Mathias Nyman, Rob Landley, Heikki Krogerus, Stephen Warren,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Devicetree List
Am Donnerstag, 28. November 2013, 10:32:41 schrieb Thierry Reding:
> On Thu, Nov 28, 2013 at 10:09:14AM +0100, Marc Dietrich wrote:
> > The real problem with the rfkill driver is that it does not support DT. A
> > naive attempt to convert it was made some year ago, but got rejected
> > because rfkill wasn't seen as isolated device which can be represented in
> > the device- tree. Also it can not be added under some existing device
> > node (e.g. the wifi driver) because those devices sit normally on an
> > "enumeratable" bus (e.g. usb, pci), which is not listed in the device
> > tree at all. This is why it still requires a board file and
> > platform_data. I wish we could find a solution for this.
>
> There is a solution at least for PCI. You can list PCI devices within
> the device tree, which is really handy (required even) if for instance
> one of the PCI devices is an SPI or I2C controller, each providing a bus
> that cannot be probed. What you usually do is describe the PCI hierarchy
> at least up to the controller and then list slaves as child nodes.
>
> I'm not aware of anything similar for USB, but it should certainly be
> possible to come up with a standard binding for the USB bus. It has a
> topology that's similar enough to that of PCI so that the same general
> rules could be applied.
>
> If that's really the only thing that keeps rfkill from gaining DT
> support then it's something worth tackling in my opinion.
it's not so simple I fear. The wifi driver needs to learn about the rfkill
"device". As mentioned above, it's not really a device so the question is what
needs to be added and where? The wifi driver just polls his own gpio lines to
check the status of rfkill. Be we want to modify the "other side", so maybe
this isn't related to the wifi driver at all. It's more a "virtual rfkill
device". No idea if something like this exists already in device tree.
Marc
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/6] ARM: tegra: add gpiod_lookup table for paz00
2013-11-28 10:20 ` [PATCH v3 1/6] ARM: tegra: add gpiod_lookup table for paz00 Marc Dietrich
@ 2013-11-28 11:06 ` Thierry Reding
2013-11-28 12:54 ` Marc Dietrich
0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2013-11-28 11:06 UTC (permalink / raw)
To: Marc Dietrich
Cc: Alexandre Courbot, Rhyland Klein, Mika Westerberg,
linux-acpi@vger.kernel.org, Rafael J. Wysocki, Linus Walleij,
Chris Ball, Johannes Berg, Adrian Hunter, Alex Courbot,
Mathias Nyman, Rob Landley, Heikki Krogerus, Stephen Warren,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Devicetree List
[-- Attachment #1: Type: text/plain, Size: 3497 bytes --]
On Thu, Nov 28, 2013 at 11:20:19AM +0100, Marc Dietrich wrote:
> Am Donnerstag, 28. November 2013, 10:32:41 schrieb Thierry Reding:
> > On Thu, Nov 28, 2013 at 10:09:14AM +0100, Marc Dietrich wrote:
> > > The real problem with the rfkill driver is that it does not support DT. A
> > > naive attempt to convert it was made some year ago, but got rejected
> > > because rfkill wasn't seen as isolated device which can be represented in
> > > the device- tree. Also it can not be added under some existing device
> > > node (e.g. the wifi driver) because those devices sit normally on an
> > > "enumeratable" bus (e.g. usb, pci), which is not listed in the device
> > > tree at all. This is why it still requires a board file and
> > > platform_data. I wish we could find a solution for this.
> >
> > There is a solution at least for PCI. You can list PCI devices within
> > the device tree, which is really handy (required even) if for instance
> > one of the PCI devices is an SPI or I2C controller, each providing a bus
> > that cannot be probed. What you usually do is describe the PCI hierarchy
> > at least up to the controller and then list slaves as child nodes.
> >
> > I'm not aware of anything similar for USB, but it should certainly be
> > possible to come up with a standard binding for the USB bus. It has a
> > topology that's similar enough to that of PCI so that the same general
> > rules could be applied.
> >
> > If that's really the only thing that keeps rfkill from gaining DT
> > support then it's something worth tackling in my opinion.
>
> it's not so simple I fear. The wifi driver needs to learn about the rfkill
> "device".
Why does the WiFi driver need to know about it? You say below that the
WiFi driver polls a separate set of GPIO lines (internal to the WiFi
module I assume?). In that case rfkill is merely a way to export control
of that functionality so that it can be used from some other part of the
kernel or from userspace.
That's very similar to things such as backlight control or fan control.
Still we manage to describe those in DT as well.
> As mentioned above, it's not really a device so the question is what
> needs to be added and where? The wifi driver just polls his own gpio lines to
> check the status of rfkill. Be we want to modify the "other side", so maybe
> this isn't related to the wifi driver at all. It's more a "virtual rfkill
> device". No idea if something like this exists already in device tree.
But it's a part of some other device. Or rather, it's always associated
with another device, right? So I don't see anything particularily wrong
with something like this:
usb-controller {
/* USB hub */
usb@0,0 {
...
/* USB device */
usb@1,0 {
...
rfkill {
shutdown-gpio = <&gpio ...>;
reset-gpio = <&gpio ...>;
};
...
};
...
};
};
You said that the main objection was that it needed to be represented as
a "subdevice" of whatever device it controls. If the only reason is that
we have no means to represent those devices because they are on a bus
that can be enumerated and therefore can't be listed in DT, then my
suggestion is to fix things so that we can describe those devices in DT.
The goal is to get rid of board files, right? board-paz00.c is the only
one left for Tegra, and rfkill is an actual hardware component, so there
is no reason why it can't be described in DT.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/6] ARM: tegra: add gpiod_lookup table for paz00
2013-11-28 11:06 ` Thierry Reding
@ 2013-11-28 12:54 ` Marc Dietrich
2013-11-29 11:03 ` Thierry Reding
0 siblings, 1 reply; 4+ messages in thread
From: Marc Dietrich @ 2013-11-28 12:54 UTC (permalink / raw)
To: Thierry Reding
Cc: Alexandre Courbot, Rhyland Klein, Mika Westerberg,
linux-acpi@vger.kernel.org, Rafael J. Wysocki, Linus Walleij,
Chris Ball, Johannes Berg, Adrian Hunter, Alex Courbot,
Mathias Nyman, Rob Landley, Heikki Krogerus, Stephen Warren,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Devicetree List
Am Donnerstag, 28. November 2013, 12:06:37 schrieb Thierry Reding:
> On Thu, Nov 28, 2013 at 11:20:19AM +0100, Marc Dietrich wrote:
> > Am Donnerstag, 28. November 2013, 10:32:41 schrieb Thierry Reding:
> > > On Thu, Nov 28, 2013 at 10:09:14AM +0100, Marc Dietrich wrote:
> > > > The real problem with the rfkill driver is that it does not support
> > > > DT. A
> > > > naive attempt to convert it was made some year ago, but got rejected
> > > > because rfkill wasn't seen as isolated device which can be represented
> > > > in
> > > > the device- tree. Also it can not be added under some existing device
> > > > node (e.g. the wifi driver) because those devices sit normally on an
> > > > "enumeratable" bus (e.g. usb, pci), which is not listed in the device
> > > > tree at all. This is why it still requires a board file and
> > > > platform_data. I wish we could find a solution for this.
> > >
> > > There is a solution at least for PCI. You can list PCI devices within
> > > the device tree, which is really handy (required even) if for instance
> > > one of the PCI devices is an SPI or I2C controller, each providing a bus
> > > that cannot be probed. What you usually do is describe the PCI hierarchy
> > > at least up to the controller and then list slaves as child nodes.
> > >
> > > I'm not aware of anything similar for USB, but it should certainly be
> > > possible to come up with a standard binding for the USB bus. It has a
> > > topology that's similar enough to that of PCI so that the same general
> > > rules could be applied.
> > >
> > > If that's really the only thing that keeps rfkill from gaining DT
> > > support then it's something worth tackling in my opinion.
> >
> > it's not so simple I fear. The wifi driver needs to learn about the rfkill
> > "device".
>
> Why does the WiFi driver need to know about it? You say below that the
> WiFi driver polls a separate set of GPIO lines (internal to the WiFi
> module I assume?). In that case rfkill is merely a way to export control
> of that functionality so that it can be used from some other part of the
> kernel or from userspace.
You are right. We just need some device to bind this driver to. It doesn't
need to be the wifi driver.
> That's very similar to things such as backlight control or fan control.
> Still we manage to describe those in DT as well.
Yes, rfkill is just an interface for userspace to able to control the gpio.
E.g. backlight of medcom-wide seems to be related to the pwm controller, but
is not a subnode of it. Instead it is a device of its own without parent.
Hence, we may include rfkill in a similar, "free-standing" node. But this
approch was rejected in the past. Maybe this changed now.
> > As mentioned above, it's not really a device so the question is what
> > needs to be added and where? The wifi driver just polls his own gpio lines
> > to check the status of rfkill. Be we want to modify the "other side", so
> > maybe this isn't related to the wifi driver at all. It's more a "virtual
> > rfkill device". No idea if something like this exists already in device
> > tree.
> But it's a part of some other device. Or rather, it's always associated
> with another device, right? So I don't see anything particularily wrong
> with something like this:
>
> usb-controller {
> /* USB hub */
> usb@0,0 {
> ...
>
> /* USB device */
> usb@1,0 {
> ...
>
> rfkill {
> shutdown-gpio = <&gpio ...>;
> reset-gpio = <&gpio ...>;
> };
>
> ...
> };
>
> ...
> };
> };
>
> You said that the main objection was that it needed to be represented as
> a "subdevice" of whatever device it controls. If the only reason is that
> we have no means to represent those devices because they are on a bus
> that can be enumerated and therefore can't be listed in DT, then my
> suggestion is to fix things so that we can describe those devices in DT.
>
> The goal is to get rid of board files, right? board-paz00.c is the only
> one left for Tegra, and rfkill is an actual hardware component, so there
> is no reason why it can't be described in DT.
Thinking a bit more about it, rfkill is neither a hw block nor a function of
the wifi driver, so I guess it cannot be added to the usb controller (or a usb
device).
Anyway, I think this discussion deserves a new mail thread, but I don't have
enough background information to start one. We can bring this topic back when
all turkeys who deserve it, are dead.
Marc
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/6] ARM: tegra: add gpiod_lookup table for paz00
2013-11-28 12:54 ` Marc Dietrich
@ 2013-11-29 11:03 ` Thierry Reding
0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2013-11-29 11:03 UTC (permalink / raw)
To: Marc Dietrich
Cc: Alexandre Courbot, Rhyland Klein, Mika Westerberg,
linux-acpi@vger.kernel.org, Rafael J. Wysocki, Linus Walleij,
Chris Ball, Johannes Berg, Adrian Hunter, Alex Courbot,
Mathias Nyman, Rob Landley, Heikki Krogerus, Stephen Warren,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Devicetree List
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]
On Thu, Nov 28, 2013 at 01:54:10PM +0100, Marc Dietrich wrote:
[...]
> Yes, rfkill is just an interface for userspace to able to control the gpio.
> E.g. backlight of medcom-wide seems to be related to the pwm controller, but
> is not a subnode of it. Instead it is a device of its own without parent.
> Hence, we may include rfkill in a similar, "free-standing" node. But this
> approch was rejected in the past. Maybe this changed now.
Indeed. I think we really do need ways to represent this kind of device.
If we can't then how are we supposed to get rid of board files?
> Thinking a bit more about it, rfkill is neither a hw block nor a function of
> the wifi driver, so I guess it cannot be added to the usb controller (or a usb
> device).
I guess it depends a bit. Some rfkill-type devices may control more than
just WiFi (bluetooth, NFC, ...). If it really only controls WiFi, I
think it would still be reasonable to represent it as a child of the
WiFi device. It is, after all, a mechanism to control the WiFi hardware.
Alternatively I suppose we wouldn't really need to have an explicit
node. The WiFi driver could simply instantiate an rfkill device based on
its own properties.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-11-29 11:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1385460350-17543-1-git-send-email-mika.westerberg@linux.intel.com>
[not found] ` <4501377.Eymj5teNBr@fb07-iapwap2>
[not found] ` <20131128093224.GA26634@ulmo.nvidia.com>
2013-11-28 10:20 ` [PATCH v3 1/6] ARM: tegra: add gpiod_lookup table for paz00 Marc Dietrich
2013-11-28 11:06 ` Thierry Reding
2013-11-28 12:54 ` Marc Dietrich
2013-11-29 11:03 ` Thierry Reding
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).