Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18334747ybl; Thu, 2 Jan 2020 23:48:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwS5T0gOVGtE6gOoEdGR/YHSLXZHRqYeZG4GbSkHv8HIq7yG8ue/07dgZ4ZDK3ju70PVe1K X-Received: by 2002:a9d:6d10:: with SMTP id o16mr99360277otp.28.1578037730009; Thu, 02 Jan 2020 23:48:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578037730; cv=none; d=google.com; s=arc-20160816; b=v8IkWCs6hm2SoBDudrSXSx3XEzaHrCiJyNe7Byj5MSpfg1obrCPf8G5bZCBMjVfYR7 jo5pmOYIwRd3IoXdP2/7vi8WFjb7MKg9SOAP1UUviqn+PUf41+tqZh6p+mxrfIqYTL46 zsWNrUQffe4VMOFWqXFTAXeOLeufCqwdl1T2+k+a2uf5ArnyRBXL6hGy2sdW8yGqyqZw JOZYuVhkYqcFFWljv8oWyUiDFAm7Agpsp0qfv0UcDCpoi7sKU42Hfuq37ZGmJiAEt9+8 Nsk0frXOObye55Kfyg9nWjMdJ69hgNGojAZ17z0z6Wz9AycJ+GIouy/Uzu2MB9opDiwD nHqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TYmR7Su3TQRhxaGSs/Gmy519O0CuGnaDkzrvLms+94Q=; b=xSP+b3NOCbcHprG/EgfeCRjw0m+MI/Q/XdaW/g2uKBlEXAEXOrHhOZFuy4xz9hwE/k CC+QjX4Fk9ORRTNjTn0W2dyqGuaIb5VDWhCHX8M66d2hRABs4pjYJpfjooAH8WbsErON tDOrvk6adGrPTEFAQywvmb46SxBAE/YopbI/aNMZDiR6sYeST0QiCqAJdw6lagCpTnl0 aVWleA8lBVdEj8DPVI5XLNWTvbU+Kq3gaG2NwLHVEtWtzc3Mgzc+Ae2TCPPeM7TkmZH+ VWa/L6yWcw+STWvnhigrZ+A1ID7FSKzQmoQ/6uUajEcOBx9UTrqVDsprxkorOjUqb2xJ Ia3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XEFtpMy5; 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 j7si30515047otp.323.2020.01.02.23.48.36; Thu, 02 Jan 2020 23:48:49 -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=XEFtpMy5; 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 S1726390AbgACHrv (ORCPT + 99 others); Fri, 3 Jan 2020 02:47:51 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44549 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgACHrv (ORCPT ); Fri, 3 Jan 2020 02:47:51 -0500 Received: by mail-pl1-f193.google.com with SMTP id az3so18756593plb.11 for ; Thu, 02 Jan 2020 23:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TYmR7Su3TQRhxaGSs/Gmy519O0CuGnaDkzrvLms+94Q=; b=XEFtpMy5dirtZBAqM+HlhZxWmFJs8HM7yAX4hIvs1uimxFANWi/fN275Yyz0CfOQZn VKiiTqf2W6g4Eug26y3EBVgcQiGR4E1Lv28ZNhY3cNo7bcsThg2VG3jNwU4hX8LsKa7Y +x9xhrdzgZPuLS7t/3yM4jrcK/t3npeui8yU9zzihZCfmNiXppGIIFxle1dS8JC0fVhw Zs4sLyPsqJHT/fr1v2/7dO8AVfCUoLeb5OdPcNoMrD8BRFfJGra8meReEPPIkK0OXyLM hD+vWP0pgKG/8VXUOQTVDq0FzW6a8Qa55dAXGTZW63b7HFulGhCwrMkJ3vuqwGCsaOOz /SOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TYmR7Su3TQRhxaGSs/Gmy519O0CuGnaDkzrvLms+94Q=; b=RMQXhn5Nj2KE8emmOSFEHhJFK/hLmcX9zCM6IRW+ipWzf0fZH7xNnYruHmilMZ4JCW hUgelgjmv2r4BKfusSCS+O7VNmgjAPIpyPEzJhCJswnCOJsH+XMWrupzw8es9It/bQGZ VhPaGnV0iDAJPvGTMy/EBqmxjt70HDSCykBYo86fzFJyTBTeHXdztW+4r+5s+A1ryBt3 wij9kOj8qfxMU11goJbiDquax0E0s8RmCbZBcE80ikDtXN0Foneeke0DzvgaBGMhv4XW a6qj+vldzf/09Vgvc69PsGmhiJBgwKdwu9j0lHfsqADK+m+smYtfKefqgc7rKCST9t1Y Ph0w== X-Gm-Message-State: APjAAAXd6stp1q9budZGiOt8AR23nO3GN2Ocsze2gPtaO61EE/FOfjxb VmtIpwfCOK/TIoq9QKQkfzM/Vg== X-Received: by 2002:a17:90a:c388:: with SMTP id h8mr24798177pjt.83.1578037670646; Thu, 02 Jan 2020 23:47:50 -0800 (PST) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k16sm13727175pje.18.2020.01.02.23.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2020 23:47:49 -0800 (PST) Date: Thu, 2 Jan 2020 23:47:47 -0800 From: Bjorn Andersson To: Niklas Cassel Cc: Andy Gross , linux-arm-msm@vger.kernel.org, amit.kucheria@linaro.org, sboyd@kernel.org, Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 7/7] clk: qcom: apcs-msm8916: use clk_parent_data to specify the parent Message-ID: <20200103074747.GN988120@minitux> References: <20191125135910.679310-1-niklas.cassel@linaro.org> <20191125135910.679310-8-niklas.cassel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191125135910.679310-8-niklas.cassel@linaro.org> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 25 Nov 05:59 PST 2019, Niklas Cassel wrote: > Allow accessing the parent clock names required for the driver > operation by using the device tree node, while falling back to > the previous method of using names in the global name space. > > This permits extending the driver to other platforms without having to > modify its source code. > > Co-developed-by: Jorge Ramirez-Ortiz > Signed-off-by: Jorge Ramirez-Ortiz > Signed-off-by: Niklas Cassel > --- > Changes since v2: > -Use clk_parent_data when specifying clock parents. > > drivers/clk/qcom/apcs-msm8916.c | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c > index 46061b3d230e..bb91644edc00 100644 > --- a/drivers/clk/qcom/apcs-msm8916.c > +++ b/drivers/clk/qcom/apcs-msm8916.c > @@ -19,9 +19,9 @@ > > static const u32 gpll0_a53cc_map[] = { 4, 5 }; > > -static const char * const gpll0_a53cc[] = { > - "gpll0_vote", > - "a53pll", > +static const struct clk_parent_data pdata[] = { > + { .fw_name = "aux", .name = "gpll0_vote", }, > + { .fw_name = "pll", .name = "a53pll", }, > }; > > /* > @@ -51,6 +51,19 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) > struct clk_init_data init = { }; > int ret = -ENODEV; > > + /* > + * This driver is defined by the devicetree binding > + * Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt, > + * however, this driver is registered as a platform device by > + * qcom-apcs-ipc-mailbox.c. Because of this, when this driver > + * uses dev_get_regmap() and devm_clk_get(), it has to send the parent > + * device as argument. > + * When registering with the clock framework, we cannot use this trick, > + * since the clock framework always looks at dev->of_node when it tries > + * to find parent clock names using clk_parent_data. > + */ > + dev->of_node = parent->of_node; > + With this hunk replaced by Stephen's patch for handling this in the clock core I did some basic tests and things seems to work as expected. Tested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson Regards, Bjorn > regmap = dev_get_regmap(parent, NULL); > if (!regmap) { > dev_err(dev, "failed to get regmap: %d\n", ret); > @@ -62,8 +75,8 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) > return -ENOMEM; > > init.name = "a53mux"; > - init.parent_names = gpll0_a53cc; > - init.num_parents = ARRAY_SIZE(gpll0_a53cc); > + init.parent_data = pdata; > + init.num_parents = ARRAY_SIZE(pdata); > init.ops = &clk_regmap_mux_div_ops; > init.flags = CLK_SET_RATE_PARENT; > > -- > 2.23.0 >