* [PATCH v1 1/1] Input: clps711x-keypad - get rid of OF_GPIO dependency
@ 2022-08-30 18:28 Andy Shevchenko
2022-08-30 18:37 ` Arnd Bergmann
2022-08-30 21:15 ` Dmitry Torokhov
0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2022-08-30 18:28 UTC (permalink / raw)
To: Dmitry Torokhov, Andy Shevchenko, linux-input, linux-kernel,
linux-arm-kernel
Cc: Alexander Shiyan
There is no such dependency in the driver, but it's implicitly
used to have OF property APIs available. Replace that by device
property API and get rid of OF_GPIO dependency.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/input/keyboard/Kconfig | 2 +-
drivers/input/keyboard/clps711x-keypad.c | 13 +++++++------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index a20ee693b22b..2c6cef222f9c 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -186,7 +186,7 @@ config KEYBOARD_QT2160
config KEYBOARD_CLPS711X
tristate "CLPS711X Keypad support"
- depends on OF_GPIO && (ARCH_CLPS711X || COMPILE_TEST)
+ depends on ARCH_CLPS711X || COMPILE_TEST
select INPUT_MATRIXKMAP
help
Say Y here to enable the matrix keypad on the Cirrus Logic
diff --git a/drivers/input/keyboard/clps711x-keypad.c b/drivers/input/keyboard/clps711x-keypad.c
index 939c88655fc0..4c1a3e611edd 100644
--- a/drivers/input/keyboard/clps711x-keypad.c
+++ b/drivers/input/keyboard/clps711x-keypad.c
@@ -6,9 +6,11 @@
*/
#include <linux/input.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/of_gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/sched.h>
#include <linux/input/matrix_keypad.h>
@@ -86,7 +88,6 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
{
struct clps711x_keypad_data *priv;
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
struct input_dev *input;
u32 poll_interval;
int i, err;
@@ -95,11 +96,11 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- priv->syscon = syscon_regmap_lookup_by_phandle(np, "syscon");
+ priv->syscon = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon");
if (IS_ERR(priv->syscon))
return PTR_ERR(priv->syscon);
- priv->row_count = of_gpio_named_count(np, "row-gpios");
+ priv->row_count = gpiod_count(dev, "row");
if (priv->row_count < 1)
return -EINVAL;
@@ -119,7 +120,7 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
return PTR_ERR(data->desc);
}
- err = of_property_read_u32(np, "poll-interval", &poll_interval);
+ err = device_property_read_u32(dev, "poll-interval", &poll_interval);
if (err)
return err;
@@ -143,7 +144,7 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
return err;
input_set_capability(input, EV_MSC, MSC_SCAN);
- if (of_property_read_bool(np, "autorepeat"))
+ if (device_property_read_bool(dev, "autorepeat"))
__set_bit(EV_REP, input->evbit);
/* Set all columns to low */
--
2.35.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] Input: clps711x-keypad - get rid of OF_GPIO dependency
2022-08-30 18:28 [PATCH v1 1/1] Input: clps711x-keypad - get rid of OF_GPIO dependency Andy Shevchenko
@ 2022-08-30 18:37 ` Arnd Bergmann
2022-08-30 21:15 ` Dmitry Torokhov
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2022-08-30 18:37 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Aug 30, 2022, at 8:28 PM, Andy Shevchenko wrote:
> There is no such dependency in the driver, but it's implicitly
> used to have OF property APIs available. Replace that by device
> property API and get rid of OF_GPIO dependency.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
The patch doesn't hurt, but I don't really see the point since
OF_GPIO can't actually be disabled for clps711x.
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] Input: clps711x-keypad - get rid of OF_GPIO dependency
2022-08-30 18:28 [PATCH v1 1/1] Input: clps711x-keypad - get rid of OF_GPIO dependency Andy Shevchenko
2022-08-30 18:37 ` Arnd Bergmann
@ 2022-08-30 21:15 ` Dmitry Torokhov
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2022-08-30 21:15 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-input, linux-kernel, linux-arm-kernel, Alexander Shiyan
On Tue, Aug 30, 2022 at 09:28:39PM +0300, Andy Shevchenko wrote:
> There is no such dependency in the driver, but it's implicitly
> used to have OF property APIs available. Replace that by device
> property API and get rid of OF_GPIO dependency.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied, thank you.
--
Dmitry
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-30 21:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 18:28 [PATCH v1 1/1] Input: clps711x-keypad - get rid of OF_GPIO dependency Andy Shevchenko
2022-08-30 18:37 ` Arnd Bergmann
2022-08-30 21:15 ` Dmitry Torokhov
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).