OMAPDSS: HDMI: Split audio_enable into audio_enable/disable
authorRicardo Neri <ricardo.neri@ti.com>
Fri, 20 Apr 2012 22:17:46 +0000 (17:17 -0500)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 May 2012 12:13:50 +0000 (15:13 +0300)
To improve readability, split the audio_enable HDMI IP operation
into two separate functions for enabling and disabling audio.
The audio_enable function is also modified to return an error value.

While there, update these operations for the OMAP4 IP accordingly.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
drivers/video/omap2/dss/dss_features.c
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/dss/ti_hdmi.h
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c

index 1d10a014bc55795c0053765ec8c47640521b5372..3a28c5c79f46ea09d4408f030b09c2df4fe0d062 100644 (file)
@@ -575,6 +575,7 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
 #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
        defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
        .audio_enable           =       ti_hdmi_4xxx_wp_audio_enable,
+       .audio_disable          =       ti_hdmi_4xxx_wp_audio_disable,
 #endif
 
 };
index 5f2e2f677befaef397d8cba343f8b55f81735118..2a011401c8f2e41a617d91fc544c09a66227b176 100644 (file)
@@ -557,12 +557,12 @@ static int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
        case SNDRV_PCM_TRIGGER_START:
        case SNDRV_PCM_TRIGGER_RESUME:
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-               ip_data->ops->audio_enable(ip_data, true);
+               ip_data->ops->audio_enable(ip_data);
                break;
        case SNDRV_PCM_TRIGGER_STOP:
        case SNDRV_PCM_TRIGGER_SUSPEND:
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-               ip_data->ops->audio_enable(ip_data, false);
+               ip_data->ops->audio_disable(ip_data);
                break;
        default:
                err = -EINVAL;
index 1f58b84d69015035c134bc5736b86a12bf7b46f8..88fdc1cda364f118c85a130b7e50255c2ebe9005 100644 (file)
@@ -108,7 +108,9 @@ struct ti_hdmi_ip_ops {
 
 #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
        defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
-       void (*audio_enable)(struct hdmi_ip_data *ip_data, bool start);
+       int (*audio_enable)(struct hdmi_ip_data *ip_data);
+
+       void (*audio_disable)(struct hdmi_ip_data *ip_data);
 #endif
 
 };
@@ -183,6 +185,7 @@ void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
 void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
 #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
        defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
-void ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data, bool enable);
+int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data);
+void ti_hdmi_4xxx_wp_audio_disable(struct hdmi_ip_data *ip_data);
 #endif
 #endif
index 35f59e47d7fe522df5eab6e7f053e3501125a40d..39fbd6ad84298cd78d0507a0614f18c05bcc5447 100644 (file)
@@ -1247,13 +1247,24 @@ int hdmi_config_audio_acr(struct hdmi_ip_data *ip_data,
        return 0;
 }
 
-void ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data, bool enable)
+int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data)
 {
        REG_FLD_MOD(hdmi_av_base(ip_data),
-                               HDMI_CORE_AV_AUD_MODE, enable, 0, 0);
+                   HDMI_CORE_AV_AUD_MODE, true, 0, 0);
        REG_FLD_MOD(hdmi_wp_base(ip_data),
-                               HDMI_WP_AUDIO_CTRL, enable, 31, 31);
+                   HDMI_WP_AUDIO_CTRL, true, 31, 31);
        REG_FLD_MOD(hdmi_wp_base(ip_data),
-                               HDMI_WP_AUDIO_CTRL, enable, 30, 30);
+                   HDMI_WP_AUDIO_CTRL, true, 30, 30);
+       return 0;
+}
+
+void ti_hdmi_4xxx_wp_audio_disable(struct hdmi_ip_data *ip_data)
+{
+       REG_FLD_MOD(hdmi_av_base(ip_data),
+                   HDMI_CORE_AV_AUD_MODE, false, 0, 0);
+       REG_FLD_MOD(hdmi_wp_base(ip_data),
+                   HDMI_WP_AUDIO_CTRL, false, 31, 31);
+       REG_FLD_MOD(hdmi_wp_base(ip_data),
+                   HDMI_WP_AUDIO_CTRL, false, 30, 30);
 }
 #endif