aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap-hdmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/omap-hdmi.c')
-rw-r--r--sound/soc/omap/omap-hdmi.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c
index 32fa840c493e..ced3b88b44d4 100644
--- a/sound/soc/omap/omap-hdmi.c
+++ b/sound/soc/omap/omap-hdmi.c
@@ -32,15 +32,16 @@
32#include <sound/soc.h> 32#include <sound/soc.h>
33#include <sound/asound.h> 33#include <sound/asound.h>
34#include <sound/asoundef.h> 34#include <sound/asoundef.h>
35#include <sound/dmaengine_pcm.h>
35#include <video/omapdss.h> 36#include <video/omapdss.h>
36 37
37#include "omap-pcm.h"
38#include "omap-hdmi.h" 38#include "omap-hdmi.h"
39 39
40#define DRV_NAME "omap-hdmi-audio-dai" 40#define DRV_NAME "omap-hdmi-audio-dai"
41 41
42struct hdmi_priv { 42struct hdmi_priv {
43 struct omap_pcm_dma_data dma_params; 43 struct snd_dmaengine_dai_dma_data dma_data;
44 unsigned int dma_req;
44 struct omap_dss_audio dss_audio; 45 struct omap_dss_audio dss_audio;
45 struct snd_aes_iec958 iec; 46 struct snd_aes_iec958 iec;
46 struct snd_cea_861_aud_if cea; 47 struct snd_cea_861_aud_if cea;
@@ -68,7 +69,7 @@ static int omap_hdmi_dai_startup(struct snd_pcm_substream *substream,
68 return -ENODEV; 69 return -ENODEV;
69 } 70 }
70 71
71 snd_soc_dai_set_dma_data(dai, substream, &priv->dma_params); 72 snd_soc_dai_set_dma_data(dai, substream, &priv->dma_data);
72 73
73 return 0; 74 return 0;
74} 75}
@@ -88,25 +89,20 @@ static int omap_hdmi_dai_hw_params(struct snd_pcm_substream *substream,
88 struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai); 89 struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
89 struct snd_aes_iec958 *iec = &priv->iec; 90 struct snd_aes_iec958 *iec = &priv->iec;
90 struct snd_cea_861_aud_if *cea = &priv->cea; 91 struct snd_cea_861_aud_if *cea = &priv->cea;
91 struct omap_pcm_dma_data *dma_data;
92 int err = 0; 92 int err = 0;
93 93
94 dma_data = snd_soc_dai_get_dma_data(dai, substream);
95
96 switch (params_format(params)) { 94 switch (params_format(params)) {
97 case SNDRV_PCM_FORMAT_S16_LE: 95 case SNDRV_PCM_FORMAT_S16_LE:
98 dma_data->packet_size = 16; 96 priv->dma_data.maxburst = 16;
99 break; 97 break;
100 case SNDRV_PCM_FORMAT_S24_LE: 98 case SNDRV_PCM_FORMAT_S24_LE:
101 dma_data->packet_size = 32; 99 priv->dma_data.maxburst = 32;
102 break; 100 break;
103 default: 101 default:
104 dev_err(dai->dev, "format not supported!\n"); 102 dev_err(dai->dev, "format not supported!\n");
105 return -EINVAL; 103 return -EINVAL;
106 } 104 }
107 105
108 dma_data->data_type = 32;
109
110 /* 106 /*
111 * fill the IEC-60958 channel status word 107 * fill the IEC-60958 channel status word
112 */ 108 */
@@ -264,6 +260,10 @@ static struct snd_soc_dai_driver omap_hdmi_dai = {
264 .ops = &omap_hdmi_dai_ops, 260 .ops = &omap_hdmi_dai_ops,
265}; 261};
266 262
263static const struct snd_soc_component_driver omap_hdmi_component = {
264 .name = DRV_NAME,
265};
266
267static int omap_hdmi_probe(struct platform_device *pdev) 267static int omap_hdmi_probe(struct platform_device *pdev)
268{ 268{
269 int ret; 269 int ret;
@@ -283,8 +283,7 @@ static int omap_hdmi_probe(struct platform_device *pdev)
283 return -ENODEV; 283 return -ENODEV;
284 } 284 }
285 285
286 hdmi_data->dma_params.port_addr = hdmi_rsrc->start 286 hdmi_data->dma_data.addr = hdmi_rsrc->start + OMAP_HDMI_AUDIO_DMA_PORT;
287 + OMAP_HDMI_AUDIO_DMA_PORT;
288 287
289 hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_DMA, 0); 288 hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_DMA, 0);
290 if (!hdmi_rsrc) { 289 if (!hdmi_rsrc) {
@@ -292,8 +291,9 @@ static int omap_hdmi_probe(struct platform_device *pdev)
292 return -ENODEV; 291 return -ENODEV;
293 } 292 }
294 293
295 hdmi_data->dma_params.dma_req = hdmi_rsrc->start; 294 hdmi_data->dma_req = hdmi_rsrc->start;
296 hdmi_data->dma_params.name = "HDMI playback"; 295 hdmi_data->dma_data.filter_data = &hdmi_data->dma_req;
296 hdmi_data->dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
297 297
298 /* 298 /*
299 * TODO: We assume that there is only one DSS HDMI device. Future 299 * TODO: We assume that there is only one DSS HDMI device. Future
@@ -321,7 +321,8 @@ static int omap_hdmi_probe(struct platform_device *pdev)
321 } 321 }
322 322
323 dev_set_drvdata(&pdev->dev, hdmi_data); 323 dev_set_drvdata(&pdev->dev, hdmi_data);
324 ret = snd_soc_register_dai(&pdev->dev, &omap_hdmi_dai); 324 ret = snd_soc_register_component(&pdev->dev, &omap_hdmi_component,
325 &omap_hdmi_dai, 1);
325 326
326 return ret; 327 return ret;
327} 328}
@@ -330,7 +331,7 @@ static int omap_hdmi_remove(struct platform_device *pdev)
330{ 331{
331 struct hdmi_priv *hdmi_data = dev_get_drvdata(&pdev->dev); 332 struct hdmi_priv *hdmi_data = dev_get_drvdata(&pdev->dev);
332 333
333 snd_soc_unregister_dai(&pdev->dev); 334 snd_soc_unregister_component(&pdev->dev);
334 335
335 if (hdmi_data == NULL) { 336 if (hdmi_data == NULL) {
336 dev_err(&pdev->dev, "cannot obtain HDMi data\n"); 337 dev_err(&pdev->dev, "cannot obtain HDMi data\n");