linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: keyboard: gpio-keys-polled: use input name from pdata if available
@ 2019-02-11 11:19 Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 6+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-02-11 11:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-input, dmitry.torokhov

Instead of hardcoding the input name to the driver name
('gpio-keys-polled'), allow the passing a name via platform data
('name' field was already present), but default to old behaviour
in case of NULL.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index edc7262..3312186 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -272,7 +272,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
 
 	input = poll_dev->input;
 
-	input->name = pdev->name;
+	input->name = (pdata->name ? pdata->name : pdev->name);
 	input->phys = DRV_NAME"/input0";
 
 	input->id.bustype = BUS_HOST;
-- 
1.9.1


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

* [PATCH] input: keyboard: gpio-keys-polled: use input name from pdata if available
  2019-06-06 22:43 repost: input: keyboard: gpio-keys-polled: use input name from pdata Enrico Weigelt, metux IT consult
@ 2019-06-06 22:43 ` Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 6+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-06 22:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: dmitry.torokhov, linux-input

Instead of hardcoding the input name to the driver name
('gpio-keys-polled'), allow the passing a name via platform data
('name' field was already present), but default to old behaviour
in case of NULL.

Even though the general tendency is moving from pdata structs,
towards oftree/acpi/fwnode, pdata structs still have their valid
use cases, when the mentioned mechanisms aren't available or don't
provide the necessary data and so driver setup still needs to be
done explicitly.

An example use case is keys+led support for the APUv2/3 boards.
Here a board specific platform driver probes the board and then
instantiates the individual devices using classic pdata.

The gpio-keys-polled currently lacks support for specifying
input device name, which is fixed by this patch.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index edc7262..3312186 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -272,7 +272,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
 
 	input = poll_dev->input;
 
-	input->name = pdev->name;
+	input->name = (pdata->name ? pdata->name : pdev->name);
 	input->phys = DRV_NAME"/input0";
 
 	input->id.bustype = BUS_HOST;
-- 
1.9.1


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

* Re: [PATCH] input: keyboard: gpio-keys-polled: use input name from pdata if available
@ 2019-02-14  8:01 Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 6+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-02-14  8:01 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input, LKML

Dmitry Torokhov wrote:


sorry for the late reply - lost your mail by broken filter :(
(just picked it out now of the archive ...)

> > Instead of hardcoding the input name to the driver name
('gpio-keys-polled'),
> > allow the passing a name via platform data ('name' field was already
present),
> > but default to old behaviour in case of NULL.

> I thought the world is moving away from platform data and towards
> OF/ACPI systems. What device are you targeting with this change?

Well, it that only would be available everywhere :o

I've written an platform driver for the APUv2 board, which has an
gpio-attached button and LEDs on the front. It's an x86 machine,
(= no OF), and no usable ACPI information (no, I won't patch up
the bios for that, unless somebody inserts enough coins ;-))

Therefore, I need to pass everything via platform data.

By the way: I've also added support for gpio lookup table.
(sending it w/ the next patch queue)

> I would want to convert gpio-keys[-polled] to generic device
> properties and away form platform data...

I'd like to see that too, but it's not that easy. Not all platforms
support proper generic configuration mechanisms.

Maybe it would be easier, if we had oftree everywhere, and drivers
for composite devices could directly inject (locally scoped) oftree
nodes.For example, a PCI-based GPU board which has lots of sub-devices
like regulators, sensors, fans, etc. The driver then would be probed via
PCI, declare it's own bus and probe the individual devices by it's
own of subtree. Well, that's gonna take a lot more discussions ...


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: [PATCH] input: keyboard: gpio-keys-polled: use input name from pdata if available
  2019-02-07 17:05 Enrico Weigelt, metux IT consult
@ 2019-02-08  7:35 ` Dmitry Torokhov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2019-02-08  7:35 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult; +Cc: linux-kernel, linux-input

Hi Enrico,

On Thu, Feb 07, 2019 at 06:05:31PM +0100, Enrico Weigelt, metux IT consult wrote:
> Instead of hardcoding the input name to the driver name ('gpio-keys-polled'),
> allow the passing a name via platform data ('name' field was already present),
> but default to old behaviour in case of NULL.

I thought the world is moving away from platform data and towards
OF/ACPI systems. What device are you targeting with this change?

I would want to convert gpio-keys[-polled] to generic device properties
and away form platform data...

> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---
>  drivers/input/keyboard/gpio_keys_polled.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
> index edc7262..3312186 100644
> --- a/drivers/input/keyboard/gpio_keys_polled.c
> +++ b/drivers/input/keyboard/gpio_keys_polled.c
> @@ -272,7 +272,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
>  
>  	input = poll_dev->input;
>  
> -	input->name = pdev->name;
> +	input->name = (pdata->name ? pdata->name : pdev->name);
>  	input->phys = DRV_NAME"/input0";
>  
>  	input->id.bustype = BUS_HOST;
> -- 
> 1.9.1
> 

Thanks.

-- 
Dmitry

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

* [PATCH] input: keyboard: gpio-keys-polled: use input name from pdata if available
@ 2019-02-07 17:05 Enrico Weigelt, metux IT consult
  2019-02-08  7:35 ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-02-07 17:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-input, dmitry.torokhov

Instead of hardcoding the input name to the driver name ('gpio-keys-polled'),
allow the passing a name via platform data ('name' field was already present),
but default to old behaviour in case of NULL.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index edc7262..3312186 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -272,7 +272,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
 
 	input = poll_dev->input;
 
-	input->name = pdev->name;
+	input->name = (pdata->name ? pdata->name : pdev->name);
 	input->phys = DRV_NAME"/input0";
 
 	input->id.bustype = BUS_HOST;
-- 
1.9.1


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

* [PATCH] input: keyboard: gpio-keys-polled: use input name from pdata if available
@ 2019-01-22 12:00 Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 6+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-01-22 12:00 UTC (permalink / raw)
  To: juhosg, nunojpg, linux-input, linux-gpio, linux-kernel

Instead of hardcoding the input name to the driver name ('gpio-keys-polled'),
allow the passing a name via platform data ('name' field was already present),
but default to old behaviour in case of NULL.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/input/keyboard/gpio_keys_polled.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index edc7262..3312186 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -272,7 +272,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
 
 	input = poll_dev->input;
 
-	input->name = pdev->name;
+	input->name = (pdata->name ? pdata->name : pdev->name);
 	input->phys = DRV_NAME"/input0";
 
 	input->id.bustype = BUS_HOST;
-- 
1.9.1


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

end of thread, other threads:[~2019-06-06 22:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 11:19 [PATCH] input: keyboard: gpio-keys-polled: use input name from pdata if available Enrico Weigelt, metux IT consult
  -- strict thread matches above, loose matches on Subject: below --
2019-06-06 22:43 repost: input: keyboard: gpio-keys-polled: use input name from pdata Enrico Weigelt, metux IT consult
2019-06-06 22:43 ` [PATCH] input: keyboard: gpio-keys-polled: use input name from pdata if available Enrico Weigelt, metux IT consult
2019-02-14  8:01 Enrico Weigelt, metux IT consult
2019-02-07 17:05 Enrico Weigelt, metux IT consult
2019-02-08  7:35 ` Dmitry Torokhov
2019-01-22 12:00 Enrico Weigelt, metux IT consult

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).