diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c index ecd057059270..9b07b2bcea7a 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c @@ -94,6 +94,8 @@ struct firmware g_embedded_fw = { }; #endif +#define HIMAX_FILE_NAME_LENGTH 128 + #if defined(HX_AUTO_UPDATE_FW) || defined(HX_ZERO_FLASH) #if defined(HX_EN_DYNAMIC_NAME) char *i_CTPM_firmware_name; @@ -3389,6 +3391,17 @@ int himax_chip_common_init(void) #endif + i_CTPM_firmware_name = kzalloc(HIMAX_FILE_NAME_LENGTH, GFP_KERNEL); + if (!i_CTPM_firmware_name) { + E("%s: alloc i_CTPM_firmware_name failed\n", __func__); + goto firmware_name_alloc_failed; + } + if (pdata->panel_supplier) + snprintf(i_CTPM_firmware_name, HIMAX_FILE_NAME_LENGTH, "%s_Himax_firmware.bin", + pdata->panel_supplier); + else + snprintf(i_CTPM_firmware_name, HIMAX_FILE_NAME_LENGTH, "Himax_firmware.bin"); + g_hx_chip_inited = 0; idx = himax_get_ksym_idx(); if (idx >= 0) { @@ -3630,6 +3643,7 @@ err_register_charger_notify_failed: #endif error_ic_detect_failed: himax_gpio_power_deconfig(pdata); +firmware_name_alloc_failed: #ifndef CONFIG_OF err_power_failed: #endif diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c b/drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c index 42eab2e9eae0..938856bb0564 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_inspection.c @@ -1674,8 +1674,11 @@ static int himax_parse_criteria_file(void) if (hx_self_test_file_name == NULL) { E("file name is NULL\n"); hx_self_test_file_name = kzalloc(80, GFP_KERNEL); - snprintf(hx_self_test_file_name, 16, "hx_criteria.csv"); - I("%s: Use default name\n", __func__); + if (private_ts->pdata->panel_supplier) + snprintf(hx_self_test_file_name, 60, "%s_hx_criteria.csv", private_ts->pdata->panel_supplier); + else + snprintf(hx_self_test_file_name, 16, "hx_criteria.csv"); + I("%s: Use name %s\n", __func__, hx_self_test_file_name); } I("file name = %s\n", hx_self_test_file_name); diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c b/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c index 008e1e85e07a..8253d4086762 100755 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c @@ -108,7 +108,7 @@ int himax_parse_dt(struct himax_ts_data *ts, uint32_t coords[4] = {0}; uint32_t touch_info[8] = {0}; struct property *prop; - struct device_node *dt = ts->dev->of_node; + struct device_node *chosen, *dt = ts->dev->of_node; u32 data = 0; prop = of_find_property(dt, "himax,panel-coords", NULL); @@ -202,6 +202,31 @@ int himax_parse_dt(struct himax_ts_data *ts, } himax_vk_parser(dt, pdata); + + chosen = of_find_node_by_name(NULL, "chosen"); + if (chosen) { + const char *supplier; + char *s, *d; + int rc; + + rc = of_property_read_string(chosen, "mmi,panel_name", + (const char **)&supplier); + if (rc) { + I("%s: cannot read mmi,panel_name %d\n", + __func__, rc); + } else { + I( "%s: mmi,panel_name %s\n", __func__, supplier); + + /* skip dsi_ part */ + s = (char *)supplier; + d = pdata->panel_supplier; + while (*s != '_') *d++ = *s++; + + I("%s: panel-supplier %s\n", __func__, pdata->panel_supplier); + } + of_node_put(chosen); + } + return 0; } EXPORT_SYMBOL(himax_parse_dt); diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.h b/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.h index f091c0b0fc0f..35e4b40c086c 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.h +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.h @@ -92,6 +92,7 @@ struct himax_i2c_platform_data { int gpio_irq; int gpio_reset; int gpio_3v3_en; + char panel_supplier[16]; int (*power)(int on); void (*reset)(void); struct himax_virtual_key *virtual_key;