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 01/31/2015 06:48 AM, Russell King - ARM Linux wrote:
> 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.
okay, i will fixed what you have suggest in cover-letter first.

Thanks. : )
>> +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.
This function will be called by other driver (dw-hdmi-audio), both
modify the variable "hdmi->audio_enable", so i add the mutex-protected.
>
>> +}
>> +
>> +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.
>




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