summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
diff options
context:
space:
mode:
authorAlvin Šipraga <alsi@bang-olufsen.dk>2022-04-23 14:08:52 +0200
committerRobert Foss <robert.foss@linaro.org>2022-05-02 16:38:45 +0200
commit0aae7623b4952212781cd48fa411ead52608f6eb (patch)
tree793df2762be6a0cf47f13235a9ca4833789eb1c9 /drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
parent46ca7da7f1e8592af6059419176dd58c10dcdb5b (diff)
downloadlinux-0aae7623b4952212781cd48fa411ead52608f6eb.tar.gz
linux-0aae7623b4952212781cd48fa411ead52608f6eb.tar.bz2
linux-0aae7623b4952212781cd48fa411ead52608f6eb.zip
drm: bridge: adv7511: enable CEC support for ADV7535
Like the ADV7533, the ADV7535 has an offset for the CEC register map, and it is the same value (ADV7533_REG_CEC_OFFSET = 0x70). Rather than testing for numerous chip types in the offset calculations throughout the driver, just compute it during driver probe and put it in the private adv7511 data structure. Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Robert Foss <robert.foss@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20220423120854.1503163-2-alvin@pqrs.dk
Diffstat (limited to 'drivers/gpu/drm/bridge/adv7511/adv7511_drv.c')
-rw-r--r--drivers/gpu/drm/bridge/adv7511/adv7511_drv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index b3f10c54e064..556ba1b447ba 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -1027,8 +1027,7 @@ static bool adv7511_cec_register_volatile(struct device *dev, unsigned int reg)
struct i2c_client *i2c = to_i2c_client(dev);
struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
- if (adv7511->type == ADV7533 || adv7511->type == ADV7535)
- reg -= ADV7533_REG_CEC_OFFSET;
+ reg -= adv7511->reg_cec_offset;
switch (reg) {
case ADV7511_REG_CEC_RX_FRAME_HDR:
@@ -1073,6 +1072,8 @@ static int adv7511_init_cec_regmap(struct adv7511 *adv)
ret = adv7533_patch_cec_registers(adv);
if (ret)
goto err;
+
+ adv->reg_cec_offset = ADV7533_REG_CEC_OFFSET;
}
return 0;