From patchwork Wed Sep 18 12:14:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 20410 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 73A6B246E9 for ; Wed, 18 Sep 2013 12:15:13 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 6sf7111972qea.7 for ; Wed, 18 Sep 2013 05:15:13 -0700 (PDT) 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:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=y5CbZsNIQmgrbwMv+gqDO4cCZx3Oo+mUO5h/b6acLZ0=; b=kipmQb6DGO+hBHKsAWj9jGhhWtseWPNBrdOU0SW5wZBlhu0bbtotGo1vfc9iasKBg6 mtreOKpb3oOFo4F+M75WfI+6MS4fcS/JvBW1aBPaxai9jdCaSxm0geq2na2YcLCCR48n IKHJuhUFUn41kykiHzpwW2gR2uN+AS6guqqO0mDRbuT+gVA3i82MiZ/kxq3jEUooM3Eh H123igMkUiVNBjZO8gxbi1GyEjsioUH77EQOek1wOQvOcl5TMvWta1GJLN8whRXx8oOu KzYMroo7ZiSv/T8msEYIkL963sfdTPLXVRl4zF/bv50ujN2kQUlh79vEV3lMJl6vBc7K ozjw== X-Gm-Message-State: ALoCoQlftjzTmz8q24HvHrwZv6FHqGU6fRErEjZUuk/yMHHfhdWkfauvtFx2aEycIyTqDo5IvPyG X-Received: by 10.236.198.197 with SMTP id v45mr14441131yhn.26.1379506513250; Wed, 18 Sep 2013 05:15:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.29.129 with SMTP id k1ls3363485qeh.75.gmail; Wed, 18 Sep 2013 05:15:13 -0700 (PDT) X-Received: by 10.52.36.239 with SMTP id t15mr5668673vdj.11.1379506513169; Wed, 18 Sep 2013 05:15:13 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id o5si442836vdw.24.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 05:15:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id c14so5274406vea.38 for ; Wed, 18 Sep 2013 05:15:13 -0700 (PDT) X-Received: by 10.52.107.226 with SMTP id hf2mr11421466vdb.2.1379506513084; Wed, 18 Sep 2013 05:15:13 -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 u4csp214496vcz; Wed, 18 Sep 2013 05:15:12 -0700 (PDT) X-Received: by 10.15.107.10 with SMTP id ca10mr2259375eeb.76.1379506511645; Wed, 18 Sep 2013 05:15:11 -0700 (PDT) Received: from mail-ee0-f50.google.com (mail-ee0-f50.google.com [74.125.83.50]) by mx.google.com with ESMTPS id k2si1520518eey.122.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 05:15:11 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.83.50; Received: by mail-ee0-f50.google.com with SMTP id d51so3411418eek.37 for ; Wed, 18 Sep 2013 05:15:11 -0700 (PDT) X-Received: by 10.14.220.195 with SMTP id o43mr3117601eep.57.1379506511160; Wed, 18 Sep 2013 05:15:11 -0700 (PDT) Received: from localhost.localdomain (cpc15-aztw25-2-0-cust493.aztw.cable.virginmedia.com. [92.233.57.238]) by mx.google.com with ESMTPSA id b45sm2382210eef.4.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Sep 2013 05:15:10 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@linaro.org, Lee Jones Subject: [PATCH 24/41] clk: ux500: Add a 2-cell Device Tree parser for obtaining PRCC clocks Date: Wed, 18 Sep 2013 13:14:21 +0100 Message-Id: <1379506478-16625-25-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1379506478-16625-1-git-send-email-lee.jones@linaro.org> References: <1379506478-16625-1-git-send-email-lee.jones@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.179 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: , PRCC (peripheral and kernel) clocks are specified using a property tuple <&phandle base bit>, where 'base' is the peripheral (1, 2, 3, 5 or 6), and bit is read-in value into that peripheral stipulated by the hardware specification. Acked-by: Mike Turquette Signed-off-by: Lee Jones --- drivers/clk/ux500/u8500_of_clk.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/clk/ux500/u8500_of_clk.c b/drivers/clk/ux500/u8500_of_clk.c index bfbe3ca..b9b3317 100644 --- a/drivers/clk/ux500/u8500_of_clk.c +++ b/drivers/clk/ux500/u8500_of_clk.c @@ -15,6 +15,28 @@ #include #include "clk.h" +#define PRCC_SHOW(clk, base, bit) \ + clk[(base * PRCC_PERIPHS_PER_CLUSTER) + bit] + +struct clk *ux500_twocell_get(struct of_phandle_args *clkspec, void *data) +{ + struct clk **clk_data = data; + unsigned int base, bit; + + if (clkspec->args_count != 2) + return ERR_PTR(-EINVAL); + + base = clkspec->args[0]; + bit = clkspec->args[1]; + + if (base != 1 && base != 2 && base != 3 && base != 5 && base != 6) { + pr_err("%s: invalid PRCC base %d\n", __func__, base); + return ERR_PTR(-EINVAL); + } + + return PRCC_SHOW(clk_data, base, bit); +} + static const struct of_device_id u8500_clk_of_match[] = { { .compatible = "stericsson,u8500-clks", }, { },