kane: input add ic_ver file for himax touch
authordengwei1 <dengwei1@motorola.com>
Thu, 14 Feb 2019 06:18:48 +0000 (14:18 +0800)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:36:56 +0000 (17:36 +0800)
input add ic_ver file for himax touch
to support hwprop

Change-Id: I8f5e1a8f885aaf1150c59d93cbe37c0845722b4d
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1308672
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/input/touchscreen/hxchipset/himax_common.c

index cb84b99a0c7f1389174dca40a286dcdc0d481e14..260f6a92d2a89b4723d1d5325ea225cbfa9ea29c 100755 (executable)
@@ -2321,6 +2321,12 @@ exit:
        return retval;
 }
 
+static ssize_t himax_sysfs_ic_ver_show(struct device *dev,
+               struct device_attribute *attr, char *buf)
+{
+       return snprintf(buf, PAGE_SIZE, "[FW]%04x,[IC]%s\n", ic_data->vendor_config_ver, himax_ic_type_to_string());
+}
+
 static struct device_attribute attrs[] = {
        __ATTR(poweron, S_IRUSR | S_IRGRP,
                        himax_sysfs_poweron_show,
@@ -2340,6 +2346,9 @@ static struct device_attribute attrs[] = {
        __ATTR(forcereflash, S_IWUSR | S_IWGRP,
                        NULL,
                        himax_sysfs_force_reflash_store),
+       __ATTR(ic_ver, S_IRUGO,
+                       himax_sysfs_ic_ver_show,
+                       NULL),
 };
 
 #include <linux/major.h>