From patchwork Thu Jun 6 12:17:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 17632 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3B63220F47 for ; Thu, 6 Jun 2013 12:18:04 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id e52sf1427843eek.6 for ; Thu, 06 Jun 2013 05:18:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=lcqawmveHE0v7C3Bd8c+hqshC7Xigib6uK3Aaej9edE=; b=TjLFUtlkCzIskCj3avhbX2+hmv9P438lpN5bCWzywbM9qapsxh+QiRUbA8fTZpOOas mVN/N8Jsafzk13L1ERiMnUDg0HdC9ymBNCyqEyLU5DLLWUpixc1NauUZOmxaEdxg7Rc6 Sg+eDyTgCnB+PyFWfy9BuBepYqhqMkqzv5Sxax6+4rNau6O7hoPryGq8QsvJ9fMagKDS d+KOMDYPSRXFHffB/q7x73CntHQSS1grHKEyWpe7fqSJp9NiTX7Y8Ec0DAf5Xkc0/9ZP 7dbCWyUZWaGtg9QL1SywogGdTchoFd34Nu344ZO8B+vdKbf7iTYKJ//x02xHUOomkF3e sVxQ== X-Received: by 10.180.109.111 with SMTP id hr15mr4747402wib.1.1370521083358; Thu, 06 Jun 2013 05:18:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.73.242 with SMTP id o18ls881571wiv.41.gmail; Thu, 06 Jun 2013 05:18:03 -0700 (PDT) X-Received: by 10.194.179.2 with SMTP id dc2mr32122888wjc.53.1370521083269; Thu, 06 Jun 2013 05:18:03 -0700 (PDT) Received: from mail-ve0-x22c.google.com (mail-ve0-x22c.google.com [2607:f8b0:400c:c01::22c]) by mx.google.com with ESMTPS id x14si6937962wij.87.2013.06.06.05.18.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 05:18:03 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22c is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22c; Received: by mail-ve0-f172.google.com with SMTP id jz10so2116982veb.17 for ; Thu, 06 Jun 2013 05:18:02 -0700 (PDT) X-Received: by 10.52.157.138 with SMTP id wm10mr18728877vdb.57.1370521082199; Thu, 06 Jun 2013 05:18:02 -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.221.10.206 with SMTP id pb14csp64395vcb; Thu, 6 Jun 2013 05:18:01 -0700 (PDT) X-Received: by 10.194.173.71 with SMTP id bi7mr1072335wjc.2.1370521081326; Thu, 06 Jun 2013 05:18:01 -0700 (PDT) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [2a00:1450:400c:c05::22d]) by mx.google.com with ESMTPS id g10si28084452wjb.97.2013.06.06.05.18.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 05:18:01 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22d is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22d; Received: by mail-wi0-f173.google.com with SMTP id hi5so284581wib.0 for ; Thu, 06 Jun 2013 05:18:00 -0700 (PDT) X-Received: by 10.194.239.225 with SMTP id vv1mr762173wjc.63.1370521080799; Thu, 06 Jun 2013 05:18:00 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id d10sm15436140wik.0.2013.06.06.05.17.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 05:18:00 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Lee Jones , Mike Turquette , Ulf Hansson Subject: [PATCH 18/33] clk: ux500: Add a 2-cell Device Tree parser for obtaining PRCC clocks Date: Thu, 6 Jun 2013 13:17:06 +0100 Message-Id: <1370521041-32318-19-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1370521041-32318-1-git-send-email-lee.jones@linaro.org> References: <1370521041-32318-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkA5MIukpTcGllfjsICioFTnLvTNvpnfTj/Jjyrf2imC4A9Xe7Z+MrMCRyJpVGVWOLUpXL0 X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22c 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. Cc: Mike Turquette Cc: Ulf Hansson Signed-off-by: Lee Jones --- drivers/clk/ux500/u8500_clk.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/clk/ux500/u8500_clk.c b/drivers/clk/ux500/u8500_clk.c index ef948ff..3a7040b 100644 --- a/drivers/clk/ux500/u8500_clk.c +++ b/drivers/clk/ux500/u8500_clk.c @@ -15,6 +15,25 @@ #include #include "clk.h" +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); +} + const static struct of_device_id u8500_clk_of_match[] = { { .compatible = "stericsson,u8500-clks", }, { },