From: Stephen Warren <swarren@wwwdotorg.org>
To: Wei Ni <wni@nvidia.com>
Cc: Stephen Warren <swarren@nvidia.com>,
"'linux-wireless@vger.kernel.org'"
<linux-wireless@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"'linux-mmc@vger.kernel.org'" <linux-mmc@vger.kernel.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Mursalin Akon <makon@nvidia.com>,
Rakesh Kumar <krakesh@nvidia.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Olof Johansson <olof@lixom.net>
Subject: Re: Where to power on the wifi device before loading the driver.
Date: Wed, 13 Jun 2012 15:17:06 -0600 [thread overview]
Message-ID: <4FD90352.9090606@wwwdotorg.org> (raw)
In-Reply-To: <6B4D417B830BC44B8026029FD256F7F1C377BFFE88@HKMAIL01.nvidia.com>
On 06/13/2012 04:40 AM, Wei Ni wrote:
> Hi, all
> I'm working on the tegra30 wifi upstream issue.
>
> The tegra30 board (Cardhu) use Broadcom 4329 as wifi device, and use brcmfmac as the wifi driver.
>
> In the brcmfmac init routine, it call sdio_register_driver() to register driver, if the wifi device is powered on, then the mmc driver will enumerate it, and call the probe callback routine.
>
> On the Cardhu, the wifi's power is controlled by two gpios (power-gpio and reset-gpio), the default state is power-off. So we need to power on it before calling sdio_register_driver(), if not, the mmc driver can't enumerate it, and will not call the probe routine.
> This power on sequence is:
> set power-gpio to 1 ;
> mdelay(100) ;
> set reset-gpio to 1 ;
> mdelay(200);
>
> My question is where to power on the wifi. We may have three places to power on it:
> 1. power on it in the brcmfmac driver before calling sdio_register_driver(). But I think this power sequence is special for tegra30 cardhu, it's not good to add it in the generic wifi driver, because different board may use the different way to power on the wifi.
> 2. power on it in the mmc driver. In our tegra SD driver, it has power-gpios property, which allow the slot to be powered. But this power is for mmc slot, could we add this wifi power sequence in the tegra SD driver?
> 3. hard-coded into DT. Set these gpios in the DT, something like pinmux settings, but in this way, it's not good to put the mdelay() value in the DT.
>
> I have no good idea for it, does anyone has suggestion?
The core of the issue is that:
* Tegra30 support is via device tree.
* We have an SDIO bus, and the WiFi device attached to that bus is
enumerable.
* Since the WiFi device is enumerable, no node exists in the DT to
represent it.
* However, the driver for the WiFi device needs certain information,
such as the reset GPIO ID and perhaps power GPIO.
For the power GPIO, it seems reasonable to either use the existing Tegra
SD controller's power-gpios DT property, or replace that property with a
real regulator binding. The SD driver would then control this. Still,
that approach would mean the WiFi driver wouldn't be able to control
power to the device directly, which might not be a good thing.
However, I'm not sure that the reset GPIO is also something that should
be controlled by the SD card driver; it seems like it's much more
closely related to the WiFi device/driver.
I wonder if the power and reset GPIO shouldn't be represented as a
combined custom regulator type, which knows how to sequence multiple GPIOs.
Perhaps SDIO "client" devices also need a way to communicate with their
"host port" to obtain services such as power and reset control?
This is all very similar to the WiFi rfkill discussion we have re: the
Toshiba AC100 a little while back, although that was USB rather than SDIO.
next prev parent reply other threads:[~2012-06-13 21:17 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 10:40 Where to power on the wifi device before loading the driver Wei Ni
[not found] ` <6B4D417B830BC44B8026029FD256F7F1C377BFFE88-Q4EWCATADntDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-06-13 17:33 ` Franky Lin
2012-06-14 4:17 ` Wei Ni
2012-06-14 16:45 ` Franky Lin
2012-06-13 21:17 ` Stephen Warren [this message]
2012-06-14 6:31 ` Thierry Reding
[not found] ` <20120614063120.GA20167-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-06-14 12:12 ` Mark Brown
[not found] ` <20120614121234.GC3913-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-06-14 15:54 ` Stephen Warren
2012-06-15 6:09 ` Wei Ni
2012-06-15 15:49 ` Stephen Warren
[not found] ` <4FDB5976.20809-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-06-18 6:20 ` Wei Ni
2012-06-18 7:40 ` Rakesh Kumar
[not found] ` <96C9D994977DD0439FB6D3FE3B13DD907DE14CB4DF-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-06-18 8:03 ` Laxman Dewangan
[not found] ` <96C9D994977DD0439FB6D3FE3B13DD907DE14CB4E8-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-06-18 15:01 ` Stephen Warren
2012-06-19 9:13 ` Wei Ni
[not found] ` <6B4D417B830BC44B8026029FD256F7F1C6EE2DD61F-Q4EWCATADntDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-06-19 1:23 ` Philip Rakity
2012-06-19 4:25 ` Wei Ni
[not found] ` <6B4D417B830BC44B8026029FD256F7F1C6EE2DD622-Q4EWCATADntDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-06-19 9:17 ` Mark Brown
[not found] ` <20120619091719.GZ3974-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-06-19 9:44 ` Wei Ni
[not found] ` <6B4D417B830BC44B8026029FD256F7F1C6EE2DD626-Q4EWCATADntDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-06-20 0:01 ` Stephen Warren
[not found] ` <4FE112F2.7000506-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-06-20 10:47 ` Mark Brown
2012-06-20 11:28 ` Wei Ni
[not found] ` <6B4D417B830BC44B8026029FD256F7F1C6EE2DD629-Q4EWCATADntDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-06-20 16:51 ` Stephen Warren
2012-06-26 8:56 ` Dong Aisheng
[not found] ` <20120626085605.GA6047-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-06-26 16:53 ` Stephen Warren
[not found] ` <4FE9E907.6050803-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-06-26 21:26 ` Rob Herring
[not found] ` <4FEA28EC.2080906-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-06-26 22:38 ` Stephen Warren
2012-06-27 2:19 ` Dong Aisheng
2012-06-27 2:16 ` Dong Aisheng
2012-06-15 16:24 ` Franky Lin
2012-06-18 6:00 ` Wei Ni
2012-06-14 11:27 ` Wei Ni
[not found] ` <6B4D417B830BC44B8026029FD256F7F1C377BFFE8A-Q4EWCATADntDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-06-14 11:44 ` Wei Ni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FD90352.9090606@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=krakesh@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=makon@nvidia.com \
--cc=olof@lixom.net \
--cc=swarren@nvidia.com \
--cc=wni@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).