Re: [PATCH v2 08/12] drm: bridge/dw_hdmi: add audio config interfaces

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

 



On Fri, Jan 30, 2015 at 06:32:23AM -0500, Yakir Yang wrote:
> +static void hdmi_config_audio(struct dw_hdmi *hdmi,
> +			      struct hdmi_audio_fmt *aud_fmt)
> +{
> +	if (aud_fmt)
> +		hdmi->aud_fmt = *aud_fmt;
> +
> +	hdmi_modb(hdmi, AUDIO_CONF0_INTERFACE_II2S,
> +		  AUDIO_CONF0_INTERFACE_MSK, HDMI_AUD_CONF0);
> +
> +	hdmi_modb(hdmi, hdmi->aud_fmt.chan_num, AUDIO_CONF0_I2SINEN_MSK,
> +		  HDMI_AUD_CONF0);
> +
> +	hdmi_modb(hdmi, hdmi->aud_fmt.word_length, AUDIO_CONF1_DATWIDTH_MSK,
> +		  HDMI_AUD_CONF1);
> +
> +	hdmi_modb(hdmi, hdmi->aud_fmt.dai_fmt, AUDIO_CONF1_DATAMODE_MSK,
> +		  HDMI_AUD_CONF1);

These registers are not defined on iMX6 SoCs, so this probably needs to be
conditionalised with the dw-hdmi IP version.

> +void hdmi_audio_clk_enable(struct dw_hdmi *hdmi)
> +{
> +	if (hdmi->audio_enable)
> +		return;
> +
> +	mutex_lock(&hdmi->audio_mutex);
> +	hdmi->audio_enable = true;
> +	hdmi_modb(hdmi, 0, HDMI_MC_CLKDIS_AUDCLK_DISABLE, HDMI_MC_CLKDIS);
> +	mutex_unlock(&hdmi->audio_mutex);

This is racy.  The test needs to be within the mutex-protected region.

> +}
> +
> +void hdmi_audio_clk_disable(struct dw_hdmi *hdmi)
> +{
> +	if (!hdmi->audio_enable)
> +		return;
> +
> +	mutex_lock(&hdmi->audio_mutex);
> +	hdmi_modb(hdmi, HDMI_MC_CLKDIS_AUDCLK_DISABLE,
> +		  HDMI_MC_CLKDIS_AUDCLK_DISABLE, HDMI_MC_CLKDIS);
> +	hdmi->audio_enable = false;
> +	mutex_unlock(&hdmi->audio_mutex);

Ditto.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux