aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dss_features.c4
-rw-r--r--drivers/video/omap2/dss/ti_hdmi.h10
-rw-r--r--drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c30
3 files changed, 31 insertions, 13 deletions
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 5e4b829605da..afcb59301c37 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -472,6 +472,10 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
472 .dump_core = ti_hdmi_4xxx_core_dump, 472 .dump_core = ti_hdmi_4xxx_core_dump,
473 .dump_pll = ti_hdmi_4xxx_pll_dump, 473 .dump_pll = ti_hdmi_4xxx_pll_dump,
474 .dump_phy = ti_hdmi_4xxx_phy_dump, 474 .dump_phy = ti_hdmi_4xxx_phy_dump,
475#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
476 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
477 .audio_enable = ti_hdmi_4xxx_wp_audio_enable,
478#endif
475 479
476}; 480};
477 481
diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h
index 2c3443dabb14..7503f7f619a7 100644
--- a/drivers/video/omap2/dss/ti_hdmi.h
+++ b/drivers/video/omap2/dss/ti_hdmi.h
@@ -110,6 +110,11 @@ struct ti_hdmi_ip_ops {
110 110
111 void (*dump_phy)(struct hdmi_ip_data *ip_data, struct seq_file *s); 111 void (*dump_phy)(struct hdmi_ip_data *ip_data, struct seq_file *s);
112 112
113#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
114 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
115 void (*audio_enable)(struct hdmi_ip_data *ip_data, bool start);
116#endif
117
113}; 118};
114 119
115struct hdmi_ip_data { 120struct hdmi_ip_data {
@@ -134,5 +139,8 @@ void ti_hdmi_4xxx_wp_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
134void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s); 139void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
135void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s); 140void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
136void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s); 141void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s);
137 142#if defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI) || \
143 defined(CONFIG_SND_OMAP_SOC_OMAP4_HDMI_MODULE)
144void ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data, bool enable);
145#endif
138#endif 146#endif
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
index 3f74f55269bd..220e0ce5e5ef 100644
--- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
+++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
@@ -1204,35 +1204,41 @@ int hdmi_config_audio_acr(struct hdmi_ip_data *ip_data,
1204 return 0; 1204 return 0;
1205} 1205}
1206 1206
1207void ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data, bool enable)
1208{
1209 REG_FLD_MOD(hdmi_av_base(ip_data),
1210 HDMI_CORE_AV_AUD_MODE, enable, 0, 0);
1211 REG_FLD_MOD(hdmi_wp_base(ip_data),
1212 HDMI_WP_AUDIO_CTRL, enable, 31, 31);
1213 REG_FLD_MOD(hdmi_wp_base(ip_data),
1214 HDMI_WP_AUDIO_CTRL, enable, 30, 30);
1215}
1216
1207int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, 1217int hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd,
1208 struct snd_soc_dai *dai) 1218 struct snd_soc_dai *dai)
1209{ 1219{
1210 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1220 struct snd_soc_pcm_runtime *rtd = substream->private_data;
1211 struct snd_soc_codec *codec = rtd->codec; 1221 struct snd_soc_codec *codec = rtd->codec;
1222 struct platform_device *pdev = to_platform_device(codec->dev);
1212 struct hdmi_ip_data *ip_data = snd_soc_codec_get_drvdata(codec); 1223 struct hdmi_ip_data *ip_data = snd_soc_codec_get_drvdata(codec);
1213 int err = 0; 1224 int err = 0;
1214 1225
1226 if (!(ip_data->ops) && !(ip_data->ops->audio_enable)) {
1227 dev_err(&pdev->dev, "Cannot enable/disable audio\n");
1228 return -ENODEV;
1229 }
1230
1215 switch (cmd) { 1231 switch (cmd) {
1216 case SNDRV_PCM_TRIGGER_START: 1232 case SNDRV_PCM_TRIGGER_START:
1217 case SNDRV_PCM_TRIGGER_RESUME: 1233 case SNDRV_PCM_TRIGGER_RESUME:
1218 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 1234 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
1219 REG_FLD_MOD(hdmi_av_base(ip_data), 1235 ip_data->ops->audio_enable(ip_data, true);
1220 HDMI_CORE_AV_AUD_MODE, 1, 0, 0);
1221 REG_FLD_MOD(hdmi_wp_base(ip_data),
1222 HDMI_WP_AUDIO_CTRL, 1, 31, 31);
1223 REG_FLD_MOD(hdmi_wp_base(ip_data),
1224 HDMI_WP_AUDIO_CTRL, 1, 30, 30);
1225 break; 1236 break;
1226 1237
1227 case SNDRV_PCM_TRIGGER_STOP: 1238 case SNDRV_PCM_TRIGGER_STOP:
1228 case SNDRV_PCM_TRIGGER_SUSPEND: 1239 case SNDRV_PCM_TRIGGER_SUSPEND:
1229 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 1240 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
1230 REG_FLD_MOD(hdmi_av_base(ip_data), 1241 ip_data->ops->audio_enable(ip_data, false);
1231 HDMI_CORE_AV_AUD_MODE, 0, 0, 0);
1232 REG_FLD_MOD(hdmi_wp_base(ip_data),
1233 HDMI_WP_AUDIO_CTRL, 0, 30, 30);
1234 REG_FLD_MOD(hdmi_wp_base(ip_data),
1235 HDMI_WP_AUDIO_CTRL, 0, 31, 31);
1236 break; 1242 break;
1237 default: 1243 default:
1238 err = -EINVAL; 1244 err = -EINVAL;