]> git.baikalelectronics.ru Git - kernel.git/commit
gpio / ACPI: Use pin index and bit length
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 23 Sep 2014 02:35:54 +0000 (10:35 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Sep 2014 20:58:09 +0000 (22:58 +0200)
commit223c72fbe94c1e64958ba22ffef5a9b625dee7d5
treeb453653f8406377c89fbfed0202be4436f5257d9
parentc8a103038d266240a593502dfe856b813e3422b2
gpio / ACPI: Use pin index and bit length

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.

Fixes: d3ece9d944b5 (gpio / ACPI: Add support for ACPI GPIO operation regions)
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: 3.15+ <stable@vger.kernel.org> # 3.15+: c8a103038d26 ACPICA: Update to GPIO region handler interface.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/gpio/gpiolib-acpi.c