Linux Input Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] Input: atmel_mxt_ts - allow specification of config name
@ 2019-11-27 12:54 Lucas Stach
  2019-11-27 13:35 ` Marco Felsch
  2019-12-05 21:18 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Lucas Stach @ 2019-11-27 12:54 UTC (permalink / raw)
  To: Dmitry Torokhov, Nick Dyer
  Cc: Rob Herring, linux-input, devicetree, kernel, patchwork-lst

From: Nick Dyer <nick@shmanahar.org>

Signed-off-by: Nick Dyer <nick@shmanahar.org>
---
v2: Switch to linux instead of atmel as vendor prefix.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 3 +++
 drivers/input/touchscreen/atmel_mxt_ts.c                   | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
index c88919480d37..0764c7af045c 100644
--- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
+++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
@@ -31,6 +31,9 @@ Optional properties for main touchpad device:
 
 - reset-gpios: GPIO specifier for the touchscreen's reset pin (active low)
 
+- linux,cfg-name: Provide name of configuration file in OBP_RAW format. This
+    will be downloaded from the firmware loader on probe to the device.
+
 Example:
 
 	touch@4b {
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 24c4b691b1c9..60997086763b 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -308,6 +308,7 @@ struct mxt_data {
 	struct t7_config t7_cfg;
 	struct mxt_dbg dbg;
 	struct gpio_desc *reset_gpio;
+	const char *cfg_name;
 
 	/* Cached parameters from object table */
 	u16 T5_address;
@@ -2142,7 +2143,8 @@ static int mxt_initialize(struct mxt_data *data)
 	if (error)
 		return error;
 
-	error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME,
+	error = request_firmware_nowait(THIS_MODULE, true,
+					data->cfg_name ? : MXT_CFG_NAME,
 					&client->dev, GFP_KERNEL, data,
 					mxt_config_cb);
 	if (error) {
@@ -3015,6 +3017,8 @@ static int mxt_parse_device_properties(struct mxt_data *data)
 		data->t19_num_keys = n_keys;
 	}
 
+	device_property_read_string(dev, "linux,cfg-name", &data->cfg_name);
+
 	return 0;
 }
 
-- 
2.20.1


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

* Re: [PATCH v2] Input: atmel_mxt_ts - allow specification of config name
  2019-11-27 12:54 [PATCH v2] Input: atmel_mxt_ts - allow specification of config name Lucas Stach
@ 2019-11-27 13:35 ` Marco Felsch
  2019-12-05 21:18 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Marco Felsch @ 2019-11-27 13:35 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Dmitry Torokhov, Nick Dyer, devicetree, Rob Herring,
	patchwork-lst, kernel, linux-input

Hi Lucas,

just two nitpicks.

On 19-11-27 13:54, Lucas Stach wrote:
> From: Nick Dyer <nick@shmanahar.org>
> 
> Signed-off-by: Nick Dyer <nick@shmanahar.org>
> ---
> v2: Switch to linux instead of atmel as vendor prefix.
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---

Don't know the git behaviour but where happens the cut if we have two
'---'?

>  Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 3 +++
>  drivers/input/touchscreen/atmel_mxt_ts.c                   | 6 +++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> index c88919480d37..0764c7af045c 100644
> --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> @@ -31,6 +31,9 @@ Optional properties for main touchpad device:
>  
>  - reset-gpios: GPIO specifier for the touchscreen's reset pin (active low)
>  
> +- linux,cfg-name: Provide name of configuration file in OBP_RAW format. This
> +    will be downloaded from the firmware loader on probe to the device.
> +
>  Example:
>  
>  	touch@4b {
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 24c4b691b1c9..60997086763b 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -308,6 +308,7 @@ struct mxt_data {
>  	struct t7_config t7_cfg;
>  	struct mxt_dbg dbg;
>  	struct gpio_desc *reset_gpio;
> +	const char *cfg_name;
>  
>  	/* Cached parameters from object table */
>  	u16 T5_address;
> @@ -2142,7 +2143,8 @@ static int mxt_initialize(struct mxt_data *data)
>  	if (error)
>  		return error;
>  
> -	error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME,
> +	error = request_firmware_nowait(THIS_MODULE, true,
> +					data->cfg_name ? : MXT_CFG_NAME,

This will produce a warning if clang is used [1]. I don't know if we
should introduce gcc-extensions.

[1] https://releases.llvm.org/8.0.0/tools/clang/docs/DiagnosticsReference.html#wgnu-conditional-omitted-operand

Regards,
  Marco

>  					&client->dev, GFP_KERNEL, data,
>  					mxt_config_cb);
>  	if (error) {
> @@ -3015,6 +3017,8 @@ static int mxt_parse_device_properties(struct mxt_data *data)
>  		data->t19_num_keys = n_keys;
>  	}
>  
> +	device_property_read_string(dev, "linux,cfg-name", &data->cfg_name);
> +
>  	return 0;
>  }
>  
> -- 
> 2.20.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH v2] Input: atmel_mxt_ts - allow specification of config name
  2019-11-27 12:54 [PATCH v2] Input: atmel_mxt_ts - allow specification of config name Lucas Stach
  2019-11-27 13:35 ` Marco Felsch
@ 2019-12-05 21:18 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2019-12-05 21:18 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Dmitry Torokhov, Nick Dyer, linux-input, devicetree, kernel,
	patchwork-lst

On Wed, Nov 27, 2019 at 01:54:56PM +0100, Lucas Stach wrote:
> From: Nick Dyer <nick@shmanahar.org>
> 
> Signed-off-by: Nick Dyer <nick@shmanahar.org>
> ---
> v2: Switch to linux instead of atmel as vendor prefix.
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  Documentation/devicetree/bindings/input/atmel,maxtouch.txt | 3 +++
>  drivers/input/touchscreen/atmel_mxt_ts.c                   | 6 +++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> index c88919480d37..0764c7af045c 100644
> --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
> @@ -31,6 +31,9 @@ Optional properties for main touchpad device:
>  
>  - reset-gpios: GPIO specifier for the touchscreen's reset pin (active low)
>  
> +- linux,cfg-name: Provide name of configuration file in OBP_RAW format. This
> +    will be downloaded from the firmware loader on probe to the device.
> +

We have a somewhat standard 'firmware-name' property for this purpose 
already. Use that.

Rob

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 12:54 [PATCH v2] Input: atmel_mxt_ts - allow specification of config name Lucas Stach
2019-11-27 13:35 ` Marco Felsch
2019-12-05 21:18 ` Rob Herring

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git