Commit 73e7f173 authored by Fabio Estevam's avatar Fabio Estevam Committed by Dmitry Torokhov

Input: imx_keypad - convert to a DT-only driver

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: default avatarFabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210327194307.541248-1-festevam@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent bfcf3d48
...@@ -408,27 +408,18 @@ static int imx_keypad_open(struct input_dev *dev) ...@@ -408,27 +408,18 @@ static int imx_keypad_open(struct input_dev *dev)
return -EIO; return -EIO;
} }
#ifdef CONFIG_OF
static const struct of_device_id imx_keypad_of_match[] = { static const struct of_device_id imx_keypad_of_match[] = {
{ .compatible = "fsl,imx21-kpp", }, { .compatible = "fsl,imx21-kpp", },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, imx_keypad_of_match); MODULE_DEVICE_TABLE(of, imx_keypad_of_match);
#endif
static int imx_keypad_probe(struct platform_device *pdev) 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 imx_keypad *keypad;
struct input_dev *input_dev; struct input_dev *input_dev;
int irq, error, i, row, col; 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); irq = platform_get_irq(pdev, 0);
if (irq < 0) if (irq < 0)
return irq; return irq;
...@@ -469,7 +460,7 @@ static int imx_keypad_probe(struct platform_device *pdev) ...@@ -469,7 +460,7 @@ static int imx_keypad_probe(struct platform_device *pdev)
input_dev->open = imx_keypad_open; input_dev->open = imx_keypad_open;
input_dev->close = imx_keypad_close; 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_ROWS,
MAX_MATRIX_KEY_COLS, MAX_MATRIX_KEY_COLS,
keypad->keycodes, input_dev); keypad->keycodes, input_dev);
...@@ -582,7 +573,7 @@ static struct platform_driver imx_keypad_driver = { ...@@ -582,7 +573,7 @@ static struct platform_driver imx_keypad_driver = {
.driver = { .driver = {
.name = "imx-keypad", .name = "imx-keypad",
.pm = &imx_kbd_pm_ops, .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, .probe = imx_keypad_probe,
}; };
......
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