Lenovo Yoga (many variants: Yoga, Yoga2 Pro, Yoga2 13, Yoga3 Pro, Yoga 3
14 etc) has multiple modles that are a hybrid laptop, working in laptop
mode as well as tablet mode.
Currently, there is no easy interface to determine the touchpad status,
which in case of the Yoga family of machines, can also be useful to
assume tablet mode status.
Note: The ideapad-laptop driver does not provide a SW_TABLET_MODE either
Attached is v4 of the Linux kernel patch for Lenovo Yoga series hybrid laptops.
-- people. debian. org/~rrs
Ritesh Raj Sarraf | http://
Debian - The Universal Operating System
Lenovo Yoga (many variants: Yoga, Yoga2 Pro, Yoga2 13, Yoga3 Pro, Yoga 3
14 etc) has multiple modles that are a hybrid laptop, working in laptop
mode as well as tablet mode.
Currently, there is no easy interface to determine the touchpad status,
which in case of the Yoga family of machines, can also be useful to
assume tablet mode status.
Note: The ideapad-laptop driver does not provide a SW_TABLET_MODE either
For a detailed discussion on why we want either of the interfaces, /bugs.launchpad .net/onboard/ +bug/1366421/ comments/ 43
please see:
https:/
This patch adds a sysfs interface for read/write access under: platform/ devices/ VPC2004\ :00/touchpad_ mode
/sys/bus/
v4:
Use kstrtobool because supported values are boolean
v3:
Include Darren Hart's comments
Changed sysfs inteface from "touchpad_mode" to "touchpad"
v2:
Include Andy Shevchenko's comments
Signed-off-by: Ritesh Raj Sarraf <email address hidden> testing/ sysfs-platform- ideapad- laptop | 8 +++++ platform/ x86/ideapad- laptop. c | 34 +++++++ +++++++ +++++++ +
---
.../ABI/
drivers/
2 files changed, 42 insertions(+)
diff --git a/Documentation /ABI/testing/ sysfs-platform- ideapad- laptop b/Documentation /ABI/testing/ sysfs-platform- ideapad- laptop .5d24f1e8e6ef 100644 /ABI/testing/ sysfs-platform- ideapad- laptop /ABI/testing/ sysfs-platform- ideapad- laptop
index b31e782bd985.
--- a/Documentation
+++ b/Documentation
@@ -17,3 +17,11 @@ Description:
* 2 -> Dust Cleaning
* 4 -> Efficient Thermal Dissipation Mode
+What: /sys/devices/ platform/ ideapad/ touchpad platform/ x86/ideapad- laptop. c b/drivers/ platform/ x86/ideapad- laptop. c .b35954707e11 100644 platform/ x86/ideapad- laptop. c platform/ x86/ideapad- laptop. c fan(struct device *dev,
+Date: Feb 2017
+KernelVersion: 4.11
+Contact: "Ritesh Raj Sarraf <email address hidden>"
+Description:
+ Control touchpad mode.
+ * 1 -> Switched On
+ * 0 -> Switched Off
diff --git a/drivers/
index f46ece2ce3c4.
--- a/drivers/
+++ b/drivers/
@@ -423,9 +423,43 @@ static ssize_t store_ideapad_
static DEVICE_ ATTR(fan_ mode, 0644, show_ideapad_fan, store_ideapad_fan);
+ show(struct device *dev, drvdata( dev); data(priv- >adev-> handle, VPCCMD_R_TOUCHPAD, &result)) store(struct device *dev, drvdata( dev); cmd(priv- >adev-> handle, VPCCMD_W_TOUCHPAD, state); ATTR_RW( touchpad) ; attributes[ ] = { attr_camera_ power.attr, attr_fan_ mode.attr, touchpad. attr,
+static ssize_t touchpad_
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct ideapad_private *priv = dev_get_
+ unsigned long result;
+
+ if (read_ec_
+ return sprintf(buf, "-1\n");
+ return sprintf(buf, "%lu\n", result);
+}
+
+static ssize_t touchpad_
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct ideapad_private *priv = dev_get_
+ int ret;
+ bool state;
+
+ ret = kstrtobool(buf, &state);
+ if (ret)
+ return ret;
+
+ ret = write_ec_
+ if (ret < 0)
+ return -EIO;
+ return count;
+}
+
+static DEVICE_
+
static struct attribute *ideapad_
&dev_
&dev_
+ &dev_attr_
NULL
};
--
2.11.0