alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH v3] drm/bridge: dw-hdmi: Restore audio when setting a mode
@ 2019-10-08 10:21 Cheng-Yi Chiang
  2019-10-15  7:46 ` Neil Armstrong
  0 siblings, 1 reply; 2+ messages in thread
From: Cheng-Yi Chiang @ 2019-10-08 10:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jernej Skrabec, tzungbi, alsa-devel, Jonas Karlman,
	Neil Armstrong, dianders, dri-devel, Hans Verkuil,
	linux-rockchip, Russell King, Mark Brown, Daniel Kurtz,
	Yakir Yang, dgreid, Cheng-Yi Chiang, linux-arm-kernel,
	Jerome Brunet

From: Daniel Kurtz <djkurtz@chromium.org>

When setting a new display mode, dw_hdmi_setup() calls
dw_hdmi_enable_video_path(), which disables all hdmi clocks, including
the audio clock.

We should only (re-)enable the audio clock if audio was already enabled
when setting the new mode.

Without this patch, on RK3288, there will be HDMI audio on some monitors
if i2s was played to headphone when the monitor was plugged.
ACER H277HU and ASUS PB278 are two of the monitors showing this issue.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
---
 Change from v2 to v3:
 - Remove spinlock around setting clock.

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index a15fbf71b9d7..af060162b0af 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2054,7 +2054,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
 
 		/* HDMI Initialization Step E - Configure audio */
 		hdmi_clk_regenerator_update_pixel_clock(hdmi);
-		hdmi_enable_audio_clk(hdmi, true);
+		hdmi_enable_audio_clk(hdmi, hdmi->audio_enable);
 	}
 
 	/* not for DVI mode */
-- 
2.23.0.581.g78d2f28ef7-goog

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [alsa-devel] [PATCH v3] drm/bridge: dw-hdmi: Restore audio when setting a mode
  2019-10-08 10:21 [alsa-devel] [PATCH v3] drm/bridge: dw-hdmi: Restore audio when setting a mode Cheng-Yi Chiang
@ 2019-10-15  7:46 ` Neil Armstrong
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Armstrong @ 2019-10-15  7:46 UTC (permalink / raw)
  To: Cheng-Yi Chiang, linux-kernel
  Cc: Jernej Skrabec, tzungbi, alsa-devel, Jonas Karlman, dianders,
	dri-devel, Hans Verkuil, linux-rockchip, Russell King,
	Mark Brown, Daniel Kurtz, Yakir Yang, dgreid, linux-arm-kernel,
	Jerome Brunet

On 08/10/2019 12:21, Cheng-Yi Chiang wrote:
> From: Daniel Kurtz <djkurtz@chromium.org>
> 
> When setting a new display mode, dw_hdmi_setup() calls
> dw_hdmi_enable_video_path(), which disables all hdmi clocks, including
> the audio clock.
> 
> We should only (re-)enable the audio clock if audio was already enabled
> when setting the new mode.
> 
> Without this patch, on RK3288, there will be HDMI audio on some monitors
> if i2s was played to headphone when the monitor was plugged.
> ACER H277HU and ASUS PB278 are two of the monitors showing this issue.
> 
> Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
> ---
>  Change from v2 to v3:
>  - Remove spinlock around setting clock.
> 
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index a15fbf71b9d7..af060162b0af 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2054,7 +2054,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
>  
>  		/* HDMI Initialization Step E - Configure audio */
>  		hdmi_clk_regenerator_update_pixel_clock(hdmi);
> -		hdmi_enable_audio_clk(hdmi, true);
> +		hdmi_enable_audio_clk(hdmi, hdmi->audio_enable);
>  	}
>  
>  	/* not for DVI mode */
> 

Looks coherent for me.

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

Applying to drm-misc-next
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-15  7:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08 10:21 [alsa-devel] [PATCH v3] drm/bridge: dw-hdmi: Restore audio when setting a mode Cheng-Yi Chiang
2019-10-15  7:46 ` Neil Armstrong

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).