aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-08 18:07:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-08 18:07:14 -0400
commitf5a246eab9a268f51ba8189ea5b098a1bfff200e (patch)
treea6ff7169e0bcaca498d9aec8b0624de1b74eaecb /include/sound
parentd5bbd43d5f450c3fca058f5b85f3dfb4e8cc88c9 (diff)
parent7ff34ad80b7080fafaac8efa9ef0061708eddd51 (diff)
Merge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "This contains pretty many small commits covering fairly large range of files in sound/ directory. Partly because of additional API support and partly because of constantly developed ASoC and ARM stuff. Some highlights: - Introduced the helper function and documentation for exposing the channel map via control API, as discussed in Plumbers; most of PCI drivers are covered, will follow more drivers later - Most of drivers have been replaced with the new PM callbacks (if the bus is supported) - HD-audio controller got the support of runtime PM and the support of D3 clock-stop. Also changing the power_save option in sysfs kicks off immediately to enable / disable the power-save mode. - Another significant code change in HD-audio is the rewrite of firmware loading code. Other than that, most of changes in HD-audio are continued cleanups and standardization for the generic auto parser and bug fixes (HBR, device-specific fixups), in addition to the support of channel-map API. - Addition of ASoC bindings for the compressed API, used by the mid-x86 drivers. - Lots of cleanups and API refreshes for ASoC codec drivers and DaVinci. - Conversion of OMAP to dmaengine. - New machine driver for Wolfson Microelectronics Bells. - New CODEC driver for Wolfson Microelectronics WM0010. - Enhancements to the ux500 and wm2000 drivers - A new driver for DA9055 and the support for regulator bypass mode." Fix up various arm soc header file reorg conflicts. * tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (339 commits) ALSA: hda - Add new codec ALC283 ALC290 support ALSA: hda - avoid unneccesary indices on "Headphone Jack" controls ALSA: hda - fix indices on boost volume on Conexant ALSA: aloop - add locking to timer access ALSA: hda - Fix hang caused by race during suspend. sound: Remove unnecessary semicolon ALSA: hda/realtek - Fix detection of ALC271X codec ALSA: hda - Add inverted internal mic quirk for Lenovo IdeaPad U310 ALSA: hda - make Realtek/Sigmatel/Conexant use the generic unsol event ALSA: hda - make a generic unsol event handler ASoC: codecs: Add DA9055 codec driver ASoC: eukrea-tlv320: Convert it to platform driver ALSA: ASoC: add DT bindings for CS4271 ASoC: wm_hubs: Ensure volume updates are handled during class W startup ASoC: wm5110: Adding missing volume update bits ASoC: wm5110: Add OUT3R support ASoC: wm5110: Add AEC loopback support ASoC: wm5110: Rename EPOUT to HPOUT3 ASoC: arizona: Add more clock rates ASoC: arizona: Add more DSP options for mixer input muxes ...
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/ac97_codec.h3
-rw-r--r--include/sound/ad1816a.h9
-rw-r--r--include/sound/asound.h39
-rw-r--r--include/sound/compress_driver.h1
-rw-r--r--include/sound/compress_params.h1
-rw-r--r--include/sound/da9055.h33
-rw-r--r--include/sound/emu10k1.h4
-rw-r--r--include/sound/initval.h14
-rw-r--r--include/sound/memalloc.h27
-rw-r--r--include/sound/pcm.h87
-rw-r--r--include/sound/soc-dai.h3
-rw-r--r--include/sound/soc-dapm.h10
-rw-r--r--include/sound/soc.h20
-rw-r--r--include/sound/tegra_wm8903.h26
-rw-r--r--include/sound/tlv.h8
-rw-r--r--include/sound/version.h3
-rw-r--r--include/sound/wm0010.h27
-rw-r--r--include/sound/wm8960.h2
-rw-r--r--include/sound/wm8993.h4
19 files changed, 282 insertions, 39 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index fdeb8dceec0f..d315a08d6c6d 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -422,6 +422,7 @@
422 */ 422 */
423 423
424struct snd_ac97; 424struct snd_ac97;
425struct snd_pcm_chmap;
425 426
426struct snd_ac97_build_ops { 427struct snd_ac97_build_ops {
427 int (*build_3d) (struct snd_ac97 *ac97); 428 int (*build_3d) (struct snd_ac97 *ac97);
@@ -528,6 +529,8 @@ struct snd_ac97 {
528 struct delayed_work power_work; 529 struct delayed_work power_work;
529#endif 530#endif
530 struct device dev; 531 struct device dev;
532
533 struct snd_pcm_chmap *chmaps[2]; /* channel-maps (optional) */
531}; 534};
532 535
533#define to_ac97_t(d) container_of(d, struct snd_ac97, dev) 536#define to_ac97_t(d) container_of(d, struct snd_ac97, dev)
diff --git a/include/sound/ad1816a.h b/include/sound/ad1816a.h
index a7d8dc782e7c..abdf609c5918 100644
--- a/include/sound/ad1816a.h
+++ b/include/sound/ad1816a.h
@@ -147,6 +147,9 @@ struct snd_ad1816a {
147 unsigned int c_dma_size; 147 unsigned int c_dma_size;
148 148
149 struct snd_timer *timer; 149 struct snd_timer *timer;
150#ifdef CONFIG_PM
151 unsigned short image[48];
152#endif
150}; 153};
151 154
152 155
@@ -165,11 +168,15 @@ struct snd_ad1816a {
165 168
166extern int snd_ad1816a_create(struct snd_card *card, unsigned long port, 169extern int snd_ad1816a_create(struct snd_card *card, unsigned long port,
167 int irq, int dma1, int dma2, 170 int irq, int dma1, int dma2,
168 struct snd_ad1816a **chip); 171 struct snd_ad1816a *chip);
169 172
170extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm); 173extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm);
171extern int snd_ad1816a_mixer(struct snd_ad1816a *chip); 174extern int snd_ad1816a_mixer(struct snd_ad1816a *chip);
172extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device, 175extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device,
173 struct snd_timer **rtimer); 176 struct snd_timer **rtimer);
177#ifdef CONFIG_PM
178extern void snd_ad1816a_suspend(struct snd_ad1816a *chip);
179extern void snd_ad1816a_resume(struct snd_ad1816a *chip);
180#endif
174 181
175#endif /* __SOUND_AD1816A_H */ 182#endif /* __SOUND_AD1816A_H */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 0876a1e76aef..dfe7d441748c 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -472,6 +472,45 @@ enum {
472 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, 472 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
473}; 473};
474 474
475/* channel positions */
476enum {
477 SNDRV_CHMAP_UNKNOWN = 0,
478 SNDRV_CHMAP_NA, /* N/A, silent */
479 SNDRV_CHMAP_MONO, /* mono stream */
480 /* this follows the alsa-lib mixer channel value + 3 */
481 SNDRV_CHMAP_FL, /* front left */
482 SNDRV_CHMAP_FR, /* front right */
483 SNDRV_CHMAP_RL, /* rear left */
484 SNDRV_CHMAP_RR, /* rear right */
485 SNDRV_CHMAP_FC, /* front center */
486 SNDRV_CHMAP_LFE, /* LFE */
487 SNDRV_CHMAP_SL, /* side left */
488 SNDRV_CHMAP_SR, /* side right */
489 SNDRV_CHMAP_RC, /* rear center */
490 /* new definitions */
491 SNDRV_CHMAP_FLC, /* front left center */
492 SNDRV_CHMAP_FRC, /* front right center */
493 SNDRV_CHMAP_RLC, /* rear left center */
494 SNDRV_CHMAP_RRC, /* rear right center */
495 SNDRV_CHMAP_FLW, /* front left wide */
496 SNDRV_CHMAP_FRW, /* front right wide */
497 SNDRV_CHMAP_FLH, /* front left high */
498 SNDRV_CHMAP_FCH, /* front center high */
499 SNDRV_CHMAP_FRH, /* front right high */
500 SNDRV_CHMAP_TC, /* top center */
501 SNDRV_CHMAP_TFL, /* top front left */
502 SNDRV_CHMAP_TFR, /* top front right */
503 SNDRV_CHMAP_TFC, /* top front center */
504 SNDRV_CHMAP_TRL, /* top rear left */
505 SNDRV_CHMAP_TRR, /* top rear right */
506 SNDRV_CHMAP_TRC, /* top rear center */
507 SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
508};
509
510#define SNDRV_CHMAP_POSITION_MASK 0xffff
511#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
512#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
513
475#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int) 514#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
476#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info) 515#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
477#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int) 516#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h
index 48f2a1ff2bbc..f2912abacdf3 100644
--- a/include/sound/compress_driver.h
+++ b/include/sound/compress_driver.h
@@ -61,6 +61,7 @@ struct snd_compr_runtime {
61 u64 total_bytes_available; 61 u64 total_bytes_available;
62 u64 total_bytes_transferred; 62 u64 total_bytes_transferred;
63 wait_queue_head_t sleep; 63 wait_queue_head_t sleep;
64 void *private_data;
64}; 65};
65 66
66/** 67/**
diff --git a/include/sound/compress_params.h b/include/sound/compress_params.h
index da4a456de032..602dc6c45d1a 100644
--- a/include/sound/compress_params.h
+++ b/include/sound/compress_params.h
@@ -72,6 +72,7 @@
72#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B) 72#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
73#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C) 73#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
74#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D) 74#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
75#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_G729
75 76
76/* 77/*
77 * Profile and modes are listed with bit masks. This allows for a 78 * Profile and modes are listed with bit masks. This allows for a
diff --git a/include/sound/da9055.h b/include/sound/da9055.h
new file mode 100644
index 000000000000..cf1241b64d89
--- /dev/null
+++ b/include/sound/da9055.h
@@ -0,0 +1,33 @@
1/*
2 * DA9055 ALSA Soc codec driver
3 *
4 * Copyright (c) 2012 Dialog Semiconductor
5 *
6 * Tested on (Samsung SMDK6410 board + DA9055 EVB) using I2S and I2C
7 * Written by David Chen <david.chen@diasemi.com> and
8 * Ashish Chavan <ashish.chavan@kpitcummins.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#ifndef __SOUND_DA9055_H__
17#define __SOUND_DA9055_H__
18
19enum da9055_micbias_voltage {
20 DA9055_MICBIAS_1_6V = 0,
21 DA9055_MICBIAS_1_8V = 1,
22 DA9055_MICBIAS_2_1V = 2,
23 DA9055_MICBIAS_2_2V = 3,
24};
25
26struct da9055_platform_data {
27 /* Selects which of the two MicBias pins acts as the bias source */
28 bool micbias_source;
29 /* Selects the micbias voltage */
30 enum da9055_micbias_voltage micbias;
31};
32
33#endif
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 4f865df42f0f..1a33f48ebe78 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1788,7 +1788,7 @@ struct snd_emu10k1 {
1788 unsigned int efx_voices_mask[2]; 1788 unsigned int efx_voices_mask[2];
1789 unsigned int next_free_voice; 1789 unsigned int next_free_voice;
1790 1790
1791#ifdef CONFIG_PM 1791#ifdef CONFIG_PM_SLEEP
1792 unsigned int *saved_ptr; 1792 unsigned int *saved_ptr;
1793 unsigned int *saved_gpr; 1793 unsigned int *saved_gpr;
1794 unsigned int *tram_val_saved; 1794 unsigned int *tram_val_saved;
@@ -1856,7 +1856,7 @@ unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
1856void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data); 1856void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data);
1857unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate); 1857unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate);
1858 1858
1859#ifdef CONFIG_PM 1859#ifdef CONFIG_PM_SLEEP
1860void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu); 1860void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu);
1861void snd_emu10k1_resume_init(struct snd_emu10k1 *emu); 1861void snd_emu10k1_resume_init(struct snd_emu10k1 *emu);
1862void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu); 1862void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu);
diff --git a/include/sound/initval.h b/include/sound/initval.h
index f99a0d2ddfe7..ac62c67e6f42 100644
--- a/include/sound/initval.h
+++ b/include/sound/initval.h
@@ -50,6 +50,20 @@
50#define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE } 50#define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE }
51#define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR 51#define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR
52 52
53#ifdef SNDRV_LEGACY_FIND_FREE_IOPORT
54static long snd_legacy_find_free_ioport(long *port_table, long size)
55{
56 while (*port_table != -1) {
57 if (request_region(*port_table, size, "ALSA test")) {
58 release_region(*port_table, size);
59 return *port_table;
60 }
61 port_table++;
62 }
63 return -1;
64}
65#endif
66
53#ifdef SNDRV_LEGACY_FIND_FREE_IRQ 67#ifdef SNDRV_LEGACY_FIND_FREE_IRQ
54#include <linux/interrupt.h> 68#include <linux/interrupt.h>
55 69
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h
index c42506212649..844af65af626 100644
--- a/include/sound/memalloc.h
+++ b/include/sound/memalloc.h
@@ -98,8 +98,10 @@ static inline unsigned int snd_sgbuf_aligned_pages(size_t size)
98/* 98/*
99 * return the physical address at the corresponding offset 99 * return the physical address at the corresponding offset
100 */ 100 */
101static inline dma_addr_t snd_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t offset) 101static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,
102 size_t offset)
102{ 103{
104 struct snd_sg_buf *sgbuf = dmab->private_data;
103 dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; 105 dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr;
104 addr &= PAGE_MASK; 106 addr &= PAGE_MASK;
105 return addr + offset % PAGE_SIZE; 107 return addr + offset % PAGE_SIZE;
@@ -108,10 +110,31 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t off
108/* 110/*
109 * return the virtual address at the corresponding offset 111 * return the virtual address at the corresponding offset
110 */ 112 */
111static inline void *snd_sgbuf_get_ptr(struct snd_sg_buf *sgbuf, size_t offset) 113static inline void *snd_sgbuf_get_ptr(struct snd_dma_buffer *dmab,
114 size_t offset)
112{ 115{
116 struct snd_sg_buf *sgbuf = dmab->private_data;
113 return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; 117 return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE;
114} 118}
119
120unsigned int snd_sgbuf_get_chunk_size(struct snd_dma_buffer *dmab,
121 unsigned int ofs, unsigned int size);
122#else
123/* non-SG versions */
124static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,
125 size_t offset)
126{
127 return dmab->addr + offset;
128}
129
130static inline void *snd_sgbuf_get_ptr(struct snd_dma_buffer *dmab,
131 size_t offset)
132{
133 return dmab->area + offset;
134}
135
136#define snd_sgbuf_get_chunk_size(dmab, ofs, size) (size)
137
115#endif /* CONFIG_SND_DMA_SGBUF */ 138#endif /* CONFIG_SND_DMA_SGBUF */
116 139
117/* allocate/release a buffer */ 140/* allocate/release a buffer */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index d0711bc8c914..6268a4192d5c 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -437,6 +437,7 @@ struct snd_pcm_str {
437 struct snd_info_entry *proc_xrun_debug_entry; 437 struct snd_info_entry *proc_xrun_debug_entry;
438#endif 438#endif
439#endif 439#endif
440 struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */
440}; 441};
441 442
442struct snd_pcm { 443struct snd_pcm {
@@ -982,53 +983,42 @@ static int snd_pcm_lib_alloc_vmalloc_32_buffer
982 _snd_pcm_lib_alloc_vmalloc_buffer \ 983 _snd_pcm_lib_alloc_vmalloc_buffer \
983 (subs, size, GFP_KERNEL | GFP_DMA32 | __GFP_ZERO) 984 (subs, size, GFP_KERNEL | GFP_DMA32 | __GFP_ZERO)
984 985
986#define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p)
987
985#ifdef CONFIG_SND_DMA_SGBUF 988#ifdef CONFIG_SND_DMA_SGBUF
986/* 989/*
987 * SG-buffer handling 990 * SG-buffer handling
988 */ 991 */
989#define snd_pcm_substream_sgbuf(substream) \ 992#define snd_pcm_substream_sgbuf(substream) \
990 ((substream)->runtime->dma_buffer_p->private_data) 993 snd_pcm_get_dma_buf(substream)->private_data
991
992static inline dma_addr_t
993snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs)
994{
995 struct snd_sg_buf *sg = snd_pcm_substream_sgbuf(substream);
996 return snd_sgbuf_get_addr(sg, ofs);
997}
998
999static inline void *
1000snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs)
1001{
1002 struct snd_sg_buf *sg = snd_pcm_substream_sgbuf(substream);
1003 return snd_sgbuf_get_ptr(sg, ofs);
1004}
1005 994
1006struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, 995struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream,
1007 unsigned long offset); 996 unsigned long offset);
1008unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream,
1009 unsigned int ofs, unsigned int size);
1010
1011#else /* !SND_DMA_SGBUF */ 997#else /* !SND_DMA_SGBUF */
1012/* 998/*
1013 * fake using a continuous buffer 999 * fake using a continuous buffer
1014 */ 1000 */
1001#define snd_pcm_sgbuf_ops_page NULL
1002#endif /* SND_DMA_SGBUF */
1003
1015static inline dma_addr_t 1004static inline dma_addr_t
1016snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) 1005snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs)
1017{ 1006{
1018 return substream->runtime->dma_addr + ofs; 1007 return snd_sgbuf_get_addr(snd_pcm_get_dma_buf(substream), ofs);
1019} 1008}
1020 1009
1021static inline void * 1010static inline void *
1022snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) 1011snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs)
1023{ 1012{
1024 return substream->runtime->dma_area + ofs; 1013 return snd_sgbuf_get_ptr(snd_pcm_get_dma_buf(substream), ofs);
1025} 1014}
1026 1015
1027#define snd_pcm_sgbuf_ops_page NULL 1016static inline unsigned int
1028 1017snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream,
1029#define snd_pcm_sgbuf_get_chunk_size(subs, ofs, size) (size) 1018 unsigned int ofs, unsigned int size)
1030 1019{
1031#endif /* SND_DMA_SGBUF */ 1020 return snd_sgbuf_get_chunk_size(snd_pcm_get_dma_buf(substream), ofs, size);
1021}
1032 1022
1033/* handle mmap counter - PCM mmap callback should handle this counter properly */ 1023/* handle mmap counter - PCM mmap callback should handle this counter properly */
1034static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) 1024static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area)
@@ -1086,4 +1076,51 @@ static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream
1086 return "Capture"; 1076 return "Capture";
1087} 1077}
1088 1078
1079/*
1080 * PCM channel-mapping control API
1081 */
1082/* array element of channel maps */
1083struct snd_pcm_chmap_elem {
1084 unsigned char channels;
1085 unsigned char map[15];
1086};
1087
1088/* channel map information; retrieved via snd_kcontrol_chip() */
1089struct snd_pcm_chmap {
1090 struct snd_pcm *pcm; /* assigned PCM instance */
1091 int stream; /* PLAYBACK or CAPTURE */
1092 struct snd_kcontrol *kctl;
1093 const struct snd_pcm_chmap_elem *chmap;
1094 unsigned int max_channels;
1095 unsigned int channel_mask; /* optional: active channels bitmask */
1096 void *private_data; /* optional: private data pointer */
1097};
1098
1099/* get the PCM substream assigned to the given chmap info */
1100static inline struct snd_pcm_substream *
1101snd_pcm_chmap_substream(struct snd_pcm_chmap *info, unsigned int idx)
1102{
1103 struct snd_pcm_substream *s;
1104 for (s = info->pcm->streams[info->stream].substream; s; s = s->next)
1105 if (s->number == idx)
1106 return s;
1107 return NULL;
1108}
1109
1110/* ALSA-standard channel maps (RL/RR prior to C/LFE) */
1111extern const struct snd_pcm_chmap_elem snd_pcm_std_chmaps[];
1112/* Other world's standard channel maps (C/LFE prior to RL/RR) */
1113extern const struct snd_pcm_chmap_elem snd_pcm_alt_chmaps[];
1114
1115/* bit masks to be passed to snd_pcm_chmap.channel_mask field */
1116#define SND_PCM_CHMAP_MASK_24 ((1U << 2) | (1U << 4))
1117#define SND_PCM_CHMAP_MASK_246 (SND_PCM_CHMAP_MASK_24 | (1U << 6))
1118#define SND_PCM_CHMAP_MASK_2468 (SND_PCM_CHMAP_MASK_246 | (1U << 8))
1119
1120int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
1121 const struct snd_pcm_chmap_elem *chmap,
1122 int max_channels,
1123 unsigned long private_value,
1124 struct snd_pcm_chmap **info_ret);
1125
1089#endif /* __SOUND_PCM_H */ 1126#endif /* __SOUND_PCM_H */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 1f69e0af2941..628db7bca4fd 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -18,6 +18,7 @@
18 18
19struct snd_pcm_substream; 19struct snd_pcm_substream;
20struct snd_soc_dapm_widget; 20struct snd_soc_dapm_widget;
21struct snd_compr_stream;
21 22
22/* 23/*
23 * DAI hardware audio formats. 24 * DAI hardware audio formats.
@@ -205,6 +206,8 @@ struct snd_soc_dai_driver {
205 int (*remove)(struct snd_soc_dai *dai); 206 int (*remove)(struct snd_soc_dai *dai);
206 int (*suspend)(struct snd_soc_dai *dai); 207 int (*suspend)(struct snd_soc_dai *dai);
207 int (*resume)(struct snd_soc_dai *dai); 208 int (*resume)(struct snd_soc_dai *dai);
209 /* compress dai */
210 bool compress_dai;
208 211
209 /* ops */ 212 /* ops */
210 const struct snd_soc_dai_ops *ops; 213 const struct snd_soc_dai_ops *ops;
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index abe373d57adc..e1ef63d4a5c4 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -244,10 +244,11 @@ struct device;
244{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 244{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \
245 .shift = wshift, .invert = winvert, .event = wevent, \ 245 .shift = wshift, .invert = winvert, .event = wevent, \
246 .event_flags = wflags} 246 .event_flags = wflags}
247#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay) \ 247#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \
248{ .id = snd_soc_dapm_regulator_supply, .name = wname, \ 248{ .id = snd_soc_dapm_regulator_supply, .name = wname, \
249 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ 249 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \
250 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } 250 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \
251 .invert = wflags}
251 252
252 253
253/* dapm kcontrol types */ 254/* dapm kcontrol types */
@@ -319,6 +320,9 @@ struct device;
319#define SND_SOC_DAPM_EVENT_OFF(e) \ 320#define SND_SOC_DAPM_EVENT_OFF(e) \
320 (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)) 321 (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD))
321 322
323/* regulator widget flags */
324#define SND_SOC_DAPM_REGULATOR_BYPASS 0x1 /* bypass when disabled */
325
322struct snd_soc_dapm_widget; 326struct snd_soc_dapm_widget;
323enum snd_soc_dapm_type; 327enum snd_soc_dapm_type;
324struct snd_soc_dapm_path; 328struct snd_soc_dapm_path;
@@ -412,6 +416,7 @@ void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec);
412 416
413/* Mostly internal - should not normally be used */ 417/* Mostly internal - should not normally be used */
414void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); 418void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason);
419void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm);
415 420
416/* dapm path query */ 421/* dapm path query */
417int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 422int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
@@ -510,7 +515,6 @@ struct snd_soc_dapm_widget {
510 /* dapm control */ 515 /* dapm control */
511 int reg; /* negative reg = no direct dapm */ 516 int reg; /* negative reg = no direct dapm */
512 unsigned char shift; /* bits to shift */ 517 unsigned char shift; /* bits to shift */
513 unsigned int saved_value; /* widget saved value */
514 unsigned int value; /* widget current value */ 518 unsigned int value; /* widget current value */
515 unsigned int mask; /* non-shifted mask */ 519 unsigned int mask; /* non-shifted mask */
516 unsigned int on_val; /* on state value */ 520 unsigned int on_val; /* on state value */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index e063380f63a2..91244a096c19 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -20,8 +20,10 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/regmap.h> 22#include <linux/regmap.h>
23#include <linux/log2.h>
23#include <sound/core.h> 24#include <sound/core.h>
24#include <sound/pcm.h> 25#include <sound/pcm.h>
26#include <sound/compress_driver.h>
25#include <sound/control.h> 27#include <sound/control.h>
26#include <sound/ac97_codec.h> 28#include <sound/ac97_codec.h>
27 29
@@ -159,7 +161,8 @@
159 .platform_max = xmax} } 161 .platform_max = xmax} }
160#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ 162#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \
161{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ 163{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
162 .max = xmax, .texts = xtexts } 164 .max = xmax, .texts = xtexts, \
165 .mask = xmax ? roundup_pow_of_two(xmax) - 1 : 0}
163#define SOC_ENUM_SINGLE(xreg, xshift, xmax, xtexts) \ 166#define SOC_ENUM_SINGLE(xreg, xshift, xmax, xtexts) \
164 SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts) 167 SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts)
165#define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \ 168#define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \
@@ -399,6 +402,7 @@ int snd_soc_platform_read(struct snd_soc_platform *platform,
399int snd_soc_platform_write(struct snd_soc_platform *platform, 402int snd_soc_platform_write(struct snd_soc_platform *platform,
400 unsigned int reg, unsigned int val); 403 unsigned int reg, unsigned int val);
401int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); 404int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
405int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
402 406
403struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, 407struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
404 const char *dai_link, int stream); 408 const char *dai_link, int stream);
@@ -632,6 +636,13 @@ struct snd_soc_ops {
632 int (*trigger)(struct snd_pcm_substream *, int); 636 int (*trigger)(struct snd_pcm_substream *, int);
633}; 637};
634 638
639struct snd_soc_compr_ops {
640 int (*startup)(struct snd_compr_stream *);
641 void (*shutdown)(struct snd_compr_stream *);
642 int (*set_params)(struct snd_compr_stream *);
643 int (*trigger)(struct snd_compr_stream *);
644};
645
635/* SoC cache ops */ 646/* SoC cache ops */
636struct snd_soc_cache_ops { 647struct snd_soc_cache_ops {
637 const char *name; 648 const char *name;
@@ -787,9 +798,12 @@ struct snd_soc_platform_driver {
787 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, 798 snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
788 struct snd_soc_dai *); 799 struct snd_soc_dai *);
789 800
790 /* platform stream ops */ 801 /* platform stream pcm ops */
791 struct snd_pcm_ops *ops; 802 struct snd_pcm_ops *ops;
792 803
804 /* platform stream compress ops */
805 struct snd_compr_ops *compr_ops;
806
793 /* platform stream completion event */ 807 /* platform stream completion event */
794 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); 808 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
795 809
@@ -891,6 +905,7 @@ struct snd_soc_dai_link {
891 905
892 /* machine stream operations */ 906 /* machine stream operations */
893 struct snd_soc_ops *ops; 907 struct snd_soc_ops *ops;
908 struct snd_soc_compr_ops *compr_ops;
894}; 909};
895 910
896struct snd_soc_codec_conf { 911struct snd_soc_codec_conf {
@@ -1027,6 +1042,7 @@ struct snd_soc_pcm_runtime {
1027 1042
1028 /* runtime devices */ 1043 /* runtime devices */
1029 struct snd_pcm *pcm; 1044 struct snd_pcm *pcm;
1045 struct snd_compr *compr;
1030 struct snd_soc_codec *codec; 1046 struct snd_soc_codec *codec;
1031 struct snd_soc_platform *platform; 1047 struct snd_soc_platform *platform;
1032 struct snd_soc_dai *codec_dai; 1048 struct snd_soc_dai *codec_dai;
diff --git a/include/sound/tegra_wm8903.h b/include/sound/tegra_wm8903.h
new file mode 100644
index 000000000000..57b202ee97c3
--- /dev/null
+++ b/include/sound/tegra_wm8903.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright 2011 NVIDIA, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __SOUND_TEGRA_WM38903_H
16#define __SOUND_TEGRA_WM38903_H
17
18struct tegra_wm8903_platform_data {
19 int gpio_spkr_en;
20 int gpio_hp_det;
21 int gpio_hp_mute;
22 int gpio_int_mic_en;
23 int gpio_ext_mic_en;
24};
25
26#endif
diff --git a/include/sound/tlv.h b/include/sound/tlv.h
index a64d8fe3f855..28c65e1ada21 100644
--- a/include/sound/tlv.h
+++ b/include/sound/tlv.h
@@ -86,4 +86,12 @@
86 86
87#define TLV_DB_GAIN_MUTE -9999999 87#define TLV_DB_GAIN_MUTE -9999999
88 88
89/*
90 * channel-mapping TLV items
91 * TLV length must match with num_channels
92 */
93#define SNDRV_CTL_TLVT_CHMAP_FIXED 0x101 /* fixed channel position */
94#define SNDRV_CTL_TLVT_CHMAP_VAR 0x102 /* channels freely swappable */
95#define SNDRV_CTL_TLVT_CHMAP_PAIRED 0x103 /* pair-wise swappable */
96
89#endif /* __SOUND_TLV_H */ 97#endif /* __SOUND_TLV_H */
diff --git a/include/sound/version.h b/include/sound/version.h
deleted file mode 100644
index cc75024c1089..000000000000
--- a/include/sound/version.h
+++ /dev/null
@@ -1,3 +0,0 @@
1/* include/version.h */
2#define CONFIG_SND_VERSION "1.0.25"
3#define CONFIG_SND_DATE ""
diff --git a/include/sound/wm0010.h b/include/sound/wm0010.h
new file mode 100644
index 000000000000..3261e90815af
--- /dev/null
+++ b/include/sound/wm0010.h
@@ -0,0 +1,27 @@
1/*
2 * wm0010.h -- Platform data for WM0010 DSP Driver
3 *
4 * Copyright 2012 Wolfson Microelectronics PLC.
5 *
6 * Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifndef WM0010_PDATA_H
15#define WM0010_PDATA_H
16
17struct wm0010_pdata {
18 int gpio_reset;
19
20 /* Set if there is an inverter between the GPIO controlling
21 * the reset signal and the device.
22 */
23 int reset_active_high;
24 int irq_flags;
25};
26
27#endif
diff --git a/include/sound/wm8960.h b/include/sound/wm8960.h
index 74e9a95529c5..e8ce8ee7d62d 100644
--- a/include/sound/wm8960.h
+++ b/include/sound/wm8960.h
@@ -18,7 +18,7 @@
18struct wm8960_data { 18struct wm8960_data {
19 bool capless; /* Headphone outputs configured in capless mode */ 19 bool capless; /* Headphone outputs configured in capless mode */
20 20
21 int dres; /* Discharge resistance for headphone outputs */ 21 bool shared_lrclk; /* DAC and ADC LRCLKs are wired together */
22}; 22};
23 23
24#endif 24#endif
diff --git a/include/sound/wm8993.h b/include/sound/wm8993.h
index eee19f63c0d8..8016fd826f5a 100644
--- a/include/sound/wm8993.h
+++ b/include/sound/wm8993.h
@@ -32,6 +32,10 @@ struct wm8993_platform_data {
32 unsigned int lineout1fb:1; 32 unsigned int lineout1fb:1;
33 unsigned int lineout2fb:1; 33 unsigned int lineout2fb:1;
34 34
35 /* Delay to add for microphones to stabalise after power up */
36 int micbias1_delay;
37 int micbias2_delay;
38
35 /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ 39 /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */
36 unsigned int micbias1_lvl:1; 40 unsigned int micbias1_lvl:1;
37 unsigned int micbias2_lvl:1; 41 unsigned int micbias2_lvl:1;