diff options
author | Hans de Goede <hdegoede@redhat.com> | 2017-06-14 17:30:36 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2017-06-23 10:59:39 +0200 |
commit | 88f3771491aa5e04aeb32607a30aaa632158e961 (patch) | |
tree | 6cd01958277a7f55962a826fd7a6d72d1c5454f7 /0016-Input-silead-Do-not-try-to-directly-access-the-GPIO-.patch | |
parent | 6b98e5e530e3b2c55e00df68c9537ac767058da5 (diff) | |
download | kernel-88f3771491aa5e04aeb32607a30aaa632158e961.tar.gz kernel-88f3771491aa5e04aeb32607a30aaa632158e961.tar.xz kernel-88f3771491aa5e04aeb32607a30aaa632158e961.zip |
Improve Bay and Cherry Trail device support
- Enable AXP288 PMIC support on x86_64 for battery charging and monitoring
support on Bay and Cherry Trail tablets and laptops
- Enable various drivers for peripherals found on Bay and Cherry Trail tablets
- Add some small patches fixing suspend/resume touchscreen and accelerometer
issues on various Bay and Cherry Trail tablets
Diffstat (limited to '0016-Input-silead-Do-not-try-to-directly-access-the-GPIO-.patch')
-rw-r--r-- | 0016-Input-silead-Do-not-try-to-directly-access-the-GPIO-.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/0016-Input-silead-Do-not-try-to-directly-access-the-GPIO-.patch b/0016-Input-silead-Do-not-try-to-directly-access-the-GPIO-.patch new file mode 100644 index 000000000..a2e60191a --- /dev/null +++ b/0016-Input-silead-Do-not-try-to-directly-access-the-GPIO-.patch @@ -0,0 +1,62 @@ +From fd4fb1f6633b21042ff084868323e15e708fe1cd Mon Sep 17 00:00:00 2001 +From: Hans de Goede <hdegoede@redhat.com> +Date: Sun, 1 Jan 2017 22:11:20 +0100 +Subject: [PATCH 16/16] Input: silead: Do not try to directly access the GPIO + when using ACPI pm + +On some x86 tablets we cannot directly access the GPIOs as they are +claimed by the ACPI tables, so check it the i2c client is not being +power-managed by ACPI before trying to get the power pin GPIO. + +Note this is a workaround patch to fix this until Andy' gpiolib-ACPI +patches which make gpiolib more strict land, once those are landed this +patch is no longer needed. + +Signed-off-by: Hans de Goede <hdegoede@redhat.com> +--- + drivers/input/touchscreen/silead.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c +index c0ba40c09699..30fba3cbe277 100644 +--- a/drivers/input/touchscreen/silead.c ++++ b/drivers/input/touchscreen/silead.c +@@ -31,6 +31,7 @@ + #include <linux/irq.h> + #include <linux/regulator/consumer.h> + ++#include <acpi/acpi_bus.h> + #include <asm/unaligned.h> + + #define SILEAD_TS_NAME "silead_ts" +@@ -517,12 +518,21 @@ static int silead_ts_probe(struct i2c_client *client, + if (error) + return error; + +- /* Power GPIO pin */ +- data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW); +- if (IS_ERR(data->gpio_power)) { +- if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER) +- dev_err(dev, "Shutdown GPIO request failed\n"); +- return PTR_ERR(data->gpio_power); ++ /* ++ * If device power is not managed by ACPI, get the power_gpio ++ * and manage it ourselves. ++ */ ++#ifdef CONFIG_ACPI ++ if (!acpi_bus_power_manageable(ACPI_HANDLE(dev))) ++#endif ++ { ++ data->gpio_power = devm_gpiod_get_optional(dev, "power", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(data->gpio_power)) { ++ if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER) ++ dev_err(dev, "Power GPIO request failed\n"); ++ return PTR_ERR(data->gpio_power); ++ } + } + + error = silead_ts_setup(client); +-- +2.13.0 + |