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 3250AC433F5 for ; Fri, 18 Mar 2022 04:53:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D099E83F43; Fri, 18 Mar 2022 05:53:04 +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="k+ajQXNP"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ES60I5BY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B079583D70; Fri, 18 Mar 2022 05:52:55 +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 73AE583CEF for ; Fri, 18 Mar 2022 05:52:51 +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 compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 9E0A63200F9F; Fri, 18 Mar 2022 00:52:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 18 Mar 2022 00:52:50 -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=fRTc0/xFRfzq8lytZsrxzgmmm6I3j/ 08hpA3L8p3sRo=; b=k+ajQXNPAVRboa5VpXAaZDHYXFiJ+nKmcksugTZRmRz0tJ CK4RUH137lKiDe0GXduhUypO4+L8RKhtpDtpyVFBrHyu5uOEfihpmqKEpI3hUFDE 2Mal0OFGNXGhcXQXbmRMXzHUfXBI6bJJU0OGTKwmKKd+15bHLNUTJPaEY95W4The pmRLr7gUHRQlAqDJfSnQx7S5Cqh3PtdrovC+g0KV6UumOVKR8w8qHG0L8s+0n/5R V2olrWQ/+HI5BONc9M7rz/YzbRay3447nc3iASwwt9yFldGzGJPmlmiskRgGgQl4 3cAt+yq0xNxR+G1xSSKmyNJNcKZhuvSEgEhQ84/A== 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=fRTc0/ xFRfzq8lytZsrxzgmmm6I3j/08hpA3L8p3sRo=; b=ES60I5BYHJoZnTT64NrWf/ Hh9gX270H7aNNMbaWczbecRX4zhHUVgEhFjT6x55uDVhLt6cxF/cBUrV3FB+A5r2 Y+y3FW9rBGuFoDdQSIGFoF2PN437isxWiXCxaK+7ohqy7/04aE1T0j8DPXYV5l0j djYrTsmO2BTqqCe0fYHn6KVQLskrfkRIa39OP5fL0Ss6pRLiSl6RQMtVcG/SEj+Y StAc1tRije15qWwEn6DTMDt/qeVn6RzimQVLKQG3W/oPraHyXZyRv8Xeda77v7rr F9hCA8D6GRDRzOCUrW/N3Bp8donRsX+X2RlrIwwMWcLaUuUqsSRHYiSYmAZTCmhw == 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:48 -0400 (EDT) From: Samuel Holland To: Heiko Schocher , u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Samuel Holland Subject: [PATCH 4/4] i2c: sun8i_rsb: Add support for DM clocks and resets Date: Thu, 17 Mar 2022 23:52:36 -0500 Message-Id: <20220318045237.56237-5-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. This also has the added benefit of picking the right clock/reset bits for H6 and new SoCs that have a rearranged PRCM MMIO space. Signed-off-by: Samuel Holland --- drivers/i2c/sun8i_rsb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/i2c/sun8i_rsb.c b/drivers/i2c/sun8i_rsb.c index 0681e398f7..e3a44e6a1b 100644 --- a/drivers/i2c/sun8i_rsb.c +++ b/drivers/i2c/sun8i_rsb.c @@ -9,10 +9,12 @@ */ #include +#include #include #include #include #include +#include #include #include #include @@ -243,9 +245,19 @@ static int sun8i_rsb_probe_chip(struct udevice *bus, uint chip_addr, static int sun8i_rsb_probe(struct udevice *bus) { struct sun8i_rsb_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); + return sun8i_rsb_init(priv->base); } -- 2.33.1