devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH resend fixes for 4.8 0/2] input: touchscreen: silead_gsl1680: fixes
@ 2016-09-07 20:09 Hans de Goede
  2016-09-07 20:09 ` [PATCH resend fixes for 4.8 1/2] input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation Hans de Goede
  2016-09-07 20:09 ` [PATCH resend fixes for 4.8 2/2] input: touchscreen: silead_gsl1680: Use "silead/" prefix for firmware loading Hans de Goede
  0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2016-09-07 20:09 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-input, linux-arm-kernel,
	devicetree

Hi Dmitry,

Here are 2 fixes for the silead touchscreen driver which is new in 4.8,
since these change firmware loading behavior (*) we really ought to get
these into 4.8, so that don't end up shipping a stable kernel with the
old firmware loading behavior.

Note the small dt binding change this includes has been acked by
Robh, so these 2 are ready for merging now.

Thanks & Regards,

Hans

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH resend fixes for 4.8 1/2] input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation
  2016-09-07 20:09 [PATCH resend fixes for 4.8 0/2] input: touchscreen: silead_gsl1680: fixes Hans de Goede
@ 2016-09-07 20:09 ` Hans de Goede
  2016-09-07 20:09 ` [PATCH resend fixes for 4.8 2/2] input: touchscreen: silead_gsl1680: Use "silead/" prefix for firmware loading Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2016-09-07 20:09 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-input, linux-arm-kernel,
	devicetree, 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.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/input/touchscreen/silead_gsl1680.txt         | 1 +
 drivers/input/touchscreen/silead.c                                   | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt b/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt
index ad7f41a..b726823 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt
@@ -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
diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index 3b80f14..7709f5b 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -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.");
 }
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH resend fixes for 4.8 2/2] input: touchscreen: silead_gsl1680: Use "silead/" prefix for firmware loading
  2016-09-07 20:09 [PATCH resend fixes for 4.8 0/2] input: touchscreen: silead_gsl1680: fixes Hans de Goede
  2016-09-07 20:09 ` [PATCH resend fixes for 4.8 1/2] input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation Hans de Goede
@ 2016-09-07 20:09 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2016-09-07 20:09 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-input, linux-arm-kernel,
	devicetree, 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.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/touchscreen/silead.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index 7709f5b..c6a1ae9 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -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
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-07 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-07 20:09 [PATCH resend fixes for 4.8 0/2] input: touchscreen: silead_gsl1680: fixes Hans de Goede
2016-09-07 20:09 ` [PATCH resend fixes for 4.8 1/2] input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation Hans de Goede
2016-09-07 20:09 ` [PATCH resend fixes for 4.8 2/2] input: touchscreen: silead_gsl1680: Use "silead/" prefix for firmware loading Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).