dlkm: Add himax touch info node for Moto Care

- Now we need ic_ver node to points out Product ID, Build ID and
Config ID for moto care, so add /sys/class/touchscreen/NVT-ts/ic_ver
for this requirement.

Change-Id: I9b481abb9c399077212739eb0f79e4f97b03ed84
Reviewed-on: https://gerrit.mot.com/1606735
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqiu Huang <huangjq9@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wengjun1 2020-06-08 16:04:54 +08:00 • committed by Jun Weng
commit b56025a63d
3 changed files with 32 additions and 0 deletions

View file

@ -3384,9 +3384,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
};

View file

@ -431,6 +431,8 @@ struct himax_ts_data {
int pre_finger_data[10][2];
bool vdd_1v8_always_on;
uint32_t report_gesture_key;
uint32_t build_id;
uint32_t config_id;
struct device *dev;
struct workqueue_struct *himax_wq;

View file

@ -196,6 +196,20 @@ int himax_parse_dt(struct himax_ts_data *ts,
I(" DT:protocol_type=%d\n", pdata->protocol_type);
}
if (of_property_read_u32(dt, "himax,def-build-id", &ts->build_id)) {
ts->build_id = 0;
I("himax,build_id undefined.\n");
} else {
I("himax,build_id=0x%04X\n", ts->build_id);
}
if (of_property_read_u32(dt, "himax,def-config-id", &ts->config_id)) {
ts->config_id = 0;
I("himax,config_id undefined.\n");
} else {
I("himax,config_id=0x%04X\n", ts->config_id);
}
ts->vdd_1v8_always_on = of_property_read_bool(dt, "himax,vdd_1v8_always_on");
if (ts->vdd_1v8_always_on){
I(" DT:vdd_1v8_always_on=%d\n", ts->vdd_1v8_always_on);