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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF429C433EF for ; Mon, 4 Apr 2022 17:31:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1F91883978; Mon, 4 Apr 2022 19:31:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id CDE5183972; Mon, 4 Apr 2022 19:31:27 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 794A7807E1 for ; Mon, 4 Apr 2022 19:31:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D4224D6E; Mon, 4 Apr 2022 10:31:20 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3204D3F718; Mon, 4 Apr 2022 10:31:20 -0700 (PDT) Date: Mon, 4 Apr 2022 15:24:22 +0100 From: Andre Przywara To: Samuel Holland Cc: Heiko Schocher , u-boot@lists.denx.de, Jagan Teki Subject: Re: [PATCH 2/4] i2c: sun6i_p2wi: Add support for DM clocks and resets Message-ID: <20220404152422.0d2a9170@donnerap.cambridge.arm.com> In-Reply-To: <20220318045237.56237-3-samuel@sholland.org> References: <20220318045237.56237-1-samuel@sholland.org> <20220318045237.56237-3-samuel@sholland.org> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On Thu, 17 Mar 2022 23:52:34 -0500 Samuel Holland wrote: Hi, > Currently, clock/reset setup for this device is handled by a > platform-specific function and is intermixed with non-DM pinctrl > setup. Use the devicetree to get clocks/resets, which disentagles > it from the pinctrl setup in preparation for moving to DM_PINCTRL. > > Signed-off-by: Samuel Holland No ability to test this, but it looks alright, and is robust against failures. Also we support the required clocks and resets in our clock driver, AFAICS. So: Reviewed-by: Andre Przywara Cheers, Andre > --- > > drivers/i2c/sun6i_p2wi.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/i2c/sun6i_p2wi.c b/drivers/i2c/sun6i_p2wi.c > index da7f540509..087c682a50 100644 > --- a/drivers/i2c/sun6i_p2wi.c > +++ b/drivers/i2c/sun6i_p2wi.c > @@ -14,10 +14,12 @@ > */ > > #include > +#include > #include > #include > #include > #include > +#include > #include > #include > #include > @@ -180,9 +182,19 @@ static int sun6i_p2wi_probe_chip(struct udevice *bus, uint chip_addr, > static int sun6i_p2wi_probe(struct udevice *bus) > { > struct sun6i_p2wi_priv *priv = dev_get_priv(bus); > + struct reset_ctl *reset; > + struct clk *clk; > > priv->base = dev_read_addr_ptr(bus); > > + reset = devm_reset_control_get(bus, NULL); > + if (!IS_ERR(reset)) > + reset_deassert(reset); > + > + clk = devm_clk_get(bus, NULL); > + if (!IS_ERR(clk)) > + clk_enable(clk); > + > sun6i_p2wi_init(priv->base); > > return 0;