From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F2DFC433FE for ; Fri, 30 Sep 2022 19:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:To:Cc:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=584HZ1eK3ei8qbqKRQfxdaPnOdd6euHAGDOQxWa77Es=; b=3PQxkR76ChDWUw OtLTeLJNIsddHoCYW3pivzLUwRu0wAy4XYIc5gXeraOdjSQ3ieDbM96EnrYRyungk9D66WCzg2mHp 0Z7RFOvK8EuGhEaKnqFwcoMpAefRcARlsKkywR1YcWsY3LW12VFjO34ueGYsS+ex/ZitPtbJxoSbB QVAygxbyY20Di/+MdRncFxZvfRO2XPRjJCgbgvMvPZizbii0x8g25KHAxnRDjQqlaqvzsvJ849rNe XjcaXY5oY7mgPNaTQMXRNztym0tFWrrw87td2oOn3/qB1YgI0azQzXG+3m3o8bOVm85YUTGoIrLXk OziqH8o6McjNTHzVROCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oeLW9-00BAqq-3Y; Fri, 30 Sep 2022 19:17:49 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oeLW5-00BAq3-IX for linux-arm-kernel@lists.infradead.org; Fri, 30 Sep 2022 19:17:47 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F2FB0B828D0; Fri, 30 Sep 2022 19:17:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A9FEC433C1; Fri, 30 Sep 2022 19:17:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664565462; bh=eQ3OR6rdAgAUS1SAFVKPyGxUWmtoSIhePNLnOikpW9s=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=RdmDWAM5jyzrG0/5FKSkxD11bwTzMd1KwZClufYyZfe+PMqXatpV0+ZR7rcMrplr7 e+oJ6aareVeRxHgUihqsX1UsYgyQqThvc6jr2mQ7eQl33bz/tKyoGbXJHPFm+V5lhz drUWKawadqeKm0GuZlfyUkuDvl13c9Z2epYXGGCVJI3GcC9lV36FJBe3JGeJOsVzLB xcf6uV8v9MDyXZitBpQsIXTHxNUJXPqPJfDwNh06LFPajEC8EtZMxUtVhFPhDR9u1W rh6Nx92/olJ+2UfgOx1guhW8vJB42dquHBvgYFucbBijNtgxMzUNSfTivZGxT7a8Ua GKQVzYN7q9q+Q== MIME-Version: 1.0 In-Reply-To: <20220603190509.45986-2-romain.perier@gmail.com> References: <20220603190509.45986-1-romain.perier@gmail.com> <20220603190509.45986-2-romain.perier@gmail.com> Subject: Re: [PATCH RESEND v5 1/1] clk: mstar: msc313 cpupll clk driver From: Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Willy Tarreau To: Daniel Palmer , Michael Turquette , Romain Perier , linux-clk@vger.kernel.org Date: Fri, 30 Sep 2022 12:17:40 -0700 User-Agent: alot/0.10 Message-Id: <20220930191742.9A9FEC433C1@smtp.kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220930_121745_931705_3CC577E1 X-CRM114-Status: GOOD ( 27.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Romain Perier (2022-06-03 12:05:09) > From: Daniel Palmer > > Add a driver for the CPU pll/ARM pll/MIPS pll that is present > in MStar SoCs. > > Currently there is no documentation for this block so it's possible > this driver isn't entirely correct. > > Only tested on the version of this IP in the MStar/SigmaStar > ARMv7 SoCs. > > Co-authored-by: Willy Tarreau This is not a standard tag, maybe Co-developed-by is what you want? A Signed-off-by tag should be here from Willy Tarreau then. > Signed-off-by: Daniel Palmer Your Signed-off-by needs to be here. I can't apply this otherwise. > diff --git a/drivers/clk/mstar/Kconfig b/drivers/clk/mstar/Kconfig > index de37e1bce2d2..146eeb637318 100644 > --- a/drivers/clk/mstar/Kconfig > +++ b/drivers/clk/mstar/Kconfig > @@ -1,4 +1,11 @@ > # SPDX-License-Identifier: GPL-2.0-only > +config MSTAR_MSC313_CPUPLL > + bool "MStar CPUPLL driver" > + depends on ARCH_MSTARV7 || COMPILE_TEST > + default ARCH_MSTARV7 > + help > + Support for the CPU PLL present on MStar/Sigmastar SoCs. > + > config MSTAR_MSC313_MPLL > bool "MStar MPLL driver" > depends on ARCH_MSTARV7 || COMPILE_TEST > @@ -7,3 +14,4 @@ config MSTAR_MSC313_MPLL > help > Support for the MPLL PLL and dividers block present on > MStar/Sigmastar SoCs. > + > diff --git a/drivers/clk/mstar/Makefile b/drivers/clk/mstar/Makefile > index f8dcd25ede1d..21296a04e65a 100644 > --- a/drivers/clk/mstar/Makefile > +++ b/drivers/clk/mstar/Makefile > @@ -2,5 +2,5 @@ > # > # Makefile for mstar specific clk > # > - > +obj-$(CONFIG_MSTAR_MSC313_CPUPLL) += clk-msc313-cpupll.o > obj-$(CONFIG_MSTAR_MSC313_MPLL) += clk-msc313-mpll.o > diff --git a/drivers/clk/mstar/clk-msc313-cpupll.c b/drivers/clk/mstar/clk-msc313-cpupll.c > new file mode 100644 > index 000000000000..c57b509e8c20 > --- /dev/null > +++ b/drivers/clk/mstar/clk-msc313-cpupll.c > @@ -0,0 +1,221 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) 2019 Daniel Palmer > + */ > + > +#include > +#include > +#include Ought to include kernel.h and device.h too. > + [...] > + > +static const struct clk_ops msc313_cpupll_ops = { > + .recalc_rate = msc313_cpupll_recalc_rate, > + .round_rate = msc313_cpupll_round_rate, > + .set_rate = msc313_cpupll_set_rate, > +}; > + > +static const struct of_device_id msc313_cpupll_of_match[] = { > + { .compatible = "mstar,msc313-cpupll" }, > + {} > +}; > + > +static const struct clk_parent_data cpupll_parent = { Why not put this on the stack? It doesn't have to live forever. > + .index = 0, > +}; > + > +static int msc313_cpupll_probe(struct platform_device *pdev) > +{ > + struct clk_init_data clk_init = {}; > + struct device *dev = &pdev->dev; > + struct msc313_cpupll *cpupll; > + int ret; > + > + cpupll = devm_kzalloc(&pdev->dev, sizeof(*cpupll), GFP_KERNEL); > + if (!cpupll) > + return -ENOMEM; > + > + cpupll->base = devm_platform_ioremap_resource(pdev, 0); > + if (IS_ERR(cpupll->base)) > + return PTR_ERR(cpupll->base); > + > + /* LPF might not contain the current frequency so fix that up */ > + msc313_cpupll_reg_write32(cpupll, REG_LPF_LOW_L, > + msc313_cpupll_reg_read32(cpupll, REG_CURRENT)); > + > + clk_init.name = dev_name(dev); > + clk_init.ops = &msc313_cpupll_ops; > + clk_init.parent_data = &cpupll_parent; > + clk_init.num_parents = 1; > + cpupll->clk_hw.init = &clk_init; > + > + ret = devm_clk_hw_register(dev, &cpupll->clk_hw); > + if (ret) > + return ret; > + > + return of_clk_add_hw_provider(pdev->dev.of_node, of_clk_hw_simple_get, &cpupll->clk_hw); Use devm to add the provider too. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel