From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Thu, 12 May 2011 16:47:56 +0400 Subject: [U-Boot] [PATCH] post: add gpio hotkey support In-Reply-To: <201105111054.50052.vapier@gentoo.org> References: <1305046881-5818-1-git-send-email-vapier@gentoo.org> <4DCA7611.1050508@mvista.com> <201105111054.50052.vapier@gentoo.org> Message-ID: <4DCBD6FC.9020101@mvista.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello. On 11-05-2011 18:54, Mike Frysinger wrote: >>> @@ -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 */ > not really what i was going for. it's fine either way though. I don't think 2 returns in a row is fine... > -mike WBR, Sergei