diff options
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/ac97_codec.h | 9 | ||||
-rw-r--r-- | include/sound/asound.h | 3 | ||||
-rw-r--r-- | include/sound/core.h | 62 | ||||
-rw-r--r-- | include/sound/driver.h | 1 | ||||
-rw-r--r-- | include/sound/info.h | 4 | ||||
-rw-r--r-- | include/sound/memalloc.h | 6 | ||||
-rw-r--r-- | include/sound/pcm.h | 101 | ||||
-rw-r--r-- | include/sound/sh_fsi.h | 83 | ||||
-rw-r--r-- | include/sound/soc-dai.h | 68 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 34 | ||||
-rw-r--r-- | include/sound/soc.h | 79 | ||||
-rw-r--r-- | include/sound/uda1380.h | 22 | ||||
-rw-r--r-- | include/sound/version.h | 2 | ||||
-rw-r--r-- | include/sound/wm8993.h | 44 | ||||
-rw-r--r-- | include/sound/wm9081.h | 25 |
15 files changed, 368 insertions, 175 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 251fc1cd5002..3dae3f799b9b 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -32,6 +32,9 @@ | |||
32 | #include "control.h" | 32 | #include "control.h" |
33 | #include "info.h" | 33 | #include "info.h" |
34 | 34 | ||
35 | /* maximum number of devices on the AC97 bus */ | ||
36 | #define AC97_BUS_MAX_DEVICES 4 | ||
37 | |||
35 | /* | 38 | /* |
36 | * AC'97 codec registers | 39 | * AC'97 codec registers |
37 | */ | 40 | */ |
@@ -642,4 +645,10 @@ int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime); | |||
642 | /* ad hoc AC97 device driver access */ | 645 | /* ad hoc AC97 device driver access */ |
643 | extern struct bus_type ac97_bus_type; | 646 | extern struct bus_type ac97_bus_type; |
644 | 647 | ||
648 | /* AC97 platform_data adding function */ | ||
649 | static inline void snd_ac97_dev_add_pdata(struct snd_ac97 *ac97, void *data) | ||
650 | { | ||
651 | ac97->dev.platform_data = data; | ||
652 | } | ||
653 | |||
645 | #endif /* __SOUND_AC97_CODEC_H */ | 654 | #endif /* __SOUND_AC97_CODEC_H */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 6add80fc2512..1f57bb92eb5a 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -138,7 +138,7 @@ struct snd_hwdep_dsp_image { | |||
138 | * * | 138 | * * |
139 | *****************************************************************************/ | 139 | *****************************************************************************/ |
140 | 140 | ||
141 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9) | 141 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10) |
142 | 142 | ||
143 | typedef unsigned long snd_pcm_uframes_t; | 143 | typedef unsigned long snd_pcm_uframes_t; |
144 | typedef signed long snd_pcm_sframes_t; | 144 | typedef signed long snd_pcm_sframes_t; |
@@ -255,6 +255,7 @@ typedef int __bitwise snd_pcm_subformat_t; | |||
255 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ | 255 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ |
256 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ | 256 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ |
257 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | 257 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ |
258 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | ||
258 | 259 | ||
259 | typedef int __bitwise snd_pcm_state_t; | 260 | typedef int __bitwise snd_pcm_state_t; |
260 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ | 261 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ |
diff --git a/include/sound/core.h b/include/sound/core.h index 3dea79829acc..a61499c22b0b 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -93,15 +93,6 @@ struct snd_device { | |||
93 | 93 | ||
94 | #define snd_device(n) list_entry(n, struct snd_device, list) | 94 | #define snd_device(n) list_entry(n, struct snd_device, list) |
95 | 95 | ||
96 | /* monitor files for graceful shutdown (hotplug) */ | ||
97 | |||
98 | struct snd_monitor_file { | ||
99 | struct file *file; | ||
100 | const struct file_operations *disconnected_f_op; | ||
101 | struct list_head shutdown_list; /* still need to shutdown */ | ||
102 | struct list_head list; /* link of monitor files */ | ||
103 | }; | ||
104 | |||
105 | /* main structure for soundcard */ | 96 | /* main structure for soundcard */ |
106 | 97 | ||
107 | struct snd_card { | 98 | struct snd_card { |
@@ -300,19 +291,10 @@ int snd_card_create(int idx, const char *id, | |||
300 | struct module *module, int extra_size, | 291 | struct module *module, int extra_size, |
301 | struct snd_card **card_ret); | 292 | struct snd_card **card_ret); |
302 | 293 | ||
303 | static inline __deprecated | ||
304 | struct snd_card *snd_card_new(int idx, const char *id, | ||
305 | struct module *module, int extra_size) | ||
306 | { | ||
307 | struct snd_card *card; | ||
308 | if (snd_card_create(idx, id, module, extra_size, &card) < 0) | ||
309 | return NULL; | ||
310 | return card; | ||
311 | } | ||
312 | |||
313 | int snd_card_disconnect(struct snd_card *card); | 294 | int snd_card_disconnect(struct snd_card *card); |
314 | int snd_card_free(struct snd_card *card); | 295 | int snd_card_free(struct snd_card *card); |
315 | int snd_card_free_when_closed(struct snd_card *card); | 296 | int snd_card_free_when_closed(struct snd_card *card); |
297 | void snd_card_set_id(struct snd_card *card, const char *id); | ||
316 | int snd_card_register(struct snd_card *card); | 298 | int snd_card_register(struct snd_card *card); |
317 | int snd_card_info_init(void); | 299 | int snd_card_info_init(void); |
318 | int snd_card_info_done(void); | 300 | int snd_card_info_done(void); |
@@ -320,9 +302,7 @@ int snd_component_add(struct snd_card *card, const char *component); | |||
320 | int snd_card_file_add(struct snd_card *card, struct file *file); | 302 | int snd_card_file_add(struct snd_card *card, struct file *file); |
321 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 303 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
322 | 304 | ||
323 | #ifndef snd_card_set_dev | ||
324 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) | 305 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) |
325 | #endif | ||
326 | 306 | ||
327 | /* device.c */ | 307 | /* device.c */ |
328 | 308 | ||
@@ -349,18 +329,17 @@ unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); | |||
349 | struct resource; | 329 | struct resource; |
350 | void release_and_free_resource(struct resource *res); | 330 | void release_and_free_resource(struct resource *res); |
351 | 331 | ||
352 | #ifdef CONFIG_SND_VERBOSE_PRINTK | ||
353 | void snd_verbose_printk(const char *file, int line, const char *format, ...) | ||
354 | __attribute__ ((format (printf, 3, 4))); | ||
355 | #endif | ||
356 | #if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK) | ||
357 | void snd_verbose_printd(const char *file, int line, const char *format, ...) | ||
358 | __attribute__ ((format (printf, 3, 4))); | ||
359 | #endif | ||
360 | |||
361 | /* --- */ | 332 | /* --- */ |
362 | 333 | ||
363 | #ifdef CONFIG_SND_VERBOSE_PRINTK | 334 | #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) |
335 | void __snd_printk(unsigned int level, const char *file, int line, | ||
336 | const char *format, ...) | ||
337 | __attribute__ ((format (printf, 4, 5))); | ||
338 | #else | ||
339 | #define __snd_printk(level, file, line, format, args...) \ | ||
340 | printk(format, ##args) | ||
341 | #endif | ||
342 | |||
364 | /** | 343 | /** |
365 | * snd_printk - printk wrapper | 344 | * snd_printk - printk wrapper |
366 | * @fmt: format string | 345 | * @fmt: format string |
@@ -369,15 +348,9 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
369 | * when configured with CONFIG_SND_VERBOSE_PRINTK. | 348 | * when configured with CONFIG_SND_VERBOSE_PRINTK. |
370 | */ | 349 | */ |
371 | #define snd_printk(fmt, args...) \ | 350 | #define snd_printk(fmt, args...) \ |
372 | snd_verbose_printk(__FILE__, __LINE__, fmt ,##args) | 351 | __snd_printk(0, __FILE__, __LINE__, fmt, ##args) |
373 | #else | ||
374 | #define snd_printk(fmt, args...) \ | ||
375 | printk(fmt ,##args) | ||
376 | #endif | ||
377 | 352 | ||
378 | #ifdef CONFIG_SND_DEBUG | 353 | #ifdef CONFIG_SND_DEBUG |
379 | |||
380 | #ifdef CONFIG_SND_VERBOSE_PRINTK | ||
381 | /** | 354 | /** |
382 | * snd_printd - debug printk | 355 | * snd_printd - debug printk |
383 | * @fmt: format string | 356 | * @fmt: format string |
@@ -386,11 +359,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
386 | * Ignored when CONFIG_SND_DEBUG is not set. | 359 | * Ignored when CONFIG_SND_DEBUG is not set. |
387 | */ | 360 | */ |
388 | #define snd_printd(fmt, args...) \ | 361 | #define snd_printd(fmt, args...) \ |
389 | snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) | 362 | __snd_printk(1, __FILE__, __LINE__, fmt, ##args) |
390 | #else | ||
391 | #define snd_printd(fmt, args...) \ | ||
392 | printk(fmt ,##args) | ||
393 | #endif | ||
394 | 363 | ||
395 | /** | 364 | /** |
396 | * snd_BUG - give a BUG warning message and stack trace | 365 | * snd_BUG - give a BUG warning message and stack trace |
@@ -437,9 +406,10 @@ static inline int __snd_bug_on(int cond) | |||
437 | * Works like snd_printk() for debugging purposes. | 406 | * Works like snd_printk() for debugging purposes. |
438 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. | 407 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. |
439 | */ | 408 | */ |
440 | #define snd_printdd(format, args...) snd_printk(format, ##args) | 409 | #define snd_printdd(format, args...) \ |
410 | __snd_printk(2, __FILE__, __LINE__, format, ##args) | ||
441 | #else | 411 | #else |
442 | #define snd_printdd(format, args...) /* nothing */ | 412 | #define snd_printdd(format, args...) do { } while (0) |
443 | #endif | 413 | #endif |
444 | 414 | ||
445 | 415 | ||
@@ -447,12 +417,10 @@ static inline int __snd_bug_on(int cond) | |||
447 | 417 | ||
448 | /* for easier backward-porting */ | 418 | /* for easier backward-porting */ |
449 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) | 419 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
450 | #ifndef gameport_set_dev_parent | ||
451 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) | 420 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) |
452 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) | 421 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) |
453 | #define gameport_get_port_data(gp) (gp)->port_data | 422 | #define gameport_get_port_data(gp) (gp)->port_data |
454 | #endif | 423 | #endif |
455 | #endif | ||
456 | 424 | ||
457 | /* PCI quirk list helper */ | 425 | /* PCI quirk list helper */ |
458 | struct snd_pci_quirk { | 426 | struct snd_pci_quirk { |
diff --git a/include/sound/driver.h b/include/sound/driver.h deleted file mode 100644 index f0359437d01a..000000000000 --- a/include/sound/driver.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #warning "This file is deprecated" | ||
diff --git a/include/sound/info.h b/include/sound/info.h index 7c2ee1a21b00..112e8949e1a7 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
@@ -110,13 +110,13 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer); | |||
110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} | 110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | int snd_iprintf(struct snd_info_buffer *buffer, char *fmt, ...) \ | 113 | int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \ |
114 | __attribute__ ((format (printf, 2, 3))); | 114 | __attribute__ ((format (printf, 2, 3))); |
115 | int snd_info_init(void); | 115 | int snd_info_init(void); |
116 | int snd_info_done(void); | 116 | int snd_info_done(void); |
117 | 117 | ||
118 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); | 118 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); |
119 | char *snd_info_get_str(char *dest, char *src, int len); | 119 | const char *snd_info_get_str(char *dest, const char *src, int len); |
120 | struct snd_info_entry *snd_info_create_module_entry(struct module *module, | 120 | struct snd_info_entry *snd_info_create_module_entry(struct module *module, |
121 | const char *name, | 121 | const char *name, |
122 | struct snd_info_entry *parent); | 122 | struct snd_info_entry *parent); |
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 7ccce94a5255..c42506212649 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
@@ -47,7 +47,11 @@ struct snd_dma_device { | |||
47 | #define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */ | 47 | #define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */ |
48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ | 48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ |
49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ | 49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ |
50 | #ifdef CONFIG_SND_DMA_SGBUF | ||
50 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ | 51 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ |
52 | #else | ||
53 | #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */ | ||
54 | #endif | ||
51 | 55 | ||
52 | /* | 56 | /* |
53 | * info for buffer allocation | 57 | * info for buffer allocation |
@@ -60,6 +64,7 @@ struct snd_dma_buffer { | |||
60 | void *private_data; /* private for allocator; don't touch */ | 64 | void *private_data; /* private for allocator; don't touch */ |
61 | }; | 65 | }; |
62 | 66 | ||
67 | #ifdef CONFIG_SND_DMA_SGBUF | ||
63 | /* | 68 | /* |
64 | * Scatter-Gather generic device pages | 69 | * Scatter-Gather generic device pages |
65 | */ | 70 | */ |
@@ -107,6 +112,7 @@ static inline void *snd_sgbuf_get_ptr(struct snd_sg_buf *sgbuf, size_t offset) | |||
107 | { | 112 | { |
108 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; | 113 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; |
109 | } | 114 | } |
115 | #endif /* CONFIG_SND_DMA_SGBUF */ | ||
110 | 116 | ||
111 | /* allocate/release a buffer */ | 117 | /* allocate/release a buffer */ |
112 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, | 118 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index c17296891617..de6d981de5d6 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -98,6 +98,7 @@ struct snd_pcm_ops { | |||
98 | #define SNDRV_PCM_IOCTL1_INFO 1 | 98 | #define SNDRV_PCM_IOCTL1_INFO 1 |
99 | #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2 | 99 | #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2 |
100 | #define SNDRV_PCM_IOCTL1_GSTATE 3 | 100 | #define SNDRV_PCM_IOCTL1_GSTATE 3 |
101 | #define SNDRV_PCM_IOCTL1_FIFO_SIZE 4 | ||
101 | 102 | ||
102 | #define SNDRV_PCM_TRIGGER_STOP 0 | 103 | #define SNDRV_PCM_TRIGGER_STOP 0 |
103 | #define SNDRV_PCM_TRIGGER_START 1 | 104 | #define SNDRV_PCM_TRIGGER_START 1 |
@@ -270,6 +271,7 @@ struct snd_pcm_runtime { | |||
270 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ | 271 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ |
271 | snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ | 272 | snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ |
272 | unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ | 273 | unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ |
274 | snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ | ||
273 | 275 | ||
274 | /* -- HW params -- */ | 276 | /* -- HW params -- */ |
275 | snd_pcm_access_t access; /* access mode */ | 277 | snd_pcm_access_t access; /* access mode */ |
@@ -486,80 +488,6 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream); | |||
486 | void snd_pcm_vma_notify_data(void *client, void *data); | 488 | void snd_pcm_vma_notify_data(void *client, void *data); |
487 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); | 489 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); |
488 | 490 | ||
489 | #if BITS_PER_LONG >= 64 | ||
490 | |||
491 | static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) | ||
492 | { | ||
493 | *rem = *n % div; | ||
494 | *n /= div; | ||
495 | } | ||
496 | |||
497 | #elif defined(i386) | ||
498 | |||
499 | static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) | ||
500 | { | ||
501 | u_int32_t low, high; | ||
502 | low = *n & 0xffffffff; | ||
503 | high = *n >> 32; | ||
504 | if (high) { | ||
505 | u_int32_t high1 = high % div; | ||
506 | high /= div; | ||
507 | asm("divl %2":"=a" (low), "=d" (*rem):"rm" (div), "a" (low), "d" (high1)); | ||
508 | *n = (u_int64_t)high << 32 | low; | ||
509 | } else { | ||
510 | *n = low / div; | ||
511 | *rem = low % div; | ||
512 | } | ||
513 | } | ||
514 | #else | ||
515 | |||
516 | static inline void divl(u_int32_t high, u_int32_t low, | ||
517 | u_int32_t div, | ||
518 | u_int32_t *q, u_int32_t *r) | ||
519 | { | ||
520 | u_int64_t n = (u_int64_t)high << 32 | low; | ||
521 | u_int64_t d = (u_int64_t)div << 31; | ||
522 | u_int32_t q1 = 0; | ||
523 | int c = 32; | ||
524 | while (n > 0xffffffffU) { | ||
525 | q1 <<= 1; | ||
526 | if (n >= d) { | ||
527 | n -= d; | ||
528 | q1 |= 1; | ||
529 | } | ||
530 | d >>= 1; | ||
531 | c--; | ||
532 | } | ||
533 | q1 <<= c; | ||
534 | if (n) { | ||
535 | low = n; | ||
536 | *q = q1 | (low / div); | ||
537 | *r = low % div; | ||
538 | } else { | ||
539 | *r = 0; | ||
540 | *q = q1; | ||
541 | } | ||
542 | return; | ||
543 | } | ||
544 | |||
545 | static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) | ||
546 | { | ||
547 | u_int32_t low, high; | ||
548 | low = *n & 0xffffffff; | ||
549 | high = *n >> 32; | ||
550 | if (high) { | ||
551 | u_int32_t high1 = high % div; | ||
552 | u_int32_t low1 = low; | ||
553 | high /= div; | ||
554 | divl(high1, low1, div, &low, rem); | ||
555 | *n = (u_int64_t)high << 32 | low; | ||
556 | } else { | ||
557 | *n = low / div; | ||
558 | *rem = low % div; | ||
559 | } | ||
560 | } | ||
561 | #endif | ||
562 | |||
563 | /* | 491 | /* |
564 | * PCM library | 492 | * PCM library |
565 | */ | 493 | */ |
@@ -974,6 +902,7 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, | |||
974 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); | 902 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); |
975 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); | 903 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); |
976 | 904 | ||
905 | #ifdef CONFIG_SND_DMA_SGBUF | ||
977 | /* | 906 | /* |
978 | * SG-buffer handling | 907 | * SG-buffer handling |
979 | */ | 908 | */ |
@@ -999,6 +928,28 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, | |||
999 | unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, | 928 | unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, |
1000 | unsigned int ofs, unsigned int size); | 929 | unsigned int ofs, unsigned int size); |
1001 | 930 | ||
931 | #else /* !SND_DMA_SGBUF */ | ||
932 | /* | ||
933 | * fake using a continuous buffer | ||
934 | */ | ||
935 | static inline dma_addr_t | ||
936 | snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
937 | { | ||
938 | return substream->runtime->dma_addr + ofs; | ||
939 | } | ||
940 | |||
941 | static inline void * | ||
942 | snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
943 | { | ||
944 | return substream->runtime->dma_area + ofs; | ||
945 | } | ||
946 | |||
947 | #define snd_pcm_sgbuf_ops_page NULL | ||
948 | |||
949 | #define snd_pcm_sgbuf_get_chunk_size(subs, ofs, size) (size) | ||
950 | |||
951 | #endif /* SND_DMA_SGBUF */ | ||
952 | |||
1002 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ | 953 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ |
1003 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 954 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |
1004 | { | 955 | { |
@@ -1037,4 +988,6 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) | |||
1037 | 988 | ||
1038 | #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) | 989 | #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) |
1039 | 990 | ||
991 | const char *snd_pcm_format_name(snd_pcm_format_t format); | ||
992 | |||
1040 | #endif /* __SOUND_PCM_H */ | 993 | #endif /* __SOUND_PCM_H */ |
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h new file mode 100644 index 000000000000..c0227361a876 --- /dev/null +++ b/include/sound/sh_fsi.h | |||
@@ -0,0 +1,83 @@ | |||
1 | #ifndef __SOUND_FSI_H | ||
2 | #define __SOUND_FSI_H | ||
3 | |||
4 | /* | ||
5 | * Fifo-attached Serial Interface (FSI) support for SH7724 | ||
6 | * | ||
7 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
8 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | /* flags format | ||
16 | |||
17 | * 0xABCDEEFF | ||
18 | * | ||
19 | * A: channel size for TDM (input) | ||
20 | * B: channel size for TDM (ooutput) | ||
21 | * C: inversion | ||
22 | * D: mode | ||
23 | * E: input format | ||
24 | * F: output format | ||
25 | */ | ||
26 | |||
27 | #include <linux/clk.h> | ||
28 | #include <sound/soc.h> | ||
29 | |||
30 | /* TDM channel */ | ||
31 | #define SH_FSI_SET_CH_I(x) ((x & 0xF) << 28) | ||
32 | #define SH_FSI_SET_CH_O(x) ((x & 0xF) << 24) | ||
33 | |||
34 | #define SH_FSI_CH_IMASK 0xF0000000 | ||
35 | #define SH_FSI_CH_OMASK 0x0F000000 | ||
36 | #define SH_FSI_GET_CH_I(x) ((x & SH_FSI_CH_IMASK) >> 28) | ||
37 | #define SH_FSI_GET_CH_O(x) ((x & SH_FSI_CH_OMASK) >> 24) | ||
38 | |||
39 | /* clock inversion */ | ||
40 | #define SH_FSI_INVERSION_MASK 0x00F00000 | ||
41 | #define SH_FSI_LRM_INV (1 << 20) | ||
42 | #define SH_FSI_BRM_INV (1 << 21) | ||
43 | #define SH_FSI_LRS_INV (1 << 22) | ||
44 | #define SH_FSI_BRS_INV (1 << 23) | ||
45 | |||
46 | /* mode */ | ||
47 | #define SH_FSI_MODE_MASK 0x000F0000 | ||
48 | #define SH_FSI_IN_SLAVE_MODE (1 << 16) /* default master mode */ | ||
49 | #define SH_FSI_OUT_SLAVE_MODE (1 << 17) /* default master mode */ | ||
50 | |||
51 | /* DI format */ | ||
52 | #define SH_FSI_FMT_MASK 0x000000FF | ||
53 | #define SH_FSI_IFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8) | ||
54 | #define SH_FSI_OFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0) | ||
55 | #define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK) | ||
56 | #define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK) | ||
57 | |||
58 | #define SH_FSI_FMT_MONO (1 << 0) | ||
59 | #define SH_FSI_FMT_MONO_DELAY (1 << 1) | ||
60 | #define SH_FSI_FMT_PCM (1 << 2) | ||
61 | #define SH_FSI_FMT_I2S (1 << 3) | ||
62 | #define SH_FSI_FMT_TDM (1 << 4) | ||
63 | #define SH_FSI_FMT_TDM_DELAY (1 << 5) | ||
64 | |||
65 | #define SH_FSI_IFMT_TDM_CH(x) \ | ||
66 | (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) | ||
67 | #define SH_FSI_IFMT_TDM_DELAY_CH(x) \ | ||
68 | (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x)) | ||
69 | |||
70 | #define SH_FSI_OFMT_TDM_CH(x) \ | ||
71 | (SH_FSI_OFMT(TDM) | SH_FSI_SET_CH_O(x)) | ||
72 | #define SH_FSI_OFMT_TDM_DELAY_CH(x) \ | ||
73 | (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) | ||
74 | |||
75 | struct sh_fsi_platform_info { | ||
76 | unsigned long porta_flags; | ||
77 | unsigned long portb_flags; | ||
78 | }; | ||
79 | |||
80 | extern struct snd_soc_dai fsi_soc_dai[2]; | ||
81 | extern struct snd_soc_platform fsi_soc_platform; | ||
82 | |||
83 | #endif /* __SOUND_FSI_H */ | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 13676472ddfc..97ca9af414dc 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -27,8 +27,8 @@ struct snd_pcm_substream; | |||
27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ |
28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ |
29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ |
30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ |
31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ |
32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ |
33 | 33 | ||
34 | /* left and right justified also known as MSB and LSB respectively */ | 34 | /* left and right justified also known as MSB and LSB respectively */ |
@@ -38,52 +38,34 @@ struct snd_pcm_substream; | |||
38 | /* | 38 | /* |
39 | * DAI Clock gating. | 39 | * DAI Clock gating. |
40 | * | 40 | * |
41 | * DAI bit clocks can be be gated (disabled) when not the DAI is not | 41 | * DAI bit clocks can be be gated (disabled) when the DAI is not |
42 | * sending or receiving PCM data in a frame. This can be used to save power. | 42 | * sending or receiving PCM data in a frame. This can be used to save power. |
43 | */ | 43 | */ |
44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | 44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ |
45 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ | 45 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * DAI Left/Right Clocks. | ||
49 | * | ||
50 | * Specifies whether the DAI can support different samples for similtanious | ||
51 | * playback and capture. This usually requires a seperate physical frame | ||
52 | * clock for playback and capture. | ||
53 | */ | ||
54 | #define SND_SOC_DAIFMT_SYNC (0 << 5) /* Tx FRM = Rx FRM */ | ||
55 | #define SND_SOC_DAIFMT_ASYNC (1 << 5) /* Tx FRM ~ Rx FRM */ | ||
56 | |||
57 | /* | ||
58 | * TDM | ||
59 | * | ||
60 | * Time Division Multiplexing. Allows PCM data to be multplexed with other | ||
61 | * data on the DAI. | ||
62 | */ | ||
63 | #define SND_SOC_DAIFMT_TDM (1 << 6) | ||
64 | |||
65 | /* | ||
66 | * DAI hardware signal inversions. | 48 | * DAI hardware signal inversions. |
67 | * | 49 | * |
68 | * Specifies whether the DAI can also support inverted clocks for the specified | 50 | * Specifies whether the DAI can also support inverted clocks for the specified |
69 | * format. | 51 | * format. |
70 | */ | 52 | */ |
71 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | 53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ |
72 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | 54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */ |
73 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | 55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */ |
74 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | 56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */ |
75 | 57 | ||
76 | /* | 58 | /* |
77 | * DAI hardware clock masters. | 59 | * DAI hardware clock masters. |
78 | * | 60 | * |
79 | * This is wrt the codec, the inverse is true for the interface | 61 | * This is wrt the codec, the inverse is true for the interface |
80 | * i.e. if the codec is clk and frm master then the interface is | 62 | * i.e. if the codec is clk and FRM master then the interface is |
81 | * clk and frame slave. | 63 | * clk and frame slave. |
82 | */ | 64 | */ |
83 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | 65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */ |
84 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | 66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */ |
85 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | 67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ |
86 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | 68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */ |
87 | 69 | ||
88 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | 70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f |
89 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | 71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 |
@@ -96,6 +78,16 @@ struct snd_pcm_substream; | |||
96 | #define SND_SOC_CLOCK_IN 0 | 78 | #define SND_SOC_CLOCK_IN 0 |
97 | #define SND_SOC_CLOCK_OUT 1 | 79 | #define SND_SOC_CLOCK_OUT 1 |
98 | 80 | ||
81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S8 |\ | ||
82 | SNDRV_PCM_FMTBIT_S16_LE |\ | ||
83 | SNDRV_PCM_FMTBIT_S16_BE |\ | ||
84 | SNDRV_PCM_FMTBIT_S20_3LE |\ | ||
85 | SNDRV_PCM_FMTBIT_S20_3BE |\ | ||
86 | SNDRV_PCM_FMTBIT_S24_3LE |\ | ||
87 | SNDRV_PCM_FMTBIT_S24_3BE |\ | ||
88 | SNDRV_PCM_FMTBIT_S32_LE |\ | ||
89 | SNDRV_PCM_FMTBIT_S32_BE) | ||
90 | |||
99 | struct snd_soc_dai_ops; | 91 | struct snd_soc_dai_ops; |
100 | struct snd_soc_dai; | 92 | struct snd_soc_dai; |
101 | struct snd_ac97_bus_ops; | 93 | struct snd_ac97_bus_ops; |
@@ -120,7 +112,7 @@ int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | |||
120 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | 112 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); |
121 | 113 | ||
122 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
123 | unsigned int mask, int slots); | 115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); |
124 | 116 | ||
125 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 117 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
126 | 118 | ||
@@ -130,12 +122,12 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | |||
130 | /* | 122 | /* |
131 | * Digital Audio Interface. | 123 | * Digital Audio Interface. |
132 | * | 124 | * |
133 | * Describes the Digital Audio Interface in terms of it's ALSA, DAI and AC97 | 125 | * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97 |
134 | * operations an capabilities. Codec and platfom drivers will register a this | 126 | * operations and capabilities. Codec and platform drivers will register this |
135 | * structure for every DAI they have. | 127 | * structure for every DAI they have. |
136 | * | 128 | * |
137 | * This structure covers the clocking, formating and ALSA operations for each | 129 | * This structure covers the clocking, formating and ALSA operations for each |
138 | * interface a | 130 | * interface. |
139 | */ | 131 | */ |
140 | struct snd_soc_dai_ops { | 132 | struct snd_soc_dai_ops { |
141 | /* | 133 | /* |
@@ -154,7 +146,8 @@ struct snd_soc_dai_ops { | |||
154 | */ | 146 | */ |
155 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | 147 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); |
156 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | 148 | int (*set_tdm_slot)(struct snd_soc_dai *dai, |
157 | unsigned int mask, int slots); | 149 | unsigned int tx_mask, unsigned int rx_mask, |
150 | int slots, int slot_width); | ||
158 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | 151 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); |
159 | 152 | ||
160 | /* | 153 | /* |
@@ -193,6 +186,7 @@ struct snd_soc_dai { | |||
193 | int ac97_control; | 186 | int ac97_control; |
194 | 187 | ||
195 | struct device *dev; | 188 | struct device *dev; |
189 | void *ac97_pdata; /* platform_data for the ac97 codec */ | ||
196 | 190 | ||
197 | /* DAI callbacks */ | 191 | /* DAI callbacks */ |
198 | int (*probe)(struct platform_device *pdev, | 192 | int (*probe)(struct platform_device *pdev, |
@@ -208,6 +202,7 @@ struct snd_soc_dai { | |||
208 | /* DAI capabilities */ | 202 | /* DAI capabilities */ |
209 | struct snd_soc_pcm_stream capture; | 203 | struct snd_soc_pcm_stream capture; |
210 | struct snd_soc_pcm_stream playback; | 204 | struct snd_soc_pcm_stream playback; |
205 | unsigned int symmetric_rates:1; | ||
211 | 206 | ||
212 | /* DAI runtime info */ | 207 | /* DAI runtime info */ |
213 | struct snd_pcm_runtime *runtime; | 208 | struct snd_pcm_runtime *runtime; |
@@ -219,11 +214,8 @@ struct snd_soc_dai { | |||
219 | /* DAI private data */ | 214 | /* DAI private data */ |
220 | void *private_data; | 215 | void *private_data; |
221 | 216 | ||
222 | /* parent codec/platform */ | 217 | /* parent platform */ |
223 | union { | 218 | struct snd_soc_platform *platform; |
224 | struct snd_soc_codec *codec; | ||
225 | struct snd_soc_platform *platform; | ||
226 | }; | ||
227 | 219 | ||
228 | struct list_head list; | 220 | struct list_head list; |
229 | }; | 221 | }; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index a7def6a9a030..c1410e3191e3 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -137,19 +137,39 @@ | |||
137 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} | 137 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} |
138 | 138 | ||
139 | /* stream domain */ | 139 | /* stream domain */ |
140 | #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ | ||
141 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ | ||
142 | .reg = wreg, .shift = wshift, .invert = winvert } | ||
143 | #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ | ||
144 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ | ||
145 | .reg = wreg, .shift = wshift, .invert = winvert } | ||
140 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ | 146 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ |
141 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 147 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ |
142 | .shift = wshift, .invert = winvert} | 148 | .shift = wshift, .invert = winvert} |
149 | #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ | ||
150 | wevent, wflags) \ | ||
151 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | ||
152 | .shift = wshift, .invert = winvert, \ | ||
153 | .event = wevent, .event_flags = wflags} | ||
143 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ | 154 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ |
144 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 155 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ |
145 | .shift = wshift, .invert = winvert} | 156 | .shift = wshift, .invert = winvert} |
157 | #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ | ||
158 | wevent, wflags) \ | ||
159 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | ||
160 | .shift = wshift, .invert = winvert, \ | ||
161 | .event = wevent, .event_flags = wflags} | ||
146 | 162 | ||
147 | /* generic register modifier widget */ | 163 | /* generic widgets */ |
148 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ | 164 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ |
149 | { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ | 165 | { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ |
150 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ | 166 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ |
151 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ | 167 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ |
152 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} | 168 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} |
169 | #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ | ||
170 | { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ | ||
171 | .shift = wshift, .invert = winvert, .event = wevent, \ | ||
172 | .event_flags = wflags} | ||
153 | 173 | ||
154 | /* dapm kcontrol types */ | 174 | /* dapm kcontrol types */ |
155 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ | 175 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ |
@@ -265,11 +285,11 @@ int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | |||
265 | /* dapm events */ | 285 | /* dapm events */ |
266 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, | 286 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, |
267 | int event); | 287 | int event); |
268 | int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev, | 288 | void snd_soc_dapm_shutdown(struct snd_soc_device *socdev); |
269 | enum snd_soc_bias_level level); | ||
270 | 289 | ||
271 | /* dapm sys fs - used by the core */ | 290 | /* dapm sys fs - used by the core */ |
272 | int snd_soc_dapm_sys_add(struct device *dev); | 291 | int snd_soc_dapm_sys_add(struct device *dev); |
292 | void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); | ||
273 | 293 | ||
274 | /* dapm audio pin control and status */ | 294 | /* dapm audio pin control and status */ |
275 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); | 295 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); |
@@ -298,6 +318,9 @@ enum snd_soc_dapm_type { | |||
298 | snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ | 318 | snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ |
299 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ | 319 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ |
300 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 320 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
321 | snd_soc_dapm_supply, /* power/clock supply */ | ||
322 | snd_soc_dapm_aif_in, /* audio interface input */ | ||
323 | snd_soc_dapm_aif_out, /* audio interface output */ | ||
301 | }; | 324 | }; |
302 | 325 | ||
303 | /* | 326 | /* |
@@ -357,6 +380,8 @@ struct snd_soc_dapm_widget { | |||
357 | unsigned char suspend:1; /* was active before suspend */ | 380 | unsigned char suspend:1; /* was active before suspend */ |
358 | unsigned char pmdown:1; /* waiting for timeout */ | 381 | unsigned char pmdown:1; /* waiting for timeout */ |
359 | 382 | ||
383 | int (*power_check)(struct snd_soc_dapm_widget *w); | ||
384 | |||
360 | /* external events */ | 385 | /* external events */ |
361 | unsigned short event_flags; /* flags to specify event types */ | 386 | unsigned short event_flags; /* flags to specify event types */ |
362 | int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int); | 387 | int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int); |
@@ -368,6 +393,9 @@ struct snd_soc_dapm_widget { | |||
368 | /* widget input and outputs */ | 393 | /* widget input and outputs */ |
369 | struct list_head sources; | 394 | struct list_head sources; |
370 | struct list_head sinks; | 395 | struct list_head sinks; |
396 | |||
397 | /* used during DAPM updates */ | ||
398 | struct list_head power_list; | ||
371 | }; | 399 | }; |
372 | 400 | ||
373 | #endif | 401 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index a40bc6f316fc..475cb7ed6bec 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -118,6 +118,14 @@ | |||
118 | .info = snd_soc_info_volsw, \ | 118 | .info = snd_soc_info_volsw, \ |
119 | .get = xhandler_get, .put = xhandler_put, \ | 119 | .get = xhandler_get, .put = xhandler_put, \ |
120 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 120 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
121 | #define SOC_DOUBLE_EXT(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | ||
122 | xhandler_get, xhandler_put) \ | ||
123 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
124 | .info = snd_soc_info_volsw, \ | ||
125 | .get = xhandler_get, .put = xhandler_put, \ | ||
126 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
127 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | ||
128 | .max = xmax, .invert = xinvert} } | ||
121 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 129 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
122 | xhandler_get, xhandler_put, tlv_array) \ | 130 | xhandler_get, xhandler_put, tlv_array) \ |
123 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 131 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -127,6 +135,28 @@ | |||
127 | .info = snd_soc_info_volsw, \ | 135 | .info = snd_soc_info_volsw, \ |
128 | .get = xhandler_get, .put = xhandler_put, \ | 136 | .get = xhandler_get, .put = xhandler_put, \ |
129 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 137 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
138 | #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | ||
139 | xhandler_get, xhandler_put, tlv_array) \ | ||
140 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
141 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | ||
142 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | ||
143 | .tlv.p = (tlv_array), \ | ||
144 | .info = snd_soc_info_volsw, \ | ||
145 | .get = xhandler_get, .put = xhandler_put, \ | ||
146 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
147 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | ||
148 | .max = xmax, .invert = xinvert} } | ||
149 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | ||
150 | xhandler_get, xhandler_put, tlv_array) \ | ||
151 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
152 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | ||
153 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | ||
154 | .tlv.p = (tlv_array), \ | ||
155 | .info = snd_soc_info_volsw_2r, \ | ||
156 | .get = xhandler_get, .put = xhandler_put, \ | ||
157 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
158 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | ||
159 | .max = xmax, .invert = xinvert} } | ||
130 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 160 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
131 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 161 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
132 | .info = snd_soc_info_bool_ext, \ | 162 | .info = snd_soc_info_bool_ext, \ |
@@ -175,14 +205,28 @@ struct snd_soc_jack_gpio; | |||
175 | #endif | 205 | #endif |
176 | 206 | ||
177 | typedef int (*hw_write_t)(void *,const char* ,int); | 207 | typedef int (*hw_write_t)(void *,const char* ,int); |
178 | typedef int (*hw_read_t)(void *,char* ,int); | ||
179 | 208 | ||
180 | extern struct snd_ac97_bus_ops soc_ac97_ops; | 209 | extern struct snd_ac97_bus_ops soc_ac97_ops; |
181 | 210 | ||
211 | enum snd_soc_control_type { | ||
212 | SND_SOC_CUSTOM, | ||
213 | SND_SOC_I2C, | ||
214 | SND_SOC_SPI, | ||
215 | }; | ||
216 | |||
182 | int snd_soc_register_platform(struct snd_soc_platform *platform); | 217 | int snd_soc_register_platform(struct snd_soc_platform *platform); |
183 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); | 218 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); |
184 | int snd_soc_register_codec(struct snd_soc_codec *codec); | 219 | int snd_soc_register_codec(struct snd_soc_codec *codec); |
185 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); | 220 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); |
221 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); | ||
222 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | ||
223 | int addr_bits, int data_bits, | ||
224 | enum snd_soc_control_type control); | ||
225 | |||
226 | #ifdef CONFIG_PM | ||
227 | int snd_soc_suspend_device(struct device *dev); | ||
228 | int snd_soc_resume_device(struct device *dev); | ||
229 | #endif | ||
186 | 230 | ||
187 | /* pcm <-> DAI connect */ | 231 | /* pcm <-> DAI connect */ |
188 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 232 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
@@ -206,15 +250,11 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | |||
206 | struct snd_soc_jack_gpio *gpios); | 250 | struct snd_soc_jack_gpio *gpios); |
207 | #endif | 251 | #endif |
208 | 252 | ||
209 | /* codec IO */ | ||
210 | #define snd_soc_read(codec, reg) codec->read(codec, reg) | ||
211 | #define snd_soc_write(codec, reg, value) codec->write(codec, reg, value) | ||
212 | |||
213 | /* codec register bit access */ | 253 | /* codec register bit access */ |
214 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, | 254 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, |
215 | unsigned short mask, unsigned short value); | 255 | unsigned int mask, unsigned int value); |
216 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, | 256 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, |
217 | unsigned short mask, unsigned short value); | 257 | unsigned int mask, unsigned int value); |
218 | 258 | ||
219 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, | 259 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, |
220 | struct snd_ac97_bus_ops *ops, int num); | 260 | struct snd_ac97_bus_ops *ops, int num); |
@@ -331,6 +371,7 @@ struct snd_soc_codec { | |||
331 | struct module *owner; | 371 | struct module *owner; |
332 | struct mutex mutex; | 372 | struct mutex mutex; |
333 | struct device *dev; | 373 | struct device *dev; |
374 | struct snd_soc_device *socdev; | ||
334 | 375 | ||
335 | struct list_head list; | 376 | struct list_head list; |
336 | 377 | ||
@@ -351,8 +392,10 @@ struct snd_soc_codec { | |||
351 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | 392 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); |
352 | int (*display_register)(struct snd_soc_codec *, char *, | 393 | int (*display_register)(struct snd_soc_codec *, char *, |
353 | size_t, unsigned int); | 394 | size_t, unsigned int); |
395 | int (*volatile_register)(unsigned int); | ||
396 | int (*readable_register)(unsigned int); | ||
354 | hw_write_t hw_write; | 397 | hw_write_t hw_write; |
355 | hw_read_t hw_read; | 398 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
356 | void *reg_cache; | 399 | void *reg_cache; |
357 | short reg_cache_size; | 400 | short reg_cache_size; |
358 | short reg_cache_step; | 401 | short reg_cache_step; |
@@ -372,6 +415,7 @@ struct snd_soc_codec { | |||
372 | #ifdef CONFIG_DEBUG_FS | 415 | #ifdef CONFIG_DEBUG_FS |
373 | struct dentry *debugfs_reg; | 416 | struct dentry *debugfs_reg; |
374 | struct dentry *debugfs_pop_time; | 417 | struct dentry *debugfs_pop_time; |
418 | struct dentry *debugfs_dapm; | ||
375 | #endif | 419 | #endif |
376 | }; | 420 | }; |
377 | 421 | ||
@@ -417,6 +461,12 @@ struct snd_soc_dai_link { | |||
417 | /* codec/machine specific init - e.g. add machine controls */ | 461 | /* codec/machine specific init - e.g. add machine controls */ |
418 | int (*init)(struct snd_soc_codec *codec); | 462 | int (*init)(struct snd_soc_codec *codec); |
419 | 463 | ||
464 | /* Symmetry requirements */ | ||
465 | unsigned int symmetric_rates:1; | ||
466 | |||
467 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
468 | unsigned int rate; | ||
469 | |||
420 | /* DAI pcm */ | 470 | /* DAI pcm */ |
421 | struct snd_pcm *pcm; | 471 | struct snd_pcm *pcm; |
422 | }; | 472 | }; |
@@ -490,6 +540,19 @@ struct soc_enum { | |||
490 | void *dapm; | 540 | void *dapm; |
491 | }; | 541 | }; |
492 | 542 | ||
543 | /* codec IO */ | ||
544 | static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, | ||
545 | unsigned int reg) | ||
546 | { | ||
547 | return codec->read(codec, reg); | ||
548 | } | ||
549 | |||
550 | static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, | ||
551 | unsigned int reg, unsigned int val) | ||
552 | { | ||
553 | return codec->write(codec, reg, val); | ||
554 | } | ||
555 | |||
493 | #include <sound/soc-dai.h> | 556 | #include <sound/soc-dai.h> |
494 | 557 | ||
495 | #endif | 558 | #endif |
diff --git a/include/sound/uda1380.h b/include/sound/uda1380.h new file mode 100644 index 000000000000..381319c7000c --- /dev/null +++ b/include/sound/uda1380.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * UDA1380 ALSA SoC Codec driver | ||
3 | * | ||
4 | * Copyright 2009 Philipp Zabel | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __UDA1380_H | ||
12 | #define __UDA1380_H | ||
13 | |||
14 | struct uda1380_platform_data { | ||
15 | int gpio_power; | ||
16 | int gpio_reset; | ||
17 | int dac_clk; | ||
18 | #define UDA1380_DAC_CLK_SYSCLK 0 | ||
19 | #define UDA1380_DAC_CLK_WSPLL 1 | ||
20 | }; | ||
21 | |||
22 | #endif /* __UDA1380_H */ | ||
diff --git a/include/sound/version.h b/include/sound/version.h index 456f1359e1c0..22939142dd23 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h */ | 1 | /* include/version.h */ |
2 | #define CONFIG_SND_VERSION "1.0.20" | 2 | #define CONFIG_SND_VERSION "1.0.21" |
3 | #define CONFIG_SND_DATE "" | 3 | #define CONFIG_SND_DATE "" |
diff --git a/include/sound/wm8993.h b/include/sound/wm8993.h new file mode 100644 index 000000000000..9c661f2f8cda --- /dev/null +++ b/include/sound/wm8993.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * linux/sound/wm8993.h -- Platform data for WM8993 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM8993_H | ||
12 | #define __LINUX_SND_WM8993_H | ||
13 | |||
14 | /* Note that EQ1 only contains the enable/disable bit so will be | ||
15 | ignored but is included for simplicity. | ||
16 | */ | ||
17 | struct wm8993_retune_mobile_setting { | ||
18 | const char *name; | ||
19 | unsigned int rate; | ||
20 | u16 config[24]; | ||
21 | }; | ||
22 | |||
23 | struct wm8993_platform_data { | ||
24 | struct wm8993_retune_mobile_setting *retune_configs; | ||
25 | int num_retune_configs; | ||
26 | |||
27 | /* LINEOUT can be differential or single ended */ | ||
28 | unsigned int lineout1_diff:1; | ||
29 | unsigned int lineout2_diff:1; | ||
30 | |||
31 | /* Common mode feedback */ | ||
32 | unsigned int lineout1fb:1; | ||
33 | unsigned int lineout2fb:1; | ||
34 | |||
35 | /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ | ||
36 | unsigned int micbias1_lvl:1; | ||
37 | unsigned int micbias2_lvl:1; | ||
38 | |||
39 | /* Jack detect threashold levels, see datasheet for values */ | ||
40 | unsigned int jd_scthr:2; | ||
41 | unsigned int jd_thr:2; | ||
42 | }; | ||
43 | |||
44 | #endif | ||
diff --git a/include/sound/wm9081.h b/include/sound/wm9081.h new file mode 100644 index 000000000000..e173ddbf6bd4 --- /dev/null +++ b/include/sound/wm9081.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * linux/sound/wm9081.h -- Platform data for WM9081 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM_9081_H | ||
12 | #define __LINUX_SND_WM_9081_H | ||
13 | |||
14 | struct wm9081_retune_mobile_setting { | ||
15 | const char *name; | ||
16 | unsigned int rate; | ||
17 | u16 config[20]; | ||
18 | }; | ||
19 | |||
20 | struct wm9081_retune_mobile_config { | ||
21 | struct wm9081_retune_mobile_setting *configs; | ||
22 | int num_configs; | ||
23 | }; | ||
24 | |||
25 | #endif | ||