From: Tim Lunn <tim@feathertop.org>
To: linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org
Cc: Tim Lunn <tim@feathertop.org>, Jagan Teki <jagan@edgeble.ai>,
Rob Herring <robh+dt@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Heiko Stuebner <heiko@sntech.de>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Andi Shyti <andi.shyti@kernel.org>,
linux-i2c@vger.kernel.org
Subject: [PATCH v2 3/9] i2c: rk3x: Adjust offset for i2c2 on rv1126
Date: Wed, 22 Nov 2023 23:22:26 +1100 [thread overview]
Message-ID: <20231122122232.952696-4-tim@feathertop.org> (raw)
In-Reply-To: <20231122122232.952696-1-tim@feathertop.org>
Rockchip RV1126 has special case mask bits for i2c2.
i2c2 wasnt previously enabled in rv1126.dtsi, adding DT node alone
is not sufficient to enable i2c2. This patch fixes the i2c2 bus.
Signed-off-by: Tim Lunn <tim@feathertop.org>
---
Changes in v2:
- i2c: clarify commit message
drivers/i2c/busses/i2c-rk3x.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index a044ca0c35a1..151927466d1d 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -1288,8 +1288,11 @@ 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)
+ 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.40.1
next prev parent reply other threads:[~2023-11-22 12:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 12:22 [PATCH v2 0/9] Add support for Sonoff iHost RV1126 Smart Home Gateway Tim Lunn
2023-11-22 12:22 ` Tim Lunn [this message]
2023-11-26 19:43 ` [PATCH v2 3/9] i2c: rk3x: Adjust offset for i2c2 on rv1126 Andi Shyti
2023-11-27 0:26 ` Heiko Stübner
2023-11-27 10:11 ` Tim Lunn
2023-11-27 21:57 ` Andi Shyti
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=20231122122232.952696-4-tim@feathertop.org \
--to=tim@feathertop.org \
--cc=andi.shyti@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=jagan@edgeble.ai \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=robh+dt@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