aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-07-06 16:29:11 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2022-07-06 16:29:50 -0700
commitc4bcc1b99b8b8acdfe673e4701a9c2acb6b8b2fb (patch)
treebff92ba62c2b6c84bb56b1738e56b210ccab0da6 /drivers/input/touchscreen
parentInput: i8042 - add TUXEDO devices to i8042 quirk tables (diff)
downloadlinux-dev-c4bcc1b99b8b8acdfe673e4701a9c2acb6b8b2fb.tar.xz
linux-dev-c4bcc1b99b8b8acdfe673e4701a9c2acb6b8b2fb.zip
Input: goodix - switch use of acpi_gpio_get_*_resource() APIs
No need to open code functionality that is provided by the acpi_gpio_get_irq_resource() and acpi_gpio_get_io_resource(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220705180252.963-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/goodix.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index 3ad9870db108..cc52f0d21dbb 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -822,22 +822,16 @@ static int goodix_resource(struct acpi_resource *ares, void *data)
struct device *dev = &ts->client->dev;
struct acpi_resource_gpio *gpio;
- switch (ares->type) {
- case ACPI_RESOURCE_TYPE_GPIO:
- gpio = &ares->data.gpio;
- if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT) {
- if (ts->gpio_int_idx == -1) {
- ts->gpio_int_idx = ts->gpio_count;
- } else {
- dev_err(dev, "More then one GpioInt resource, ignoring ACPI GPIO resources\n");
- ts->gpio_int_idx = -2;
- }
+ if (acpi_gpio_get_irq_resource(ares, &gpio)) {
+ if (ts->gpio_int_idx == -1) {
+ ts->gpio_int_idx = ts->gpio_count;
+ } else {
+ dev_err(dev, "More then one GpioInt resource, ignoring ACPI GPIO resources\n");
+ ts->gpio_int_idx = -2;
}
ts->gpio_count++;
- break;
- default:
- break;
- }
+ } else if (acpi_gpio_get_io_resource(ares, &gpio))
+ ts->gpio_count++;
return 0;
}