From patchwork Thu Nov 13 09:32:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 40716 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3564024493 for ; Thu, 13 Nov 2014 09:43:14 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id b13sf7591387wgh.10 for ; Thu, 13 Nov 2014 01:43:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=Qr93kgnxVuYOIMwiTghwkcQaj4JE9FdMCNlfyqw0jnE=; b=ZTwxalilCI+kjTQe4gF/EsK2qUMSJZIvPWqWjZ7y25ucIBlS/8viWcgfPT57BqtL25 cmIIZ2BWUlwGy1N8tT/FAd1aDfxsQ0A99kdxSkyDtLlB+Bw+9VVUJ6jtG5oZ2sOxVLrw P2eJcHyu4TEka9HqRRbPmR4/aQpPfAjV/fJKJ1DvmLiIedinNufWVW5liPzhaMfZTufV +GrgLEkgH+Y+A2MUrRKd9kHKCa+bEKWz+aSyJlw55kO3fycUnwQ1TbAyFCXls3LFNxIA XxjjDV0mpDn6GFXuUu5HmEjs+z56fdnB46EkgOBcyv+6dV+w/ZAv9I006tU9W+J+3Ubw aLqA== X-Gm-Message-State: ALoCoQnryI6lmfVGZxI1X8PhCNoWUmZxQOezBPwDR3JqiVK3RB/h3TxEl5bvlhZSDuVG5P4+uC9v X-Received: by 10.112.89.195 with SMTP id bq3mr2781282lbb.9.1415871793379; Thu, 13 Nov 2014 01:43:13 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.1 with SMTP id bc1ls235440lab.24.gmail; Thu, 13 Nov 2014 01:43:13 -0800 (PST) X-Received: by 10.152.27.38 with SMTP id q6mr1114727lag.92.1415871793074; Thu, 13 Nov 2014 01:43:13 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id jb8si18766652lbc.58.2014.11.13.01.43.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 01:43:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id 10so10607271lbg.7 for ; Thu, 13 Nov 2014 01:43:13 -0800 (PST) X-Received: by 10.112.235.196 with SMTP id uo4mr1320358lbc.66.1415871792958; Thu, 13 Nov 2014 01:43:12 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp562350lbc; Thu, 13 Nov 2014 01:43:12 -0800 (PST) X-Received: by 10.68.135.229 with SMTP id pv5mr1402494pbb.23.1415871789760; Thu, 13 Nov 2014 01:43:09 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id no2si25130825pdb.179.2014.11.13.01.43.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 01:43:09 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XoquG-0001as-A0; Thu, 13 Nov 2014 09:41:36 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xoqmn-0007WU-KH for linux-arm-kernel@bombadil.infradead.org; Thu, 13 Nov 2014 09:33:53 +0000 Received: from mail-wi0-f177.google.com ([209.85.212.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xoqml-0003lx-LM for linux-arm-kernel@lists.infradead.org; Thu, 13 Nov 2014 09:33:52 +0000 Received: by mail-wi0-f177.google.com with SMTP id l15so3673265wiw.10 for ; Thu, 13 Nov 2014 01:33:28 -0800 (PST) X-Received: by 10.194.122.10 with SMTP id lo10mr1948610wjb.19.1415871208578; Thu, 13 Nov 2014 01:33:28 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id s8sm34780905wjx.9.2014.11.13.01.33.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 01:33:27 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] ARM: integrator: move core module LED to device tree Date: Thu, 13 Nov 2014 10:32:55 +0100 Message-Id: <1415871176-11368-3-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1415871176-11368-1-git-send-email-linus.walleij@linaro.org> References: <1415871176-11368-1-git-send-email-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141113_043351_801950_67E8AECE X-CRM114-Status: GOOD ( 18.61 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.177 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.177 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Linus Walleij X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This gets rid of the custom LED driver in the Integrator directory altogether and switches us over to using the syscon LEDs for this. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/integrator.dtsi | 10 +++++ arch/arm/mach-integrator/Makefile | 2 +- arch/arm/mach-integrator/leds.c | 80 --------------------------------------- 3 files changed, 11 insertions(+), 81 deletions(-) delete mode 100644 arch/arm/mach-integrator/leds.c diff --git a/arch/arm/boot/dts/integrator.dtsi b/arch/arm/boot/dts/integrator.dtsi index 5d27087d5248..28e38f8c6b0f 100644 --- a/arch/arm/boot/dts/integrator.dtsi +++ b/arch/arm/boot/dts/integrator.dtsi @@ -8,6 +8,16 @@ core-module@10000000 { compatible = "arm,core-module-integrator", "syscon"; reg = <0x10000000 0x200>; + + /* Use core module LED to indicate CPU load */ + led@0c.0 { + compatible = "register-bit-led"; + offset = <0x0c>; + mask = <0x01>; + label = "integrator:core_module"; + linux,default-trigger = "cpu0"; + default-state = "on"; + }; }; ebi@12000000 { diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile index ec759ded7b60..1ebe45356b09 100644 --- a/arch/arm/mach-integrator/Makefile +++ b/arch/arm/mach-integrator/Makefile @@ -4,7 +4,7 @@ # Object file lists. -obj-y := core.o lm.o leds.o +obj-y := core.o lm.o obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c deleted file mode 100644 index 56f243744b98..000000000000 --- a/arch/arm/mach-integrator/leds.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Driver for the 4 user LEDs found on the Integrator AP/CP baseboard - * Based on Versatile and RealView machine LED code - * - * License terms: GNU General Public License (GPL) version 2 - * Author: Bryan Wu - */ -#include -#include -#include -#include -#include - -#include "hardware.h" -#include "cm.h" - -#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS) - -struct integrator_led { - struct led_classdev cdev; -}; - -/* - * The triggers lines up below will only be used if the - * LED triggers are compiled in. - */ -static const struct { - const char *name; - const char *trigger; -} integrator_leds[] = { - { "integrator:core_module", "cpu0", }, -}; - -static void cm_led_set(struct led_classdev *cdev, - enum led_brightness b) -{ - if (b != LED_OFF) - cm_control(CM_CTRL_LED, CM_CTRL_LED); - else - cm_control(CM_CTRL_LED, 0); -} - -static enum led_brightness cm_led_get(struct led_classdev *cdev) -{ - u32 reg = cm_get(); - - return (reg & CM_CTRL_LED) ? LED_FULL : LED_OFF; -} - -static int __init integrator_leds_init(void) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(integrator_leds); i++) { - struct integrator_led *led; - - led = kzalloc(sizeof(*led), GFP_KERNEL); - if (!led) - break; - - led->cdev.name = integrator_leds[i].name; - led->cdev.brightness_set = cm_led_set; - led->cdev.brightness_get = cm_led_get; - led->cdev.default_trigger = integrator_leds[i].trigger; - - if (led_classdev_register(NULL, &led->cdev) < 0) { - kfree(led); - break; - } - } - - return 0; -} - -/* - * Since we may have triggers on any subsystem, defer registration - * until after subsystem_init. - */ -fs_initcall(integrator_leds_init); -#endif