From mboxrd@z Thu Jan 1 00:00:00 1970 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 6DC4412B9A; Sat, 3 Feb 2024 04:14:29 +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=1706933669; cv=none; b=I/eiHAKiHawl7Ph62LLG6Y3dZhf4Qf2pDPkGUgaR5h4UepMNt7VIxU1+SCeBZ0jxSklC/2xNbEjfczLyvRHKgjOF4FEs9TaxpzP/9KvHE/CjHHdzR4bIj9DUdsB9I1MWg6H+0ZIvfSC37NcgcB6qIocrZoy/7zhukFFTKasjpbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706933669; c=relaxed/simple; bh=8wb5OuZZLPQTbz0AfYXvZauJWo/WfkfbDgr04QfE2PI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dulZ78GaRZ0G2NvW7TLQbA7Jc0mwykm2j3vJ4RUjaU43exoi2Ur8ecatZdHAQaAb0BpFYnXlDxuEGy5qG23hZlVRTpER2LMbK1HbzQPUdMdqRi62BdvJlEI0Bo4EMtAbZw5f9R5o7x8/3mXksIZf/X3e9RD3h6Xb/ZwMyrVuvaQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fsRGofbb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fsRGofbb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32261C43394; Sat, 3 Feb 2024 04:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706933669; bh=8wb5OuZZLPQTbz0AfYXvZauJWo/WfkfbDgr04QfE2PI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fsRGofbb+xsQQV7NXivFhk18nwuyNpgAU9rf97zOst2ZdgUed0rctkU4HtZaX9mZp PTYRrxq4KtGHWhJulM/cbEK25PpLDhjXmbziT3KnRf+kkEdo5KJelU3m93qb5j922D 8husvAsFFHoSM/k63Ab2dqi44+Z1JbhcdqsPvres= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tim Lunn , Heiko Stuebner , Andi Shyti , Wolfram Sang , Sasha Levin Subject: [PATCH 6.6 258/322] i2c: rk3x: Adjust mask/value offset for i2c2 on rv1126 Date: Fri, 2 Feb 2024 20:05:55 -0800 Message-ID: <20240203035407.487187131@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240203035359.041730947@linuxfoundation.org> References: <20240203035359.041730947@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ 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 4362db7c5789..086fdf262e7b 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