]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ASoC: OMAP: HDMI: Correct signature of ASoC functions
authorRicardo Neri <ricardo.neri@ti.com>
Wed, 23 Nov 2011 02:50:50 +0000 (20:50 -0600)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 5 Jan 2012 08:34:47 +0000 (10:34 +0200)
These functions require access to IP-secific data. However, it is not possible
to pass such data as a function argument as such functions have a specific
signature specified by ASoC. Instead, they will have access to the IP-specific
data by calling snd_soc_codec_get_drvdata. The codec driver data is set
at probe time.

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

index 3c96d771e2c9ef4362c3bb5ad8fce72674bc6640..b727992efd6d7f7f4123ff010a739d854363c832 100644 (file)
@@ -561,11 +561,13 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
 #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
        defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
 
-static int hdmi_audio_hw_params(struct hdmi_ip_data *ip_data,
-                                       struct snd_pcm_substream *substream,
+static int hdmi_audio_hw_params(struct snd_pcm_substream *substream,
                                    struct snd_pcm_hw_params *params,
                                    struct snd_soc_dai *dai)
 {
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_codec *codec = rtd->codec;
+       struct hdmi_ip_data *ip_data = snd_soc_codec_get_drvdata(codec);
        struct hdmi_audio_format audio_format;
        struct hdmi_audio_dma audio_dma;
        struct hdmi_core_audio_config core_cfg;
index e1a6ce518af6c4c250f6d542e9a135e2927683ba..3f74f55269bd0bbd86df557d3f8cc0f1f773dfd2 100644 (file)
@@ -1204,11 +1204,14 @@ int hdmi_config_audio_acr(struct hdmi_ip_data *ip_data,
        return 0;
 }
 
-int hdmi_audio_trigger(struct hdmi_ip_data *ip_data,
-                               struct snd_pcm_substream *substream, int cmd,
+int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
                                struct snd_soc_dai *dai)
 {
+       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_codec *codec = rtd->codec;
+       struct hdmi_ip_data *ip_data = snd_soc_codec_get_drvdata(codec);
        int err = 0;
+
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
        case SNDRV_PCM_TRIGGER_RESUME:
index 204095632d27bd09b0f104994ed7d568f4d47e6a..eb5e8f7120f83f726701f4196250a48c10d6e602 100644 (file)
@@ -576,8 +576,7 @@ struct hdmi_core_audio_config {
 
 #if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
        defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
-int hdmi_audio_trigger(struct hdmi_ip_data *ip_data,
-                               struct snd_pcm_substream *substream, int cmd,
+int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
                                struct snd_soc_dai *dai);
 int hdmi_config_audio_acr(struct hdmi_ip_data *ip_data,
                                u32 sample_freq, u32 *n, u32 *cts);