* [PATCH v2 1/6] tegra: fdt: Add keyboard controller definition
[not found] ` <1323208489-17830-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2011-12-06 21:54 ` Simon Glass
2011-12-06 21:54 ` [PATCH v2 2/6] tegra: fdt: Add keyboard definitions for Seaboard Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2011-12-06 21:54 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Albert ARIBAUD, Jerry Van Baren, Tom Warren, Devicetree Discuss
From: Anton Staff <robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
The Tegra keyboard controller provides a simple interface to a matrix
keyboard.
Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
arch/arm/dts/tegra20.dtsi | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index 27e3127..1dd3d2b 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -168,5 +168,9 @@
u-boot,periph-id = <59>; // PERIPH_ID_USB3
};
+ kbc@7000e200 {
+ compatible = "nvidia,tegra20-kbc";
+ reg = <0x7000e200 0x0078>;
+ };
};
--
1.7.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/6] tegra: fdt: Add keyboard definitions for Seaboard
[not found] ` <1323208489-17830-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-12-06 21:54 ` [PATCH v2 1/6] tegra: fdt: Add keyboard controller definition Simon Glass
@ 2011-12-06 21:54 ` Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2011-12-06 21:54 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Albert ARIBAUD, Jerry Van Baren, Tom Warren, Devicetree Discuss
From: Anton Staff <robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Seaboard uses a QUERTY keyboard. We add key codes for this to
enable key scanning to work.
Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Changes in v2:
- Remove status = "okay" since this is the default anyway
board/nvidia/dts/tegra2-seaboard.dts | 70 ++++++++++++++++++++++++++++++++++
1 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts
index 839e761..ce2c1ec 100644
--- a/board/nvidia/dts/tegra2-seaboard.dts
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -44,4 +44,74 @@
usb@c5004000 {
status = "disabled";
};
+
+ kbc@7000e200 {
+ keycode-plain = [00 00 'w' 's' 'a' 'z' 00 DE
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ '5' '4' 'r' 'e' 'f' 'd' 'x' 00
+ '7' '6' 't' 'h' 'g' 'v' 'c' ' '
+ '9' '8' 'u' 'y' 'j' 'n' 'b' 5C
+ '-' '0' 'o' 'i' 'l' 'k' ',' 'm'
+ 00 '=' ']' 0D 00 00 00 00
+ 00 00 00 00 DF DF 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ '[' 'p' 27 ';' '/' '.' 00 00
+ 00 00 08 '3' '2' 1E 00 00
+ 00 7F 00 00 00 1D 1F 1C
+ 00 00 00 'q' 00 00 '1' 00
+ 1B '`' 00 09 00 00 00 00];
+
+ keycode-shift = [00 00 'W' 'S' 'A' 'Z' 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ '%' '$' 'R' 'E' 'F' 'D' 'X' 00
+ '&' '^' 'T' 'H' 'G' 'V' 'C' ' '
+ '(' '*' 'U' 'Y' 'J' 'N' 'B' '|'
+ '_' ')' 'O' 'I' 'L' 'K' '<' 'M'
+ 00 '+' '}' 0D 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ '{' 'P' '"' ':' '?' '>' 00 00
+ 00 00 08 '#' '@' 00 00 00
+ 00 7F 00 00 00 00 00 00
+ 00 00 00 'Q' 00 00 '!' 00
+ 1B '~' 00 09 00 00 00 00];
+
+ keycode-fn = [00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ '7' 00 00 00 00 00 00 00
+ '9' '8' '4' 00 '1' 00 00 00
+ 00 '/' '6' '5' '3' '2' 00 '0'
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 27 00 '-' '+' '.' 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 '?' 00 00 00];
+
+ keycode-ctrl = [00 00 17 13 01 1a 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 12 05 06 04 18 00
+ 00 00 14 08 07 16 03 00
+ 00 00 15 19 0a 0e 02 00
+ 00 00 0f 09 0c 0b 00 0d
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 10 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 00 00 00 00 00
+ 00 00 00 11 00 00 00 00
+ 00 00 00 00 00 00 00 00];
+ };
};
--
1.7.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 3/6] fdt: Add fdtdec functions to read byte array
[not found] <1323208489-17830-1-git-send-email-sjg@chromium.org>
[not found] ` <1323208489-17830-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2011-12-06 21:54 ` Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2011-12-06 21:54 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Anton Staff, Jerry Van Baren, Tom Warren, Devicetree Discuss
From: Anton Staff <robotboy@chromium.org>
Sometimes we don't need a full cell for each value. This provides
a simple function to read a byte array, both with and without
copying it.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Use correct name for get_prop_check_min_len() function
include/fdtdec.h | 32 ++++++++++++++++++++++++++++++++
lib/fdtdec.c | 24 ++++++++++++++++++++++++
2 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/include/fdtdec.h b/include/fdtdec.h
index a8911b5..d345e7d 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -227,3 +227,35 @@ int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
* @return 0 if all ok or gpio was FDT_GPIO_NONE; -1 on error
*/
int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
+
+/**
+ * Look up a property in a node and return its contents in a byte
+ * array of given length. The property must have at least enough data for
+ * the array (count bytes). It may have more, but this will be ignored.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_name name of property to find
+ * @param array array to fill with data
+ * @param count number of array elements
+ * @return 0 if ok, or -FDT_ERR_MISSING if the property is not found,
+ * or -FDT_ERR_BADLAYOUT if not enough data
+ */
+int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name,
+ u8 *array, int count);
+
+/**
+ * Look up a property in a node and return a pointer to its contents as a
+ * byte array of given length. The property must have at least enough data
+ * for the array (count bytes). It may have more, but this will be ignored.
+ * The data is not copied.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_name name of property to find
+ * @param count number of array elements
+ * @return pointer to byte array if found, or NULL if the property is not
+ * found or there is not enough data
+ */
+const u8 *fdtdec_locate_byte_array(const void *blob, int node,
+ const char *prop_name, int count);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 931b4ce..696e57c 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -301,3 +301,27 @@ int fdtdec_setup_gpio(struct fdt_gpio_state *gpio)
return -1;
return 0;
}
+
+int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name,
+ u8 *array, int count)
+{
+ const u8 *cell;
+ int err;
+
+ cell = get_prop_check_min_len(blob, node, prop_name, count, &err);
+ if (!err)
+ memcpy(array, cell, count);
+ return err;
+}
+
+const u8 *fdtdec_locate_byte_array(const void *blob, int node,
+ const char *prop_name, int count)
+{
+ const u8 *cell;
+ int err;
+
+ cell = get_prop_check_min_len(blob, node, prop_name, count, &err);
+ if (err)
+ return NULL;
+ return cell;
+}
--
1.7.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-06 21:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1323208489-17830-1-git-send-email-sjg@chromium.org>
[not found] ` <1323208489-17830-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-12-06 21:54 ` [PATCH v2 1/6] tegra: fdt: Add keyboard controller definition Simon Glass
2011-12-06 21:54 ` [PATCH v2 2/6] tegra: fdt: Add keyboard definitions for Seaboard Simon Glass
2011-12-06 21:54 ` [PATCH v2 3/6] fdt: Add fdtdec functions to read byte array Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).