Received: by 10.192.165.148 with SMTP id m20csp3492265imm; Mon, 30 Apr 2018 00:46:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrAh0uz5KnSew3NdM5I8GhfwWssiwjSwbc+BXWbbO2VNqfNLbVrkDYPb9LPlrPcdU2ReHT2 X-Received: by 2002:a17:902:bd41:: with SMTP id b1-v6mr11269271plx.302.1525074402165; Mon, 30 Apr 2018 00:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525074402; cv=none; d=google.com; s=arc-20160816; b=ohwrxUlyM3oosCUgVn5XGOZCUtAWzxEvECoz3Og5Buqsf+p3P3sNgIL9Sfb8JV/H38 /hm1LivLOvdJ1Vjxjp0roDO9dGTg4LEKPPOu3BH1w5Hjlx9ZfLXYgblRtyJh4/FImvZr qDKohNEGeTJ0bQGCCRZ58wZoCJIs76TN4lS+S7ShiCoaR1p59u0yEY56UxLUzYysdh4H zbSmZSAPl9Mifee6jrTyc9dAvdmJ6+LUmY2K4o4+3pmxEiWkOm813hyKmDcfS9SGAnui GC1xqqb777hXFfPFZ3ex0ZVxwetMo6z46nbBTBmSNepPMxCAe83DQ9Lv6iIE66Jy5i/R Lf+Q== 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:arc-authentication-results; bh=XkoLG5YlLoc7uf9MWWCOk1mGvzdq+sRKgN7Iu19y2UI=; b=gIsas0fzNrBDUITRQ1boPo9pfA7ilFuZaPk4WhxrgJpmBrCyyANuz+S2ae6E0NCnIK zAIbmwnK++hUqOV7uqChm2IxOQOJQMYKKfXQwxmLiKqblS2f966LMfbeK7A5lqNdCFCz PLQdlxFdn7ba9rriCD1vV/aMu+rR7qXfPTLeu1VKn8VVdgwU0BI5q4sS/PJ3Qi0k2RPo es/Rk0VpVMIc5Odf0u8Bh4Q7Bpx7VlgzmZ2oAOl1UYUOQwxEcfxRzutCubPLssdctgoZ 3iNTfVblt4CgZay7PYFqOP6xoVCr0vscYmUly1ArC+ghlMBX0w3trafILI+t0w8RqO5z fHQg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u193-v6si5847633pgc.186.2018.04.30.00.46.27; Mon, 30 Apr 2018 00:46:42 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752215AbeD3HqR (ORCPT + 99 others); Mon, 30 Apr 2018 03:46:17 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:3302 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbeD3HqP (ORCPT ); Mon, 30 Apr 2018 03:46:15 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Mon, 30 Apr 2018 00:46:22 -0700 Received: from HQMAIL106.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 30 Apr 2018 00:46:14 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 30 Apr 2018 00:46:14 -0700 Received: from UKMAIL102.nvidia.com (10.26.138.15) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 30 Apr 2018 07:46:13 +0000 Received: from tbergstrom-lnx.Nvidia.com (10.21.24.170) by UKMAIL102.nvidia.com (10.26.138.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 30 Apr 2018 07:46:09 +0000 Received: by tbergstrom-lnx.Nvidia.com (Postfix, from userid 1002) id C2FBBF8077F; Mon, 30 Apr 2018 10:46:09 +0300 (EEST) Date: Mon, 30 Apr 2018 10:46:09 +0300 From: Peter De Schrijver To: Dmitry Osipenko CC: Thierry Reding , Jonathan Hunter , Prashant Gaikwad , Stephen Boyd , Michael Turquette , "Linus Walleij" , Marcel Ziswiler , Marc Dietrich , , , , Subject: Re: [PATCH v1 2/4] pinctrl: tegra20: Provide CDEV1/2 clock muxes Message-ID: <20180430074609.GK6835@tbergstrom-lnx.Nvidia.com> References: <20180426235818.10018-1-digetx@gmail.com> <20180426235818.10018-3-digetx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180426235818.10018-3-digetx@gmail.com> X-NVConfidentiality: public User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [10.21.24.170] X-ClientProxiedBy: UKMAIL101.nvidia.com (10.26.138.13) To UKMAIL102.nvidia.com (10.26.138.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 27, 2018 at 02:58:16AM +0300, Dmitry Osipenko wrote: > Muxing of pins MCLK1/2 determine the muxing of the corresponding clocks. > Make pinctrl driver to provide clock muxes for the CDEV1/2 pingroups, so > that main clk-controller driver could get an actual parent clock for the > CDEV1/2 clocks. > > Signed-off-by: Dmitry Osipenko > --- > drivers/pinctrl/tegra/pinctrl-tegra.c | 11 --------- > drivers/pinctrl/tegra/pinctrl-tegra.h | 11 +++++++++ > drivers/pinctrl/tegra/pinctrl-tegra20.c | 30 ++++++++++++++++++++++++- > 3 files changed, 40 insertions(+), 12 deletions(-) > > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c > index 72c718e66ebb..49c7c1499bc3 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c > @@ -33,17 +33,6 @@ > #include "../pinctrl-utils.h" > #include "pinctrl-tegra.h" > > -struct tegra_pmx { > - struct device *dev; > - struct pinctrl_dev *pctl; > - > - const struct tegra_pinctrl_soc_data *soc; > - const char **group_pins; > - > - int nbanks; > - void __iomem **regs; > -}; > - > static inline u32 pmx_readl(struct tegra_pmx *pmx, u32 bank, u32 reg) > { > return readl(pmx->regs[bank] + reg); > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.h b/drivers/pinctrl/tegra/pinctrl-tegra.h > index 33b17cb1471e..aa33c20766c4 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra.h > +++ b/drivers/pinctrl/tegra/pinctrl-tegra.h > @@ -16,6 +16,17 @@ > #ifndef __PINMUX_TEGRA_H__ > #define __PINMUX_TEGRA_H__ > > +struct tegra_pmx { > + struct device *dev; > + struct pinctrl_dev *pctl; > + > + const struct tegra_pinctrl_soc_data *soc; > + const char **group_pins; > + > + int nbanks; > + void __iomem **regs; > +}; > + > enum tegra_pinconf_param { > /* argument: tegra_pinconf_pull */ > TEGRA_PINCONF_PARAM_PULL, > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra20.c b/drivers/pinctrl/tegra/pinctrl-tegra20.c > index 7e38ee9bae78..f31e39d797f9 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra20.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra20.c > @@ -19,6 +19,7 @@ > * more details. > */ > > +#include > #include > #include > #include > @@ -2231,9 +2232,36 @@ static const struct tegra_pinctrl_soc_data tegra20_pinctrl = { > .drvtype_in_mux = false, > }; > > +static const char *cdev1_parents[4] = { No need to have 4 here, just cdev1_parents[] will do. > + "cdev1_osc_div", "pll_a_out0", "pll_m_out1", "audio", > +}; > + > +static const char *cdev2_parents[4] = { > + "cdev2_osc_div", "hclk", "pclk", "pll_p_out4", > +}; > + Same here. > +static void tegra20_pinctrl_register_clock_muxes(struct platform_device *pdev) > +{ > + struct tegra_pmx *pmx = platform_get_drvdata(pdev); > + > + clk_register_mux(NULL, "cdev1_mux", cdev1_parents, 4, 0, > + pmx->regs[1] + 0x8, 2, 2, CLK_MUX_READ_ONLY, NULL); > + > + clk_register_mux(NULL, "cdev2_mux", cdev2_parents, 4, 0, > + pmx->regs[1] + 0x8, 4, 2, CLK_MUX_READ_ONLY, NULL); > +} > + > static int tegra20_pinctrl_probe(struct platform_device *pdev) > { > - return tegra_pinctrl_probe(pdev, &tegra20_pinctrl); > + int err; > + > + err = tegra_pinctrl_probe(pdev, &tegra20_pinctrl); > + if (err) > + return err; > + > + tegra20_pinctrl_register_clock_muxes(pdev); > + > + return 0; > } > > static const struct of_device_id tegra20_pinctrl_of_match[] = { Apart from these nitpicks: Acked-By: Peter De Schrijver