diff options
author | Jeffrey Lin <jeffrey.lin@rad-ic.com> | 2018-01-05 00:35:23 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-01-05 12:28:39 -0500 |
commit | 92a37438ced77a8acb380457e0a28970f1ae9472 (patch) | |
tree | e6c265f80bc448c43146c04c5829fc95d2b2dd72 | |
parent | b8af0b5b928775960ff4b5936cbbc20714e9d921 (diff) |
Input: raydium_i2c_ts - include hardware version in firmware name
Add hardware version to the firmware file name to handle scenarios where
single system image supports variety of devices.
Signed-off-by: Jeffrey Lin <jeffrey.lin@rad-ic.com>
Patchwork-Id: 10127677
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/raydium_i2c_ts.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c index 100538d64fff..d1c09e6a2cb6 100644 --- a/drivers/input/touchscreen/raydium_i2c_ts.c +++ b/drivers/input/touchscreen/raydium_i2c_ts.c | |||
@@ -752,13 +752,20 @@ static int raydium_i2c_fw_update(struct raydium_data *ts) | |||
752 | { | 752 | { |
753 | struct i2c_client *client = ts->client; | 753 | struct i2c_client *client = ts->client; |
754 | const struct firmware *fw = NULL; | 754 | const struct firmware *fw = NULL; |
755 | const char *fw_file = "raydium.fw"; | 755 | char *fw_file; |
756 | int error; | 756 | int error; |
757 | 757 | ||
758 | fw_file = kasprintf(GFP_KERNEL, "raydium_%#04x.fw", | ||
759 | le32_to_cpu(ts->info.hw_ver)); | ||
760 | if (!fw_file) | ||
761 | return -ENOMEM; | ||
762 | |||
763 | dev_dbg(&client->dev, "firmware name: %s\n", fw_file); | ||
764 | |||
758 | error = request_firmware(&fw, fw_file, &client->dev); | 765 | error = request_firmware(&fw, fw_file, &client->dev); |
759 | if (error) { | 766 | if (error) { |
760 | dev_err(&client->dev, "Unable to open firmware %s\n", fw_file); | 767 | dev_err(&client->dev, "Unable to open firmware %s\n", fw_file); |
761 | return error; | 768 | goto out_free_fw_file; |
762 | } | 769 | } |
763 | 770 | ||
764 | disable_irq(client->irq); | 771 | disable_irq(client->irq); |
@@ -787,6 +794,9 @@ out_enable_irq: | |||
787 | 794 | ||
788 | release_firmware(fw); | 795 | release_firmware(fw); |
789 | 796 | ||
797 | out_free_fw_file: | ||
798 | kfree(fw_file); | ||
799 | |||
790 | return error; | 800 | return error; |
791 | } | 801 | } |
792 | 802 | ||