diff options
author | Anton Staaf <robotboy@chromium.org> | 2011-06-28 16:06:47 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:39:39 -0700 |
commit | 929be6aa4559f215fa8e0ab1041d3c5a75b4c73a (patch) | |
tree | a4046911df29ffa57701dc5b3b5a4e4927730478 /include/fdt_decode.h | |
parent | 228a895c773668e5ec7c7294c0f1f8d2d998b27d (diff) |
fdt: Add support for decoding keyboard key tables
This adds a function for reading key tables from the fdt.
BUG=chromium-os:17034
TEST=boot U-Boot; type plain, shift and fn keys and check that the correct
output results
Change-Id: Ifb24f8bf143689ecb0f65c034a7d1b85a4d523ba
Reviewed-on: http://gerrit.chromium.org/gerrit/3333
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/fdt_decode.h')
-rw-r--r-- | include/fdt_decode.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/fdt_decode.h b/include/fdt_decode.h index ce08cf34e33..c4b78d73ffc 100644 --- a/include/fdt_decode.h +++ b/include/fdt_decode.h @@ -53,6 +53,7 @@ enum fdt_compat_id { COMPAT_SERIAL_NS16550, /* NS16550 UART */ COMPAT_NVIDIA_TEGRA250_USB, /* Tegra 250 USB port */ COMPAT_NVIDIA_TEGRA250_SDMMC, /* Tegra 250 SDMMC port */ + COMPAT_NVIDIA_TEGRA250_KBC, /* Tegra 250 Keyboard */ COMPAT_COUNT, }; @@ -167,6 +168,17 @@ struct fdt_sdmmc { enum periph_id periph_id; /* peripheral id */ }; +enum { + FDT_KBC_KEY_COUNT = 128, /* number of keys in each map */ +}; + +/* Information about keycode mappings */ +struct fdt_kbc { + u8 plain_keycode[FDT_KBC_KEY_COUNT]; + u8 shift_keycode[FDT_KBC_KEY_COUNT]; + u8 fn_keycode[FDT_KBC_KEY_COUNT]; +}; + /** * Return information from the FDT about the console UART. This looks for * an alias node called 'console' which must point to a UART. It then reads @@ -359,3 +371,22 @@ int fdt_decode_sdmmc(const void *blob, int node, struct fdt_sdmmc *config); * @returns property string, NULL on error. */ char *fdt_decode_get_config_string(const void *blob, const char *prop_name); + +/** + * Returns information from the FDT about the keboard controler. This function + * reads out the following attributes: + * + * reg + * keycode-plain + * keycode-shift + * keycode-fn + * + * @param blob FDT blob to use + * @param node Node to read from + * @param config structure to use to return information + * @returns 0 on success, -ve on error, in which case config may or may not be + * unchanged. If the node is present but expected data is + * missing then this will generally return + * -FDT_ERR_MISSING. + */ +int fdt_decode_kbc(const void *blob, int node, struct fdt_kbc *config); |