lkml.org 
[lkml]   [2015]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 08/12] drm: bridge/dw_hdmi: add audio config interfaces
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.


\
 
 \ /
  Last update: 2015-01-31 13:01    [W:0.147 / U:27.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site