From 371e29b7421486f46c5b75c8f5b05d24e9d3bdca Mon Sep 17 00:00:00 2001 From: houdz1 Date: Tue, 23 Jul 2019 13:42:46 +0800 Subject: [PATCH] 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 Reviewed-on: https://gerrit.mot.com/1390106 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jun Weng Reviewed-by: Jialei Hao Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- .../focaltech_0flash_mmi/focaltech_core.c | 10 ++++++++++ .../focaltech_0flash_mmi/focaltech_core.h | 1 + .../focaltech_0flash_mmi/focaltech_ex_fun.c | 13 +++++++++++++ 3 files changed, 24 insertions(+) diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c index 2eb33f718c61..60e5f31fcc99 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.c @@ -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; } diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h index f0ec30425dd8..5db82b16a2d2 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_core.h @@ -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 diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_ex_fun.c b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_ex_fun.c index 7c80e3661742..b7196be90c69 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_ex_fun.c +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_ex_fun.c @@ -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 };