All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Dietich <marvin24-Mmb7MZpHnFY@public.gmane.org>
To: Dmitry Artamonow <mad_soft-aPYA7nAdAYY@public.gmane.org>
Cc: Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 6/6] ARM: tegra: paz00: enable wifi card
Date: Fri, 20 May 2011 09:50:33 +0200	[thread overview]
Message-ID: <201105200950.33623.marvin24@gmx.de> (raw)
In-Reply-To: <20110519200611.GA20596@rainbow>


Hi Dmitry,

> On 14:08 Thu 19 May     , Marc Dietrich wrote:
> > The Wifi card attached to one usb port needs to be unkilled. The
> > corresponding gpio and also the gpio for the LED are exported to be
> > controlled by userspace later on.
> > 
> > Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>
> 
> [snip]
> 
> > +static void __init paz00_wifi_init(void)
> > +{
> > +	int ret;
> > +
> > +	/* unlock hw rfkill */
> > +	ret = gpio_request_one(TEGRA_WIFI_PWRN, GPIOF_OUT_INIT_HIGH,
> > +			"wifi_pwrn");
> > +	if(ret) {
> > +		pr_warning("WIFI: could not request PWRN gpio!\n");
> > +		return;
> > +	}
> > +	gpio_export(TEGRA_WIFI_PWRN, 0);
> 
> Although enabling wifi on boot may be OK for now, I think in long term
> it would be better and more proper to use rfkill infrastructure for this
> instead of just exporting gpio to userspace. There were some patches for
> gpio-based rfkill switch floating around lately. This is one the versions:
> https://lkml.org/lkml/2011/5/6/372
> Not sure about their status and if they are directly suitable for PAZ00,
> but you may have a look. Btw, there's also another mostly generic
> gpio-rfkill driver in the tree I'm aware of - see
> arch/arm/mach-pxa/tosa-bt.c

yes, proper rfkill support is on my ToDo list. As it seems, the rt2x00 driver 
which we are using also has some initial support for gpio based rfkill. I guess 
I need some more time to sort this out.

> > +
> > +	/* export wifi led */
> > +	ret = gpio_request_one(TEGRA_WIFI_LED, GPIOF_OUT_INIT_HIGH,
> > +			"wifi_led");
> > +	if(ret)
> > +		pr_warning("WIFI: could not request LED gpio!\n");
> > +	gpio_export(TEGRA_WIFI_LED, 0);
> 
> For LED I think it's better to register gpio-leds platform device with
> something like 'rfkill.0' or 'wifi-rx' or whatever as a default trigger
> (not sure about exact names of triggers - you'll need to look up them).
> That way you will get a wide choice of led triggers for free, and still
> retain possibility of manual driving leds from userspace.

There are surely better ways to do this. Luckily, we got some more time to 
rework this because the tegra board changes were put to "hold" status. Expect 
some new version in a few weeks.

Colin, first sorry that I misspelled your name serveral times. I swear it will 
not happen again. 

Second, please don't apply this patch to the for-next tree. I will resend a new 
version which better integrates into the kernel subsystem.

Thanks for your comments!

Marc

WARNING: multiple messages have this Message-ID
From: marvin24@gmx.de (Marc Dietich)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/6] ARM: tegra: paz00: enable wifi card
Date: Fri, 20 May 2011 09:50:33 +0200	[thread overview]
Message-ID: <201105200950.33623.marvin24@gmx.de> (raw)
In-Reply-To: <20110519200611.GA20596@rainbow>


Hi Dmitry,

> On 14:08 Thu 19 May     , Marc Dietrich wrote:
> > The Wifi card attached to one usb port needs to be unkilled. The
> > corresponding gpio and also the gpio for the LED are exported to be
> > controlled by userspace later on.
> > 
> > Signed-off-by: Marc Dietrich <marvin24@gmx.de>
> 
> [snip]
> 
> > +static void __init paz00_wifi_init(void)
> > +{
> > +	int ret;
> > +
> > +	/* unlock hw rfkill */
> > +	ret = gpio_request_one(TEGRA_WIFI_PWRN, GPIOF_OUT_INIT_HIGH,
> > +			"wifi_pwrn");
> > +	if(ret) {
> > +		pr_warning("WIFI: could not request PWRN gpio!\n");
> > +		return;
> > +	}
> > +	gpio_export(TEGRA_WIFI_PWRN, 0);
> 
> Although enabling wifi on boot may be OK for now, I think in long term
> it would be better and more proper to use rfkill infrastructure for this
> instead of just exporting gpio to userspace. There were some patches for
> gpio-based rfkill switch floating around lately. This is one the versions:
> https://lkml.org/lkml/2011/5/6/372
> Not sure about their status and if they are directly suitable for PAZ00,
> but you may have a look. Btw, there's also another mostly generic
> gpio-rfkill driver in the tree I'm aware of - see
> arch/arm/mach-pxa/tosa-bt.c

yes, proper rfkill support is on my ToDo list. As it seems, the rt2x00 driver 
which we are using also has some initial support for gpio based rfkill. I guess 
I need some more time to sort this out.

> > +
> > +	/* export wifi led */
> > +	ret = gpio_request_one(TEGRA_WIFI_LED, GPIOF_OUT_INIT_HIGH,
> > +			"wifi_led");
> > +	if(ret)
> > +		pr_warning("WIFI: could not request LED gpio!\n");
> > +	gpio_export(TEGRA_WIFI_LED, 0);
> 
> For LED I think it's better to register gpio-leds platform device with
> something like 'rfkill.0' or 'wifi-rx' or whatever as a default trigger
> (not sure about exact names of triggers - you'll need to look up them).
> That way you will get a wide choice of led triggers for free, and still
> retain possibility of manual driving leds from userspace.

There are surely better ways to do this. Luckily, we got some more time to 
rework this because the tegra board changes were put to "hold" status. Expect 
some new version in a few weeks.

Colin, first sorry that I misspelled your name serveral times. I swear it will 
not happen again. 

Second, please don't apply this patch to the for-next tree. I will resend a new 
version which better integrates into the kernel subsystem.

Thanks for your comments!

Marc

  reply	other threads:[~2011-05-20  7:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 12:08 [PATCH 0/6 V2] ARM: tegra: paz00 patches for 2.6.40 Marc Dietrich
2011-05-19 12:08 ` Marc Dietrich
     [not found] ` <1305806910-3903-1-git-send-email-marvin24-Mmb7MZpHnFY@public.gmane.org>
2011-05-19 12:08   ` [PATCH 1/6] ARM: tegra: paz00: whitespace cleanup Marc Dietrich
2011-05-19 12:08     ` Marc Dietrich
2011-05-19 12:08   ` [PATCH 2/6] ARM: tegra: paz00: register i2c busses Marc Dietrich
2011-05-19 12:08     ` Marc Dietrich
2011-05-19 12:08   ` [PATCH 3/6] ARM: tegra: paz00: enable usb ports Marc Dietrich
2011-05-19 12:08     ` Marc Dietrich
2011-05-19 12:08   ` [PATCH 4/6] ARM: tegra: paz00: cleanup sdhci ports Marc Dietrich
2011-05-19 12:08     ` Marc Dietrich
2011-05-19 12:08   ` [PATCH 5/6] ARM: tegra: paz00: change the machine name Marc Dietrich
2011-05-19 12:08     ` Marc Dietrich
2011-05-19 12:08   ` [PATCH 6/6] ARM: tegra: paz00: enable wifi card Marc Dietrich
2011-05-19 12:08     ` Marc Dietrich
2011-05-19 20:06     ` Dmitry Artamonow
2011-05-19 20:06       ` Dmitry Artamonow
2011-05-20  7:50       ` Marc Dietich [this message]
2011-05-20  7:50         ` Marc Dietich
2011-07-10 22:14   ` [PATCH 0/6 V2] ARM: tegra: paz00 patches for 2.6.40 Colin Cross
2011-07-10 22:14     ` Colin Cross
     [not found]     ` <CAMbhsRSH2iyv0_1seVtwSQ7AbHmPbz+VqSVkhfLgsNA8+dOwJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-12 10:47       ` Marc Dietrich
2011-07-12 10:47         ` Marc Dietrich

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=201105200950.33623.marvin24@gmx.de \
    --to=marvin24-mmb7mzphnfy@public.gmane.org \
    --cc=ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mad_soft-aPYA7nAdAYY@public.gmane.org \
    --cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
    --subject='Re: [PATCH 6/6] ARM: tegra: paz00: enable wifi card' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.