public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] post: add gpio hotkey support
Date: Wed, 11 May 2011 15:42:09 +0400	[thread overview]
Message-ID: <4DCA7611.1050508@mvista.com> (raw)
In-Reply-To: <1305046881-5818-1-git-send-email-vapier@gentoo.org>

Hello.

On 10-05-2011 21:01, Mike Frysinger wrote:

> 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
[...]
> @@ -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

    You surely meant #else here?

> +
>   	return 0;	/* No hotkeys supported */
>   }
>   int post_hotkeys_pressed(void)

WBR, Sergei

  reply	other threads:[~2011-05-11 11:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 17:01 [U-Boot] [PATCH] post: add gpio hotkey support Mike Frysinger
2011-05-11 11:42 ` Sergei Shtylyov [this message]
2011-05-11 14:54   ` Mike Frysinger
2011-05-12 12:47     ` Sergei Shtylyov
2011-05-12 15:08       ` Mike Frysinger
2011-07-26 14:47 ` Wolfgang Denk

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=4DCA7611.1050508@mvista.com \
    --to=sshtylyov@mvista.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox