diff --git a/drivers/input/touchscreen/synaptics_fw_update.c b/drivers/input/touchscreen/synaptics_fw_update.c index 9fc3d6791e2c36db9a38d0abb24a22b611cfa768..1163f217eac7ef1c084444079913a094b84f8539 100644 --- a/drivers/input/touchscreen/synaptics_fw_update.c +++ b/drivers/input/touchscreen/synaptics_fw_update.c @@ -350,12 +350,11 @@ static void parse_header(void) memcpy(img->product_info, data->product_info, sizeof(data->product_info)); -#ifdef CHECK_BUILD_INFO - img->is_contain_build_info = - (data->options_firmware_id == (1 << OPTION_BUILD_INFO)); -#else - img->is_contain_build_info = 0; -#endif + if (fwu->rmi4_data->check_build) + img->is_contain_build_info = + (data->options_firmware_id == (1 << OPTION_BUILD_INFO)); + else + img->is_contain_build_info = 0; if (img->is_contain_build_info) { img->package_id = (data->pkg_id_msb << 8) | diff --git a/drivers/input/touchscreen/synaptics_i2c_rmi4.c b/drivers/input/touchscreen/synaptics_i2c_rmi4.c index 5063de71123a30dd6be8fb0b37e03d2d058eef29..a5d9789bc75f739e4e1909991d672a23b60b0fcc 100644 --- a/drivers/input/touchscreen/synaptics_i2c_rmi4.c +++ b/drivers/input/touchscreen/synaptics_i2c_rmi4.c @@ -1679,6 +1679,8 @@ static int synaptics_rmi4_parse_dt(struct device *dev, rmi4_pdata->do_lockdown = of_property_read_bool(np, "synaptics,do-lockdown"); rmi4_pdata->wakeup = of_property_read_bool(np, "synaptics,wakeup"); + rmi4_pdata->check_build = of_property_read_bool(np, + "synaptics,check-build"); rc = synaptics_rmi4_get_dt_coords(dev, "synaptics,display-coords", rmi4_pdata); @@ -3292,6 +3294,7 @@ static int synaptics_rmi4_probe(struct i2c_client *client, rmi4_data->irq_enabled = false; rmi4_data->fw_updating = false; rmi4_data->suspended = false; + rmi4_data->check_build = rmi4_data->board->check_build; rmi4_data->i2c_read = synaptics_rmi4_i2c_read; rmi4_data->i2c_write = synaptics_rmi4_i2c_write; diff --git a/drivers/input/touchscreen/synaptics_i2c_rmi4.h b/drivers/input/touchscreen/synaptics_i2c_rmi4.h index 9ebfdfdb8ae1075dd27f4be74be8f01217415a4f..5a6077b933cb6a1c73e3be3dcacdc537b45d7d5c 100644 --- a/drivers/input/touchscreen/synaptics_i2c_rmi4.h +++ b/drivers/input/touchscreen/synaptics_i2c_rmi4.h @@ -198,6 +198,7 @@ struct synaptics_rmi4_device_info { * @flip_x: set to TRUE if desired to flip direction on x-axis * @flip_y: set to TRUE if desired to flip direction on y-axis * @fw_updating: firmware is updating flag + * @check_build: check the build information for firmware * @sensor_sleep: flag to indicate sleep state of sensor * @wait: wait queue for touch data polling in interrupt thread * @i2c_read: pointer to i2c read function @@ -255,6 +256,7 @@ struct synaptics_rmi4_data { wait_queue_head_t wait; bool stay_awake; bool staying_awake; + bool check_build; int (*i2c_read)(struct synaptics_rmi4_data *pdata, unsigned short addr, unsigned char *data, unsigned short length); int (*i2c_write)(struct synaptics_rmi4_data *pdata, unsigned short addr, diff --git a/include/linux/input/synaptics_dsx.h b/include/linux/input/synaptics_dsx.h index 25947a1c7882f00c3f722a0a2c645993d4f89c60..76df6e52acd780238beefb80b802f20558632ade 100644 --- a/include/linux/input/synaptics_dsx.h +++ b/include/linux/input/synaptics_dsx.h @@ -37,6 +37,7 @@ struct synaptics_rmi4_capacitance_button_map { * @y_flip: y flip flag * @i2c_pull_up: pull up i2c bus with regulator * @power_down_enable: enable complete regulator shutdown in suspend + * @check_build: check the build information for firmware * @irq_gpio: attention interrupt gpio * @irq_flags: flags used by the irq * @reset_flags: flags used by reset line @@ -65,6 +66,7 @@ struct synaptics_rmi4_platform_data { bool wakeup; bool disable_gpios; bool do_lockdown; + bool check_build; unsigned irq_gpio; u32 irq_flags; u32 reset_flags;