aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRicardo Neri <ricardo.neri@ti.com>2012-04-20 18:17:46 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-11 08:13:50 -0400
commit027bdc85ee74f8f456a47dc53154252ef7d1792f (patch)
tree99d55912caa0f4b3c43552b89160d22faf9d3584 /drivers/video
parent9c0b8420369cb5d7fd2fea51d4705cbd0ea52743 (diff)
OMAPDSS: HDMI: Split audio_enable into audio_enable/disable
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dss_features.c1
-rw-r--r--drivers/video/omap2/dss/hdmi.c4
-rw-r--r--drivers/video/omap2/dss/ti_hdmi.h7
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c19
4 files changed, 23 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 1d10a014bc55..3a28c5c79f46 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -575,6 +575,7 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
575#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \ 575#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
576 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE) 576 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
577 .audio_enable = ti_hdmi_4xxx_wp_audio_enable, 577 .audio_enable = ti_hdmi_4xxx_wp_audio_enable,
578 .audio_disable = ti_hdmi_4xxx_wp_audio_disable,
578#endif 579#endif
579 580
580}; 581};
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 5f2e2f677bef..2a011401c8f2 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -557,12 +557,12 @@ static int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
557 case SNDRV_PCM_TRIGGER_START: 557 case SNDRV_PCM_TRIGGER_START:
558 case SNDRV_PCM_TRIGGER_RESUME: 558 case SNDRV_PCM_TRIGGER_RESUME:
559 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 559 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
560 ip_data->ops->audio_enable(ip_data, true); 560 ip_data->ops->audio_enable(ip_data);
561 break; 561 break;
562 case SNDRV_PCM_TRIGGER_STOP: 562 case SNDRV_PCM_TRIGGER_STOP:
563 case SNDRV_PCM_TRIGGER_SUSPEND: 563 case SNDRV_PCM_TRIGGER_SUSPEND:
564 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 564 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
565 ip_data->ops->audio_enable(ip_data, false); 565 ip_data->ops->audio_disable(ip_data);
566 break; 566 break;
567 default: 567 default:
568 err = -EINVAL; 568 err = -EINVAL;
diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h
index 1f58b84d6901..88fdc1cda364 100644
--- a/drivers/video/omap2/dss/ti_hdmi.h
+++ b/drivers/video/omap2/dss/ti_hdmi.h
@@ -108,7 +108,9 @@ struct ti_hdmi_ip_ops {
108 108
109#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \ 109#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
110 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE) 110 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
111 void (*audio_enable)(struct hdmi_ip_data *ip_data, bool start); 111 int (*audio_enable)(struct hdmi_ip_data *ip_data);
112
113 void (*audio_disable)(struct hdmi_ip_data *ip_data);
112#endif 114#endif
113 115
114}; 116};
@@ -183,6 +185,7 @@ void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
183void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s); 185void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
184#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \ 186#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
185 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE) 187 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
186void ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data, bool enable); 188int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data);
189void ti_hdmi_4xxx_wp_audio_disable(struct hdmi_ip_data *ip_data);
187#endif 190#endif
188#endif 191#endif
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index 35f59e47d7fe..39fbd6ad8429 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -1247,13 +1247,24 @@ int hdmi_config_audio_acr(struct hdmi_ip_data *ip_data,
1247 return 0; 1247 return 0;
1248} 1248}
1249 1249
1250void ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data, bool enable) 1250int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data)
1251{ 1251{
1252 REG_FLD_MOD(hdmi_av_base(ip_data), 1252 REG_FLD_MOD(hdmi_av_base(ip_data),
1253 HDMI_CORE_AV_AUD_MODE, enable, 0, 0); 1253 HDMI_CORE_AV_AUD_MODE, true, 0, 0);
1254 REG_FLD_MOD(hdmi_wp_base(ip_data), 1254 REG_FLD_MOD(hdmi_wp_base(ip_data),
1255 HDMI_WP_AUDIO_CTRL, enable, 31, 31); 1255 HDMI_WP_AUDIO_CTRL, true, 31, 31);
1256 REG_FLD_MOD(hdmi_wp_base(ip_data), 1256 REG_FLD_MOD(hdmi_wp_base(ip_data),
1257 HDMI_WP_AUDIO_CTRL, enable, 30, 30); 1257 HDMI_WP_AUDIO_CTRL, true, 30, 30);
1258 return 0;
1259}
1260
1261void ti_hdmi_4xxx_wp_audio_disable(struct hdmi_ip_data *ip_data)
1262{
1263 REG_FLD_MOD(hdmi_av_base(ip_data),
1264 HDMI_CORE_AV_AUD_MODE, false, 0, 0);
1265 REG_FLD_MOD(hdmi_wp_base(ip_data),
1266 HDMI_WP_AUDIO_CTRL, false, 31, 31);
1267 REG_FLD_MOD(hdmi_wp_base(ip_data),
1268 HDMI_WP_AUDIO_CTRL, false, 30, 30);
1258} 1269}
1259#endif 1270#endif