From 921f70ffe8901f98f7552194cc0458c4a145145e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Wed, 3 Feb 2021 21:56:44 +0000
Subject: [PATCH] Revert "platform/x86: ideapad-laptop: Switch touchpad attribute to be RO"
Mime-version: 1.0
Content-type: text/plain; charset=UTF-8
Content-transfer-encoding: 8bit
Git-commit: 921f70ffe8901f98f7552194cc0458c4a145145e
Patch-mainline: v5.12-rc1
References: git-fixes
The touchpad can be enabled/disabled via this attribute on a Lenovo
Yoga 520-14IKB. Allow writing as it provides legitimate functionality.
This reverts commit 7f363145992cebf4ea760447f1cfdf6f81459683.
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210203215403.290792-24-pobrn@protonmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
---
drivers/platform/x86/ideapad-laptop.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -413,10 +413,9 @@ static ssize_t touchpad_show(struct devi
return sprintf(buf, "%lu\n", result);
}
-/* Switch to RO for now: It might be revisited in the future */
-static ssize_t __maybe_unused touchpad_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
+static ssize_t touchpad_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
struct ideapad_private *priv = dev_get_drvdata(dev);
bool state;
@@ -432,7 +431,7 @@ static ssize_t __maybe_unused touchpad_s
return count;
}
-static DEVICE_ATTR_RO(touchpad);
+static DEVICE_ATTR_RW(touchpad);
static ssize_t conservation_mode_show(struct device *dev,
struct device_attribute *attr,