diff --git a/drivers/input/touchscreen/himax_0flash_mmi/himax_common.c b/drivers/input/touchscreen/himax_0flash_mmi/himax_common.c index 18cbb6e65a41..8c33c996e1d7 100644 --- a/drivers/input/touchscreen/himax_0flash_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_0flash_mmi/himax_common.c @@ -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 }; diff --git a/drivers/input/touchscreen/himax_0flash_mmi/himax_common.h b/drivers/input/touchscreen/himax_0flash_mmi/himax_common.h index 5390d0aed82b..e17cf147d59e 100755 --- a/drivers/input/touchscreen/himax_0flash_mmi/himax_common.h +++ b/drivers/input/touchscreen/himax_0flash_mmi/himax_common.h @@ -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; diff --git a/drivers/input/touchscreen/himax_0flash_mmi/himax_platform_QCT_SPI.c b/drivers/input/touchscreen/himax_0flash_mmi/himax_platform_QCT_SPI.c index 764f17eb6bb2..8a050873cd09 100755 --- a/drivers/input/touchscreen/himax_0flash_mmi/himax_platform_QCT_SPI.c +++ b/drivers/input/touchscreen/himax_0flash_mmi/himax_platform_QCT_SPI.c @@ -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);