The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Rhyland Klein <rklein@nvidia.com>
Cc: olof@lixom.net, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: rfkill: add generic gpio rfkill driver
Date: Sat, 07 May 2011 12:01:43 +0200	[thread overview]
Message-ID: <1304762503.3574.5.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1304728801-21331-2-git-send-email-rklein@nvidia.com>

On Fri, 2011-05-06 at 17:40 -0700, Rhyland Klein wrote:

[snip]

Looks nice! A few comments below:

> + * @blocked:           block rf enabled (default is true)

(see below)

> +struct rfkill_gpio_platform_data {
> +	char			*name;

> +	char			*power_clk_name;

const?

> +	bool			blocked;

The comments say this is default "true", but I don't think that makes
sense since this struct would be defined somewhere else and be static
const so zero-initialised. Also, are you sure that even having this
makes sense? (see below)

> +config RFKILL_GPIO
> +	bool "GPIO RFKILL driver"
> +	depends on RFKILL && GPIOLIB
> +	help
> +	  If you say yes here you get support of a generic gpio RFKILL
> +	  driver. Platform needs to define the resources required

That appears to be cut short?


> +#define GPIO_NAME_LEN  40

Is there really no definition yet? Maybe it would make sense to
dynamically allocate?

> +struct rfkill_gpio_data {
> +	struct rfkill_gpio_platform_data	*pdata;
> +	struct rfkill				*rfkill_dev;
> +	char					reset_name[GPIO_NAME_LEN];
> +	char					shutdown_name[GPIO_NAME_LEN];
> +	struct					clk *pwr_clk;

That last line is a little oddly formatted.

> +	/* setup initial state */
> +	rfkill_gpio_set_power(rfkill, pdata->blocked);
> +	rfkill_set_states(rfkill->rfkill_dev, pdata->blocked, false);
> +
> +	ret = rfkill_register(rfkill->rfkill_dev);

So if you do this, rfkill core will set the persistent thing. We
discovered a while ago (and I mentioned that in the original thread)
there will be quirky behaviour. I would recommend leaving this out and
just relying on the rfkill core to call set_block() a little after
rfkill_register() to sync the state of this device with the desired
system state.

johannes


      reply	other threads:[~2011-05-07 10:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-07  0:40 [PATCH] add support for rfkill gpio devices Rhyland Klein
2011-05-07  0:40 ` [PATCH] net: rfkill: add generic gpio rfkill driver Rhyland Klein
2011-05-07 10:01   ` Johannes Berg [this message]

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=1304762503.3574.5.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=rklein@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