Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp784227rdb; Sun, 28 Jan 2024 08:47:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgTtZfCqA7EZHnzqaEf9sMGWoGdi0U1e7nG/ZMwIeAx0ehNrS6IBw6sc7z90WemzB4k3qA X-Received: by 2002:a05:6402:27d0:b0:55e:e3f2:5381 with SMTP id c16-20020a05640227d000b0055ee3f25381mr1045360ede.15.1706460471143; Sun, 28 Jan 2024 08:47:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706460471; cv=pass; d=google.com; s=arc-20160816; b=J4T8U/OUSoA1ag/g6CJXZBVwIuUkdAUzBS3TwO1NagT8UdDBUeFpTaF7D2mgKXsB7l YgPRAztWQwbzWTucJYvSNvc0Bg/JB82SknWQWNs+1zMt2ibTKG6ECQV6YW4Ur8wqikg/ yid0/BS3P/26bx8SxdOyWobZttV5Q6Gff0WJT4Ja23iMr4XkaL/YHY0L36Eo4oGVnu/9 SVoBwsietge5oq57ULN3T4hvE7JmBpj/nPEcpJD0frhJ6rqSKqasaLgnfm+DqnVRXovQ hQEJqb49wYlcYG5nYRwzomSeTrFrps5EAqJehB0CcPgTrm3j9HlFmidwcCvr83mQhHu0 A13g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ld6jV/VGImdbdKKOKiAuB/jJAUIdjE4mdtNF4eN5SP0=; fh=yE8dKmtz0qGYmmRiDSVgLV2s5WAX14E6bwMK8ZAgLjI=; b=rxrmmR+C8JGgn/nyT+32FHE98r8Z8Kt0pyxC7WTeKFBKXlhpJpuU62EWXjW8ZGSpTK kWv0oajkw1rQ4COh0YyrKZfsmJ+VCYljRGGT2JpPxXPEfJe6kAxTctjrthnBBhmW1jle v/7cQ2mkK8REkTlmfdg0KQ6RtULd2Tmsaskgs3zWGhgJ5r/0LTshSz7abfuVpf6Y57M6 c+tgU6ZYJPomhkLLAsSE+0LIDr3iuACjAo+dXDaSNkxOoz2WtFxjyAW95o9L0tX5+Bm0 3Y6AJCHhRZDbTyj2+e8jsjLjopgBrGo0sXUyf663wBY49i2Il/x32RU0Myvsz1QgSIzg pXgw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6SQ8S2h; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41782-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fi21-20020a056402551500b0054cd3ad8197si2636703edb.306.2024.01.28.08.47.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:47:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6SQ8S2h; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41782-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C63311F262F0 for ; Sun, 28 Jan 2024 16:38:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B594212A165; Sun, 28 Jan 2024 16:15:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f6SQ8S2h" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DB2E912A144; Sun, 28 Jan 2024 16:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458516; cv=none; b=cm0FO36SZPVJ8ZOSzW03vbVq+b/7nn62TYHIu+l+Nhiku1vrkvPVQ6s5K+/QcBB/rilpPxivkriNZpX29MeEQpH9xOWzm+t9OtIL5fTjsyTRwdYwPJDi/mxjsLAB2tj+Th8Dlt+tkpd76vEcPI9MbqF453MA4bdams52/dGIKYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458516; c=relaxed/simple; bh=G+N+8BBIfAm8TLoRk47DdnlMegqEadH0LZkeQEpo5w4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EaJBoZBzeY4nGVPnBTqbMylpQ6oIznzVx9Z/hKrM8JHLAcmD7H/xddDx6222DiR5Gq4PJ0t0jgXVsLRV51eK8b3J3x8X1kfRR4L6/bi3ak2JoK9l3vsK489bnfyv/TmVaSO4xHf42AoOR5kVD7IjJcXov1u6an6j6ekPwMawfi0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f6SQ8S2h; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FD7CC433F1; Sun, 28 Jan 2024 16:15:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706458515; bh=G+N+8BBIfAm8TLoRk47DdnlMegqEadH0LZkeQEpo5w4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f6SQ8S2hOMVO7w/RmJJr9TPOEsrxLYVk16BUb+y2Zd4g+XWurlxBj2t5GMa/0lV47 8/GtGBCaVHIsAFZOeml3AiN4sY5xI9aYH2ZMV2XQzNkUza7rAmJea7/OnHIHvFnR/p qRohB1ukSqhNAonxtIgnlkFTRWe4BNTucKvINLv7x5RMg84K7LUbK0YXBVlKcAx3Cq aPolGreXFfFOYx0E0KT8BmLZ/N3l/LmQPdoH9rqO4LtmQcQ0AoferZxmxpykZVXsfh h1cexw8PKlfUqAdKX9CdjG4ORtjHF7oMdWCUaMpqgCMT43rZnkmCgGNRzIpGKg2+bo Kb+YI6bsN6+1Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tim Lunn , Heiko Stuebner , Andi Shyti , Wolfram Sang , Sasha Levin , 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 Message-ID: <20240128161424.203600-27-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240128161424.203600-1-sashal@kernel.org> References: <20240128161424.203600-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.75 Content-Transfer-Encoding: 8bit From: Tim Lunn [ 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 Acked-by: Heiko Stuebner Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- 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