@@ -130,6 +130,7 @@ struct raydium_data {
struct gpio_desc *reset_gpio;
struct raydium_info info;
+ char fw_file[64];
struct mutex sysfs_mutex;
@@ -752,12 +753,16 @@ static int raydium_i2c_fw_update(struct raydium_data *ts)
{
struct i2c_client *client = ts->client;
const struct firmware *fw = NULL;
- const char *fw_file = "raydium.fw";
int error;
- error = request_firmware(&fw, fw_file, &client->dev);
+ /* Firmware name */
+ snprintf(ts->fw_file, sizeof(ts->fw_file),
+ "raydium_%x.fw", ts->info.hw_ver);
+ dev_dbg(&client->dev, "firmware name: %s\n", ts->fw_file);
+
+ error = request_firmware(&fw, ts->fw_file, &client->dev);
if (error) {
- dev_err(&client->dev, "Unable to open firmware %s\n", fw_file);
+ dev_err(&client->dev, "Unable to open firmware %s\n", ts->fw_file);
return error;
}
Modify update firmware to accept alternative file name Signed-off-by: jeffrey.lin <jeffrey.lin@rad-ic.com> --- drivers/input/touchscreen/raydium_i2c_ts.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)