public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Lv Zheng <lv.zheng@intel.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Len Brown <len.brown@intel.com>, Lv Zheng <zetalog@gmail.com>,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH 2/2] gpio / ACPI: Use pin index and bit length
Date: Tue, 23 Sep 2014 08:30:37 -0700	[thread overview]
Message-ID: <1411486237.3203.97.camel@spandruv-desktop.jf.intel.com> (raw)
In-Reply-To: <6093416.FMcGNUEiEQ@vostro.rjw.lan>

On Tue, 2014-09-23 at 17:32 +0200, Rafael J. Wysocki wrote:
> On Tuesday, September 23, 2014 01:27:28 PM Mika Westerberg wrote:
> > On Tue, Sep 23, 2014 at 10:35:54AM +0800, Lv Zheng wrote:
> > > From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > > 
> > > Fix code when the operation region callback is for an gpio, which
> > > is not at index 0 and for partial pins in a GPIO definition.
> > > For example:
> > > Name (GMOD, ResourceTemplate ()
> > > {
> > > 	//3 Outputs that define the Power mode of the device
> > > 	GpioIo (Exclusive, PullDown, , , , "\\_SB.GPI2") {10, 11, 12}
> > > 	})
> > > }
> > > 
> > > If opregion callback calls is for:
> > > - Set pin 10, then address = 0 and bit length = 1
> > > - Set pin 11, then address = 1 and bit length = 1
> > > - Set for both pin 11 and pin 12, then address = 1, bit length = 2
> > > 
> > > This change requires updated ACPICA gpio operation handler code to
> > > send the pin index and bit length.
> > > 
> > > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > > Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > 
> > Adding the GPIO maintainers since we need their ACK to get this merged
> > through ACPI tree.
> 
> Actually, it would be good to say that the ACPICA change mentioned in the
> changelog above is made by patch [1/2] in this series.
> 
> Linus, Alexandre, please let us know if you need the whole series to be
> resent for context. This is quite urgent, as we need that fixed in 3.18,
> because there are systems out there where it doesn't work already.
> 
> Mika, Srinivas, I suppose that we need this in -stable?  Which one if so?
> 
Yes both ACPICA patch (1/2 in this series) and this patch should be a
target for stable.

Thanks,
Srinivas
> > > ---
> > >  drivers/gpio/gpiolib-acpi.c |    5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> > > index d62eaaa..687476f 100644
> > > --- a/drivers/gpio/gpiolib-acpi.c
> > > +++ b/drivers/gpio/gpiolib-acpi.c
> > > @@ -377,8 +377,10 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
> > >  	struct gpio_chip *chip = achip->chip;
> > >  	struct acpi_resource_gpio *agpio;
> > >  	struct acpi_resource *ares;
> > > +	int pin_index = (int)address;
> > >  	acpi_status status;
> > >  	bool pull_up;
> > > +	int length;
> > >  	int i;
> > >  
> > >  	status = acpi_buffer_to_resource(achip->conn_info.connection,
> > > @@ -400,7 +402,8 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
> > >  		return AE_BAD_PARAMETER;
> > >  	}
> > >  
> > > -	for (i = 0; i < agpio->pin_table_length; i++) {
> > > +	length = min(agpio->pin_table_length, (u16)(pin_index + bits));
> > > +	for (i = pin_index; i < length; ++i) {
> > >  		unsigned pin = agpio->pin_table[i];
> > >  		struct acpi_gpio_connection *conn;
> > >  		struct gpio_desc *desc;
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



  parent reply	other threads:[~2014-09-23 15:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23  2:35 [PATCH 1/2] ACPICA: Update to GPIO region handler interface Lv Zheng
2014-09-23  2:35 ` [PATCH 2/2] gpio / ACPI: Use pin index and bit length Lv Zheng
2014-09-23 10:27   ` Mika Westerberg
2014-09-23 15:32     ` Rafael J. Wysocki
2014-09-23 15:29       ` Mika Westerberg
2014-09-23 15:52         ` Rafael J. Wysocki
2014-09-23 15:30       ` Srinivas Pandruvada [this message]
2014-09-24 11:25     ` Linus Walleij
2014-09-24 13:29       ` Rafael J. Wysocki
2014-09-24 21:22 ` [PATCH 1/2] ACPICA: Update to GPIO region handler interface Rafael J. Wysocki

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=1411486237.3203.97.camel@spandruv-desktop.jf.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=acourbot@nvidia.com \
    --cc=len.brown@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=zetalog@gmail.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