summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-04-30 18:58:01 +0200
committerHans de Goede <hdegoede@redhat.com>2023-05-09 12:33:37 +0200
commit6555daf9a711c135cb718ce8baaf126232d9ff37 (patch)
tree5442a6820bbbd0dec569908bb5754ff9641802f4 /drivers/platform
parentf771ec85b626c3e30362841cbc7b82f398e64469 (diff)
downloadlinux-stable-6555daf9a711c135cb718ce8baaf126232d9ff37.tar.gz
linux-stable-6555daf9a711c135cb718ce8baaf126232d9ff37.tar.bz2
linux-stable-6555daf9a711c135cb718ce8baaf126232d9ff37.zip
platform/x86: lenovo-yogabook: Add a yogabook_toggle_digitizer_mode() helper function
Add a yogabook_toggle_digitizer_mode() helper function. This is a preparation patch for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230430165807.472798-14-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/lenovo-yogabook-wmi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/platform/x86/lenovo-yogabook-wmi.c b/drivers/platform/x86/lenovo-yogabook-wmi.c
index 7954559b9ac5..1b9f6622f67b 100644
--- a/drivers/platform/x86/lenovo-yogabook-wmi.c
+++ b/drivers/platform/x86/lenovo-yogabook-wmi.c
@@ -128,10 +128,8 @@ static void yogabook_wmi_work(struct work_struct *work)
}
}
-static void yogabook_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
+static void yogabook_toggle_digitizer_mode(struct yogabook_wmi *data)
{
- struct yogabook_wmi *data = dev_get_drvdata(&wdev->dev);
-
if (test_bit(YB_SUSPENDED, &data->flags))
return;
@@ -147,6 +145,11 @@ static void yogabook_wmi_notify(struct wmi_device *wdev, union acpi_object *dumm
schedule_work(&data->work);
}
+static void yogabook_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
+{
+ yogabook_toggle_digitizer_mode(dev_get_drvdata(&wdev->dev));
+}
+
static irqreturn_t yogabook_backside_hall_irq(int irq, void *_data)
{
struct yogabook_wmi *data = _data;