DLKM: Compatible with different modules for focal 0flash

Since we are using different modules with the same IC(ft8756) on
sofia & sofiap, so we need to use different firmware to match different
panel, add dts property focaltech,panel-supplier for this request.

Change-Id: Ie7f74ce4437f7ee2d7f277403b448d099e1fa4dd
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1390106
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Jialei Hao <haojl2@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
houdz1 2019-07-23 13:42:46 +08:00 • committed by Jun Weng
commit 371e29b742
3 changed files with 24 additions and 0 deletions

View file

@ -1218,6 +1218,7 @@ static int fts_parse_dt(struct device *dev, struct fts_ts_platform_data *pdata)
{
int ret = 0;
struct device_node *np = dev->of_node;
struct fts_ts_data *ts_data = fts_data;
u32 temp_val = 0;
FTS_FUNC_ENTER();
@ -1292,6 +1293,15 @@ static int fts_parse_dt(struct device *dev, struct fts_ts_platform_data *pdata)
FTS_INFO("max touch number:%d, irq gpio:%d, reset gpio:%d",
pdata->max_touch_number, pdata->irq_gpio, pdata->reset_gpio);
ret = of_property_read_string(np, "focaltech,panel-supplier",
&ts_data->panel_supplier);
if (ret < 0) {
ts_data->panel_supplier = NULL;
FTS_ERROR("Unable to read panel supplier\n");
} else {
FTS_INFO("panel supplier is %s", (char *)ts_data->panel_supplier);
}
FTS_FUNC_EXIT();
return 0;
}

View file

@ -182,6 +182,7 @@ struct fts_ts_data {
int key_state;
int touch_point;
int point_num;
const char *panel_supplier;
struct regulator *vdd;
struct regulator *vcc_i2c;
#if FTS_PINCTRL_EN

View file

@ -1267,6 +1267,18 @@ static ssize_t fts_log_level_store(
return count;
}
static ssize_t fts_panel_supplier_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct fts_ts_data *data = dev_get_drvdata(dev);
if (data->panel_supplier)
return scnprintf(buf, PAGE_SIZE, "%s\n",
data->panel_supplier);
return 0;
}
static DEVICE_ATTR(panel_supplier, 0444, fts_panel_supplier_show, NULL);
/* get the fw version example:cat fw_version */
static DEVICE_ATTR(fts_fw_version, S_IRUGO | S_IWUSR, fts_tpfwver_show, fts_tpfwver_store);
@ -1326,6 +1338,7 @@ static struct attribute *fts_attributes[] = {
&dev_attr_doreflash.attr,
&dev_attr_poweron.attr,
&dev_attr_productinfo.attr,
&dev_attr_panel_supplier.attr,
NULL
};