Commit c5872d6a authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Dmitry Torokhov

Input: clps711x-keypad - get rid of OF_GPIO dependency

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220830182839.47965-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent a9da7251
...@@ -186,7 +186,7 @@ config KEYBOARD_QT2160 ...@@ -186,7 +186,7 @@ config KEYBOARD_QT2160
config KEYBOARD_CLPS711X config KEYBOARD_CLPS711X
tristate "CLPS711X Keypad support" tristate "CLPS711X Keypad support"
depends on OF_GPIO && (ARCH_CLPS711X || COMPILE_TEST) depends on ARCH_CLPS711X || COMPILE_TEST
select INPUT_MATRIXKMAP select INPUT_MATRIXKMAP
help help
Say Y here to enable the matrix keypad on the Cirrus Logic Say Y here to enable the matrix keypad on the Cirrus Logic
......
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
*/ */
#include <linux/input.h> #include <linux/input.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_gpio.h> #include <linux/gpio/consumer.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/input/matrix_keypad.h> #include <linux/input/matrix_keypad.h>
...@@ -86,7 +88,6 @@ static int clps711x_keypad_probe(struct platform_device *pdev) ...@@ -86,7 +88,6 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
{ {
struct clps711x_keypad_data *priv; struct clps711x_keypad_data *priv;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct input_dev *input; struct input_dev *input;
u32 poll_interval; u32 poll_interval;
int i, err; int i, err;
...@@ -95,11 +96,11 @@ static int clps711x_keypad_probe(struct platform_device *pdev) ...@@ -95,11 +96,11 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
if (!priv) if (!priv)
return -ENOMEM; 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)) if (IS_ERR(priv->syscon))
return PTR_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) if (priv->row_count < 1)
return -EINVAL; return -EINVAL;
...@@ -119,7 +120,7 @@ static int clps711x_keypad_probe(struct platform_device *pdev) ...@@ -119,7 +120,7 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
return PTR_ERR(data->desc); 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) if (err)
return err; return err;
...@@ -143,7 +144,7 @@ static int clps711x_keypad_probe(struct platform_device *pdev) ...@@ -143,7 +144,7 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
return err; return err;
input_set_capability(input, EV_MSC, MSC_SCAN); 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_bit(EV_REP, input->evbit);
/* Set all columns to low */ /* Set all columns to low */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment