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 D1FB8C369AB for ; Sat, 12 Apr 2025 18:27:51 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ENDXO4uKqGuTkN9ifyMGyviKx6Na6b7wSZprE6SVttI=; b=sydg9go8HQM1bB DMB5V4RFRlXtLinbtqyX9VpqdkZSebIXuFEMLk4UxMLrA5YQq8gdlvPlTgOaGSMD1kV4NEBmyc/Mb yOto31yWlaD8GmWxPOfbEp2gnYu+X4qU/5dkBgl0COQQoWESe+ITcdYT9akdSaH86jsC2QcaBzgjD JyRVYl/sZlcjKO2Y3N9uKCKg7TkP4qj1UGtCa984NzW/0yPVxGymWGqmOiQybVSIhwq+aNruAjBQW bcEsh/tcgUwPV9kXE36BCrKHXOeEOG3BoWCzobFSdhxUfHy0fe2jzfJSDfHGINT7Ow+fJAREIzF8o eUhW9yEACx3ZfOUPjWYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3fZu-0000000GGnb-2Y2G; Sat, 12 Apr 2025 18:27:42 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u3fZr-0000000GGmh-44Qq for linux-riscv@lists.infradead.org; Sat, 12 Apr 2025 18:27:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 9E516A499BA; Sat, 12 Apr 2025 18:22:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DD05C4CEE3; Sat, 12 Apr 2025 18:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744482458; bh=5jrniUTmToNcT6JYZS1XF5QtKtluIwGUs3hnv44XPvY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TaDTUKSRACe488kdE+7xZwixRfG6BNyTWwTGWMOcvOHy/C/21FsAKHRHY0mL8rnAc DjkTG+MgoTRtGul7YElGwKc2Mrd4pkxv0Ecgsgc4x+OOo27Qj5W5yQd7wspvUzGUI3 sk//jx1faHzWqhn+ONT8inmPPMXvPIrLBzFvjAlX1Y1UXWUnULQ3BiBQ3BP+xO3Br5 79WW4A5hivdxH+WNW+OxhFiDPn8OuKNOHypUgQarvvtvdZNkAB/xialBmbf1lceRwt 7Dkm/SP+/8zRf9QYgx+GztyVVMNzBPpx/148Xz+yru7AVL2iqyDWJgjAtkVEfYSrYh 6B6EWuQ6IQ0+g== Date: Sat, 12 Apr 2025 13:27:37 -0500 From: Rob Herring To: Yixun Lan Cc: Linus Walleij , Krzysztof Kozlowski , Conor Dooley , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] pinctrl: spacemit: add clock support for K1 SoC Message-ID: <20250412182737.GA1425287-robh@kernel.org> References: <20250412-02-k1-pinctrl-clk-v1-0-e39734419a2d@gentoo.org> <20250412-02-k1-pinctrl-clk-v1-2-e39734419a2d@gentoo.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250412-02-k1-pinctrl-clk-v1-2-e39734419a2d@gentoo.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250412_112740_069455_9B9A19AB X-CRM114-Status: GOOD ( 17.90 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Sat, Apr 12, 2025 at 02:58:11PM +0800, Yixun Lan wrote: > For SpacemiT K1 SoC's pinctrl, explicitly acquiring clocks in > the driver instead of relying on bootloader or default hardware > settings to enable it. > > Signed-off-by: Yixun Lan > --- > drivers/pinctrl/spacemit/pinctrl-k1.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/pinctrl/spacemit/pinctrl-k1.c b/drivers/pinctrl/spacemit/pinctrl-k1.c > index 67e867b04a02ea1887d93aedfdea5bda037f88b1..3805fb09c1bc3b8cf2ccfc22dd25367292b397b9 100644 > --- a/drivers/pinctrl/spacemit/pinctrl-k1.c > +++ b/drivers/pinctrl/spacemit/pinctrl-k1.c > @@ -2,6 +2,7 @@ > /* Copyright (c) 2024 Yixun Lan */ > > #include > +#include > #include > #include > #include > @@ -721,6 +722,7 @@ static int spacemit_pinctrl_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > struct spacemit_pinctrl *pctrl; > + struct clk *func_clk, *bus_clk; > const struct spacemit_pinctrl_data *pctrl_data; > int ret; > > @@ -739,6 +741,14 @@ static int spacemit_pinctrl_probe(struct platform_device *pdev) > if (IS_ERR(pctrl->regs)) > return PTR_ERR(pctrl->regs); > > + func_clk = devm_clk_get_optional_enabled(dev, "func"); > + if (IS_ERR(func_clk)) > + return dev_err_probe(dev, PTR_ERR(func_clk), "failed to get func clock\n"); > + > + bus_clk = devm_clk_get_optional_enabled(dev, "bus"); > + if (IS_ERR(bus_clk)) > + return dev_err_probe(dev, PTR_ERR(bus_clk), "failed to get bus clock\n"); Do you really need these to be optional? Yes, it maintains compatibility, but if this platform isn't stable, then do you really need that? Rob _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv