From: Heiko Stuebner <heiko@sntech.de>
To: linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
Tim Lunn <tim@feathertop.org>
Cc: Jagan Teki <jagan@edgeble.ai>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Tim Lunn <tim@feathertop.org>, Rob Herring <robh+dt@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Conor Dooley <conor+dt@kernel.org>,
Andi Shyti <andi.shyti@kernel.org>,
linux-i2c@vger.kernel.org
Subject: Re: [PATCH 3/8] i2c: rk3x: Adjust grf offset for i2c2 on rv1126
Date: Thu, 16 Nov 2023 20:54:02 +0100 [thread overview]
Message-ID: <4846724.GXAFRqVoOG@phil> (raw)
In-Reply-To: <20231113120705.1647498-4-tim@feathertop.org>
Hi,
Am Montag, 13. November 2023, 13:07:00 CET schrieb Tim Lunn:
> Rockchip RV1126 has a special case grf offset/mask for i2c2
This sounds misleading. When looking at the soc-data, the grf offset
seems to be the same for all busses of the rv1126, only the offset
seems to be different for i2c2.
Sadly I don't have (and didn't find any) rv1126 TRM, so couldn't verify.
Change itself looks nice. As it's only this one bus of one soc so far,
we likely won't need a more involved solution just now.
> Signed-off-by: Tim Lunn <tim@feathertop.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 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 */
same here, comment could drop the offset reference I guess.
> + 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) {
>
Heiko
next prev parent reply other threads:[~2023-11-16 19:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 12:06 [PATCH 0/8] Add support for Sonoff iHost RV1126 Smart Home Gateway Tim Lunn
2023-11-13 12:06 ` [PATCH 1/8] ARM: dts: rockchip: rv1126: Add alternate UART pins Tim Lunn
2023-11-13 12:06 ` [PATCH 2/8] ARM: dts: rockchip: rv1126: Serial aliases Tim Lunn
2023-11-13 12:07 ` [PATCH 3/8] i2c: rk3x: Adjust grf offset for i2c2 on rv1126 Tim Lunn
2023-11-16 19:54 ` Heiko Stuebner [this message]
2023-11-18 0:31 ` Tim Lunn
2023-11-13 12:07 ` [PATCH 4/8] ARM: dts: rockchip: rv1126: Add i2c2 nodes Tim Lunn
2023-11-13 12:07 ` [PATCH 5/8] ARM: dts: rockchip: rv1126: Split up rgmii1 pinctrl Tim Lunn
2023-11-13 12:07 ` [PATCH 6/8] ARM: dts: rockchip: rv1126: Add ethernet alias Tim Lunn
2023-11-13 12:07 ` [PATCH 7/8] ARM: dts: Add Sonoff iHost Smart Home Hub Tim Lunn
2023-11-18 12:09 ` Heiko Stübner
2023-11-19 3:05 ` Tim Lunn
2023-11-13 12:07 ` [PATCH 8/8] dt-bindings: arm: rockchip: Add Sonoff iHost Tim Lunn
2023-11-16 18:10 ` Rob Herring
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=4846724.GXAFRqVoOG@phil \
--to=heiko@sntech.de \
--cc=andi.shyti@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--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 \
--cc=tim@feathertop.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;
as well as URLs for NNTP newsgroup(s).