All of lore.kernel.org
 help / color / mirror / Atom feed
* input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation
@ 2016-08-29 19:29 ` Hans de Goede
  0 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2016-08-29 19:29 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree

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

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation
@ 2016-08-29 19:29 ` Hans de Goede
  0 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2016-08-29 19:29 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

* [PATCH v2 1/2] input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation
  2016-08-29 19:29 ` Hans de Goede
@ 2016-08-29 19:29     ` Hans de Goede
  -1 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2016-08-29 19:29 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 1/2] input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation
@ 2016-08-29 19:29     ` Hans de Goede
  0 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2016-08-29 19:29 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 .../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] 8+ messages in thread

* [PATCH v2 2/2] input: touchscreen: silead_gsl1680: Use "silead/" prefix for firmware loading
  2016-08-29 19:29 ` Hans de Goede
@ 2016-08-29 19:29     ` Hans de Goede
  -1 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2016-08-29 19:29 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 2/2] input: touchscreen: silead_gsl1680: Use "silead/" prefix for firmware loading
@ 2016-08-29 19:29     ` Hans de Goede
  0 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2016-08-29 19:29 UTC (permalink / raw)
  To: linux-arm-kernel

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] 8+ messages in thread

* Re: [PATCH v2 1/2] input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation
  2016-08-29 19:29     ` Hans de Goede
@ 2016-09-02 14:39         ` Rob Herring
  -1 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2016-09-02 14:39 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Dmitry Torokhov, Maxime Ripard, Chen-Yu Tsai,
	linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree

On Mon, Aug 29, 2016 at 09:29:36PM +0200, Hans de Goede wrote:
> 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  .../devicetree/bindings/input/touchscreen/silead_gsl1680.txt         | 1 +
>  drivers/input/touchscreen/silead.c                                   | 5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 1/2] input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation
@ 2016-09-02 14:39         ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2016-09-02 14:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 29, 2016 at 09:29:36PM +0200, Hans de Goede wrote:
> 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>
> ---
>  .../devicetree/bindings/input/touchscreen/silead_gsl1680.txt         | 1 +
>  drivers/input/touchscreen/silead.c                                   | 5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)

Acked-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2016-09-02 14:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-29 19:29 input: touchscreen: silead_gsl1680: Document firmware-name, fix implementation Hans de Goede
2016-08-29 19:29 ` Hans de Goede
     [not found] ` <20160829192937.32129-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-08-29 19:29   ` [PATCH v2 1/2] " Hans de Goede
2016-08-29 19:29     ` Hans de Goede
     [not found]     ` <20160829192937.32129-2-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-09-02 14:39       ` Rob Herring
2016-09-02 14:39         ` Rob Herring
2016-08-29 19:29   ` [PATCH v2 2/2] input: touchscreen: silead_gsl1680: Use "silead/" prefix for firmware loading Hans de Goede
2016-08-29 19:29     ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.