From patchwork Tue Jul 12 06:46:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jochen Friedrich X-Patchwork-Id: 967342 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 p6C6o8vu014322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 12 Jul 2011 06:50:29 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QgWn3-0002GA-Ka; Tue, 12 Jul 2011 06:49:54 +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 1QgWn2-0000Xo-E0; Tue, 12 Jul 2011 06:49:52 +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 1QgWli-0000BV-9E for linux-arm-kernel@lists.infradead.org; Tue, 12 Jul 2011 06:48:32 +0000 Received: from localhost (mail0.scram.de [78.47.204.202]) by localhost (Postfix) with ESMTP id C2F2754174; Tue, 12 Jul 2011 08:48:28 +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.409 X-Spam-Level: X-Spam-Status: No, score=-4.409 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.100, 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 t-R4EoRstKvr; Tue, 12 Jul 2011 08:48:15 +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 7F049544A7; Tue, 12 Jul 2011 08:48:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scram.de; s=mail201002; t=1310453280; bh=L0QXT2wQj2ajIZkofIMvsgINsCGEoz98zFnD emy2DYQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References; b=pZ1KP2IKNICpGsPmWtVJG0YPVCXjH+NfKMBoXavoSvMLQlUNoRJa OoWSx8+LQYWbqYZllpbTVXqVyr1Hj4sscq9XL2MveCm0VKCCf2zk6UECO+X8h6/v2lz UKkW4VuqHlaSyATzdGZzvrCyfoO3/igAVImLq6R3BA4xSiX0C9IY= 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: Tue, 12 Jul 2011 08:46:26 +0200 Message-Id: <1310453186-22518-5-git-send-email-jochen@scram.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310453186-22518-1-git-send-email-jochen@scram.de> References: <1310453186-22518-1-git-send-email-jochen@scram.de> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110712_024830_818575_5272EB71 X-CRM114-Status: GOOD ( 14.82 ) 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]); Tue, 12 Jul 2011 06:50:29 +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, };