diff options
author | Olof Johansson <olof@lixom.net> | 2012-03-14 08:36:29 +0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-03-14 08:37:07 +0400 |
commit | 145e97348a3066cf71038d02392aa8063550de6f (patch) | |
tree | 2ef6ed98478e18030b3c266b4951e24075f8510c /drivers/input/keyboard/tegra-kbc.c | |
parent | 2cd36877ad1c61429e00c099b6903ebcd936ca00 (diff) | |
download | linux-145e97348a3066cf71038d02392aa8063550de6f.tar.xz |
Input: tegra-kbc - revise device tree support
This is an incremental patch updating to the revised bindings for
matrix keyboards.
This includes an optional "linux,fn-keymap" binding that is not yet
implemented, that will be used to specify the Fn-key modifier layout
if needed.
Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/tegra-kbc.c')
-rw-r--r-- | drivers/input/keyboard/tegra-kbc.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index dc19432c665b..21c42f852343 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -624,6 +624,8 @@ tegra_kbc_dt_parse_pdata(struct platform_device *pdev) { struct tegra_kbc_platform_data *pdata; struct device_node *np = pdev->dev.of_node; + u32 prop; + int i; if (!np) return NULL; @@ -631,16 +633,16 @@ tegra_kbc_dt_parse_pdata(struct platform_device *pdev) if (!pdata) return NULL; - if (!of_property_read_u32(np, "debounce-delay", &prop)) + if (!of_property_read_u32(np, "nvidia,debounce-delay-ms", &prop)) pdata->debounce_cnt = prop; - if (!of_property_read_u32(np, "repeat-delay", &prop)) + if (!of_property_read_u32(np, "nvidia,repeat-delay-ms", &prop)) pdata->repeat_cnt = prop; - if (of_find_property(np, "needs-ghost-filter", NULL)) + if (of_find_property(np, "nvidia,needs-ghost-filter", NULL)) pdata->use_ghost_filter = true; - if (of_find_property(np, "wakeup-source", NULL)) + if (of_find_property(np, "nvidia,wakeup-source", NULL)) pdata->wakeup = true; /* @@ -657,6 +659,10 @@ tegra_kbc_dt_parse_pdata(struct platform_device *pdev) pdata->pin_cfg[KBC_MAX_ROW + i].type = PIN_CFG_COL; } + pdata->keymap_data = matrix_keyboard_of_fill_keymap(np, "linux,keymap"); + + /* FIXME: Add handling of linux,fn-keymap here */ + return pdata; } #else @@ -792,6 +798,9 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, kbc); device_init_wakeup(&pdev->dev, pdata->wakeup); + if (!pdev->dev.platform_data) + matrix_keyboard_of_free_keymap(pdata->keymap_data); + return 0; err_free_irq: @@ -806,8 +815,10 @@ err_free_mem: input_free_device(input_dev); kfree(kbc); err_free_pdata: - if (!pdev->dev.platform_data) + if (!pdev->dev.platform_data) { + matrix_keyboard_of_free_keymap(pdata->keymap_data); kfree(pdata); + } return err; } |