From patchwork Mon Nov 13 12:07:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Lunn X-Patchwork-Id: 743561 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E34941D545; Mon, 13 Nov 2023 12:07:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=feathertop.org header.i=@feathertop.org header.b="TyGjYT0y"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NBFq3f3G" Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2517D7C; Mon, 13 Nov 2023 04:07:54 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 207CF5C0163; Mon, 13 Nov 2023 07:07:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 13 Nov 2023 07:07:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=feathertop.org; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1699877274; x= 1699963674; bh=cfmKWNvi9ySzOZPovC2dZMwlGmDOYANqHBVeqSwUZ00=; b=T yGjYT0y4TH3JKxE7wobbcM1k6GDfZRjL1iNgLq2gE78S8WtPwhKVbVEd//7ZRbum CSCTavJMQPZIR1LEa+vqJ1WX7j6vpo491EBzVaFkhEa7VTcWGQTeZcYqh21e7wMA 9TG928SA4tMJlMaNEv+5Xh2Cyrf/VdBpcr9htvZBl9+5RITjJ6a+XUyXmMVH5A9u VCDPbJwRE1ZgXgqC7Rz6xb3RpnK5EOKmnQUnRqCUefVKylIwK62GmqY9x/+0MjEz IFDxq3pL+ObD2UrXjGPrlomHN9tzfdnnlNDM5/He5ke6tH+XIrBZO5WTEIN1Pm9Z 75DCKiNs8/IUs7tGIsYfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id: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; t=1699877274; x= 1699963674; bh=cfmKWNvi9ySzOZPovC2dZMwlGmDOYANqHBVeqSwUZ00=; b=N BFq3f3GTVoQHhjm7t9KANn5UThMmMppOtBhbhy+HMco7HYw8SHbzcHA4edK6GyXh Q8mFamXFhEF0VQwVzNRiR35o3RhoJZqWuowTvCq7X7Kt14ZPX83QD1CL5l+u0EM5 Ctzm3e8nXT3IhJ7lgRkOPSJKuclm9nxUnct8LxstVQgeAs479Z24ZJpwVsIs/nby /8nmg2xrkIG20lrMXvb0Vg5eWvI/RYmABEirqtLlhkr64eVcqd5GQlX1co4TEKWh GR9RtUP2rVnXAWDc/x61zW0nc30OJe5tR3bJb+3S4y/e73yXrhoBvfJSotKNKYnl 2A7kf0Thh6PPZCmNRNsrw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeftddgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhimhcu nfhunhhnuceothhimhesfhgvrghthhgvrhhtohhprdhorhhgqeenucggtffrrghtthgvrh hnpeefffeuhfetgeeikeejvefgtdefteehgfdvhfetfeeuffeuhffhfeekgfekgeehieen ucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehtihhmse hfvggrthhhvghrthhophdrohhrgh X-ME-Proxy: Feedback-ID: i1f8241ce:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Nov 2023 07:07:48 -0500 (EST) Received: by feathertop.org (sSMTP sendmail emulation); Mon, 13 Nov 2023 23:07:44 +1100 From: Tim Lunn To: linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: Jagan Teki , Krzysztof Kozlowski , Tim Lunn , Rob Herring , Heiko Stuebner , linux-arm-kernel@lists.infradead.org, Conor Dooley , Andi Shyti , linux-i2c@vger.kernel.org Subject: [PATCH 3/8] i2c: rk3x: Adjust grf offset for i2c2 on rv1126 Date: Mon, 13 Nov 2023 23:07:00 +1100 Message-Id: <20231113120705.1647498-4-tim@feathertop.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231113120705.1647498-1-tim@feathertop.org> References: <20231113120705.1647498-1-tim@feathertop.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Rockchip RV1126 has a special case grf offset/mask for i2c2 Signed-off-by: Tim Lunn --- drivers/i2c/busses/i2c-rk3x.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index a044ca0c35a1..83b7bf7b48a7 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -1288,8 +1288,12 @@ static int rk3x_i2c_probe(struct platform_device *pdev) return -EINVAL; } - /* 27+i: write mask, 11+i: value */ - value = BIT(27 + bus_nr) | BIT(11 + bus_nr); + if (i2c->soc_data == &rv1126_soc_data && bus_nr == 2) + /* rv1126 i2c2 set pmugrf offset-0x118, bit-4 */ + value = BIT(20) | BIT(4); + else + /* 27+i: write mask, 11+i: value */ + value = BIT(27 + bus_nr) | BIT(11 + bus_nr); ret = regmap_write(grf, i2c->soc_data->grf_offset, value); if (ret != 0) {