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 1365DC433EF for ; Fri, 18 Mar 2022 04:53:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 74A9A83D0C; Fri, 18 Mar 2022 05:52:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="SQHJSii7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="J/4dA1V2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0FC5C83AFD; Fri, 18 Mar 2022 05:52:51 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9573883CD8 for ; Fri, 18 Mar 2022 05:52:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id C6F753201E5F; Fri, 18 Mar 2022 00:52:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 18 Mar 2022 00:52:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; bh=jEWVPGgMvVOv7KNwpblHLtbC1L64QQ nzMLFJTsClTWo=; b=SQHJSii7rpQSRqDpb+2Cxcg+FB7Tdkf4Mn2r3N1QQ6rOug IWWVMXvbIvaC03RNaxgqRmyMXDQ8VfryjRNiDVOZPjLxUR/nJCJ480XcTHNImgYp CrX5YUvwmCfNtyMhbVUJLDDzlNCsJIwQX5Gzn0vxbOD88psKvrXEqyu38WVPdWzS q0dbtG6voi8GKL9DG16CQWlcxRCtCEOFEzXHjbEJS+5JaG5mYVYLCM7YyFZ9jo51 YPQ0zspOqpdRAyhtm/+aafc3cMqm3GrUiuKZVmiaGDm2IOfIYPj1etBN1pUCyV2U JmwWiEw1TMQ3N6dhqfdRlObHeSZHNh+lXkotvx+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=jEWVPG gMvVOv7KNwpblHLtbC1L64QQnzMLFJTsClTWo=; b=J/4dA1V26n99/odEfo5jLA 3xVP7fSYf5niGgI/5VVgpCgZxvu8Tqm8dD2SamWNYNs+Ev4gsD1/jyNn9XAwI133 nmMSS/Ziyi4Lt2LbjSwUEF5xxvrNBNXmpLHJmuOJOwGhOw+G27o0JcU/Hxt/blZl oXuKbO+2mbDNhgsaM65Vy2yEdWL3++p0BSmidFEkM1Z7i8X8z/JjPdaZHlsBtRK0 PVUnnKhbpOyISBmzoVoAeGQLifteY3zhOCbF1DRMAuWNh5amH29tOe1YSEgt2TYI VPkV1r64jAeLZ7CElGoz9Ji1t8bpbjt4pFiGq6C6VitlTGoa39xYkI+oMn0nUrcg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudefhedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Mar 2022 00:52:43 -0400 (EDT) From: Samuel Holland To: Heiko Schocher , u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Samuel Holland Subject: [PATCH 2/4] i2c: sun6i_p2wi: Add support for DM clocks and resets Date: Thu, 17 Mar 2022 23:52:34 -0500 Message-Id: <20220318045237.56237-3-samuel@sholland.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220318045237.56237-1-samuel@sholland.org> References: <20220318045237.56237-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 --- 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; -- 2.33.1