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: 20936 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9CE172611D for ; Thu, 10 Oct 2013 13:52:25 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id x20sf4596711qcv.11 for ; Thu, 10 Oct 2013 06:52:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=AkUqEjjtR98lRusPc42RkGsNMrUvglr2qJISR09wIj0=; b=NOZCvpTmibExKAhvV66uv6TNjXjRWBScDbCp5II24+exm9GJOdb3fHsBqXTiBvb+s9 +YnSTufM7JYJ7gBaI3BnF0SjxwwTqQdQ3F2Rc2IaE2O+wOjB5dI1W1LZB43+Rnp2ioQ/ Y7FudSkxaXwkeJkqnCMso9klu1wc4nzwQDbH4Q1MRID9Pbeqz8yBfpjVKfWSZnnfvgzL krsSoo56jY9LM4W2TuKNnreSSlpzsUeLBEufRT63xqcQh9jwENfmJQy5sgqf2SfXbhEC 7X7lmWsCf2hTDcKn+UWg70GX8X+zVO8dNWoD1Z7+AZTGcDtV+qgN66vOqhmIP8SsksXk +Xdg== X-Received: by 10.236.0.232 with SMTP id 68mr11673367yhb.16.1381413145154; Thu, 10 Oct 2013 06:52:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.198 with SMTP id w6ls1011754qev.9.gmail; Thu, 10 Oct 2013 06:52:25 -0700 (PDT) X-Received: by 10.220.184.202 with SMTP id cl10mr7198737vcb.69.1381413145044; Thu, 10 Oct 2013 06:52:25 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id k17si14275478vck.102.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 06:52:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ia6so634144vcb.6 for ; Thu, 10 Oct 2013 06:52:25 -0700 (PDT) X-Gm-Message-State: ALoCoQkQQ/VNKZ5Gc9Y9+sFexhR2QPB02bUckR0ZpxpcQi9JX5YzSZ+mnaMreLLWURdX9n0zZ1vx X-Received: by 10.52.231.39 with SMTP id td7mr5827866vdc.106.1381413144912; Thu, 10 Oct 2013 06:52:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp377493vcz; Thu, 10 Oct 2013 06:52:24 -0700 (PDT) X-Received: by 10.180.83.101 with SMTP id p5mr7897868wiy.42.1381413143586; Thu, 10 Oct 2013 06:52:23 -0700 (PDT) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by mx.google.com with ESMTPS id ud6si6131050wib.59.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 06:52:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.171 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.212.171; Received: by mail-wi0-f171.google.com with SMTP id hm2so10084759wib.4 for ; Thu, 10 Oct 2013 06:52:23 -0700 (PDT) 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 Cc: Linus Walleij 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; }