mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aaron Sierra <asierra@xes-inc.com>
To: Guenter Roeck <guenter@roeck-us.net>
Cc: Peter Tyser <ptyser@xes-inc.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	LKML <linux-kernel@vger.kernel.org>,
	Jean Delvare <khali@linux-fr.org>
Subject: Re: [PATCH V5 2/3] gpio: Add support for Intel  ICHx/3100/Series[56] GPIO
Date: Tue, 21 Feb 2012 11:25:13 -0600 (CST)	[thread overview]
Message-ID: <a6f20f7d-8af4-4020-ba8d-c1f90512138b@zimbra> (raw)
In-Reply-To: <6.2.5.6.2.20120220221635.0273c0d0@roeck-us.net>

> >+static int ich6_gpio_get(struct gpio_chip *chip, unsigned nr)
> >+{
> >+       unsigned long flags;
> >+       u32 data;
> >+
> >+       /*
> >+       * GPI 0 - 15 need to be read from the power management
> >registers on
> >+       * a ICH6/3100 bridge.
> >+       */
> >+       if (nr < 16 && ichx_priv.pm_base) {
> >+               spin_lock_irqsave(&ichx_priv.lock, flags);
> >+
> >+               /* GPI 0 - 15 are latched, write 1 to clear*/
> >+               ICHX_WRITE(1 << (16 + nr), 0, ichx_priv.pm_base);
> >+               data = ICHX_READ(0, ichx_priv.pm_base);
> >+
> >+               spin_unlock_irqrestore(&ichx_priv.lock, flags);
> >+
> >+               return (data >> 16) & (1 << nr) ? 1 : 0;
> >+       } else {
> 
> 
> unless I am missing something, this still does not address the error
> case where pm_base is not set because of an ACPI conflict (.uses_gpe0
> is true, but .pm_base is NULL).
> 
> Not sure what to do in that case, but simply calling ichx_gpio_get
> doesn't seem to be the correct solution.

Guenter,
You're right. That doesn't do what I'd intended, but this should do the
trick:

	...

	* a ICH6/3100 bridge.
	*/
	if (nr < 16) {
		if (!ichx_priv.pm_base)
			return -ENXIO;

	...

Any other concerns?

> >+               return ichx_gpio_get(chip, nr);
> >+       }

      reply	other threads:[~2012-02-21 17:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <625e6c76-399b-4eb2-8f56-87caf241b87c@zimbra>
2012-02-21  1:11 ` Aaron Sierra
2012-02-21  6:21   ` Guenter Roeck
2012-02-21 17:25     ` Aaron Sierra [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=a6f20f7d-8af4-4020-ba8d-c1f90512138b@zimbra \
    --to=asierra@xes-inc.com \
    --cc=grant.likely@secretlab.ca \
    --cc=guenter@roeck-us.net \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ptyser@xes-inc.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

all inboxes | Powered by JetHome®