linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Input: imx_keypad - convert to a DT-only driver
@ 2021-03-16 13:35 Fabio Estevam
  2021-03-27 19:14 ` Fabio Estevam
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2021-03-16 13:35 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, Fabio Estevam

i.MX has been converted to a DT-only platform, so make the
adjustments to the driver to convert it to a DT-only driver.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- Remove dev_get_platdata() and the pdev->dev.of_node check (Dmitry).

 drivers/input/keyboard/Kconfig      |  1 +
 drivers/input/keyboard/imx_keypad.c | 13 ++-----------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 32d15809ae58..bef0c06ef2a9 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -458,6 +458,7 @@ config KEYBOARD_SNVS_PWRKEY
 config KEYBOARD_IMX
 	tristate "IMX keypad support"
 	depends on ARCH_MXC || COMPILE_TEST
+	depends on OF
 	select INPUT_MATRIXKMAP
 	help
 	  Enable support for IMX keypad port.
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 1f5c9ea5e9e5..ae9303848571 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -408,27 +408,18 @@ static int imx_keypad_open(struct input_dev *dev)
 	return -EIO;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id imx_keypad_of_match[] = {
 	{ .compatible = "fsl,imx21-kpp", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, imx_keypad_of_match);
-#endif
 
 static int imx_keypad_probe(struct platform_device *pdev)
 {
-	const struct matrix_keymap_data *keymap_data =
-			dev_get_platdata(&pdev->dev);
 	struct imx_keypad *keypad;
 	struct input_dev *input_dev;
 	int irq, error, i, row, col;
 
-	if (!keymap_data && !pdev->dev.of_node) {
-		dev_err(&pdev->dev, "no keymap defined\n");
-		return -EINVAL;
-	}
-
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return irq;
@@ -469,7 +460,7 @@ static int imx_keypad_probe(struct platform_device *pdev)
 	input_dev->open = imx_keypad_open;
 	input_dev->close = imx_keypad_close;
 
-	error = matrix_keypad_build_keymap(keymap_data, NULL,
+	error = matrix_keypad_build_keymap(NULL, NULL,
 					   MAX_MATRIX_KEY_ROWS,
 					   MAX_MATRIX_KEY_COLS,
 					   keypad->keycodes, input_dev);
@@ -582,7 +573,7 @@ static struct platform_driver imx_keypad_driver = {
 	.driver		= {
 		.name	= "imx-keypad",
 		.pm	= &imx_kbd_pm_ops,
-		.of_match_table = of_match_ptr(imx_keypad_of_match),
+		.of_match_table = imx_keypad_of_match,
 	},
 	.probe		= imx_keypad_probe,
 };
-- 
2.25.1


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

* Re: [PATCH v2] Input: imx_keypad - convert to a DT-only driver
  2021-03-16 13:35 [PATCH v2] Input: imx_keypad - convert to a DT-only driver Fabio Estevam
@ 2021-03-27 19:14 ` Fabio Estevam
  2021-03-27 19:37   ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2021-03-27 19:14 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

Hi Dmitry,

On Tue, Mar 16, 2021 at 10:36 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> i.MX has been converted to a DT-only platform, so make the
> adjustments to the driver to convert it to a DT-only driver.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> Changes since v1:
> - Remove dev_get_platdata() and the pdev->dev.of_node check (Dmitry).

Does v2 look good?

Thanks

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

* Re: [PATCH v2] Input: imx_keypad - convert to a DT-only driver
  2021-03-27 19:14 ` Fabio Estevam
@ 2021-03-27 19:37   ` Dmitry Torokhov
  2021-03-27 19:44     ` Fabio Estevam
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2021-03-27 19:37 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux-input

Hi Fabio,

On Sat, Mar 27, 2021 at 04:14:46PM -0300, Fabio Estevam wrote:
> Hi Dmitry,
> 
> On Tue, Mar 16, 2021 at 10:36 AM Fabio Estevam <festevam@gmail.com> wrote:
> >
> > i.MX has been converted to a DT-only platform, so make the
> > adjustments to the driver to convert it to a DT-only driver.
> >
> > Signed-off-by: Fabio Estevam <festevam@gmail.com>
> > ---
> > Changes since v1:
> > - Remove dev_get_platdata() and the pdev->dev.of_node check (Dmitry).
> 
> Does v2 look good?

Sorry, I am still confused why we need the OF dependency given that the
driver can be compiled without CONFIG_OF (of_device_id is always
defined) and, as far as I understand, while entire ARCH_MXC is not
selecting OF, all real users are converted to OF.

I guess if we really need this OF dependency we can make it:

	depends on (ARCH_MXC && OF) || COMPILE_TEST

Please let me know.

Thanks.

-- 
Dmitry

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

* Re: [PATCH v2] Input: imx_keypad - convert to a DT-only driver
  2021-03-27 19:37   ` Dmitry Torokhov
@ 2021-03-27 19:44     ` Fabio Estevam
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2021-03-27 19:44 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

Hi Dmitry,

On Sat, Mar 27, 2021 at 4:37 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:

> Sorry, I am still confused why we need the OF dependency given that the
> driver can be compiled without CONFIG_OF (of_device_id is always
> defined) and, as far as I understand, while entire ARCH_MXC is not
> selecting OF, all real users are converted to OF.
>
> I guess if we really need this OF dependency we can make it:
>
>         depends on (ARCH_MXC && OF) || COMPILE_TEST
>
> Please let me know.

You are correct. There is no need to add the OF dependency.

I have just submitted v3 without it.

Thanks

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

end of thread, other threads:[~2021-03-27 19:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 13:35 [PATCH v2] Input: imx_keypad - convert to a DT-only driver Fabio Estevam
2021-03-27 19:14 ` Fabio Estevam
2021-03-27 19:37   ` Dmitry Torokhov
2021-03-27 19:44     ` Fabio Estevam

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