aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>2008-07-07 11:07:17 -0400
committerJaroslav Kysela <perex@perex.cz>2008-07-10 03:32:32 -0400
commit3c4b266fe642bcaebe2b95edb56c3f8802924ff9 (patch)
tree837a5e7d8e77702bcca5a02fbcaed51c3fa52065 /include
parenta5302181e5321664047f75715242aac4e0bbd17c (diff)
ALSA: asoc: core - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.
This patch series merges struct snd_soc_codec_dai and struct snd_soc_cpu_dai into struct snd_soc_dai in preparation for further ASoC v2 patches. This merger removes duplication in both DAI structures and simplifies the API for other users. Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc.h71
1 files changed, 23 insertions, 48 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 340223a8f24c..778e57e74dc8 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -221,8 +221,7 @@ struct snd_soc_pcm_stream;
221struct snd_soc_ops; 221struct snd_soc_ops;
222struct snd_soc_dai_mode; 222struct snd_soc_dai_mode;
223struct snd_soc_pcm_runtime; 223struct snd_soc_pcm_runtime;
224struct snd_soc_codec_dai; 224struct snd_soc_dai;
225struct snd_soc_cpu_dai;
226struct snd_soc_codec; 225struct snd_soc_codec;
227struct snd_soc_machine_config; 226struct snd_soc_machine_config;
228struct soc_enum; 227struct soc_enum;
@@ -317,50 +316,24 @@ struct snd_soc_ops {
317/* ASoC DAI ops */ 316/* ASoC DAI ops */
318struct snd_soc_dai_ops { 317struct snd_soc_dai_ops {
319 /* DAI clocking configuration */ 318 /* DAI clocking configuration */
320 int (*set_sysclk)(struct snd_soc_codec_dai *codec_dai, 319 int (*set_sysclk)(struct snd_soc_dai *dai,
321 int clk_id, unsigned int freq, int dir); 320 int clk_id, unsigned int freq, int dir);
322 int (*set_pll)(struct snd_soc_codec_dai *codec_dai, 321 int (*set_pll)(struct snd_soc_dai *dai,
323 int pll_id, unsigned int freq_in, unsigned int freq_out); 322 int pll_id, unsigned int freq_in, unsigned int freq_out);
324 int (*set_clkdiv)(struct snd_soc_codec_dai *codec_dai, 323 int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div);
325 int div_id, int div);
326 324
327 /* DAI format configuration */ 325 /* DAI format configuration */
328 int (*set_fmt)(struct snd_soc_codec_dai *codec_dai, 326 int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt);
329 unsigned int fmt); 327 int (*set_tdm_slot)(struct snd_soc_dai *dai,
330 int (*set_tdm_slot)(struct snd_soc_codec_dai *codec_dai,
331 unsigned int mask, int slots); 328 unsigned int mask, int slots);
332 int (*set_tristate)(struct snd_soc_codec_dai *, int tristate); 329 int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
333 330
334 /* digital mute */ 331 /* digital mute */
335 int (*digital_mute)(struct snd_soc_codec_dai *, int mute); 332 int (*digital_mute)(struct snd_soc_dai *dai, int mute);
336}; 333};
337 334
338/* SoC Codec DAI */ 335/* SoC DAI (Digital Audio Interface) */
339struct snd_soc_codec_dai { 336struct snd_soc_dai {
340 char *name;
341 int id;
342 unsigned char type;
343
344 /* DAI capabilities */
345 struct snd_soc_pcm_stream playback;
346 struct snd_soc_pcm_stream capture;
347
348 /* DAI runtime info */
349 struct snd_soc_codec *codec;
350 unsigned int active;
351 unsigned char pop_wait:1;
352
353 /* ops */
354 struct snd_soc_ops ops;
355 struct snd_soc_dai_ops dai_ops;
356
357 /* DAI private data */
358 void *private_data;
359};
360
361/* SoC CPU DAI */
362struct snd_soc_cpu_dai {
363
364 /* DAI description */ 337 /* DAI description */
365 char *name; 338 char *name;
366 unsigned int id; 339 unsigned int id;
@@ -368,13 +341,13 @@ struct snd_soc_cpu_dai {
368 341
369 /* DAI callbacks */ 342 /* DAI callbacks */
370 int (*probe)(struct platform_device *pdev, 343 int (*probe)(struct platform_device *pdev,
371 struct snd_soc_cpu_dai *dai); 344 struct snd_soc_dai *dai);
372 void (*remove)(struct platform_device *pdev, 345 void (*remove)(struct platform_device *pdev,
373 struct snd_soc_cpu_dai *dai); 346 struct snd_soc_dai *dai);
374 int (*suspend)(struct platform_device *pdev, 347 int (*suspend)(struct platform_device *pdev,
375 struct snd_soc_cpu_dai *cpu_dai); 348 struct snd_soc_dai *dai);
376 int (*resume)(struct platform_device *pdev, 349 int (*resume)(struct platform_device *pdev,
377 struct snd_soc_cpu_dai *cpu_dai); 350 struct snd_soc_dai *dai);
378 351
379 /* ops */ 352 /* ops */
380 struct snd_soc_ops ops; 353 struct snd_soc_ops ops;
@@ -386,7 +359,9 @@ struct snd_soc_cpu_dai {
386 359
387 /* DAI runtime info */ 360 /* DAI runtime info */
388 struct snd_pcm_runtime *runtime; 361 struct snd_pcm_runtime *runtime;
389 unsigned char active:1; 362 struct snd_soc_codec *codec;
363 unsigned int active;
364 unsigned char pop_wait:1;
390 void *dma_data; 365 void *dma_data;
391 366
392 /* DAI private data */ 367 /* DAI private data */
@@ -428,7 +403,7 @@ struct snd_soc_codec {
428 struct delayed_work delayed_work; 403 struct delayed_work delayed_work;
429 404
430 /* codec DAI's */ 405 /* codec DAI's */
431 struct snd_soc_codec_dai *dai; 406 struct snd_soc_dai *dai;
432 unsigned int num_dai; 407 unsigned int num_dai;
433}; 408};
434 409
@@ -447,12 +422,12 @@ struct snd_soc_platform {
447 int (*probe)(struct platform_device *pdev); 422 int (*probe)(struct platform_device *pdev);
448 int (*remove)(struct platform_device *pdev); 423 int (*remove)(struct platform_device *pdev);
449 int (*suspend)(struct platform_device *pdev, 424 int (*suspend)(struct platform_device *pdev,
450 struct snd_soc_cpu_dai *cpu_dai); 425 struct snd_soc_dai *dai);
451 int (*resume)(struct platform_device *pdev, 426 int (*resume)(struct platform_device *pdev,
452 struct snd_soc_cpu_dai *cpu_dai); 427 struct snd_soc_dai *dai);
453 428
454 /* pcm creation and destruction */ 429 /* pcm creation and destruction */
455 int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, 430 int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
456 struct snd_pcm *); 431 struct snd_pcm *);
457 void (*pcm_free)(struct snd_pcm *); 432 void (*pcm_free)(struct snd_pcm *);
458 433
@@ -466,8 +441,8 @@ struct snd_soc_dai_link {
466 char *stream_name; /* Stream name */ 441 char *stream_name; /* Stream name */
467 442
468 /* DAI */ 443 /* DAI */
469 struct snd_soc_codec_dai *codec_dai; 444 struct snd_soc_dai *codec_dai;
470 struct snd_soc_cpu_dai *cpu_dai; 445 struct snd_soc_dai *cpu_dai;
471 446
472 /* machine stream operations */ 447 /* machine stream operations */
473 struct snd_soc_ops *ops; 448 struct snd_soc_ops *ops;