From patchwork Thu Oct 10 13:52:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3016031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5ABE5BF924 for ; Thu, 10 Oct 2013 13:52:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DA6B2015B for ; Thu, 10 Oct 2013 13:52:57 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DDF3202F8 for ; Thu, 10 Oct 2013 13:52:55 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUGfb-0004EZ-Te; Thu, 10 Oct 2013 13:52:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUGfZ-0006ak-EW; Thu, 10 Oct 2013 13:52:49 +0000 Received: from mail-we0-f172.google.com ([74.125.82.172]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUGfW-0006DE-Lt for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2013 13:52:47 +0000 Received: by mail-we0-f172.google.com with SMTP id q58so2593610wes.31 for ; Thu, 10 Oct 2013 06:52:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AkUqEjjtR98lRusPc42RkGsNMrUvglr2qJISR09wIj0=; b=UrgLnHMLDk4JFMFOS87aQahePKNIPiKwfXdybBxvc7jYStV9Mbok/tE4iHD4zcvY+G Hlm7nqMOoUj1AXWjjYOZUa9CfTKl8l/W+Z13tbZVqd/la4irybT6L1u1b5jEdXW0/ZUw 5V4uZc4lhw63IXpS4vTzNdR2XEhRo/Y8iRPzmj9jSV9w6AdMP/Ntuav8GXEWUpclaWO0 U+5X/2cShFpF92fpldkqyJQVgea4DxXulfqK9K3vHF9d4NsPUEECH37TTCPCFHnaJteK VWyqmO2LHtzT1eVhucEr4+4ZbRpnNZJtNhaq7IRAwvon53f0ZAx0Oy4/q9ilwDsfnWOK CE1A== X-Gm-Message-State: ALoCoQnwmBNnNfte8Hs3u0PeA2p5PGZiydW0GJd4qwo1U4dOyqRKf/YHua1KAr/zB6A0PzHwfzuw X-Received: by 10.180.76.205 with SMTP id m13mr7988908wiw.10.1381413142931; Thu, 10 Oct 2013 06:52:22 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id om10sm25672286wic.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 10 Oct 2013 06:52:21 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: integrator: get the CM control register by proxy Date: Thu, 10 Oct 2013 15:52:13 +0200 Message-Id: <1381413133-16096-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131010_095246_834312_1F2DA086 X-CRM114-Status: GOOD ( 12.76 ) X-Spam-Score: -2.6 (--) Cc: Linus Walleij X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The CM_CTRL register was accessed directly from the LED driver, which does not work now that we get the base for the register from the device tree. Add an accessor function to do this and make the LED driver compile again. Signed-off-by: Linus Walleij --- arch/arm/mach-integrator/core.c | 8 ++++++++ arch/arm/mach-integrator/include/mach/cm.h | 3 ++- arch/arm/mach-integrator/leds.c | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 4cdfd73..c07c821 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c @@ -94,6 +94,14 @@ int __init integrator_init(bool is_cp) static DEFINE_RAW_SPINLOCK(cm_lock); /** + * cm_get - get the value from the CM_CTRL register + */ +u32 cm_get(void) +{ + return readl(cm_base + INTEGRATOR_HDR_CTRL_OFFSET); +} + +/** * cm_control - update the CM_CTRL register. * @mask: bits to change * @set: bits to set diff --git a/arch/arm/mach-integrator/include/mach/cm.h b/arch/arm/mach-integrator/include/mach/cm.h index 202e6a5..ae6085f 100644 --- a/arch/arm/mach-integrator/include/mach/cm.h +++ b/arch/arm/mach-integrator/include/mach/cm.h @@ -1,6 +1,7 @@ /* - * update the core module control register. + * access the core module control register. */ +u32 cm_get(void); void cm_control(u32, u32); #define CM_CTRL __io_address(INTEGRATOR_HDR_CTRL) diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c index 7a7f6d3..ed82535 100644 --- a/arch/arm/mach-integrator/leds.c +++ b/arch/arm/mach-integrator/leds.c @@ -78,7 +78,7 @@ static void cm_led_set(struct led_classdev *cdev, static enum led_brightness cm_led_get(struct led_classdev *cdev) { - u32 reg = readl(CM_CTRL); + u32 reg = cm_get(); return (reg & CM_CTRL_LED) ? LED_FULL : LED_OFF; }