cros-ec-keyboard: Synchronize DT binding from linux
Subsystems (4)
PATCH 1/1 cros-ec-keyboard: Synchronize DT binding from linux
The ChromeOS EC keyboard is used by various different chromebooks. Peach pi being the third board in the u-boot tree to use it (snow and peach pit the other two). Rather then embedding the same big DT node in the peach-pi DT again, copy the dtsi snippit & bindings documentation from linux and include it in all 3 boards.
This slightly changes the dt bindings in u-boot:
* google,key-rows becomes keypad,num-rows
* google,key-colums becomes keypad,num-colums
* google,repeat-delay-ms and google,repeat-rate-ms are no longer used and replaced by hardcoded values (similar to tegra kbc)
--- arch/arm/dts/cros-ec-keyboard.dtsi | 105 ++++++++++++++++++++++++ arch/arm/dts/exynos5250-snow.dts | 59 +------------ arch/arm/dts/exynos5420-peach-pit.dts | 59 +------------ arch/arm/dts/exynos5800-peach-pi.dts | 4 +- doc/device-tree-bindings/input/cros-ec-keyb.txt | 53 ++++++------ drivers/input/cros_ec_keyb.c | 16 ++-- 6 files changed, 143 insertions(+), 153 deletions(-) create mode 100644 arch/arm/dts/cros-ec-keyboard.dtsi
arch/arm/dts/cros-ec-keyboard.dtsi new file +105 -0
@@ -0,0 +1,105 @@ +/* + * Keyboard dts fragment for devices that use cros-ec-keyboard + * + * Copyright (c) 2014 Google, Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include <dt-bindings/input/input.h> + +&cros_ec { + keyboard-controller { + compatible = "google,cros-ec-keyb"; + keypad,num-rows = <8>; + keypad,num-columns = <13>; + google,needs-ghost-filter; + + linux,keymap = < + MATRIX_KEY(0x00, 0x01, KEY_LEFTMETA) + MATRIX_KEY(0x00, 0x02, KEY_F1) + MATRIX_KEY(0x00, 0x03, KEY_B) + MATRIX_KEY(0x00, 0x04, KEY_F10) + MATRIX_KEY(0x00, 0x06, KEY_N) + MATRIX_KEY(0x00, 0x08, KEY_EQUAL) + MATRIX_KEY(0x00, 0x0a, KEY_RIGHTALT) + + MATRIX_KEY(0x01, 0x01, KEY_ESC) + MATRIX_KEY(0x01, 0x02, KEY_F4) + MATRIX_KEY(0x01, 0x03, KEY_G) + MATRIX_KEY(0x01, 0x04, KEY_F7) + MATRIX_KEY(0x01, 0x06, KEY_H) + MATRIX_KEY(0x01, 0x08, KEY_APOSTROPHE) + MATRIX_KEY(0x01, 0x09, KEY_F9) + MATRIX_KEY(0x01, 0x0b, KEY_BACKSPACE) + + MATRIX_KEY(0x02, 0x00, KEY_LEFTCTRL) + MATRIX_KEY(0x02, 0x01, KEY_TAB) + MATRIX_KEY(0x02, 0x02, KEY_F3) + MATRIX_KEY(0x02, 0x03, KEY_T) + MATRIX_KEY(0x02, 0x04, KEY_F6) + MATRIX_KEY(0x02, 0x05, KEY_RIGHTBRACE) + MATRIX_KEY(0x02, 0x06, KEY_Y) + MATRIX_KEY(0x02, 0x07, KEY_102ND) + MATRIX_KEY(0x02, 0x08, KEY_LEFTBRACE) + MATRIX_KEY(0x02, 0x09, KEY_F8) + + MATRIX_KEY(0x03, 0x01, KEY_GRAVE) + MATRIX_KEY(0x03, 0x02, KEY_F2) + MATRIX_KEY(0x03, 0x03, KEY_5) + MATRIX_KEY(0x03, 0x04, KEY_F5) + MATRIX_KEY(0x03, 0x06, KEY_6) + MATRIX_KEY(0x03, 0x08, KEY_MINUS) + MATRIX_KEY(0x03, 0x0b, KEY_BACKSLASH) + + MATRIX_KEY(0x04, 0x00, KEY_RIGHTCTRL) + MATRIX_KEY(0x04, 0x01, KEY_A) + MATRIX_KEY(0x04, 0x02, KEY_D) + MATRIX_KEY(0x04, 0x03, KEY_F) + MATRIX_KEY(0x04, 0x04, KEY_S) + MATRIX_KEY(0x04, 0x05, KEY_K) + MATRIX_KEY(0x04, 0x06, KEY_J) + MATRIX_KEY(0x04, 0x08, KEY_SEMICOLON) + MATRIX_KEY(0x04, 0x09, KEY_L) + MATRIX_KEY(0x04, 0x0a, KEY_BACKSLASH) + MATRIX_KEY(0x04, 0x0b, KEY_ENTER) + + MATRIX_KEY(0x05, 0x01, KEY_Z) + MATRIX_KEY(0x05, 0x02, KEY_C) + MATRIX_KEY(0x05, 0x03, KEY_V) + MATRIX_KEY(0x05, 0x04, KEY_X) + MATRIX_KEY(0x05, 0x05, KEY_COMMA) + MATRIX_KEY(0x05, 0x06, KEY_M) + MATRIX_KEY(0x05, 0x07, KEY_LEFTSHIFT) + MATRIX_KEY(0x05, 0x08, KEY_SLASH) + MATRIX_KEY(0x05, 0x09, KEY_DOT) + MATRIX_KEY(0x05, 0x0b, KEY_SPACE) + + MATRIX_KEY(0x06, 0x01, KEY_1) + MATRIX_KEY(0x06, 0x02, KEY_3) + MATRIX_KEY(0x06, 0x03, KEY_4) + MATRIX_KEY(0x06, 0x04, KEY_2) + MATRIX_KEY(0x06, 0x05, KEY_8) + MATRIX_KEY(0x06, 0x06, KEY_7) + MATRIX_KEY(0x06, 0x08, KEY_0) + MATRIX_KEY(0x06, 0x09, KEY_9) + MATRIX_KEY(0x06, 0x0a, KEY_LEFTALT) + MATRIX_KEY(0x06, 0x0b, KEY_DOWN) + MATRIX_KEY(0x06, 0x0c, KEY_RIGHT) + + MATRIX_KEY(0x07, 0x01, KEY_Q) + MATRIX_KEY(0x07, 0x02, KEY_E) + MATRIX_KEY(0x07, 0x03, KEY_R) + MATRIX_KEY(0x07, 0x04, KEY_W) + MATRIX_KEY(0x07, 0x05, KEY_I) + MATRIX_KEY(0x07, 0x06, KEY_U) + MATRIX_KEY(0x07, 0x07, KEY_RIGHTSHIFT) + MATRIX_KEY(0x07, 0x08, KEY_P) + MATRIX_KEY(0x07, 0x09, KEY_O) + MATRIX_KEY(0x07, 0x0b, KEY_UP) + MATRIX_KEY(0x07, 0x0c, KEY_LEFT) + >; + }; +};
arch/arm/dts/exynos5250-snow.dts +3 -56
74 lines not on this page · raw message
arch/arm/dts/exynos5420-peach-pit.dts +3 -56
74 lines not on this page · raw message
arch/arm/dts/exynos5800-peach-pi.dts +3 -1
@@ -101,7 +101,7 @@ spi at 12d40000 { /* spi2 */ spi-max-frequency = <4000000>; spi-deactivate-delay = <200>; - cros-ec at 0 { + cros_ec: cros-ec at 0 { reg = <0>; compatible = "google,cros-ec"; spi-half-duplex;
@@ -155,3 +155,5 @@ samsung,dual-lcd-enabled = <0>; }; }; + +#include "cros-ec-keyboard.dtsi"
doc/device-tree-bindings/input/cros-ec-keyb.txt +23 -30
68 lines not on this page · raw message
drivers/input/cros_ec_keyb.c +6 -10
@@ -18,6 +18,8 @@ DECLARE_GLOBAL_DATA_PTR;enum {KBC_MAX_KEYS =8 ,/* Maximum keys held down at once */ +KBC_REPEAT_RATE_MS =30 , +KBC_REPEAT_DELAY_MS =240 , }; static struct keyb {
@@ -26,8 +28,6 @@ static struct keyb {struct key_matrix matrix;/* The key matrix layer */ int key_rows;/* Number of keyboard rows */ int key_cols;/* Number of keyboard columns */ -unsigned int repeat_delay_ms;/* Time before autorepeat starts */ -unsigned int repeat_rate_ms;/* Autorepeat rate in ms */ int ghost_filter;/* 1 to enable ghost filter, else 0 */ int inited;/* 1 if keyboard is ready */ } config;
@@ -188,8 +188,8 @@ static int cros_ec_keyb_decode_fdt(const void *blob, int node,* Get keyboard rows and columns -@present we are limited to * 8 columns by the protocol (one byte per row scan) */ - config->key_rows =fdtdec_get_int (blob, node,"google,key-rows" ,0 ); - config->key_cols =fdtdec_get_int (blob, node,"google,key-columns" ,0 ); + config->key_rows =fdtdec_get_int (blob, node,"keypad,num-rows" ,0 ); + config->key_cols =fdtdec_get_int (blob, node,"keypad,num-columns" ,0 );if (!config->key_rows || !config->key_cols || config->key_rows * config->key_cols /8 >CROS_EC_KEYSCAN_COLS ) {
@@ -197,10 +197,6 @@ static int cros_ec_keyb_decode_fdt(const void *blob, int node, config->key_rows, config->key_cols);return -1 ; } - config->repeat_delay_ms =fdtdec_get_int (blob, node, -"google,repeat-delay-ms" ,0 ); - config->repeat_rate_ms =fdtdec_get_int (blob, node, -"google,repeat-rate-ms" ,0 ); config->ghost_filter =fdtdec_get_bool (blob, node,"google,ghost-filter" );return 0 ;
@@ -232,8 +228,8 @@ static int cros_ec_init_keyboard(struct stdio_dev *dev) }if (cros_ec_keyb_decode_fdt (blob, node, &config))return -1 ; -input_set_delays (&config.input, config.repeat_delay_ms, - config.repeat_rate_ms); +input_set_delays (&config.input,KBC_REPEAT_DELAY_MS , +KBC_REPEAT_RATE_MS );if (key_matrix_init (&config.matrix, config.key_rows, config.key_cols, config.ghost_filter)) {debug ("%s: cannot init key matrix\n" , __func__);
Signature · 1 line
2.1.3
PATCH 1/1 cros-ec-keyboard: Synchronize DT binding from linux
Quoted 13 lines · Sjoerd Simons
The ChromeOS EC keyboard is used by various different chromebooks. Peach pi being the third board in the u-boot tree to use it (snow and peach pit the other two). Rather then embedding the same big DT node in the peach-pi DT again, copy the dtsi snippit & bindings documentation from linux and include it in all 3 boards.
This slightly changes the dt bindings in u-boot:
* google,key-rows becomes keypad,num-rows
* google,key-colums becomes keypad,num-colums
* google,repeat-delay-ms and google,repeat-rate-ms are no longer used and replaced by hardcoded values (similar to tegra kbc)Signed-off-by Sjoerd Simons <[email protected]>
Quoted 9 lines
--- arch/arm/dts/cros-ec-keyboard.dtsi | 105 ++++++++++++++++++++++++ arch/arm/dts/exynos5250-snow.dts | 59 +------------ arch/arm/dts/exynos5420-peach-pit.dts | 59 +------------ arch/arm/dts/exynos5800-peach-pi.dts | 4 +- doc/device-tree-bindings/input/cros-ec-keyb.txt | 53 ++++++------ drivers/input/cros_ec_keyb.c | 16 ++-- 6 files changed, 143 insertions(+), 153 deletions(-) create mode 100644 arch/arm/dts/cros-ec-keyboard.dtsi
Thanks for doing this.
Tested Chrome OS EC and keyboard on snow, pit, pi.
PATCH 1/1 cros-ec-keyboard: Synchronize DT binding from linux
In reply to Sjoerd SimonsQuoted 7 lines · Sjoerd Simons
The ChromeOS EC keyboard is used by various different chromebooks. Peach pi being the third board in the u-boot tree to use it (snow and peach pit the other two). Rather then embedding the same big DT node in the peach-pi DT again, copy the dtsi snippit & bindings documentation from linux and include it in all 3 boards.
This slightly changes the dt bindings in u-boot:
...
Quoted 2 lines
* google,repeat-delay-ms and google,repeat-rate-ms are no longer used and replaced by hardcoded values (similar to tegra kbc)
If more than one board needs this (and it clearly does) it would be good to make the binding "official"...? I guess that means talking to linux Documentation/devicetree maintainers...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
PATCH 1/1 cros-ec-keyboard: Synchronize DT binding from linux
Quoted 7 lines · Pavel Machek
Quoted 6 lines · Sjoerd Simons
The ChromeOS EC keyboard is used by various different chromebooks. Peach pi being the third board in the u-boot tree to use it (snow and peach pit the other two). Rather then embedding the same big DT node in the peach-pi DT again, copy the dtsi snippit & bindings documentation from linux and include it in all 3 boards.
Quoted 8 lines
Quoted 1 line
This slightly changes the dt bindings in u-boot:
...
Quoted 2 lines
* google,repeat-delay-ms and google,repeat-rate-ms are no longer used and replaced by hardcoded values (similar to tegra kbc)
If more than one board needs this (and it clearly does) it would be good to make the binding "official"...? I guess that means talking to linux
Documentation/devicetreemaintainers...
Device tree is for describing hardware, while repeat rate & delay are user preferences, not something inherent to the hardware. As such, those properties do not belong in device-tree in the first place.
Fwiw, Linux by default uses a delay of 250ms and a period of 33ms unless the driver handles auto-repeat (e.g. for PS2 which does repeat in hardware). If your goal is to fix the hardcoding of these values in various drivers, it's probably better to make u-boot input core have sane defaults for repeat rather then pushing it out into device-tree.
Signature · 9 lines
Sjoerd Simons <[email protected]> Collabora Ltd. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 6170 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141216/9cb516a5/attachment.bin>
PATCH 1/1 cros-ec-keyboard: Synchronize DT binding from linux
Hi,
Quoted 21 lines · Sjoerd Simons
Quoted 7 lines · Pavel Machek
Quoted 6 lines · Sjoerd Simons
The ChromeOS EC keyboard is used by various different chromebooks. Peach pi being the third board in the u-boot tree to use it (snow and peach pit the other two). Rather then embedding the same big DT node in the peach-pi DT again, copy the dtsi snippit & bindings documentation from linux and include it in all 3 boards.
Quoted 8 lines
Quoted 1 line
This slightly changes the dt bindings in u-boot:
...
Quoted 2 lines
* google,repeat-delay-ms and google,repeat-rate-ms are no longer used and replaced by hardcoded values (similar to tegra kbc)
If more than one board needs this (and it clearly does) it would be good to make the binding "official"...? I guess that means talking to linux
Documentation/devicetreemaintainers...Device tree is for describing hardware, while repeat rate & delay are user preferences, not something inherent to the hardware. As such, those properties do not belong in device-tree in the first place.
Quoted 5 lines
Fwiw, Linux by default uses a delay of 250ms and a period of 33ms unless the driver handles auto-repeat (e.g. for PS2 which does repeat in hardware). If your goal is to fix the hardcoding of these values in various drivers, it's probably better to make u-boot input core have sane defaults for repeat rather then pushing it out into device-tree.
This patch could be adjusted to drop the common keyboard file, which is now in mainline. But on the other hand, it will probably apply cleaning for Minkyu.
Regards,
Simon
PATCH 1/1 cros-ec-keyboard: Synchronize DT binding from linux
Quoted 31 lines · Simon Glass
Hi,
Quoted 21 lines · Sjoerd Simons
Quoted 7 lines · Pavel Machek
Quoted 6 lines · Sjoerd Simons
The ChromeOS EC keyboard is used by various different chromebooks. Peach pi being the third board in the u-boot tree to use it (snow and peach pit the other two). Rather then embedding the same big DT node in the peach-pi DT again, copy the dtsi snippit & bindings documentation from linux and include it in all 3 boards.
Quoted 8 lines
Quoted 1 line
This slightly changes the dt bindings in u-boot:
...
Quoted 2 lines
* google,repeat-delay-ms and google,repeat-rate-ms are no longer used and replaced by hardcoded values (similar to tegra kbc)
If more than one board needs this (and it clearly does) it would be good to make the binding "official"...? I guess that means talking to linux
Documentation/devicetreemaintainers...Device tree is for describing hardware, while repeat rate & delay are user preferences, not something inherent to the hardware. As such, those properties do not belong in device-tree in the first place.
Quoted 5 lines
Fwiw, Linux by default uses a delay of 250ms and a period of 33ms unless the driver handles auto-repeat (e.g. for PS2 which does repeat in hardware). If your goal is to fix the hardcoding of these values in various drivers, it's probably better to make u-boot input core have sane defaults for repeat rather then pushing it out into device-tree.
Quoted 3 lines
This patch could be adjusted to drop the common keyboard file, which is now in mainline. But on the other hand, it will probably apply cleaning for Minkyu.
I'll pick this up and apply it on top of my previous change.
Applied to u-boot-x86 branch misc, thanks!
- Simon