public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Tim Lunn <tim@feathertop.org>, Heiko Stuebner <heiko@sntech.de>,
	Andi Shyti <andi.shyti@kernel.org>, Wolfram Sang <wsa@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-i2c@vger.kernel.org
Subject: [PATCH AUTOSEL 6.1 27/27] i2c: rk3x: Adjust mask/value offset for i2c2 on rv1126
Date: Sun, 28 Jan 2024 11:14:12 -0500	[thread overview]
Message-ID: <20240128161424.203600-27-sashal@kernel.org> (raw)
In-Reply-To: <20240128161424.203600-1-sashal@kernel.org>

From: Tim Lunn <tim@feathertop.org>

[ Upstream commit 92a85b7c6262f19c65a1c115cf15f411ba65a57c ]

Rockchip RV1126 is using old style i2c controller, the i2c2
bus uses a non-sequential offset in the grf register for the
mask/value bits for this bus.

This patch fixes i2c2 bus on rv1126 SoCs.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 6aa4f1f06240..c8cd5cadcf56 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -1295,8 +1295,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);
+		/* rv1126 i2c2 uses non-sequential write mask 20, value 4 */
+		if (i2c->soc_data == &rv1126_soc_data && bus_nr == 2)
+			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) {
-- 
2.43.0


  parent reply	other threads:[~2024-01-28 16:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-28 16:13 [PATCH AUTOSEL 6.1 01/27] PCI: Only override AMD USB controller if required Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 02/27] PCI: switchtec: Fix stdev_release() crash after surprise hot remove Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 03/27] perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 04/27] xhci: fix possible null pointer deref during xhci urb enqueue Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 05/27] usb: hub: Replace hardcoded quirk value with BIT() macro Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 06/27] usb: hub: Add quirk to decrease IN-ep poll interval for Microchip USB491x hub Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 07/27] selftests/sgx: Fix linker script asserts Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 08/27] tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 09/27] fs/kernfs/dir: obey S_ISGID Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 10/27] spmi: mediatek: Fix UAF on device remove Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 11/27] PCI: Fix 64GT/s effective data rate calculation Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 12/27] PCI/AER: Decode Requester ID when no error info found Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 13/27] 9p: Fix initialisation of netfs_inode for 9p Sasha Levin
2024-01-28 16:13 ` [PATCH AUTOSEL 6.1 14/27] misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 15/27] libsubcmd: Fix memory leak in uniq() Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 16/27] drm/amdkfd: Fix lock dependency warning Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 17/27] drm/amdkfd: Fix lock dependency warning with srcu Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 18/27] virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 19/27] blk-mq: fix IO hang from sbitmap wakeup race Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 20/27] ceph: reinitialize mds feature bit even when session in open Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 21/27] ceph: fix deadlock or deadcode of misusing dget() Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 22/27] ceph: fix invalid pointer access if get_quota_realm return ERR_PTR Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 23/27] drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()' Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 24/27] drm/amdgpu: Fix with right return code '-EIO' in 'amdgpu_gmc_vram_checking()' Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 25/27] drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()' Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 6.1 26/27] drm/amdkfd: Fix 'node' NULL check in 'svm_range_get_range_boundaries()' Sasha Levin
2024-01-28 16:14 ` Sasha Levin [this message]
2024-01-28 23:19   ` [PATCH AUTOSEL 6.1 27/27] i2c: rk3x: Adjust mask/value offset for i2c2 on rv1126 Tim Lunn
2024-02-22 12:37     ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240128161424.203600-27-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tim@feathertop.org \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox