diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dmaengine.h | 6 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ab8500-codec.h | 52 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ab8500.h | 2 | ||||
-rw-r--r-- | include/linux/platform_data/mmp_audio.h | 22 | ||||
-rw-r--r-- | include/sound/designware_i2s.h | 69 | ||||
-rw-r--r-- | include/sound/dmaengine_pcm.h | 1 | ||||
-rw-r--r-- | include/sound/pcm.h | 11 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 12 | ||||
-rw-r--r-- | include/sound/soc.h | 77 | ||||
-rw-r--r-- | include/sound/spear_dma.h | 35 | ||||
-rw-r--r-- | include/sound/spear_spdif.h | 29 |
11 files changed, 311 insertions, 5 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 56377df39124..cc0756a35ae3 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -670,6 +670,12 @@ static inline int dmaengine_resume(struct dma_chan *chan) | |||
670 | return dmaengine_device_control(chan, DMA_RESUME, 0); | 670 | return dmaengine_device_control(chan, DMA_RESUME, 0); |
671 | } | 671 | } |
672 | 672 | ||
673 | static inline enum dma_status dmaengine_tx_status(struct dma_chan *chan, | ||
674 | dma_cookie_t cookie, struct dma_tx_state *state) | ||
675 | { | ||
676 | return chan->device->device_tx_status(chan, cookie, state); | ||
677 | } | ||
678 | |||
673 | static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc) | 679 | static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc) |
674 | { | 680 | { |
675 | return desc->tx_submit(desc); | 681 | return desc->tx_submit(desc); |
diff --git a/include/linux/mfd/abx500/ab8500-codec.h b/include/linux/mfd/abx500/ab8500-codec.h new file mode 100644 index 000000000000..dc6529202cdd --- /dev/null +++ b/include/linux/mfd/abx500/ab8500-codec.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2012 | ||
3 | * | ||
4 | * Author: Ola Lilja <ola.o.lilja@stericsson.com> | ||
5 | * for ST-Ericsson. | ||
6 | * | ||
7 | * License terms: | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published | ||
11 | * by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef AB8500_CORE_CODEC_H | ||
15 | #define AB8500_CORE_CODEC_H | ||
16 | |||
17 | /* Mic-types */ | ||
18 | enum amic_type { | ||
19 | AMIC_TYPE_SINGLE_ENDED, | ||
20 | AMIC_TYPE_DIFFERENTIAL | ||
21 | }; | ||
22 | |||
23 | /* Mic-biases */ | ||
24 | enum amic_micbias { | ||
25 | AMIC_MICBIAS_VAMIC1, | ||
26 | AMIC_MICBIAS_VAMIC2 | ||
27 | }; | ||
28 | |||
29 | /* Bias-voltage */ | ||
30 | enum ear_cm_voltage { | ||
31 | EAR_CMV_0_95V, | ||
32 | EAR_CMV_1_10V, | ||
33 | EAR_CMV_1_27V, | ||
34 | EAR_CMV_1_58V | ||
35 | }; | ||
36 | |||
37 | /* Analog microphone settings */ | ||
38 | struct amic_settings { | ||
39 | enum amic_type mic1_type; | ||
40 | enum amic_type mic2_type; | ||
41 | enum amic_micbias mic1a_micbias; | ||
42 | enum amic_micbias mic1b_micbias; | ||
43 | enum amic_micbias mic2_micbias; | ||
44 | }; | ||
45 | |||
46 | /* Platform data structure for the audio-parts of the AB8500 */ | ||
47 | struct ab8500_codec_platform_data { | ||
48 | struct amic_settings amics; | ||
49 | enum ear_cm_voltage ear_cmv; | ||
50 | }; | ||
51 | |||
52 | #endif | ||
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 91dd3ef63e99..bc9b84b60ec6 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
@@ -266,6 +266,7 @@ struct ab8500 { | |||
266 | struct regulator_reg_init; | 266 | struct regulator_reg_init; |
267 | struct regulator_init_data; | 267 | struct regulator_init_data; |
268 | struct ab8500_gpio_platform_data; | 268 | struct ab8500_gpio_platform_data; |
269 | struct ab8500_codec_platform_data; | ||
269 | 270 | ||
270 | /** | 271 | /** |
271 | * struct ab8500_platform_data - AB8500 platform data | 272 | * struct ab8500_platform_data - AB8500 platform data |
@@ -284,6 +285,7 @@ struct ab8500_platform_data { | |||
284 | int num_regulator; | 285 | int num_regulator; |
285 | struct regulator_init_data *regulator; | 286 | struct regulator_init_data *regulator; |
286 | struct ab8500_gpio_platform_data *gpio; | 287 | struct ab8500_gpio_platform_data *gpio; |
288 | struct ab8500_codec_platform_data *codec; | ||
287 | }; | 289 | }; |
288 | 290 | ||
289 | extern int __devinit ab8500_init(struct ab8500 *ab8500, | 291 | extern int __devinit ab8500_init(struct ab8500 *ab8500, |
diff --git a/include/linux/platform_data/mmp_audio.h b/include/linux/platform_data/mmp_audio.h new file mode 100644 index 000000000000..0f25d165abd6 --- /dev/null +++ b/include/linux/platform_data/mmp_audio.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * MMP Platform AUDIO Management | ||
3 | * | ||
4 | * Copyright (c) 2011 Marvell Semiconductors Inc. | ||
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 | |||
12 | #ifndef MMP_AUDIO_H | ||
13 | #define MMP_AUDIO_H | ||
14 | |||
15 | struct mmp_audio_platdata { | ||
16 | u32 period_max_capture; | ||
17 | u32 buffer_max_capture; | ||
18 | u32 period_max_playback; | ||
19 | u32 buffer_max_playback; | ||
20 | }; | ||
21 | |||
22 | #endif /* MMP_AUDIO_H */ | ||
diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h new file mode 100644 index 000000000000..26f406e0f673 --- /dev/null +++ b/include/sound/designware_i2s.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * Copyright (ST) 2012 Rajeev Kumar (rajeev-dlh.kumar@st.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __SOUND_DESIGNWARE_I2S_H | ||
21 | #define __SOUND_DESIGNWARE_I2S_H | ||
22 | |||
23 | #include <linux/dmaengine.h> | ||
24 | #include <linux/types.h> | ||
25 | |||
26 | /* | ||
27 | * struct i2s_clk_config_data - represent i2s clk configuration data | ||
28 | * @chan_nr: number of channel | ||
29 | * @data_width: number of bits per sample (8/16/24/32 bit) | ||
30 | * @sample_rate: sampling frequency (8Khz, 16Khz, 32Khz, 44Khz, 48Khz) | ||
31 | */ | ||
32 | struct i2s_clk_config_data { | ||
33 | int chan_nr; | ||
34 | u32 data_width; | ||
35 | u32 sample_rate; | ||
36 | }; | ||
37 | |||
38 | struct i2s_platform_data { | ||
39 | #define DWC_I2S_PLAY (1 << 0) | ||
40 | #define DWC_I2S_RECORD (1 << 1) | ||
41 | unsigned int cap; | ||
42 | int channel; | ||
43 | u32 snd_fmts; | ||
44 | u32 snd_rates; | ||
45 | |||
46 | void *play_dma_data; | ||
47 | void *capture_dma_data; | ||
48 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
49 | int (*i2s_clk_cfg)(struct i2s_clk_config_data *config); | ||
50 | }; | ||
51 | |||
52 | struct i2s_dma_data { | ||
53 | void *data; | ||
54 | dma_addr_t addr; | ||
55 | u32 max_burst; | ||
56 | enum dma_slave_buswidth addr_width; | ||
57 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
58 | }; | ||
59 | |||
60 | /* I2S DMA registers */ | ||
61 | #define I2S_RXDMA 0x01C0 | ||
62 | #define I2S_TXDMA 0x01C8 | ||
63 | |||
64 | #define TWO_CHANNEL_SUPPORT 2 /* up to 2.0 */ | ||
65 | #define FOUR_CHANNEL_SUPPORT 4 /* up to 3.1 */ | ||
66 | #define SIX_CHANNEL_SUPPORT 6 /* up to 5.1 */ | ||
67 | #define EIGHT_CHANNEL_SUPPORT 8 /* up to 7.1 */ | ||
68 | |||
69 | #endif /* __SOUND_DESIGNWARE_I2S_H */ | ||
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index a8fcaa6d531f..b877334bbb0f 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h | |||
@@ -39,6 +39,7 @@ 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); | 39 | 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); | 40 | int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd); |
41 | snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream); | 41 | 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); | ||
42 | 43 | ||
43 | int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, | 44 | int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, |
44 | dma_filter_fn filter_fn, void *filter_data); | 45 | dma_filter_fn filter_fn, void *filter_data); |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index e91e6047ca6f..c75c0d1a85e2 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -1074,4 +1074,15 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) | |||
1074 | 1074 | ||
1075 | const char *snd_pcm_format_name(snd_pcm_format_t format); | 1075 | const char *snd_pcm_format_name(snd_pcm_format_t format); |
1076 | 1076 | ||
1077 | /** | ||
1078 | * Get a string naming the direction of a stream | ||
1079 | */ | ||
1080 | static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream) | ||
1081 | { | ||
1082 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
1083 | return "Playback"; | ||
1084 | else | ||
1085 | return "Capture"; | ||
1086 | } | ||
1087 | |||
1077 | #endif /* __SOUND_PCM_H */ | 1088 | #endif /* __SOUND_PCM_H */ |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index e3833d9f1914..abe373d57adc 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -229,6 +229,10 @@ struct device; | |||
229 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 229 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ |
230 | .shift = wshift, .invert = winvert, \ | 230 | .shift = wshift, .invert = winvert, \ |
231 | .event = wevent, .event_flags = wflags} | 231 | .event = wevent, .event_flags = wflags} |
232 | #define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ | ||
233 | { .id = snd_soc_dapm_clock_supply, .name = wname, \ | ||
234 | .reg = SND_SOC_NOPM, .event = dapm_clock_event, \ | ||
235 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } | ||
232 | 236 | ||
233 | /* generic widgets */ | 237 | /* generic widgets */ |
234 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ | 238 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ |
@@ -245,6 +249,7 @@ struct device; | |||
245 | .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ | 249 | .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ |
246 | .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 } |
247 | 251 | ||
252 | |||
248 | /* dapm kcontrol types */ | 253 | /* dapm kcontrol types */ |
249 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ | 254 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ |
250 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 255 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -327,6 +332,8 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w, | |||
327 | struct snd_kcontrol *kcontrol, int event); | 332 | struct snd_kcontrol *kcontrol, int event); |
328 | int dapm_regulator_event(struct snd_soc_dapm_widget *w, | 333 | int dapm_regulator_event(struct snd_soc_dapm_widget *w, |
329 | struct snd_kcontrol *kcontrol, int event); | 334 | struct snd_kcontrol *kcontrol, int event); |
335 | int dapm_clock_event(struct snd_soc_dapm_widget *w, | ||
336 | struct snd_kcontrol *kcontrol, int event); | ||
330 | 337 | ||
331 | /* dapm controls */ | 338 | /* dapm controls */ |
332 | int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | 339 | int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, |
@@ -367,6 +374,8 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); | |||
367 | void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); | 374 | void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); |
368 | int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, | 375 | int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, |
369 | const struct snd_soc_dapm_route *route, int num); | 376 | const struct snd_soc_dapm_route *route, int num); |
377 | int snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm, | ||
378 | const struct snd_soc_dapm_route *route, int num); | ||
370 | int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, | 379 | int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, |
371 | const struct snd_soc_dapm_route *route, int num); | 380 | const struct snd_soc_dapm_route *route, int num); |
372 | 381 | ||
@@ -432,6 +441,7 @@ enum snd_soc_dapm_type { | |||
432 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 441 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
433 | snd_soc_dapm_supply, /* power/clock supply */ | 442 | snd_soc_dapm_supply, /* power/clock supply */ |
434 | snd_soc_dapm_regulator_supply, /* external regulator */ | 443 | snd_soc_dapm_regulator_supply, /* external regulator */ |
444 | snd_soc_dapm_clock_supply, /* external clock */ | ||
435 | snd_soc_dapm_aif_in, /* audio interface input */ | 445 | snd_soc_dapm_aif_in, /* audio interface input */ |
436 | snd_soc_dapm_aif_out, /* audio interface output */ | 446 | snd_soc_dapm_aif_out, /* audio interface output */ |
437 | snd_soc_dapm_siggen, /* signal generator */ | 447 | snd_soc_dapm_siggen, /* signal generator */ |
@@ -537,6 +547,8 @@ struct snd_soc_dapm_widget { | |||
537 | struct list_head dirty; | 547 | struct list_head dirty; |
538 | int inputs; | 548 | int inputs; |
539 | int outputs; | 549 | int outputs; |
550 | |||
551 | struct clk *clk; | ||
540 | }; | 552 | }; |
541 | 553 | ||
542 | struct snd_soc_dapm_update { | 554 | struct snd_soc_dapm_update { |
diff --git a/include/sound/soc.h b/include/sound/soc.h index c703871f5f65..e063380f63a2 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -42,11 +42,22 @@ | |||
42 | ((unsigned long)&(struct soc_mixer_control) \ | 42 | ((unsigned long)&(struct soc_mixer_control) \ |
43 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ | 43 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ |
44 | .max = xmax, .platform_max = xmax, .invert = xinvert}) | 44 | .max = xmax, .platform_max = xmax, .invert = xinvert}) |
45 | #define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \ | ||
46 | ((unsigned long)&(struct soc_mixer_control) \ | ||
47 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ | ||
48 | .min = xmin, .max = xmax, .platform_max = xmax, .invert = xinvert}) | ||
45 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ | 49 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ |
46 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 50 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
47 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 51 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
48 | .put = snd_soc_put_volsw, \ | 52 | .put = snd_soc_put_volsw, \ |
49 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 53 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
54 | #define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \ | ||
55 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
56 | .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ | ||
57 | .put = snd_soc_put_volsw_range, \ | ||
58 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
59 | {.reg = xreg, .shift = xshift, .min = xmin,\ | ||
60 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
50 | #define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ | 61 | #define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ |
51 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 62 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
52 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 63 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
@@ -67,6 +78,16 @@ | |||
67 | {.reg = xreg, .rreg = xreg, \ | 78 | {.reg = xreg, .rreg = xreg, \ |
68 | .shift = xshift, .rshift = xshift, \ | 79 | .shift = xshift, .rshift = xshift, \ |
69 | .max = xmax, .min = xmin} } | 80 | .max = xmax, .min = xmin} } |
81 | #define SOC_SINGLE_RANGE_TLV(xname, xreg, xshift, xmin, xmax, xinvert, tlv_array) \ | ||
82 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
83 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | ||
84 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | ||
85 | .tlv.p = (tlv_array), \ | ||
86 | .info = snd_soc_info_volsw_range, \ | ||
87 | .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ | ||
88 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
89 | {.reg = xreg, .shift = xshift, .min = xmin,\ | ||
90 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
70 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ | 91 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ |
71 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 92 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
72 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 93 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
@@ -79,6 +100,13 @@ | |||
79 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ | 100 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
80 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ | 101 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
81 | xmax, xinvert) } | 102 | xmax, xinvert) } |
103 | #define SOC_DOUBLE_R_RANGE(xname, reg_left, reg_right, xshift, xmin, \ | ||
104 | xmax, xinvert) \ | ||
105 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
106 | .info = snd_soc_info_volsw_range, \ | ||
107 | .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ | ||
108 | .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \ | ||
109 | xshift, xmin, xmax, xinvert) } | ||
82 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ | 110 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ |
83 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 111 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
84 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 112 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
@@ -97,6 +125,16 @@ | |||
97 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ | 125 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
98 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ | 126 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
99 | xmax, xinvert) } | 127 | xmax, xinvert) } |
128 | #define SOC_DOUBLE_R_RANGE_TLV(xname, reg_left, reg_right, xshift, xmin, \ | ||
129 | xmax, xinvert, tlv_array) \ | ||
130 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
131 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | ||
132 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | ||
133 | .tlv.p = (tlv_array), \ | ||
134 | .info = snd_soc_info_volsw_range, \ | ||
135 | .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ | ||
136 | .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \ | ||
137 | xshift, xmin, xmax, xinvert) } | ||
100 | #define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \ | 138 | #define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \ |
101 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 139 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
102 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 140 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
@@ -460,6 +498,12 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | |||
460 | struct snd_ctl_elem_value *ucontrol); | 498 | struct snd_ctl_elem_value *ucontrol); |
461 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, | 499 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, |
462 | struct snd_ctl_elem_value *ucontrol); | 500 | struct snd_ctl_elem_value *ucontrol); |
501 | int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol, | ||
502 | struct snd_ctl_elem_info *uinfo); | ||
503 | int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, | ||
504 | struct snd_ctl_elem_value *ucontrol); | ||
505 | int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol, | ||
506 | struct snd_ctl_elem_value *ucontrol); | ||
463 | int snd_soc_limit_volume(struct snd_soc_codec *codec, | 507 | int snd_soc_limit_volume(struct snd_soc_codec *codec, |
464 | const char *name, int max); | 508 | const char *name, int max); |
465 | int snd_soc_bytes_info(struct snd_kcontrol *kcontrol, | 509 | int snd_soc_bytes_info(struct snd_kcontrol *kcontrol, |
@@ -785,13 +829,36 @@ struct snd_soc_dai_link { | |||
785 | /* config - must be set by machine driver */ | 829 | /* config - must be set by machine driver */ |
786 | const char *name; /* Codec name */ | 830 | const char *name; /* Codec name */ |
787 | const char *stream_name; /* Stream name */ | 831 | const char *stream_name; /* Stream name */ |
788 | const char *codec_name; /* for multi-codec */ | 832 | /* |
789 | const struct device_node *codec_of_node; | 833 | * You MAY specify the link's CPU-side device, either by device name, |
790 | const char *platform_name; /* for multi-platform */ | 834 | * or by DT/OF node, but not both. If this information is omitted, |
791 | const struct device_node *platform_of_node; | 835 | * the CPU-side DAI is matched using .cpu_dai_name only, which hence |
836 | * must be globally unique. These fields are currently typically used | ||
837 | * only for codec to codec links, or systems using device tree. | ||
838 | */ | ||
839 | const char *cpu_name; | ||
840 | const struct device_node *cpu_of_node; | ||
841 | /* | ||
842 | * You MAY specify the DAI name of the CPU DAI. If this information is | ||
843 | * omitted, the CPU-side DAI is matched using .cpu_name/.cpu_of_node | ||
844 | * only, which only works well when that device exposes a single DAI. | ||
845 | */ | ||
792 | const char *cpu_dai_name; | 846 | const char *cpu_dai_name; |
793 | const struct device_node *cpu_dai_of_node; | 847 | /* |
848 | * You MUST specify the link's codec, either by device name, or by | ||
849 | * DT/OF node, but not both. | ||
850 | */ | ||
851 | const char *codec_name; | ||
852 | const struct device_node *codec_of_node; | ||
853 | /* You MUST specify the DAI name within the codec */ | ||
794 | const char *codec_dai_name; | 854 | const char *codec_dai_name; |
855 | /* | ||
856 | * You MAY specify the link's platform/PCM/DMA driver, either by | ||
857 | * device name, or by DT/OF node, but not both. Some forms of link | ||
858 | * do not need a platform. | ||
859 | */ | ||
860 | const char *platform_name; | ||
861 | const struct device_node *platform_of_node; | ||
795 | int be_id; /* optional ID for machine driver BE identification */ | 862 | int be_id; /* optional ID for machine driver BE identification */ |
796 | 863 | ||
797 | const struct snd_soc_pcm_stream *params; | 864 | const struct snd_soc_pcm_stream *params; |
diff --git a/include/sound/spear_dma.h b/include/sound/spear_dma.h new file mode 100644 index 000000000000..1b365bfdfb37 --- /dev/null +++ b/include/sound/spear_dma.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * linux/spear_dma.h | ||
3 | * | ||
4 | * Copyright (ST) 2012 Rajeev Kumar (rajeev-dlh.kumar@st.com) | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #ifndef SPEAR_DMA_H | ||
23 | #define SPEAR_DMA_H | ||
24 | |||
25 | #include <linux/dmaengine.h> | ||
26 | |||
27 | struct spear_dma_data { | ||
28 | void *data; | ||
29 | dma_addr_t addr; | ||
30 | u32 max_burst; | ||
31 | enum dma_slave_buswidth addr_width; | ||
32 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
33 | }; | ||
34 | |||
35 | #endif /* SPEAR_DMA_H */ | ||
diff --git a/include/sound/spear_spdif.h b/include/sound/spear_spdif.h new file mode 100644 index 000000000000..a12f39695610 --- /dev/null +++ b/include/sound/spear_spdif.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (ST) 2012 Vipin Kumar (vipin.kumar@st.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __SOUND_SPDIF_H | ||
20 | #define __SOUND_SPDIF_H | ||
21 | |||
22 | struct spear_spdif_platform_data { | ||
23 | /* DMA params */ | ||
24 | void *dma_params; | ||
25 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
26 | void (*reset_perip)(void); | ||
27 | }; | ||
28 | |||
29 | #endif /* SOUND_SPDIF_H */ | ||