From patchwork Mon Jan 28 18:32:53 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: 156865 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3748656jaa; Mon, 28 Jan 2019 10:33:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN6sFGQCZi6g7ttDuX+6Amhve6BwPNp4kkN5zZtEmYyeGz4+W+nRKIkywsjDoJSdxM0htSG4 X-Received: by 2002:a65:4ccb:: with SMTP id n11mr21111233pgt.257.1548700415615; Mon, 28 Jan 2019 10:33:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548700415; cv=none; d=google.com; s=arc-20160816; b=I02vU6p4G1GlN/ilvbsu3iNL4fmId0F1+ENJlV8X7dC8wYCQOdv/kTPl0CvFfKHGVu uaCDis36gagRA3JN+3dcppLBp2rIqQAuffC0bM9czv69oDQj0DdwQJuG4CW7WIPeLNOO i6RHSaqQcVksrQJOldYAdLLy/N1ZeIg4rNV6hzNK9oUBQn9qaTrpI7/GMXV/9uj9qBO9 PeL0UOXL+vVHTQDA4HFEaFxpHVMfC9gPwRxrZoiQXQ/6ZC/vX5F6BHSsjdmZmTc04VS8 suMidRKN6qewYm3PmUgcXG+GEUsZJZm9mFS9+ZzkU4gTklepFeTgtcx0EZ1kBuvcHGpl g7Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=CrsB9vDQWUxmYDFtafFb8lMIaGmRCz/1Apw6ozfisK4=; b=D1Vm1lFSL7tRSZWFc13ivQF8bN7kGPXXaYaMg2H5OJwOjVpVlybX4lx8PjB8ZenZc1 RWFkZvYKfrRfjJnAlgIyOIDwMKjoTlzg576z+8mPzWaJscP2Z9m+hOkAN4js/PJyTrPB Fu6z54M08pTsJ6g21p0MAYajhA7UD+KdMi546PLnN/x+COzzMYPMzUMISz/NdnXa32+/ /exhsG0rDhaTP+dvc159vsvRvIA7fLzD1ExVrWviYrum9m0HfN9CdBwrV7QFxA6EMOaT 0XYT6QYgaVNQu4oX9cqK1FepRpzUs+Ef8ua0rr4g0SRB3+TnBwmvZI/jTawRPhjELoWp kN+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KhRO5+cs; 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 b2si10231477pgh.475.2019.01.28.10.33.35; Mon, 28 Jan 2019 10:33:35 -0800 (PST) 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=KhRO5+cs; 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 S1727981AbfA1Sdc (ORCPT + 31 others); Mon, 28 Jan 2019 13:33:32 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34348 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727909AbfA1Sd2 (ORCPT ); Mon, 28 Jan 2019 13:33:28 -0500 Received: by mail-wm1-f66.google.com with SMTP id y185so11107923wmd.1 for ; Mon, 28 Jan 2019 10:33:27 -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=KhRO5+csN6b8B+mnXc+NAwS26Oh+divVSo7QhSO3rViTZsfX0dTqWyofGc7paL1I+9 YmjqT4gyn4WWHjSJ2KHFD9EVU19issse0zOzuDZq+GpG8ewfA9hfWkLO/h4AOXwezu78 f/9cKm4qgduRmD5A5un53ljNDnpsg2bd+AxT4= 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=bRcrz8sdZojTUmlbA1FFPIS+MhPNWvmk587f7sXh8D6fhrl0a9IMNmwDpIZlP8Qas6 mIUf2A1LIIpVr0e+TYwVCzoyG0djStk4zyiZBN9YKx61EVpc9o/WzOSxsH8fAYXVjfr3 Xuyve5MjbHLfhnqDVxLUkFaWJVmGuL2E3yl6Y7eeaB9e3v6NQB+yubf67n1yI3bfKS2Q k8HpSvq2VrD2qsfWCnxLRjWDzLyGupejRuA23JEXNJSuIt0fw2/JJ9gK3N06Yg0NL3CL TezCGo+ziCd6Iy76ZgMq9dZmZKo9MtB5YNmIa200UT6FAG2Za3WhtRGdKYV8cqHAB2Cz qlZA== X-Gm-Message-State: AJcUukf16QVXksXJcRZI5uPXCXFZd5KUHgRIMMdWpykSKMlyVyC2K+AF 03ZjW1OXN83bSKKADTFn0ekZmA== X-Received: by 2002:a1c:5dd1:: with SMTP id r200mr18719376wmb.93.1548700407005; Mon, 28 Jan 2019 10:33:27 -0800 (PST) Received: from localhost.localdomain (233.red-81-47-145.staticip.rima-tde.net. [81.47.145.233]) by smtp.gmail.com with ESMTPSA id l19sm270082wme.21.2019.01.28.10.33.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 10:33:26 -0800 (PST) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, sboyd@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.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 v2 06/14] clk: qcom: hfpll: get parent clock names from DT Date: Mon, 28 Jan 2019 19:32:53 +0100 Message-Id: <1548700381-22376-7-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548700381-22376-1-git-send-email-jorge.ramirez-ortiz@linaro.org> References: <1548700381-22376-1-git-send-email-jorge.ramirez-ortiz@linaro.org> 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 --- drivers/clk/qcom/hfpll.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.7.4 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);