All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peter 'p2' De Schrijver" <peter.de-schrijver@nokia.com>
To: ext Kevin Hilman <khilman@deeprootsystems.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 2/3] Debobs and ETK padconf implementation
Date: Tue, 7 Oct 2008 13:59:27 +0300	[thread overview]
Message-ID: <20081007105927.GA4755@codecarver.research.nokia.com> (raw)
In-Reply-To: <87tzboelfk.fsf@deeprootsystems.com>

> 
> Intead of __gpio_set_value(), this should be 
> 
>   gpio_direction_output(ETK_GPIO(gpio), value);
> 
> Because otherwise, the default direction defaults to input.
> 

Yes. The user should set the direction to output by himself. The idea is
that the kernel code should always be able to toggle the output value,
but the person debugging the system can still control if the GPIO value
is visible to the outside world or not. So I don't think the kernel
should force the direction, at least not implicitly.

> > +int debug_gpio_get(unsigned gpio)
> > +{
> > +	if (!debobs_initialized)
> > +		return -EINVAL;
> > +
> > +	WARN_ON(gpio >= NUM_OF_DEBOBS_PADS);
> > +	if (gpio < NUM_OF_DEBOBS_PADS)
> > +		return __gpio_get_value(ETK_GPIO(gpio));
> 
> I thing this should just be gpio_get_value() (no underscores)  and 
> then <linux/gpio.h> included.  The OMAP-specific inlines will be used
> anyways, so no need to use the __gpio* calls.
> 

There is only gpio_get_value_cansleep, while I want this functionality
to be always available, also in interrupthandlers. __gpio_get_value
warns if it would sleep.

Cheers,

Peter.

-- 
goa is a state of mind

  reply	other threads:[~2008-10-07 11:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 15:11 [PATCH 0/3] debobs support for OMAP3430 Peter 'p2' De Schrijver
2008-10-01 15:11 ` [PATCH 1/3] Add definitions for ETK pads and debobs registers Peter 'p2' De Schrijver
2008-10-01 15:11   ` [PATCH 2/3] Debobs and ETK padconf implementation Peter 'p2' De Schrijver
2008-10-01 15:11     ` [PATCH 3/3] Add debobs Kconfig item Peter 'p2' De Schrijver
2008-10-07 10:42     ` [PATCH 2/3] Debobs and ETK padconf implementation Kevin Hilman
2008-10-07 10:59       ` Peter 'p2' De Schrijver [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-09-16 11:24 [PATCH 0/3] debobs support for OMAP3430 Peter 'p2' De Schrijver
2008-09-16 11:24 ` [PATCH 1/3] Add definitions for ETK pads and debobs registers Peter 'p2' De Schrijver
2008-09-16 11:24   ` [PATCH 2/3] Debobs and ETK padconf implementation Peter 'p2' De Schrijver

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=20081007105927.GA4755@codecarver.research.nokia.com \
    --to=peter.de-schrijver@nokia.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@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.