From patchwork Wed Jul 31 20:29:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 170229 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4462569ile; Wed, 31 Jul 2019 13:29:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwE+7YBTFbd9X/QL5mxCNYoiX6suH5FweYhNFtSQhUAY5QN5GCx+2JsNgaquKci3v4cFSyZ X-Received: by 2002:a62:874d:: with SMTP id i74mr48262970pfe.94.1564604991371; Wed, 31 Jul 2019 13:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564604991; cv=none; d=google.com; s=arc-20160816; b=u9qQFhhuN7EQLv9nT8BBM+E5jRqLhyHJ9WXF1GGnHgspQUknmWajGpG2qM4vxvxqsI JOU1VQN+HsaltA2qmAM6JXu/ITZzZrnibl2p3/RamOfqR4NMWFH17Oxegq3pgVuhFv71 pCmeJTSaWddpbJciIzq8JVswpuUhLpj2rqDN/9eyAqSXFi0ABt6babswRQ+dHCbS8eoB HaDjNjihF1OE+j8EtEEGblDUMlYO9ZIoOOKaHLlgju1EuLZXqfqsb6Ih5Gub4/GegVOX 7Yf2cAzzQjNwQ8KKDjRtnST3JBKXiUOh/acc78D6UhB+uwE/AjOaJhaMDhEFNh5W6cir fwig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BoMlESuV3B6tPWN9XWP2L6fpdT8XV6yqfKxT2xNxK2o=; b=FwYCD5mqia7Lu3ztJUiPBjnay7Y9yjCKNcMUvcs7GJxV6yPSv9X1m8PjTssW5AzDif Ovf6Tjaj+8GSOUp6FPyLFilgGPl1SETArWbwZE6Csy82ZOWHqCE7SP4DRyYR25QkR/Wi amId5GN1ecCYTrKvg/hFrkTP0YE7Op5mLbPsDSmGUG0EyqoEMl9N2lVOIeqJt6KtAhSm GORKeUeOzW4WTXj14Emujen+wuV/AeF6q+ipWzYfiz860J2A2AUh+69ayD32AGvc4YZQ gpc0PfGHHvzFk7NLh2t65JFH7qgJFkMvdi+03FS7z80x4ZnYHfjDL8UlmCj2zfBsaiLy ejIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n6sHKkfa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p186si20164335pgp.373.2019.07.31.13.29.51; Wed, 31 Jul 2019 13:29:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n6sHKkfa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730706AbfGaU3u (ORCPT + 29 others); Wed, 31 Jul 2019 16:29:50 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39281 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730640AbfGaU3r (ORCPT ); Wed, 31 Jul 2019 16:29:47 -0400 Received: by mail-wr1-f68.google.com with SMTP id x4so17922050wrt.6 for ; Wed, 31 Jul 2019 13:29:46 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=BoMlESuV3B6tPWN9XWP2L6fpdT8XV6yqfKxT2xNxK2o=; b=n6sHKkfaAZlka5CATr3XtZRARQ3pNoD6Mf1sXo2WWw8trtUv/46OA3woHnhBMu0b0E 6b/b/Mt+v3BxRwqJeBaAfR4dXduuxA/gGaZDNGnwJDnYsQDkRBImyl8xD0eYnPo+yxQ0 jBT/Pi0Zfg9u4jQoFELZbrv8WqznsZuz5aa/ykhC6JiyiEK74G4O0cvTMGLdKpqvOBTQ tA9D56Ag6WUbe6fuL75YnPpHQItr6F7A4lcd/PmjTlUSnOlmJXhua5N7P5eFsOkVJ7zC t0POw5bAvNfWz2eiMONKgBWktBxCeUV2NMKlOuupDWYmfCz8YKl16g1UYi5xdIoRKuBQ 8lBw== 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:mime-version:content-transfer-encoding; bh=BoMlESuV3B6tPWN9XWP2L6fpdT8XV6yqfKxT2xNxK2o=; b=dVTv+JrJOJo/DRGwtoGxaMwE+Vd7MjpPWvanNsNmiqlLm5KtdVMFqBoBdgmovsvzKF tWftj34oCmqnRKlTxKV+bGCQtbz3DGK8qwMKXvsS51Ggk1uqMPJpf84mL4njMvJ5ZW+0 5kVM9c/gD6kh0LQTwbs1bQUhXCzhAgq6jvHxam1d2ihltoTLDUbK+moDi2GCHlQPk/af XvCUSb8dGOLB6ambe9+lCLaaOfjt9SRd1u3W3j6ndd+VFSg55NaBSCjIHOLbkf3cqTcY NdOovWi2JpcHPsSevqtJkhHO4Y4aXocL3EzEqKY4DGgyqN/qD+BxB8uNx5pE50ls0KMS UEXQ== X-Gm-Message-State: APjAAAWo+OD+C8ywsAcMILZxmFuXqWRAnk7N87ModzRf5ddi02iEWBQ1 1RHr9V4aKOvkyqw2iUM6bhjG0w== X-Received: by 2002:adf:fa42:: with SMTP id y2mr54956154wrr.170.1564604985426; Wed, 31 Jul 2019 13:29:45 -0700 (PDT) Received: from localhost.localdomain (19.red-176-86-136.dynamicip.rima-tde.net. [176.86.136.19]) by smtp.gmail.com with ESMTPSA id i18sm91905591wrp.91.2019.07.31.13.29.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Jul 2019 13:29:44 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, bjorn.andersson@linaro.org, sboyd@kernel.org, david.brown@linaro.org, jassisinghbrar@gmail.com, mark.rutland@arm.com, mturquette@baylibre.com, robh+dt@kernel.org, will.deacon@arm.com, arnd@arndb.de, horms+renesas@verge.net.au, heiko@sntech.de, sibis@codeaurora.org, enric.balletbo@collabora.com, jagan@amarulasolutions.com, olof@lixom.net Cc: vkoul@kernel.org, niklas.cassel@linaro.org, georgi.djakov@linaro.org, amit.kucheria@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-msm@vger.kernel.org, khasim.mohammed@linaro.org Subject: [PATCH v4 06/13] clk: qcom: hfpll: get parent clock names from DT Date: Wed, 31 Jul 2019 22:29:22 +0200 Message-Id: <20190731202929.16443-7-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190731202929.16443-1-jorge.ramirez-ortiz@linaro.org> References: <20190731202929.16443-1-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.22.0 diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c index a6de7101430c..87b7f46d27e0 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);