From: Robert Foss <robert.foss@linaro.org>
To: Antonio Borneo <antonio.borneo@foss.st.com>
Cc: Jonas Karlman <jonas@kwiboo.se>, David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org,
Neil Armstrong <narmstrong@baylibre.com>,
linux-kernel@vger.kernel.org,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Andrzej Hajda <a.hajda@samsung.com>,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH RESEND] drm: adv7511: override i2c address of cec before accessing it
Date: Fri, 10 Jun 2022 10:17:49 +0200 [thread overview]
Message-ID: <CAG3jFyvt8+Tbbx6rT8R72aNgEk40O+V7GE0ZTc4RdWDcQmhwYg@mail.gmail.com> (raw)
In-Reply-To: <20220607213144.427177-1-antonio.borneo@foss.st.com>
On Tue, 7 Jun 2022 at 23:32, Antonio Borneo <antonio.borneo@foss.st.com> wrote:
>
> Commit 680532c50bca ("drm: adv7511: Add support for
> i2c_new_secondary_device") allows a device tree node to override
> the default addresses of the secondary i2c devices. This is useful
> for solving address conflicts on the i2c bus.
>
> In adv7511_init_cec_regmap() the new i2c address of cec device is
> read from device tree and immediately accessed, well before it is
> written in the proper register to override the default address.
> This can cause an i2c error during probe and a consequent probe
> failure.
>
> Once the new i2c address is read from the device tree, override
> the default address before any attempt to access the cec.
>
> Tested with adv7533 and stm32mp157f.
>
> Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
> Fixes: 680532c50bca ("drm: adv7511: Add support for i2c_new_secondary_device")
> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
>
> ---
>
> This patch got somehow lost, I'm resending it.
> Added reviewed by Kieran Bingham.
> Rebased on drm-misc-next.
>
> ---
> drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index 5bb9300040dd..074c2e650cae 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -1065,6 +1065,10 @@ static int adv7511_init_cec_regmap(struct adv7511 *adv)
> ADV7511_CEC_I2C_ADDR_DEFAULT);
> if (IS_ERR(adv->i2c_cec))
> return PTR_ERR(adv->i2c_cec);
> +
> + regmap_write(adv->regmap, ADV7511_REG_CEC_I2C_ADDR,
> + adv->i2c_cec->addr << 1);
> +
> i2c_set_clientdata(adv->i2c_cec, adv);
>
> adv->regmap_cec = devm_regmap_init_i2c(adv->i2c_cec,
> @@ -1271,9 +1275,6 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
> if (ret)
> goto err_i2c_unregister_packet;
>
> - regmap_write(adv7511->regmap, ADV7511_REG_CEC_I2C_ADDR,
> - adv7511->i2c_cec->addr << 1);
> -
> INIT_WORK(&adv7511->hpd_work, adv7511_hpd_work);
>
> if (i2c->irq) {
>
> base-commit: dfa687bffc8a4a21ed929c7dececf01b8f1f52ee
> --
> 2.36.1
>
Applied to drm-misc-next.
prev parent reply other threads:[~2022-06-10 8:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-18 18:28 [PATCH] drm: adv7511: override i2c address of cec before accessing it Antonio Borneo
2021-12-20 14:54 ` Kieran Bingham
2021-12-20 15:53 ` Antonio Borneo
2021-12-21 11:39 ` Kieran Bingham
2022-06-07 21:31 ` [PATCH RESEND] " Antonio Borneo
2022-06-10 8:17 ` Robert Foss [this message]
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=CAG3jFyvt8+Tbbx6rT8R72aNgEk40O+V7GE0ZTc4RdWDcQmhwYg@mail.gmail.com \
--to=robert.foss@linaro.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=antonio.borneo@foss.st.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=narmstrong@baylibre.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;
as well as URLs for NNTP newsgroup(s).