From patchwork Sun Feb 14 19:33:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Zetterberg X-Patchwork-Id: 79313 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1EJXUSC010487 for ; Sun, 14 Feb 2010 19:33:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752870Ab0BNTd3 (ORCPT ); Sun, 14 Feb 2010 14:33:29 -0500 Received: from proxy1.bredband.net ([195.54.101.71]:46291 "EHLO proxy1.bredband.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752858Ab0BNTd0 (ORCPT ); Sun, 14 Feb 2010 14:33:26 -0500 Received: from ipb2.telenor.se (195.54.127.165) by proxy1.bredband.net (7.3.140.3) id 4B62ECEA00A3642C for linux-omap@vger.kernel.org; Sun, 14 Feb 2010 20:33:26 +0100 X-SMTPAUTH-B2: X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AslJAL3ed0vVcnxTPGdsb2JhbACDBYRUk0MMAQEBATcurR2OSoQAWwQ X-IronPort-AV: E=Sophos;i="4.49,472,1262559600"; d="scan'208";a="37173567" Received: from c-537c72d5.010-317-73746f23.cust.bredbandsbolaget.se (HELO otto.home) ([213.114.124.83]) by ipb2.telenor.se with ESMTP; 14 Feb 2010 20:33:26 +0100 Received: from [192.168.1.165] by otto.home with esmtp (Exim 4.69) (envelope-from ) id 1NgkDe-0004a4-DI; Sun, 14 Feb 2010 20:33:26 +0100 Message-ID: <4B785006.9090502@jozz.se> Date: Sun, 14 Feb 2010 20:33:26 +0100 From: Jonas Zetterberg User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20100109 Icedove/3.0 MIME-Version: 1.0 To: linux-omap@vger.kernel.org CC: =?UTF-8?B?RW5yaWMgQmFsbGV0YsOyIGkgU2VycmE=?= , Anders Hedlund Subject: [PATCH 2/2] IGEPv2: Use Red Led1 as Heartbeat if configured Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 14 Feb 2010 19:33:31 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 00ea2d6..9958987 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -354,9 +355,34 @@ static void __init igep2_display_init(void) gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1)) pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n"); } +#ifdef CONFIG_LEDS_TRIGGERS +static struct gpio_led gpio_leds[] = { + { + .name = "GPIO_LED1_RED", + .default_trigger = "heartbeat", + .gpio = IGEP2_GPIO_LED1_RED, + }, +}; + +static struct gpio_led_platform_data gpio_leds_info = { + .leds = gpio_leds, + .num_leds = ARRAY_SIZE(gpio_leds), +}; + +static struct platform_device leds_gpio = { + .name = "leds-gpio", + .id = -1, + .dev = { + .platform_data = &gpio_leds_info, + }, +}; +#endif static struct platform_device *igep2_devices[] __initdata = { &igep2_dss_device, +#ifdef CONFIG_LEDS_TRIGGERS + &leds_gpio, +#endif }; static void __init igep2_init_irq(void) @@ -462,14 +488,14 @@ static void __init igep2_init(void) gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0); } else pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); - +#ifndef CONFIG_LEDS_TRIGGERS if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_LED1_RED") == 0) && (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) { gpio_export(IGEP2_GPIO_LED1_RED, 0); gpio_set_value(IGEP2_GPIO_LED1_RED, 0); } else pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n"); - +#endif /* GPIO W-LAN + Bluetooth combo module */ if ((gpio_request(IGEP2_GPIO_WIFI_NPD, "GPIO_WIFI_NPD") == 0) && (gpio_direction_output(IGEP2_GPIO_WIFI_NPD, 1) == 0)) {