From 74fd22263c58b996e3f26ca35d2928318600ec29 Mon Sep 17 00:00:00 2001 From: dengwei1 Date: Tue, 9 Jun 2020 18:27:14 +0800 Subject: [PATCH] guam: input touch add class ic_ver support input touch add class ic_ver support NO_PROP_NEEDED: only for guam Change-Id: I315c83611f52196a62d57325645bc27217a39d6c Signed-off-by: dengwei1 Reviewed-on: https://gerrit.mot.com/1610780 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- .../touchscreen/chipone_tddi_mmi/cts_sysfs.c | 13 +++++++++++++ .../touchscreen/himax_v3_mmi/himax_common.c | 16 ++++++++++++++++ .../touchscreen/himax_v3_mmi/himax_common.h | 2 ++ 3 files changed, 31 insertions(+) diff --git a/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c b/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c index fc883ca30cb9..f243357b40f1 100755 --- a/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c +++ b/drivers/input/touchscreen/chipone_tddi_mmi/cts_sysfs.c @@ -2561,9 +2561,22 @@ static ssize_t vendor_show(struct device *dev, return scnprintf(buf, PAGE_SIZE, "chipone"); } +/* Attribute: vendor (RO) */ +static ssize_t ic_ver_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct chipone_ts_data *ts = dev_get_drvdata(dev); + + return scnprintf(buf, PAGE_SIZE, "%s%s\n%s%04x\n%s%04x\n", + "Product ID: ", ts->cts_dev.hwdata->name, + "Build ID: ", ts->cts_dev.fwdata.version, + "Config ID: ", ts->cts_dev.fwdata.ddi_version); +} + static struct device_attribute touchscreen_attributes[] = { __ATTR_RO(path), __ATTR_RO(vendor), + __ATTR_RO(ic_ver), __ATTR_NULL }; diff --git a/drivers/input/touchscreen/himax_v3_mmi/himax_common.c b/drivers/input/touchscreen/himax_v3_mmi/himax_common.c index c015a70d5e41..fde675a1bb94 100755 --- a/drivers/input/touchscreen/himax_v3_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_v3_mmi/himax_common.c @@ -3337,9 +3337,25 @@ static ssize_t vendor_show(struct device *dev, return scnprintf(buf, PAGE_SIZE, "himax"); } +/* Attribute: vendor (RO) */ +static ssize_t ic_ver_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct himax_ts_data *ts = dev_get_drvdata(dev); + int buildid; + + buildid = (ic_data->vendor_cid_maj_ver << 8 | + ic_data->vendor_cid_min_ver); + return scnprintf(buf, PAGE_SIZE, "%s%s\n%s%04x\n%s%04x\n", + "Product ID: ", ts->chip_name, + "Build ID: ", buildid ? buildid : ts->build_id, + "Config ID: ", ic_data->vendor_touch_cfg_ver ? ic_data->vendor_touch_cfg_ver : ts->config_id); +} + static struct device_attribute touchscreen_attributes[] = { __ATTR_RO(path), __ATTR_RO(vendor), + __ATTR_RO(ic_ver), __ATTR_NULL }; diff --git a/drivers/input/touchscreen/himax_v3_mmi/himax_common.h b/drivers/input/touchscreen/himax_v3_mmi/himax_common.h index abd51f2e6d79..c12ab2c76cd8 100755 --- a/drivers/input/touchscreen/himax_v3_mmi/himax_common.h +++ b/drivers/input/touchscreen/himax_v3_mmi/himax_common.h @@ -410,6 +410,8 @@ struct himax_ts_data { int (*power)(int on); int pre_finger_data[10][2]; bool vdd_1v8_always_on; + uint32_t build_id; + uint32_t config_id; struct device *dev; struct workqueue_struct *himax_wq;