From patchwork Mon Aug 16 07:24:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Hannemann X-Patchwork-Id: 119658 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7G7OW2q030908 for ; Mon, 16 Aug 2010 07:24:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752736Ab0HPHYb (ORCPT ); Mon, 16 Aug 2010 03:24:31 -0400 Received: from mta-1.ms.rz.RWTH-Aachen.DE ([134.130.7.72]:42857 "EHLO mta-1.ms.rz.rwth-aachen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752610Ab0HPHYb (ORCPT ); Mon, 16 Aug 2010 03:24:31 -0400 Content-transfer-encoding: 7BIT Received: from ironport-out-1.rz.rwth-aachen.de ([134.130.5.40]) by mta-1.ms.rz.RWTH-Aachen.de (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008)) with ESMTP id <0L78004MWHWULLA0@mta-1.ms.rz.RWTH-Aachen.de> for linux-sh@vger.kernel.org; Mon, 16 Aug 2010 09:24:30 +0200 (CEST) X-IronPort-AV: E=Sophos; i="4.55,375,1278280800"; d="scan'208"; a="68923172" Received: from smarthost-2.ms.rz.rwth-aachen.de (HELO smarthost.rwth-aachen.de) ([134.130.7.90]) by ironport-in-1.rz.rwth-aachen.de with ESMTP; Mon, 16 Aug 2010 09:24:29 +0200 Received: from localhost.localdomain (informatik-4-137-226-12-76.nn.RWTH-Aachen.DE [137.226.12.76] (may be forged)) by smarthost.rwth-aachen.de (8.14.4+Sun/8.13.8/1) with ESMTP id o7G7OU7M019656; Mon, 16 Aug 2010 09:24:30 +0200 (CEST) From: Arnd Hannemann To: lethal@linux-sh.org Cc: linux-sh@vger.kernel.org, Arnd Hannemann Subject: [PATCH] ARM: mach-shmobile: AP4EVB: use gpio-leds for leds v2 Date: Mon, 16 Aug 2010 09:24:27 +0200 Message-id: <1281943467-25582-1-git-send-email-arnd@arndnet.de> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <20100816042328.GA8817@linux-sh.org> References: <20100816042328.GA8817@linux-sh.org> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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]); Mon, 16 Aug 2010 07:24:32 +0000 (UTC) diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 23d472f..88fdd40 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -650,7 +651,44 @@ static struct platform_device hdmi_device = { }, }; +static struct gpio_led ap4evb_leds[] = { + { + .name = "led4", + .gpio = GPIO_PORT185, + .default_state = LEDS_GPIO_DEFSTATE_ON, + }, + { + .name = "led2", + .gpio = GPIO_PORT186, + .default_state = LEDS_GPIO_DEFSTATE_ON, + }, + { + .name = "led3", + .gpio = GPIO_PORT187, + .default_state = LEDS_GPIO_DEFSTATE_ON, + }, + { + .name = "led1", + .gpio = GPIO_PORT188, + .default_state = LEDS_GPIO_DEFSTATE_ON, + } +}; + +static struct gpio_led_platform_data ap4evb_leds_pdata = { + .num_leds = ARRAY_SIZE(ap4evb_leds), + .leds = ap4evb_leds, +}; + +static struct platform_device leds_device = { + .name = "leds-gpio", + .id = 0, + .dev = { + .platform_data = &ap4evb_leds_pdata, + }, +}; + static struct platform_device *ap4evb_devices[] __initdata = { + &leds_device, &nor_flash_device, &smc911x_device, &sdhi0_device, @@ -840,20 +878,6 @@ static void __init ap4evb_init(void) gpio_request(GPIO_FN_CS5A, NULL); gpio_request(GPIO_FN_IRQ6_39, NULL); - /* enable LED 1 - 4 */ - gpio_request(GPIO_PORT185, NULL); - gpio_request(GPIO_PORT186, NULL); - gpio_request(GPIO_PORT187, NULL); - gpio_request(GPIO_PORT188, NULL); - gpio_direction_output(GPIO_PORT185, 1); - gpio_direction_output(GPIO_PORT186, 1); - gpio_direction_output(GPIO_PORT187, 1); - gpio_direction_output(GPIO_PORT188, 1); - gpio_export(GPIO_PORT185, 0); - gpio_export(GPIO_PORT186, 0); - gpio_export(GPIO_PORT187, 0); - gpio_export(GPIO_PORT188, 0); - /* enable Debug switch (S6) */ gpio_request(GPIO_PORT32, NULL); gpio_request(GPIO_PORT33, NULL);