Patch "drm: adv7511: override i2c address of cec before accessing it" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm: adv7511: override i2c address of cec before accessing it

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-adv7511-override-i2c-address-of-cec-before-acces.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4cb898a217c4fdf34db4713de8fd250f356654c9
Author: Antonio Borneo <antonio.borneo@xxxxxxxxxxx>
Date:   Tue Jun 7 23:31:44 2022 +0200

    drm: adv7511: override i2c address of cec before accessing it
    
    [ Upstream commit 9cc4853e4781bf0dd0f35355dc92d97c9da02f5d ]
    
    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@xxxxxxxxxxx>
    Fixes: 680532c50bca ("drm: adv7511: Add support for i2c_new_secondary_device")
    Reviewed-by: Kieran Bingham <kieran.bingham+renesas@xxxxxxxxxxxxxxxx>
    Signed-off-by: Robert Foss <robert.foss@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220607213144.427177-1-antonio.borneo@xxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index aca2f14f04c2..8bac392cab79 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -1063,6 +1063,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,
@@ -1267,9 +1271,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) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux