mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master] video: dw-hdmi: fix I2C controller probe breakage
Date: Tue, 17 Dec 2024 15:08:33 +0100	[thread overview]
Message-ID: <20241217140833.3693113-1-a.fatoum@pengutronix.de> (raw)

The dw-hdmi I2C controller binding doesn't support listing I2C slaves
as child nodes in the device tree. This is fine as the EDID I2C address
is well-known, but trying to parse the dw-hdmi device tree node as if it
were a normal I2C controller will fail:

  ERROR: i2c11: of_i2c: invalid reg on /hdmi@fe0a0000/ports

Fix this by only use the device tree node to find the alias if any and
not passing it alone to the I2C core.

Fixes: 474b6cb42ea5 ("video: dw-hdmi: populate missing I2C adapter device node")
Reported-by: Alexander Shiyan <eagle.alexander923@gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/video/dw-hdmi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/video/dw-hdmi.c b/drivers/video/dw-hdmi.c
index cd5de17e9bd7..b86f3c7366c1 100644
--- a/drivers/video/dw-hdmi.c
+++ b/drivers/video/dw-hdmi.c
@@ -433,9 +433,15 @@ static struct i2c_adapter *dw_hdmi_i2c_adapter(struct dw_hdmi *hdmi)
 
 	adap = &i2c->adap;
 	adap->dev.parent = hdmi->dev;
-	adap->dev.of_node = hdmi->dev->of_node;
 	adap->master_xfer = dw_hdmi_i2c_xfer;
-	adap->nr = -1;
+
+	/*
+	 * The binding doesn't support listing slaves as OF child nodes,
+	 * therefore we use the device tree node only to check if
+	 * there is an alias.
+	 */
+	adap->dev.of_node = NULL;
+	adap->nr = of_alias_get_id(hdmi->dev->of_node, "i2c");
 
 	i2c->rinfo.sda_gpio = of_get_named_gpio_flags(hdmi->dev->of_node,
 							  "sda-gpios", 0,
-- 
2.39.5




             reply	other threads:[~2024-12-17 14:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17 14:08 Ahmad Fatoum [this message]
2024-12-17 14:44 ` Alexander Shiyan
2024-12-20  8:48 ` Sascha Hauer

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=20241217140833.3693113-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=eagle.alexander923@gmail.com \
    /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