diff options
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/compress_driver.h | 4 | ||||
-rw-r--r-- | include/sound/control.h | 5 | ||||
-rw-r--r-- | include/sound/core.h | 26 | ||||
-rw-r--r-- | include/sound/dmaengine_pcm.h | 97 | ||||
-rw-r--r-- | include/sound/emu10k1.h | 1 | ||||
-rw-r--r-- | include/sound/pcm.h | 33 | ||||
-rw-r--r-- | include/sound/soc-dai.h | 8 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 1 | ||||
-rw-r--r-- | include/sound/soc.h | 33 | ||||
-rw-r--r-- | include/sound/tas5086.h | 7 | ||||
-rw-r--r-- | include/sound/tegra_wm8903.h | 26 | ||||
-rw-r--r-- | include/sound/tlv.h | 6 |
12 files changed, 171 insertions, 76 deletions
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index ff6c74153fa1..9031a26249b5 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h | |||
@@ -56,8 +56,6 @@ struct snd_compr_runtime { | |||
56 | u64 buffer_size; | 56 | u64 buffer_size; |
57 | u32 fragment_size; | 57 | u32 fragment_size; |
58 | u32 fragments; | 58 | u32 fragments; |
59 | u64 hw_pointer; | ||
60 | u64 app_pointer; | ||
61 | u64 total_bytes_available; | 59 | u64 total_bytes_available; |
62 | u64 total_bytes_transferred; | 60 | u64 total_bytes_transferred; |
63 | wait_queue_head_t sleep; | 61 | wait_queue_head_t sleep; |
@@ -121,7 +119,7 @@ struct snd_compr_ops { | |||
121 | int (*trigger)(struct snd_compr_stream *stream, int cmd); | 119 | int (*trigger)(struct snd_compr_stream *stream, int cmd); |
122 | int (*pointer)(struct snd_compr_stream *stream, | 120 | int (*pointer)(struct snd_compr_stream *stream, |
123 | struct snd_compr_tstamp *tstamp); | 121 | struct snd_compr_tstamp *tstamp); |
124 | int (*copy)(struct snd_compr_stream *stream, const char __user *buf, | 122 | int (*copy)(struct snd_compr_stream *stream, char __user *buf, |
125 | size_t count); | 123 | size_t count); |
126 | int (*mmap)(struct snd_compr_stream *stream, | 124 | int (*mmap)(struct snd_compr_stream *stream, |
127 | struct vm_area_struct *vma); | 125 | struct vm_area_struct *vma); |
diff --git a/include/sound/control.h b/include/sound/control.h index 8332e865c759..34bc93d80d55 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -189,7 +189,6 @@ int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave, | |||
189 | * | 189 | * |
190 | * Add a virtual slave control to the given master element created via | 190 | * Add a virtual slave control to the given master element created via |
191 | * snd_ctl_create_virtual_master() beforehand. | 191 | * snd_ctl_create_virtual_master() beforehand. |
192 | * Returns zero if successful or a negative error code. | ||
193 | * | 192 | * |
194 | * All slaves must be the same type (returning the same information | 193 | * All slaves must be the same type (returning the same information |
195 | * via info callback). The function doesn't check it, so it's your | 194 | * via info callback). The function doesn't check it, so it's your |
@@ -199,6 +198,8 @@ int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave, | |||
199 | * at most two channels, | 198 | * at most two channels, |
200 | * logarithmic volume control (dB level) thus no linear volume, | 199 | * logarithmic volume control (dB level) thus no linear volume, |
201 | * master can only attenuate the volume without gain | 200 | * master can only attenuate the volume without gain |
201 | * | ||
202 | * Return: Zero if successful or a negative error code. | ||
202 | */ | 203 | */ |
203 | static inline int | 204 | static inline int |
204 | snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave) | 205 | snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave) |
@@ -219,6 +220,8 @@ snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave) | |||
219 | * When the control peeks the hardware values directly and the value | 220 | * When the control peeks the hardware values directly and the value |
220 | * can be changed by other means than the put callback of the element, | 221 | * can be changed by other means than the put callback of the element, |
221 | * this function should be used to keep the value always up-to-date. | 222 | * this function should be used to keep the value always up-to-date. |
223 | * | ||
224 | * Return: Zero if successful or a negative error code. | ||
222 | */ | 225 | */ |
223 | static inline int | 226 | static inline int |
224 | snd_ctl_add_slave_uncached(struct snd_kcontrol *master, | 227 | snd_ctl_add_slave_uncached(struct snd_kcontrol *master, |
diff --git a/include/sound/core.h b/include/sound/core.h index 7cede2d6aa86..5bfe5136441c 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -229,7 +229,7 @@ int snd_register_device_for_dev(int type, struct snd_card *card, | |||
229 | * This function uses the card's device pointer to link to the | 229 | * This function uses the card's device pointer to link to the |
230 | * correct &struct device. | 230 | * correct &struct device. |
231 | * | 231 | * |
232 | * Returns zero if successful, or a negative error code on failure. | 232 | * Return: Zero if successful, or a negative error code on failure. |
233 | */ | 233 | */ |
234 | static inline int snd_register_device(int type, struct snd_card *card, int dev, | 234 | static inline int snd_register_device(int type, struct snd_card *card, int dev, |
235 | const struct file_operations *f_ops, | 235 | const struct file_operations *f_ops, |
@@ -379,18 +379,10 @@ void __snd_printk(unsigned int level, const char *file, int line, | |||
379 | * snd_BUG_ON - debugging check macro | 379 | * snd_BUG_ON - debugging check macro |
380 | * @cond: condition to evaluate | 380 | * @cond: condition to evaluate |
381 | * | 381 | * |
382 | * When CONFIG_SND_DEBUG is set, this macro evaluates the given condition, | 382 | * Has the same behavior as WARN_ON when CONFIG_SND_DEBUG is set, |
383 | * and call WARN() and returns the value if it's non-zero. | 383 | * otherwise just evaluates the conditional and returns the value. |
384 | * | ||
385 | * When CONFIG_SND_DEBUG is not set, this just returns zero, and the given | ||
386 | * condition is ignored. | ||
387 | * | ||
388 | * NOTE: the argument won't be evaluated at all when CONFIG_SND_DEBUG=n. | ||
389 | * Thus, don't put any statement that influences on the code behavior, | ||
390 | * such as pre/post increment, to the argument of this macro. | ||
391 | * If you want to evaluate and give a warning, use standard WARN_ON(). | ||
392 | */ | 384 | */ |
393 | #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) | 385 | #define snd_BUG_ON(cond) WARN_ON((cond)) |
394 | 386 | ||
395 | #else /* !CONFIG_SND_DEBUG */ | 387 | #else /* !CONFIG_SND_DEBUG */ |
396 | 388 | ||
@@ -400,11 +392,11 @@ __printf(2, 3) | |||
400 | static inline void _snd_printd(int level, const char *format, ...) {} | 392 | static inline void _snd_printd(int level, const char *format, ...) {} |
401 | 393 | ||
402 | #define snd_BUG() do { } while (0) | 394 | #define snd_BUG() do { } while (0) |
403 | static inline int __snd_bug_on(int cond) | 395 | |
404 | { | 396 | #define snd_BUG_ON(condition) ({ \ |
405 | return 0; | 397 | int __ret_warn_on = !!(condition); \ |
406 | } | 398 | unlikely(__ret_warn_on); \ |
407 | #define snd_BUG_ON(cond) __snd_bug_on(0 && (cond)) /* always false */ | 399 | }) |
408 | 400 | ||
409 | #endif /* CONFIG_SND_DEBUG */ | 401 | #endif /* CONFIG_SND_DEBUG */ |
410 | 402 | ||
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index b877334bbb0f..f11c35cd5532 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define __SOUND_DMAENGINE_PCM_H__ | 16 | #define __SOUND_DMAENGINE_PCM_H__ |
17 | 17 | ||
18 | #include <sound/pcm.h> | 18 | #include <sound/pcm.h> |
19 | #include <sound/soc.h> | ||
19 | #include <linux/dmaengine.h> | 20 | #include <linux/dmaengine.h> |
20 | 21 | ||
21 | /** | 22 | /** |
@@ -32,9 +33,6 @@ snd_pcm_substream_to_dma_direction(const struct snd_pcm_substream *substream) | |||
32 | return DMA_DEV_TO_MEM; | 33 | return DMA_DEV_TO_MEM; |
33 | } | 34 | } |
34 | 35 | ||
35 | void snd_dmaengine_pcm_set_data(struct snd_pcm_substream *substream, void *data); | ||
36 | void *snd_dmaengine_pcm_get_data(struct snd_pcm_substream *substream); | ||
37 | |||
38 | int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream, | 36 | int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream, |
39 | const struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); | 37 | const struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); |
40 | int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd); | 38 | int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd); |
@@ -42,9 +40,100 @@ snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream) | |||
42 | snd_pcm_uframes_t snd_dmaengine_pcm_pointer_no_residue(struct snd_pcm_substream *substream); | 40 | snd_pcm_uframes_t snd_dmaengine_pcm_pointer_no_residue(struct snd_pcm_substream *substream); |
43 | 41 | ||
44 | int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, | 42 | int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, |
45 | dma_filter_fn filter_fn, void *filter_data); | 43 | struct dma_chan *chan); |
46 | int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream); | 44 | int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream); |
47 | 45 | ||
46 | int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream, | ||
47 | dma_filter_fn filter_fn, void *filter_data); | ||
48 | int snd_dmaengine_pcm_close_release_chan(struct snd_pcm_substream *substream); | ||
49 | |||
50 | struct dma_chan *snd_dmaengine_pcm_request_channel(dma_filter_fn filter_fn, | ||
51 | void *filter_data); | ||
48 | struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream); | 52 | struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream); |
49 | 53 | ||
54 | /** | ||
55 | * struct snd_dmaengine_dai_dma_data - DAI DMA configuration data | ||
56 | * @addr: Address of the DAI data source or destination register. | ||
57 | * @addr_width: Width of the DAI data source or destination register. | ||
58 | * @maxburst: Maximum number of words(note: words, as in units of the | ||
59 | * src_addr_width member, not bytes) that can be send to or received from the | ||
60 | * DAI in one burst. | ||
61 | * @slave_id: Slave requester id for the DMA channel. | ||
62 | * @filter_data: Custom DMA channel filter data, this will usually be used when | ||
63 | * requesting the DMA channel. | ||
64 | */ | ||
65 | struct snd_dmaengine_dai_dma_data { | ||
66 | dma_addr_t addr; | ||
67 | enum dma_slave_buswidth addr_width; | ||
68 | u32 maxburst; | ||
69 | unsigned int slave_id; | ||
70 | void *filter_data; | ||
71 | }; | ||
72 | |||
73 | void snd_dmaengine_pcm_set_config_from_dai_data( | ||
74 | const struct snd_pcm_substream *substream, | ||
75 | const struct snd_dmaengine_dai_dma_data *dma_data, | ||
76 | struct dma_slave_config *config); | ||
77 | |||
78 | |||
79 | /* | ||
80 | * Try to request the DMA channel using compat_request_channel or | ||
81 | * compat_filter_fn if it couldn't be requested through devicetree. | ||
82 | */ | ||
83 | #define SND_DMAENGINE_PCM_FLAG_COMPAT BIT(0) | ||
84 | /* | ||
85 | * Don't try to request the DMA channels through devicetree. This flag only | ||
86 | * makes sense if SND_DMAENGINE_PCM_FLAG_COMPAT is set as well. | ||
87 | */ | ||
88 | #define SND_DMAENGINE_PCM_FLAG_NO_DT BIT(1) | ||
89 | /* | ||
90 | * The platforms dmaengine driver does not support reporting the amount of | ||
91 | * bytes that are still left to transfer. | ||
92 | */ | ||
93 | #define SND_DMAENGINE_PCM_FLAG_NO_RESIDUE BIT(2) | ||
94 | /* | ||
95 | * The PCM is half duplex and the DMA channel is shared between capture and | ||
96 | * playback. | ||
97 | */ | ||
98 | #define SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX BIT(3) | ||
99 | |||
100 | /** | ||
101 | * struct snd_dmaengine_pcm_config - Configuration data for dmaengine based PCM | ||
102 | * @prepare_slave_config: Callback used to fill in the DMA slave_config for a | ||
103 | * PCM substream. Will be called from the PCM drivers hwparams callback. | ||
104 | * @compat_request_channel: Callback to request a DMA channel for platforms | ||
105 | * which do not use devicetree. | ||
106 | * @compat_filter_fn: Will be used as the filter function when requesting a | ||
107 | * channel for platforms which do not use devicetree. The filter parameter | ||
108 | * will be the DAI's DMA data. | ||
109 | * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM. | ||
110 | * @prealloc_buffer_size: Size of the preallocated audio buffer. | ||
111 | * | ||
112 | * Note: If both compat_request_channel and compat_filter_fn are set | ||
113 | * compat_request_channel will be used to request the channel and | ||
114 | * compat_filter_fn will be ignored. Otherwise the channel will be requested | ||
115 | * using dma_request_channel with compat_filter_fn as the filter function. | ||
116 | */ | ||
117 | struct snd_dmaengine_pcm_config { | ||
118 | int (*prepare_slave_config)(struct snd_pcm_substream *substream, | ||
119 | struct snd_pcm_hw_params *params, | ||
120 | struct dma_slave_config *slave_config); | ||
121 | struct dma_chan *(*compat_request_channel)( | ||
122 | struct snd_soc_pcm_runtime *rtd, | ||
123 | struct snd_pcm_substream *substream); | ||
124 | dma_filter_fn compat_filter_fn; | ||
125 | |||
126 | const struct snd_pcm_hardware *pcm_hardware; | ||
127 | unsigned int prealloc_buffer_size; | ||
128 | }; | ||
129 | |||
130 | int snd_dmaengine_pcm_register(struct device *dev, | ||
131 | const struct snd_dmaengine_pcm_config *config, | ||
132 | unsigned int flags); | ||
133 | void snd_dmaengine_pcm_unregister(struct device *dev); | ||
134 | |||
135 | int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, | ||
136 | struct snd_pcm_hw_params *params, | ||
137 | struct dma_slave_config *slave_config); | ||
138 | |||
50 | #endif | 139 | #endif |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index f841ba4bacb8..dfb42ca6d043 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -1787,6 +1787,7 @@ struct snd_emu10k1 { | |||
1787 | unsigned int next_free_voice; | 1787 | unsigned int next_free_voice; |
1788 | 1788 | ||
1789 | const struct firmware *firmware; | 1789 | const struct firmware *firmware; |
1790 | const struct firmware *dock_fw; | ||
1790 | 1791 | ||
1791 | #ifdef CONFIG_PM_SLEEP | 1792 | #ifdef CONFIG_PM_SLEEP |
1792 | unsigned int *saved_ptr; | 1793 | unsigned int *saved_ptr; |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 45c1981c9ca2..b48792fe386b 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -181,6 +181,8 @@ struct snd_pcm_ops { | |||
181 | #define SNDRV_PCM_FMTBIT_G723_24_1B _SNDRV_PCM_FMTBIT(G723_24_1B) | 181 | #define SNDRV_PCM_FMTBIT_G723_24_1B _SNDRV_PCM_FMTBIT(G723_24_1B) |
182 | #define SNDRV_PCM_FMTBIT_G723_40 _SNDRV_PCM_FMTBIT(G723_40) | 182 | #define SNDRV_PCM_FMTBIT_G723_40 _SNDRV_PCM_FMTBIT(G723_40) |
183 | #define SNDRV_PCM_FMTBIT_G723_40_1B _SNDRV_PCM_FMTBIT(G723_40_1B) | 183 | #define SNDRV_PCM_FMTBIT_G723_40_1B _SNDRV_PCM_FMTBIT(G723_40_1B) |
184 | #define SNDRV_PCM_FMTBIT_DSD_U8 _SNDRV_PCM_FMTBIT(DSD_U8) | ||
185 | #define SNDRV_PCM_FMTBIT_DSD_U16_LE _SNDRV_PCM_FMTBIT(DSD_U16_LE) | ||
184 | 186 | ||
185 | #ifdef SNDRV_LITTLE_ENDIAN | 187 | #ifdef SNDRV_LITTLE_ENDIAN |
186 | #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE | 188 | #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE |
@@ -659,7 +661,7 @@ static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime | |||
659 | * | 661 | * |
660 | * Checks whether enough free space is available on the playback buffer. | 662 | * Checks whether enough free space is available on the playback buffer. |
661 | * | 663 | * |
662 | * Returns non-zero if available, or zero if not. | 664 | * Return: Non-zero if available, or zero if not. |
663 | */ | 665 | */ |
664 | static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream) | 666 | static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream) |
665 | { | 667 | { |
@@ -673,7 +675,7 @@ static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream) | |||
673 | * | 675 | * |
674 | * Checks whether enough capture data is available on the capture buffer. | 676 | * Checks whether enough capture data is available on the capture buffer. |
675 | * | 677 | * |
676 | * Returns non-zero if available, or zero if not. | 678 | * Return: Non-zero if available, or zero if not. |
677 | */ | 679 | */ |
678 | static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream) | 680 | static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream) |
679 | { | 681 | { |
@@ -685,10 +687,10 @@ static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream) | |||
685 | * snd_pcm_playback_data - check whether any data exists on the playback buffer | 687 | * snd_pcm_playback_data - check whether any data exists on the playback buffer |
686 | * @substream: the pcm substream instance | 688 | * @substream: the pcm substream instance |
687 | * | 689 | * |
688 | * Checks whether any data exists on the playback buffer. If stop_threshold | 690 | * Checks whether any data exists on the playback buffer. |
689 | * is bigger or equal to boundary, then this function returns always non-zero. | ||
690 | * | 691 | * |
691 | * Returns non-zero if exists, or zero if not. | 692 | * Return: Non-zero if any data exists, or zero if not. If stop_threshold |
693 | * is bigger or equal to boundary, then this function returns always non-zero. | ||
692 | */ | 694 | */ |
693 | static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream) | 695 | static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream) |
694 | { | 696 | { |
@@ -705,7 +707,7 @@ static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream) | |||
705 | * | 707 | * |
706 | * Checks whether the playback buffer is empty. | 708 | * Checks whether the playback buffer is empty. |
707 | * | 709 | * |
708 | * Returns non-zero if empty, or zero if not. | 710 | * Return: Non-zero if empty, or zero if not. |
709 | */ | 711 | */ |
710 | static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream) | 712 | static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream) |
711 | { | 713 | { |
@@ -719,7 +721,7 @@ static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream) | |||
719 | * | 721 | * |
720 | * Checks whether the capture buffer is empty. | 722 | * Checks whether the capture buffer is empty. |
721 | * | 723 | * |
722 | * Returns non-zero if empty, or zero if not. | 724 | * Return: Non-zero if empty, or zero if not. |
723 | */ | 725 | */ |
724 | static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream) | 726 | static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream) |
725 | { | 727 | { |
@@ -852,7 +854,7 @@ int snd_pcm_format_big_endian(snd_pcm_format_t format); | |||
852 | * snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian | 854 | * snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian |
853 | * @format: the format to check | 855 | * @format: the format to check |
854 | * | 856 | * |
855 | * Returns 1 if the given PCM format is CPU-endian, 0 if | 857 | * Return: 1 if the given PCM format is CPU-endian, 0 if |
856 | * opposite, or a negative error code if endian not specified. | 858 | * opposite, or a negative error code if endian not specified. |
857 | */ | 859 | */ |
858 | int snd_pcm_format_cpu_endian(snd_pcm_format_t format); | 860 | int snd_pcm_format_cpu_endian(snd_pcm_format_t format); |
@@ -867,7 +869,7 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ | |||
867 | ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); | 869 | ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); |
868 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); | 870 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); |
869 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); | 871 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); |
870 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); | 872 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsigned, int big_endian); |
871 | 873 | ||
872 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); | 874 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); |
873 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); | 875 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); |
@@ -963,7 +965,7 @@ struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, | |||
963 | * contiguous in kernel virtual space, but not in physical memory. Use this | 965 | * contiguous in kernel virtual space, but not in physical memory. Use this |
964 | * if the buffer is accessed by kernel code but not by device DMA. | 966 | * if the buffer is accessed by kernel code but not by device DMA. |
965 | * | 967 | * |
966 | * Returns 1 if the buffer was changed, 0 if not changed, or a negative error | 968 | * Return: 1 if the buffer was changed, 0 if not changed, or a negative error |
967 | * code. | 969 | * code. |
968 | */ | 970 | */ |
969 | static int snd_pcm_lib_alloc_vmalloc_buffer | 971 | static int snd_pcm_lib_alloc_vmalloc_buffer |
@@ -975,6 +977,9 @@ static int snd_pcm_lib_alloc_vmalloc_buffer | |||
975 | * | 977 | * |
976 | * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses | 978 | * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses |
977 | * vmalloc_32(), i.e., the pages are allocated from 32-bit-addressable memory. | 979 | * vmalloc_32(), i.e., the pages are allocated from 32-bit-addressable memory. |
980 | * | ||
981 | * Return: 1 if the buffer was changed, 0 if not changed, or a negative error | ||
982 | * code. | ||
978 | */ | 983 | */ |
979 | static int snd_pcm_lib_alloc_vmalloc_32_buffer | 984 | static int snd_pcm_lib_alloc_vmalloc_32_buffer |
980 | (struct snd_pcm_substream *substream, size_t size); | 985 | (struct snd_pcm_substream *substream, size_t size); |
@@ -1070,6 +1075,8 @@ const char *snd_pcm_format_name(snd_pcm_format_t format); | |||
1070 | /** | 1075 | /** |
1071 | * snd_pcm_stream_str - Get a string naming the direction of a stream | 1076 | * snd_pcm_stream_str - Get a string naming the direction of a stream |
1072 | * @substream: the pcm substream instance | 1077 | * @substream: the pcm substream instance |
1078 | * | ||
1079 | * Return: A string naming the direction of the stream. | ||
1073 | */ | 1080 | */ |
1074 | static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream) | 1081 | static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream) |
1075 | { | 1082 | { |
@@ -1126,4 +1133,10 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, | |||
1126 | unsigned long private_value, | 1133 | unsigned long private_value, |
1127 | struct snd_pcm_chmap **info_ret); | 1134 | struct snd_pcm_chmap **info_ret); |
1128 | 1135 | ||
1136 | /* Strong-typed conversion of pcm_format to bitwise */ | ||
1137 | static inline u64 pcm_format_to_bits(snd_pcm_format_t pcm_format) | ||
1138 | { | ||
1139 | return 1ULL << (__force int) pcm_format; | ||
1140 | } | ||
1141 | |||
1129 | #endif /* __SOUND_PCM_H */ | 1142 | #endif /* __SOUND_PCM_H */ |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 3d84808952b9..ae9a227d35d3 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -95,14 +95,6 @@ struct snd_soc_dai_driver; | |||
95 | struct snd_soc_dai; | 95 | struct snd_soc_dai; |
96 | struct snd_ac97_bus_ops; | 96 | struct snd_ac97_bus_ops; |
97 | 97 | ||
98 | /* Digital Audio Interface registration */ | ||
99 | int snd_soc_register_dai(struct device *dev, | ||
100 | struct snd_soc_dai_driver *dai_drv); | ||
101 | void snd_soc_unregister_dai(struct device *dev); | ||
102 | int snd_soc_register_dais(struct device *dev, | ||
103 | struct snd_soc_dai_driver *dai_drv, size_t count); | ||
104 | void snd_soc_unregister_dais(struct device *dev, size_t count); | ||
105 | |||
106 | /* Digital Audio Interface clocking API.*/ | 98 | /* Digital Audio Interface clocking API.*/ |
107 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, | 99 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, |
108 | unsigned int freq, int dir); | 100 | unsigned int freq, int dir); |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 44a30b108683..d4609029f014 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -566,7 +566,6 @@ struct snd_soc_dapm_update { | |||
566 | 566 | ||
567 | /* DAPM context */ | 567 | /* DAPM context */ |
568 | struct snd_soc_dapm_context { | 568 | struct snd_soc_dapm_context { |
569 | int n_widgets; /* number of widgets in this context */ | ||
570 | enum snd_soc_bias_level bias_level; | 569 | enum snd_soc_bias_level bias_level; |
571 | enum snd_soc_bias_level suspend_bias_level; | 570 | enum snd_soc_bias_level suspend_bias_level; |
572 | struct delayed_work delayed_work; | 571 | struct delayed_work delayed_work; |
diff --git a/include/sound/soc.h b/include/sound/soc.h index a6a059ca3874..85c15226103b 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -324,6 +324,8 @@ struct snd_soc_dai_link; | |||
324 | struct snd_soc_platform_driver; | 324 | struct snd_soc_platform_driver; |
325 | struct snd_soc_codec; | 325 | struct snd_soc_codec; |
326 | struct snd_soc_codec_driver; | 326 | struct snd_soc_codec_driver; |
327 | struct snd_soc_component; | ||
328 | struct snd_soc_component_driver; | ||
327 | struct soc_enum; | 329 | struct soc_enum; |
328 | struct snd_soc_jack; | 330 | struct snd_soc_jack; |
329 | struct snd_soc_jack_zone; | 331 | struct snd_soc_jack_zone; |
@@ -371,12 +373,20 @@ int snd_soc_suspend(struct device *dev); | |||
371 | int snd_soc_resume(struct device *dev); | 373 | int snd_soc_resume(struct device *dev); |
372 | int snd_soc_poweroff(struct device *dev); | 374 | int snd_soc_poweroff(struct device *dev); |
373 | int snd_soc_register_platform(struct device *dev, | 375 | int snd_soc_register_platform(struct device *dev, |
374 | struct snd_soc_platform_driver *platform_drv); | 376 | const struct snd_soc_platform_driver *platform_drv); |
375 | void snd_soc_unregister_platform(struct device *dev); | 377 | void snd_soc_unregister_platform(struct device *dev); |
378 | int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform, | ||
379 | const struct snd_soc_platform_driver *platform_drv); | ||
380 | void snd_soc_remove_platform(struct snd_soc_platform *platform); | ||
381 | struct snd_soc_platform *snd_soc_lookup_platform(struct device *dev); | ||
376 | int snd_soc_register_codec(struct device *dev, | 382 | int snd_soc_register_codec(struct device *dev, |
377 | const struct snd_soc_codec_driver *codec_drv, | 383 | const struct snd_soc_codec_driver *codec_drv, |
378 | struct snd_soc_dai_driver *dai_drv, int num_dai); | 384 | struct snd_soc_dai_driver *dai_drv, int num_dai); |
379 | void snd_soc_unregister_codec(struct device *dev); | 385 | void snd_soc_unregister_codec(struct device *dev); |
386 | int snd_soc_register_component(struct device *dev, | ||
387 | const struct snd_soc_component_driver *cmpnt_drv, | ||
388 | struct snd_soc_dai_driver *dai_drv, int num_dai); | ||
389 | void snd_soc_unregister_component(struct device *dev); | ||
380 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, | 390 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, |
381 | unsigned int reg); | 391 | unsigned int reg); |
382 | int snd_soc_codec_readable_register(struct snd_soc_codec *codec, | 392 | int snd_soc_codec_readable_register(struct snd_soc_codec *codec, |
@@ -801,10 +811,10 @@ struct snd_soc_platform_driver { | |||
801 | struct snd_soc_dai *); | 811 | struct snd_soc_dai *); |
802 | 812 | ||
803 | /* platform stream pcm ops */ | 813 | /* platform stream pcm ops */ |
804 | struct snd_pcm_ops *ops; | 814 | const struct snd_pcm_ops *ops; |
805 | 815 | ||
806 | /* platform stream compress ops */ | 816 | /* platform stream compress ops */ |
807 | struct snd_compr_ops *compr_ops; | 817 | const struct snd_compr_ops *compr_ops; |
808 | 818 | ||
809 | /* platform stream completion event */ | 819 | /* platform stream completion event */ |
810 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | 820 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); |
@@ -823,7 +833,7 @@ struct snd_soc_platform { | |||
823 | const char *name; | 833 | const char *name; |
824 | int id; | 834 | int id; |
825 | struct device *dev; | 835 | struct device *dev; |
826 | struct snd_soc_platform_driver *driver; | 836 | const struct snd_soc_platform_driver *driver; |
827 | struct mutex mutex; | 837 | struct mutex mutex; |
828 | 838 | ||
829 | unsigned int suspended:1; /* platform is suspended */ | 839 | unsigned int suspended:1; /* platform is suspended */ |
@@ -841,6 +851,20 @@ struct snd_soc_platform { | |||
841 | #endif | 851 | #endif |
842 | }; | 852 | }; |
843 | 853 | ||
854 | struct snd_soc_component_driver { | ||
855 | const char *name; | ||
856 | }; | ||
857 | |||
858 | struct snd_soc_component { | ||
859 | const char *name; | ||
860 | int id; | ||
861 | int num_dai; | ||
862 | struct device *dev; | ||
863 | struct list_head list; | ||
864 | |||
865 | const struct snd_soc_component_driver *driver; | ||
866 | }; | ||
867 | |||
844 | struct snd_soc_dai_link { | 868 | struct snd_soc_dai_link { |
845 | /* config - must be set by machine driver */ | 869 | /* config - must be set by machine driver */ |
846 | const char *name; /* Codec name */ | 870 | const char *name; /* Codec name */ |
@@ -1086,7 +1110,6 @@ struct soc_enum { | |||
1086 | unsigned int mask; | 1110 | unsigned int mask; |
1087 | const char * const *texts; | 1111 | const char * const *texts; |
1088 | const unsigned int *values; | 1112 | const unsigned int *values; |
1089 | void *dapm; | ||
1090 | }; | 1113 | }; |
1091 | 1114 | ||
1092 | /* codec IO */ | 1115 | /* codec IO */ |
diff --git a/include/sound/tas5086.h b/include/sound/tas5086.h new file mode 100644 index 000000000000..aac481b7db8f --- /dev/null +++ b/include/sound/tas5086.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef _SND_SOC_CODEC_TAS5086_H_ | ||
2 | #define _SND_SOC_CODEC_TAS5086_H_ | ||
3 | |||
4 | #define TAS5086_CLK_IDX_MCLK 0 | ||
5 | #define TAS5086_CLK_IDX_SCLK 1 | ||
6 | |||
7 | #endif /* _SND_SOC_CODEC_TAS5086_H_ */ | ||
diff --git a/include/sound/tegra_wm8903.h b/include/sound/tegra_wm8903.h deleted file mode 100644 index 57b202ee97c3..000000000000 --- a/include/sound/tegra_wm8903.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
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 | |||
18 | struct 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 28c65e1ada21..e11e179420a1 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h | |||
@@ -74,7 +74,11 @@ | |||
74 | #define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \ | 74 | #define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \ |
75 | unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) } | 75 | unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) } |
76 | 76 | ||
77 | /* dB range container */ | 77 | /* dB range container: |
78 | * Items in dB range container must be ordered by their values and by their | ||
79 | * dB values. This implies that larger values must correspond with larger | ||
80 | * dB values (which is also required for all other mixer controls). | ||
81 | */ | ||
78 | /* Each item is: <min> <max> <TLV> */ | 82 | /* Each item is: <min> <max> <TLV> */ |
79 | #define TLV_DB_RANGE_ITEM(...) \ | 83 | #define TLV_DB_RANGE_ITEM(...) \ |
80 | TLV_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__) | 84 | TLV_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__) |