From patchwork Wed Jul 6 14:42:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jochen Friedrich X-Patchwork-Id: 949812 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p66EjnPv022277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 6 Jul 2011 14:46:10 GMT Received: from canuck.infradead.org ([134.117.69.58]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QeTLw-0000rP-GQ; Wed, 06 Jul 2011 14:45:25 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QeTLr-0007MJ-Kn; Wed, 06 Jul 2011 14:45:19 +0000 Received: from mail0.scram.de ([2a01:4f8:130:2201::3] helo=mail.scram.de) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QeTL0-00079Y-VH for linux-arm-kernel@lists.infradead.org; Wed, 06 Jul 2011 14:44:29 +0000 Received: from localhost (mail0.scram.de [78.47.204.202]) by localhost (Postfix) with ESMTP id 41F0C544A6; Wed, 6 Jul 2011 16:44:25 +0200 (CEST) Authentication-Results: localhost; dkim=pass (1024-bit key) header.i=@scram.de; dkim-asp=signed X-Virus-Scanned: Debian amavisd-new at colab.de X-Spam-Flag: NO X-Spam-Score: -4.393 X-Spam-Level: X-Spam-Status: No, score=-4.393 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.116, BAYES_00=-2.599, DKIM_SIGNED=-0.01, DKIM_VERIFIED=-0.1] Authentication-Results: amavis.colab.de (amavisd-new); dkim=pass header.i=@scram.de Received: from mail.scram.de ([78.47.204.202]) by localhost (amavis.colab.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9C-yC9n5EcVO; Wed, 6 Jul 2011 16:44:12 +0200 (CEST) Received: from vfrsxgvnjfr-dev1.vr-netze.vrnet (prx.genotel.de [83.136.72.5]) (Authenticated sender: scram287) by mail.scram.de (Postfix) with ESMTPA id 56A92544A7; Wed, 6 Jul 2011 16:44:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scram.de; s=mail201002; t=1309963448; bh=L0QXT2wQj2ajIZkofIMvsgINsCGEoz98zFnD emy2DYQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References; b=Lw/CznrLV+nINB9eTcU/XjwCpNlhpfRCB+7cJgUsuWiPUGB21ak2 FstJQxwU5hNsYSjafI4yISYp+VBiJbNxrDkQG6u5Oau9ErzbMlq1sOSzh3GyKctp8TA nAvzhEIR3wOMlOs7W1OVXD3Zpb1K778WlGZj0CtnMShMnYevSWww= From: Jochen Friedrich To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, bryan.wu@canonical.com, kristoffer.ericson@gmail.com Subject: [PATCH 3.1 4/4] ARM: simpad: replace ARM specific LED code Date: Wed, 6 Jul 2011 16:42:32 +0200 Message-Id: <1309963352-12229-5-git-send-email-jochen@scram.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1309963352-12229-1-git-send-email-jochen@scram.de> References: <1309963352-12229-1-git-send-email-jochen@scram.de> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110706_104427_477797_464F9D50 X-CRM114-Status: GOOD ( 14.48 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Jochen Friedrich X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 06 Jul 2011 14:46:10 +0000 (UTC) Remove the legacy ARM LED code for simpad devices and register a stadard LED platform device using GPIO line instead. Signed-off-by: Jochen Friedrich --- arch/arm/mach-sa1100/Makefile | 1 - arch/arm/mach-sa1100/leds-simpad.c | 97 ------------------------------------ arch/arm/mach-sa1100/leds.c | 2 - arch/arm/mach-sa1100/leds.h | 1 - arch/arm/mach-sa1100/simpad.c | 28 ++++++++++ 5 files changed, 28 insertions(+), 101 deletions(-) delete mode 100644 arch/arm/mach-sa1100/leds-simpad.c diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile index 41252d2..0063178 100644 --- a/arch/arm/mach-sa1100/Makefile +++ b/arch/arm/mach-sa1100/Makefile @@ -45,7 +45,6 @@ obj-$(CONFIG_SA1100_PLEB) += pleb.o obj-$(CONFIG_SA1100_SHANNON) += shannon.o obj-$(CONFIG_SA1100_SIMPAD) += simpad.o -led-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o # LEDs support obj-$(CONFIG_LEDS) += $(led-y) diff --git a/arch/arm/mach-sa1100/leds-simpad.c b/arch/arm/mach-sa1100/leds-simpad.c deleted file mode 100644 index d25784c..0000000 --- a/arch/arm/mach-sa1100/leds-simpad.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * linux/arch/arm/mach-sa1100/leds-simpad.c - * - * Author: Juergen Messerer - */ -#include - -#include -#include -#include -#include - -#include "leds.h" - - -#define LED_STATE_ENABLED 1 -#define LED_STATE_CLAIMED 2 - -static unsigned int led_state; -static unsigned int hw_led_state; - -#define LED_GREEN (1) -#define LED_MASK (1) - -void simpad_leds_event(led_event_t evt) -{ - switch (evt) - { - case led_start: - hw_led_state = LED_GREEN; - led_state = LED_STATE_ENABLED; - break; - - case led_stop: - led_state &= ~LED_STATE_ENABLED; - break; - - case led_claim: - led_state |= LED_STATE_CLAIMED; - hw_led_state = LED_GREEN; - break; - - case led_release: - led_state &= ~LED_STATE_CLAIMED; - hw_led_state = LED_GREEN; - break; - -#ifdef CONFIG_LEDS_TIMER - case led_timer: - if (!(led_state & LED_STATE_CLAIMED)) - hw_led_state ^= LED_GREEN; - break; -#endif - -#ifdef CONFIG_LEDS_CPU - case led_idle_start: - break; - - case led_idle_end: - break; -#endif - - case led_halted: - break; - - case led_green_on: - if (led_state & LED_STATE_CLAIMED) - hw_led_state |= LED_GREEN; - break; - - case led_green_off: - if (led_state & LED_STATE_CLAIMED) - hw_led_state &= ~LED_GREEN; - break; - - case led_amber_on: - break; - - case led_amber_off: - break; - - case led_red_on: - break; - - case led_red_off: - break; - - default: - break; - } - - if (led_state & LED_STATE_ENABLED) - simpad_set_cs3_bit(LED2_ON); - else - simpad_clear_cs3_bit(LED2_ON); -} - diff --git a/arch/arm/mach-sa1100/leds.c b/arch/arm/mach-sa1100/leds.c index bbfe197..5fe71a0 100644 --- a/arch/arm/mach-sa1100/leds.c +++ b/arch/arm/mach-sa1100/leds.c @@ -42,8 +42,6 @@ sa1100_leds_init(void) leds_event = adsbitsy_leds_event; if (machine_is_pt_system3()) leds_event = system3_leds_event; - if (machine_is_simpad()) - leds_event = simpad_leds_event; /* what about machine registry? including led, apm... -zecke */ leds_event(led_start); return 0; diff --git a/arch/arm/mach-sa1100/leds.h b/arch/arm/mach-sa1100/leds.h index 68cc9f7..776b602 100644 --- a/arch/arm/mach-sa1100/leds.h +++ b/arch/arm/mach-sa1100/leds.h @@ -11,4 +11,3 @@ extern void pfs168_leds_event(led_event_t evt); extern void graphicsmaster_leds_event(led_event_t evt); extern void adsbitsy_leds_event(led_event_t evt); extern void system3_leds_event(led_event_t evt); -extern void simpad_leds_event(led_event_t evt); diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c index d1a13bb..b9c8e39 100644 --- a/arch/arm/mach-sa1100/simpad.c +++ b/arch/arm/mach-sa1100/simpad.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "generic.h" @@ -295,6 +296,32 @@ static struct platform_device simpad_polled_keys = { }; /* + * GPIO LEDs + */ + +static struct gpio_led simpad_leds[] = { + { + .name = "power", + .gpio = SIMPAD_CS3_LED2_ON, + .active_low = 0, + .default_trigger = "default-on", + }, +}; + +static struct gpio_led_platform_data simpad_led_data = { + .num_leds = 1, + .leds = simpad_leds, +}; + +static struct platform_device simpad_gpio_leds = { + .name = "leds-gpio", + .id = 0, + .dev = { + .platform_data = &simpad_led_data, + }, +}; + +/* * i2c */ static struct i2c_gpio_platform_data simpad_i2c_data = { @@ -324,6 +351,7 @@ static struct platform_device *devices[] __initdata = { &simpad_keys, &simpad_polled_keys, &simpad_mq200fb, + &simpad_gpio_leds, &simpad_i2c, };