From: Andy Green <[email protected]>

Set the initial audio packet settings to allow the audio
driver to work.

Cc: David Airlie <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Srinivas Kandagatla <[email protected]>
Cc: "Ville Syrjälä" <[email protected]>
Cc: Boris Brezillon <[email protected]>
Cc: Andy Green <[email protected]>
Cc: Dave Long <[email protected]>
Cc: Guodong Xu <[email protected]>
Cc: Zhangfei Gao <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Jose Abreu <[email protected]>
Cc: [email protected]
Signed-off-by: Andy Green <[email protected]>
[jstultz: Forward ported to mainline, changed to use register
 names rather then hex values, and removed config values set by
 audio driver.]
Signed-off-by: John Stultz <[email protected]>
---
 drivers/gpu/drm/bridge/adv7511/adv7533.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7533.c 
b/drivers/gpu/drm/bridge/adv7511/adv7533.c
index 6798ecf..cced7c9 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7533.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7533.c
@@ -104,6 +104,28 @@ void adv7533_dsi_power_on(struct adv7511 *adv)
        /* disable test mode */
        regmap_write(adv->regmap_cec, 0x55, 0x00);
 
+       /* hide Audio infoframe updates */
+       regmap_update_bits(adv->regmap, ADV7511_REG_INFOFRAME_UPDATE,
+                               BIT(5), BIT(5));
+       /* enable N/CTS, enable Audio sample packets */
+       regmap_update_bits(adv->regmap, ADV7511_REG_PACKET_ENABLE1,
+                               BIT(5), BIT(5));
+       /* enable N/CTS */
+       regmap_update_bits(adv->regmap, ADV7511_REG_PACKET_ENABLE1,
+                               BIT(6), BIT(6));
+       /* not copyrighted */
+       regmap_update_bits(adv->regmap, ADV7511_REG_AUDIO_CFG1,
+                               BIT(5), BIT(5));
+       /* enable audio infoframes */
+       regmap_update_bits(adv->regmap, ADV7511_REG_PACKET_ENABLE1,
+                               BIT(3), BIT(3));
+       /* AV mute disable */
+       regmap_update_bits(adv->regmap, ADV7511_REG_GC(0),
+                               BIT(7) | BIT(6), BIT(7));
+       /* use Audio infoframe updated info */
+       regmap_update_bits(adv->regmap, ADV7511_REG_GC(1),
+                               BIT(5), 0);
+
        regmap_register_patch(adv->regmap_cec, adv7533_cec_fixed_registers,
                              ARRAY_SIZE(adv7533_cec_fixed_registers));
 }
-- 
1.9.1

Reply via email to