From patchwork Mon Dec 17 09:46:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 10732987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 664011399 for ; Mon, 17 Dec 2018 09:46:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57BA12973E for ; Mon, 17 Dec 2018 09:46:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BB882974C; Mon, 17 Dec 2018 09:46:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE72A2973E for ; Mon, 17 Dec 2018 09:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732179AbeLQJqu (ORCPT ); Mon, 17 Dec 2018 04:46:50 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:32812 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732165AbeLQJqt (ORCPT ); Mon, 17 Dec 2018 04:46:49 -0500 Received: by mail-wr1-f68.google.com with SMTP id c14so11559806wrr.0 for ; Mon, 17 Dec 2018 01:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CrsB9vDQWUxmYDFtafFb8lMIaGmRCz/1Apw6ozfisK4=; b=AnLMqzqwXsU3Rh56Mw8RlaefGcFHGPMQFybrCvfMQAM0x7joM8gy5RZbA/REs6gSFs sFjAZ0C9BsOKSSnbxXXoD+VmQ35THbPnF4oapNOqnox/HFRUZJj3FUv25uiQ3Q7Ij/r8 Dr60uQr75h1UvYt4KqZB6KwXyLooOeFnR3uZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CrsB9vDQWUxmYDFtafFb8lMIaGmRCz/1Apw6ozfisK4=; b=gZ7dhL73WFp6IyQeFc+kqnhjlXqY078S+F0kOdCQBgk9PEczy9yL/OPDJN/UYsMFWq dyuxatC1NoslgQa7Zt6wwLwhn8AfUofUuUrohjPhMCdOuKii7bVtPt3mxMvsULjII2tX uBLvbs3uqJ4fCdlRAdalu8jM+LuKUDDeg6a8+XkYFixl6t0UoCg7X9L/KYaszhzSX0Bc 1NUIp3gn9j0ppc9Cvmx/qf1UfSGcNAhEHAkCc+OqIMD95yxokswP+Zk0fetJ4YQQdKP1 A1Hp3nHLNy8nZhe8SN+hg26FbkSbxxhsbnjtpXH1ez77EMJgJUbmdZuQbSg7KCXO3aTS 9T7g== X-Gm-Message-State: AA+aEWaxjnab/pJvzlOn0UKeM63FBSyPvzXSsdUKUjKkwdS70qFMbo2Y d3GO0rMNxWuU2Vu+U2mprWIPAA== X-Google-Smtp-Source: AFSGD/XJ7Wwie14n0gvFJE1BP09wzskI9QWh3ZBKXMDWsG30w6b4VE7zrHrinRfEvKyaXI/An6PA2w== X-Received: by 2002:adf:c38e:: with SMTP id p14mr9926632wrf.68.1545040007133; Mon, 17 Dec 2018 01:46:47 -0800 (PST) Received: from localhost.localdomain (58.red-81-47-145.staticip.rima-tde.net. [81.47.145.58]) by smtp.gmail.com with ESMTPSA id h12sm28878113wma.48.2018.12.17.01.46.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Dec 2018 01:46:46 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, andy.gross@linaro.org, david.brown@linaro.org, sboyd@kernel.org, will.deacon@arm.com, mturquette@baylibre.com, jassisinghbrar@gmail.com Cc: bjorn.andersson@linaro.org, vkoul@kernel.org, niklas.cassel@linaro.org, sibis@codeaurora.org, georgi.djakov@linaro.org, arnd@arndb.de, horms+renesas@verge.net.au, heiko@sntech.de, enric.balletbo@collabora.com, jagan@amarulasolutions.com, olof@lixom.net, amit.kucheria@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH 06/13] clk: qcom: hfpll: get parent clock names from DT Date: Mon, 17 Dec 2018 10:46:23 +0100 Message-Id: <1545039990-19984-7-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545039990-19984-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1545039990-19984-1-git-send-email-jorge.ramirez-ortiz@linaro.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow accessing the parent clock name required for the driver operation using the device tree node. This permits extending the driver to other platforms without having to modify its source code. For backwards compatibility leave the previous value as default. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson --- drivers/clk/qcom/hfpll.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c index a6de7101..87b7f46 100644 --- a/drivers/clk/qcom/hfpll.c +++ b/drivers/clk/qcom/hfpll.c @@ -52,6 +52,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev) void __iomem *base; struct regmap *regmap; struct clk_hfpll *h; + struct clk *pclk; struct clk_init_data init = { .parent_names = (const char *[]){ "xo" }, .num_parents = 1, @@ -75,6 +76,13 @@ static int qcom_hfpll_probe(struct platform_device *pdev) 0, &init.name)) return -ENODEV; + /* get parent clock from device tree (optional) */ + pclk = devm_clk_get(dev, "xo"); + if (!IS_ERR(pclk)) + init.parent_names = (const char *[]){ __clk_get_name(pclk) }; + else if (PTR_ERR(pclk) == -EPROBE_DEFER) + return -EPROBE_DEFER; + h->d = &hdata; h->clkr.hw.init = &init; spin_lock_init(&h->lock);