Skip to content

Commit 902806b

Browse files
Stefan Ekenberglumag
authored andcommitted
drm/bridge: adv7511_audio: Update Audio InfoFrame properly
AUDIO_UPDATE bit (Bit 5 of MAIN register 0x4A) needs to be set to 1 while updating Audio InfoFrame information and then set to 0 when done. Otherwise partially updated Audio InfoFrames could be sent out. Two cases where this rule were not followed are fixed: - In adv7511_hdmi_hw_params() make sure AUDIO_UPDATE bit is updated before/after setting ADV7511_REG_AUDIO_INFOFRAME. - In audio_startup() use the correct register for clearing AUDIO_UPDATE bit. The problem with corrupted audio infoframes were discovered by letting a HDMI logic analyser check the output of ADV7535. Note that this patchs replaces writing REG_GC(1) with REG_INFOFRAME_UPDATE. Bit 5 of REG_GC(1) is positioned within field GC_PP[3:0] and that field doesn't control audio infoframe and is read- only. My conclusion therefore was that the author if this code meant to clear bit 5 of REG_INFOFRAME_UPDATE from the very beginning. Tested-by: Biju Das <[email protected]> Fixes: 53c515b ("drm/bridge: adv7511: Add Audio support") Signed-off-by: Stefan Ekenberg <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 1b684ca commit 902806b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

drivers/gpu/drm/bridge/adv7511/adv7511_audio.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,16 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data,
153153
ADV7511_AUDIO_CFG3_LEN_MASK, len);
154154
regmap_update_bits(adv7511->regmap, ADV7511_REG_I2C_FREQ_ID_CFG,
155155
ADV7511_I2C_FREQ_ID_CFG_RATE_MASK, rate << 4);
156-
regmap_write(adv7511->regmap, 0x73, 0x1);
156+
157+
/* send current Audio infoframe values while updating */
158+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
159+
BIT(5), BIT(5));
160+
161+
regmap_write(adv7511->regmap, ADV7511_REG_AUDIO_INFOFRAME(0), 0x1);
162+
163+
/* use Audio infoframe updated info */
164+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
165+
BIT(5), 0);
157166

158167
return 0;
159168
}
@@ -184,8 +193,9 @@ static int audio_startup(struct device *dev, void *data)
184193
regmap_update_bits(adv7511->regmap, ADV7511_REG_GC(0),
185194
BIT(7) | BIT(6), BIT(7));
186195
/* use Audio infoframe updated info */
187-
regmap_update_bits(adv7511->regmap, ADV7511_REG_GC(1),
196+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
188197
BIT(5), 0);
198+
189199
/* enable SPDIF receiver */
190200
if (adv7511->audio_source == ADV7511_AUDIO_SOURCE_SPDIF)
191201
regmap_update_bits(adv7511->regmap, ADV7511_REG_AUDIO_CONFIG,

0 commit comments

Comments
 (0)