Skip to contentSkip to conversation

input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation

PATCH New Hans de Goede 2 participants 4 messages Aug 29, 2016 – Sep 2, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi All,

As discussed here is a patch to update the gsl1680 driver binding doc to document the usage of firmware-name for specifying which firmware to load.

Since the driver as merged in 4.8-rc1 uses touchscreen-fw-name, this patch also updates the driver and moves the addition of the "silead/" prefix to the driver instead of having to specify the prefix in the dt.

I've also added a second patch to also prefix the default / fallback firmware-names with "silead/".

Dmitry, since no kernel has been released with the old firmware names yet, it would be good if we can get both of these merged as a fix to 4.8, so that no one can end up depending on the old behavior.

Thanks & Regards,

Hans

#1 lore raw

PATCH v2 1/2 input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation

The driver has supported touchscreen-fw-name to specify the firmware to load since it has been merged, but this was omitted from the dt-binding documentation.

During review of adding touchscreen-fw-name to the binding documentation it was brought up that there is a standard property name called "firmware-name" for this, which should be used.

Since there are no users of touchscreen-fw-name yet, this commit adds documentation of "firmware-name" to the dt-binding documentation and switches the driver over to use this.

This commit also makes the driver add a "silead/" prefix to the firmware name from dt before calling request_firmware. That the firmware files are stored under /lib/firmware/silead under Linux is an implementation detail and does not belong in devicetree.

---
 .../devicetree/bindings/input/touchscreen/silead_gsl1680.txt         | 1 +
 drivers/input/touchscreen/silead.c                                   | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt +1 -0
index ad7f41a..b726823 100644
@@ -17,6 +17,7 @@ Required properties:
 - touchscreen-size-y	  : See touchscreen.txt
 
 Optional properties:
+- firmware-name		  : File basename (string) for board specific firmware
 - touchscreen-inverted-x  : See touchscreen.txt
 - touchscreen-inverted-y  : See touchscreen.txt
 - touchscreen-swapped-x-y : See touchscreen.txt
drivers/input/touchscreen/silead.c +3 -2
index 3b80f14..7709f5b 100644
@@ -393,9 +393,10 @@ static void silead_ts_read_props(struct i2c_client *client)
 		data->max_fingers = 5; /* Most devices handle up-to 5 fingers */
 	}
 
-	error = device_property_read_string(dev, "touchscreen-fw-name", &str);
+	error = device_property_read_string(dev, "firmware-name", &str);
 	if (!error)
-		snprintf(data->fw_name, sizeof(data->fw_name), "%s", str);
+		snprintf(data->fw_name, sizeof(data->fw_name),
+			 "silead/%s", str);
 	else
 		dev_dbg(dev, "Firmware file name read error. Using default.");
 }
Signature · 1 line
2.9.3
maintainer
#2 lore raw

PATCH v2 1/2 input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation

Quoted 17 lines · Hans de Goede

The driver has supported touchscreen-fw-name to specify the firmware to load since it has been merged, but this was omitted from the dt-binding documentation.

During review of adding touchscreen-fw-name to the binding documentation it was brought up that there is a standard property name called "firmware-name" for this, which should be used.

Since there are no users of touchscreen-fw-name yet, this commit adds documentation of "firmware-name" to the dt-binding documentation and switches the driver over to use this.

This commit also makes the driver add a "silead/" prefix to the firmware name from dt before calling request_firmware. That the firmware files are stored under /lib/firmware/silead under Linux is an implementation detail and does not belong in devicetree.

Quoted 5 lines
---
 .../devicetree/bindings/input/touchscreen/silead_gsl1680.txt         | 1 +
 drivers/input/touchscreen/silead.c                                   | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
#3 lore raw

PATCH v2 2/2 input: touchscreen: silead_gsl1680: Use "silead/" prefix for firmware loading

In reply to Hans de Goede

The silead touch-controller ICs use a different firmware per digitizer / tablet model. So there are going to be quite a few of then and they really should be under a separate subdir.

This commit prefixes the default firmware names with "silead/" just like we are already doing for devicetree specified firmware names.

---
 drivers/input/touchscreen/silead.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/input/touchscreen/silead.c +6 -5
index 7709f5b..c6a1ae9 100644
@@ -414,14 +414,14 @@ static int silead_ts_set_default_fw_name(struct silead_ts_data *data,
 		if (!acpi_id)
 			return -ENODEV;
 
-		snprintf(data->fw_name, sizeof(data->fw_name), "%s.fw",
-			acpi_id->id);
+		snprintf(data->fw_name, sizeof(data->fw_name),
+			 "silead/%s.fw", acpi_id->id);
 
 		for (i = 0; i < strlen(data->fw_name); i++)
 			data->fw_name[i] = tolower(data->fw_name[i]);
 	} else {
-		snprintf(data->fw_name, sizeof(data->fw_name), "%s.fw",
-			id->name);
+		snprintf(data->fw_name, sizeof(data->fw_name),
+			 "silead/%s.fw", id->name);
 	}
 
 	return 0;
@@ -430,7 +430,8 @@ static int silead_ts_set_default_fw_name(struct silead_ts_data *data,
 static int silead_ts_set_default_fw_name(struct silead_ts_data *data,
 					 const struct i2c_device_id *id)
 {
-	snprintf(data->fw_name, sizeof(data->fw_name), "%s.fw", id->name);
+	snprintf(data->fw_name, sizeof(data->fw_name),
+		 "silead/%s.fw", id->name);
 	return 0;
 }
 #endif
Signature · 1 line
2.9.3