linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Wolfram Sang <wsa@kernel.org>, Tim Lunn <tim@feathertop.org>,
	linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
	Jagan Teki <jagan@edgeble.ai>, Conor Dooley <conor+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Rob Herring <robh+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Andi Shyti <andi.shyti@kernel.org>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH v3 3/8] i2c: rk3x: Adjust mask/value offset for i2c2 on rv1126
Date: Tue, 19 Dec 2023 23:53:18 +0100	[thread overview]
Message-ID: <3368267.VdNmn5OnKV@diego> (raw)
In-Reply-To: <ZYHNkgxAauYp6ivX@shikoro>

Hi Wolfram,

Am Dienstag, 19. Dezember 2023, 18:06:26 CET schrieb Wolfram Sang:
> On Sun, Dec 03, 2023 at 11:39:59PM +1100, Tim Lunn wrote:
> > 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>
> > 
> 
> Applied to for-next, thanks!
> 
> But, phew, the fact that this driver _needs_ i2c-aliases in DT should be
> fixed somewhen. I totally overlooked this so far :/

Yeah, relying on aliases for this is probably not the most elegant thing
to do ;-)

Though right now I don't see the perfect way to change that.
Options I can think of, could be:

(1) As this really is "just" a thing for older socs that offer both a very
legacy i2c and the more modern one we use, I guess one possibility
would be to move this completely out of the i2c driver and into the
"grf-cleanup" driver [0].

We never actually implemented the "old"-style i2c driver for rk29xx
and earlier - and that thing is more than 10 years old now, so noone ever
will. So we always want to switch to the new one anyway in the kernel.


(2) The other option would be to try to identify the busses by their
address. We do this in some places, like the dsi driver [1]
with the entry matched against the reg property.


I guess from a "being done with it" perspective, the first option
would be nicer ;-) .

Thoughts?
Heiko


[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/soc/rockchip/grf.c
That code does a number of settings the in the "General Register Files"
that we simply expect, so also doing the i2c controller switch there
for all i2c busses in one go would make sense.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c#n1586



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-12-19 22:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-03 12:39 [PATCH v3 0/8] Add support for Sonoff iHost RV1126 Smart Home Gateway Tim Lunn
2023-12-03 12:39 ` [PATCH v3 1/8] ARM: dts: rockchip: rv1126: Add alternate UART pins Tim Lunn
2023-12-03 12:39 ` [PATCH v3 2/8] ARM: dts: rockchip: rv1126: Serial aliases Tim Lunn
2023-12-03 12:39 ` [PATCH v3 3/8] i2c: rk3x: Adjust mask/value offset for i2c2 on rv1126 Tim Lunn
2023-12-03 19:06   ` Andi Shyti
2023-12-03 19:48     ` Heiko Stübner
2023-12-03 21:55       ` Andi Shyti
2023-12-04 11:36         ` Heiko Stübner
2023-12-05  1:08           ` Andi Shyti
2023-12-19 17:06   ` Wolfram Sang
2023-12-19 22:40     ` Tim Lunn
2023-12-19 22:53     ` Heiko Stübner [this message]
2023-12-03 12:40 ` [PATCH v3 4/8] ARM: dts: rockchip: rv1126: Add i2c2 nodes Tim Lunn
2023-12-03 12:40 ` [PATCH v3 5/8] ARM: dts: rockchip: rv1126: Split up rgmii1 pinctrl Tim Lunn
2023-12-03 12:40 ` [PATCH v3 6/8] ARM: dts: rockchip: Add rv1109 SoC Tim Lunn
2023-12-03 12:40 ` [PATCH v3 7/8] ARM: dts: Add Sonoff iHost Smart Home Hub Tim Lunn
2023-12-03 12:40 ` [PATCH v3 8/8] dt-bindings: arm: rockchip: Add Sonoff iHost Tim Lunn
2023-12-05  0:06 ` (subset) [PATCH v3 0/8] Add support for Sonoff iHost RV1126 Smart Home Gateway Heiko Stuebner

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=3368267.VdNmn5OnKV@diego \
    --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 \
    --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;
as well as URLs for NNTP newsgroup(s).