Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294033
b: refs/heads/master
c: 145e973
h: refs/heads/master
i:
  294031: 9308c42
v: v3
  • Loading branch information
Olof Johansson authored and Dmitry Torokhov committed Mar 14, 2012
1 parent f55372a commit 9451646
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2cd36877ad1c61429e00c099b6903ebcd936ca00
refs/heads/master: 145e97348a3066cf71038d02392aa8063550de6f
17 changes: 11 additions & 6 deletions trunk/Documentation/devicetree/bindings/input/tegra-kbc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
Required properties:
- compatible: "nvidia,tegra20-kbc"

Optional properties:
- debounce-delay: delay in milliseconds per row scan for debouncing
- repeat-delay: delay in milliseconds before repeat starts
- ghost-filter: enable ghost filtering for this device
- wakeup-source: configure keyboard as a wakeup source for suspend/resume
Optional properties, in addition to those specified by the shared
matrix-keyboard bindings:

- linux,fn-keymap: a second keymap, same specification as the
matrix-keyboard-controller spec but to be used when the KEY_FN modifier
key is pressed.
- nvidia,debounce-delay-ms: delay in milliseconds per row scan for debouncing
- nvidia,repeat-delay-ms: delay in milliseconds before repeat starts
- nvidia,ghost-filter: enable ghost filtering for this device
- nvidia,wakeup-source: configure keyboard as a wakeup source for suspend/resume

Example:

keyboard: keyboard {
compatible = "nvidia,tegra20-kbc";
reg = <0x7000e200 0x100>;
ghost-filter;
nvidia,ghost-filter;
};
21 changes: 16 additions & 5 deletions trunk/drivers/input/keyboard/tegra-kbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,23 +624,25 @@ 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;

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;

/*
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -806,8 +815,10 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev)
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;
}
Expand Down

0 comments on commit 9451646

Please sign in to comment.