All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linus.walleij@stericsson.com, grant.likely@secretlab.ca,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] gpiolib: add gpio get direction support
Date: Tue, 23 Oct 2012 14:06:19 +0300	[thread overview]
Message-ID: <50867A2B.5020606@linux.intel.com> (raw)
In-Reply-To: <CACRpkdbxfL+1NQ73ve8Hz4VKaVMzJS-P7H50kSNVODAU9mm7QA@mail.gmail.com>

On 10/23/2012 01:23 AM, Linus Walleij wrote:
> On Mon, Oct 22, 2012 at 3:44 PM, Mathias Nyman
> <mathias.nyman@linux.intel.com>  wrote:
>
>> If the .get_direction callback is set, then gpiolib will use it
>> for showing correct gpio direction in sysfs and debug. If not set
>> then it will work the old way; e.g. guessing everything is input
>> until direction is set.
>
> If the driver cannot report the direction setting you *could*
> cache the result of all calls to gpio_direction_output()
> and gpio_direction_input() somewhere. But I don't know
> if it's a good idea.
>
> Anyway, if the callback is only called internally in the GPIOlib
> why are you making the function public to the entire
> kernel

Thought I'd do it the same was as gpio_direction_output() and 
gpio_direction_input(), but if there is no need for getting the 
direction outside gpiolob then it can be skipped. Main motivation was to 
get correct direction values in debug and sysfs after boot.

gpiolib currently uses cached values of gpio_direction_output/input() in 
sysfs. If the .get_direction callback exists it is used to refresh the 
cached values.

I'll write a new patch without the public gpio_get_direction().

-Mathias

  reply	other threads:[~2012-10-23 11:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 13:44 [RFC PATCH] gpiolib: add gpio get direction support Mathias Nyman
2012-10-22 22:23 ` Linus Walleij
2012-10-23 11:06   ` Mathias Nyman [this message]
2012-10-24  5:39     ` Linus Walleij

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=50867A2B.5020606@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 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.