From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/5] post: add gpio hotkey support
Date: Tue, 28 Jun 2011 15:26:40 -0400 [thread overview]
Message-ID: <1309289203-5758-2-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1309289203-5758-1-git-send-email-vapier@gentoo.org>
Now that we have the generic GPIO layer, we can easily provide a common
implementation for the post_hotkeys_pressed() function based on it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
post/post.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/post/post.c b/post/post.c
index 1b7f2aa..ecea1e1 100644
--- a/post/post.c
+++ b/post/post.c
@@ -26,6 +26,10 @@
#include <watchdog.h>
#include <post.h>
+#ifdef CONFIG_SYS_POST_HOTKEYS_GPIO
+#include <asm/gpio.h>
+#endif
+
#ifdef CONFIG_LOGBUFFER
#include <logbuff.h>
#endif
@@ -68,6 +72,23 @@ int post_init_f (void)
*/
int __post_hotkeys_pressed(void)
{
+#ifdef CONFIG_SYS_POST_HOTKEYS_GPIO
+ int ret;
+ unsigned gpio = CONFIG_SYS_POST_HOTKEYS_GPIO;
+
+ ret = gpio_request(gpio, "hotkeys");
+ if (ret) {
+ printf("POST: gpio hotkey request failed\n");
+ return 0;
+ }
+
+ gpio_direction_input(gpio);
+ ret = gpio_get_value(gpio);
+ gpio_free(gpio);
+
+ return ret;
+#endif
+
return 0; /* No hotkeys supported */
}
int post_hotkeys_pressed(void)
--
1.7.5.3
next prev parent reply other threads:[~2011-06-28 19:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-28 19:26 [U-Boot] Pull request u-boot-blackfin.git (post branch) Mike Frysinger
2011-06-28 19:26 ` [U-Boot] [PATCH 1/5] post: fix up I/O helper usage Mike Frysinger
2011-06-28 19:26 ` Mike Frysinger [this message]
2011-06-28 19:26 ` [U-Boot] [PATCH 3/5] post: use ARRAY_SIZE Mike Frysinger
2011-06-28 19:26 ` [U-Boot] [PATCH 4/5] post: new nor flash test Mike Frysinger
2011-06-28 19:26 ` [U-Boot] [PATCH 5/5] serial: implement common uart post test Mike Frysinger
2011-06-29 21:21 ` [U-Boot] Pull request u-boot-blackfin.git (post branch) Wolfgang Denk
2011-06-29 23:30 ` Mike Frysinger
2011-06-30 10:29 ` Wolfgang Denk
2011-06-30 15:26 ` Mike Frysinger
2011-06-30 15:38 ` Wolfgang Denk
2011-06-30 15:42 ` Mike Frysinger
2011-06-30 15:49 ` Wolfgang Denk
2011-06-30 16:04 ` Mike Frysinger
2011-06-30 21:10 ` Wolfgang Denk
2011-06-30 21:12 ` Mike Frysinger
2011-06-30 22:57 ` Wolfgang Denk
2011-06-30 23:06 ` Mike Frysinger
2011-07-01 4:36 ` Wolfgang Denk
2011-07-01 23:27 ` Mike Frysinger
2011-07-03 22:30 ` Wolfgang Denk
2011-07-05 1:25 ` Mike Frysinger
2011-07-05 4:42 ` Wolfgang Denk
2011-07-05 6:14 ` Mike Frysinger
2011-07-05 9:59 ` Wolfgang Denk
2011-07-05 17:32 ` Mike Frysinger
2011-07-05 21:54 ` Wolfgang Denk
2011-07-05 22:12 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309289203-5758-2-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.