From patchwork Mon Jan 20 20:55:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 23414 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 33482203C6 for ; Mon, 20 Jan 2014 20:55:10 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id hq11sf12421733vcb.0 for ; Mon, 20 Jan 2014 12:55:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=iFH45tK1fGAbspL7fKcVUsgYKWZJ4VRI5vJNUMviXQ4=; b=fn5VHNa/f++uRjQ3XGIIMOG5UQlMd1eHSQRIufKtSUgxQQXzaNUZ9qMT7LzyBMUDZR qrLbKKi8Dgq9GzzWdvECG7vV+lhMb/9tCCYu/76Rr3nLPFy9EGDHUMKCftwxIz79O9hu lG/ytYaSsD/V/fnybb5x3T0q/wTOnWIy0mOVPAnGMHrnayYMBK6xId9gA7JPb+lCNg8S 72R8YJdEX6gn5EsrDXWM2QHBvGVeqv/GTsP5TKAbt0MtPiRTgxev0Vppgj+0fd3hrbXZ /Bv5G0jvTay5REU7bJjDzhs3dN/3P1XtlAT9jO2BozRhBYj+pTrzNIjXTAPC2ua2MQ0X pLzQ== X-Gm-Message-State: ALoCoQloCvsBLPD1WlgM8pmMOp5vtN0Ii5Cz+55+778cyR30o/LW0Yxetv4yKYVTJn+hugIHxnuV X-Received: by 10.58.189.73 with SMTP id gg9mr1773825vec.34.1390251309396; Mon, 20 Jan 2014 12:55:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.195 with SMTP id 3ls299244qeg.75.gmail; Mon, 20 Jan 2014 12:55:09 -0800 (PST) X-Received: by 10.220.92.135 with SMTP id r7mr11630140vcm.11.1390251309295; Mon, 20 Jan 2014 12:55:09 -0800 (PST) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id b20si773770veu.22.2014.01.20.12.55.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Jan 2014 12:55:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id p6so3000570vbe.6 for ; Mon, 20 Jan 2014 12:55:09 -0800 (PST) X-Received: by 10.52.160.164 with SMTP id xl4mr2699197vdb.21.1390251309204; Mon, 20 Jan 2014 12:55:09 -0800 (PST) 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 u4csp76161vcz; Mon, 20 Jan 2014 12:55:08 -0800 (PST) X-Received: by 10.180.39.43 with SMTP id m11mr11430643wik.8.1390251308316; Mon, 20 Jan 2014 12:55:08 -0800 (PST) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mx.google.com with ESMTPS id j8si1578628wjz.101.2014.01.20.12.55.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Jan 2014 12:55:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.170 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.212.170; Received: by mail-wi0-f170.google.com with SMTP id ex4so4846987wid.1 for ; Mon, 20 Jan 2014 12:55:07 -0800 (PST) X-Received: by 10.180.198.200 with SMTP id je8mr5571141wic.13.1390251307719; Mon, 20 Jan 2014 12:55:07 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id pl7sm3515219wjc.16.2014.01.20.12.55.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jan 2014 12:55:06 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Mike Turquette Cc: Linus Walleij , Russell King , Rob Herring Subject: [PATCH 2/5] ARM: SP804: make Integrator/CP timer pick clock from DT Date: Mon, 20 Jan 2014 21:55:02 +0100 Message-Id: <1390251302-6285-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.4.2 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.212.47 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: , This modifies the SP804 driver so that the clock will be taken from the device tree node for the timer. Cc: Russell King Cc: Rob Herring Signed-off-by: Linus Walleij --- arch/arm/common/timer-sp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c index ce922d0ea7aa..a0648d296055 100644 --- a/arch/arm/common/timer-sp.c +++ b/arch/arm/common/timer-sp.c @@ -271,10 +271,14 @@ static void __init integrator_cp_of_init(struct device_node *np) void __iomem *base; int irq; const char *name = of_get_property(np, "compatible", NULL); + struct clk *clk; base = of_iomap(np, 0); if (WARN_ON(!base)) return; + clk = of_clk_get(np, 0); + if (WARN_ON(IS_ERR(clk))) + return; /* Ensure timer is disabled */ writel(0, base + TIMER_CTRL); @@ -283,13 +287,13 @@ static void __init integrator_cp_of_init(struct device_node *np) goto err; if (!init_count) - sp804_clocksource_init(base, name); + __sp804_clocksource_and_sched_clock_init(base, name, clk, 0); else { irq = irq_of_parse_and_map(np, 0); if (irq <= 0) goto err; - sp804_clockevents_init(base, irq, name); + __sp804_clockevents_init(base, irq, clk, name); } init_count++;