aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-08-20 06:39:18 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-20 06:39:18 -0400
commit170465ee7f5a9a2d0ac71285507e52642e040353 (patch)
treedbca81f04cde9e625170abbd6a72555cfbeb194e /sound
parent169ad16bb87c10a3f7c108bb7008ebc0270f617a (diff)
parent1fca25427482387689fa27594c992a961d98768f (diff)
Merge branch 'linus' into x86/xen
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/pxa2xx-ac97.c8
-rw-r--r--sound/arm/pxa2xx-pcm.c4
-rw-r--r--sound/arm/sa11xx-uda1341.c4
-rw-r--r--sound/core/seq/oss/seq_oss_synth.c3
-rw-r--r--sound/oss/vidc.c2
-rw-r--r--sound/oss/vidc_fill.S2
-rw-r--r--sound/oss/waveartist.c2
-rw-r--r--sound/pci/Kconfig2
-rw-r--r--sound/pci/hda/hda_intel.c4
-rw-r--r--sound/pci/hda/patch_realtek.c45
-rw-r--r--sound/pci/oxygen/virtuoso.c73
-rw-r--r--sound/sh/aica.c2
-rw-r--r--sound/soc/at32/playpaq_wm8510.c4
-rw-r--r--sound/soc/at91/at91-pcm.c4
-rw-r--r--sound/soc/at91/at91-pcm.h2
-rw-r--r--sound/soc/at91/at91-ssc.c6
-rw-r--r--sound/soc/at91/eti_b1_wm8731.c4
-rw-r--r--sound/soc/codecs/wm8750.c3
-rw-r--r--sound/soc/codecs/wm8990.c10
-rw-r--r--sound/soc/codecs/wm8990.h14
-rw-r--r--sound/soc/davinci/davinci-evm.c3
-rw-r--r--sound/soc/fsl/fsl_dma.c242
-rw-r--r--sound/soc/fsl/fsl_ssi.c74
-rw-r--r--sound/soc/omap/n810.c4
-rw-r--r--sound/soc/omap/omap-mcbsp.c6
-rw-r--r--sound/soc/omap/omap-pcm.c2
-rw-r--r--sound/soc/pxa/corgi.c8
-rw-r--r--sound/soc/pxa/e800_wm9712.c6
-rw-r--r--sound/soc/pxa/em-x270.c6
-rw-r--r--sound/soc/pxa/poodle.c16
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c8
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c8
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c6
-rw-r--r--sound/soc/pxa/spitz.c10
-rw-r--r--sound/soc/pxa/tosa.c9
-rw-r--r--sound/soc/s3c24xx/neo1973_wm8753.c11
-rw-r--r--sound/soc/s3c24xx/s3c2412-i2s.c8
-rw-r--r--sound/soc/s3c24xx/s3c2443-ac97.c10
-rw-r--r--sound/soc/s3c24xx/s3c24xx-i2s.c10
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c6
-rw-r--r--sound/soc/soc-dapm.c1
41 files changed, 411 insertions, 241 deletions
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 5b3274b465eb..199cca3366df 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -26,10 +26,10 @@
26 26
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <linux/mutex.h> 28#include <linux/mutex.h>
29#include <asm/hardware.h> 29#include <mach/hardware.h>
30#include <asm/arch/pxa-regs.h> 30#include <mach/pxa-regs.h>
31#include <asm/arch/pxa2xx-gpio.h> 31#include <mach/pxa2xx-gpio.h>
32#include <asm/arch/audio.h> 32#include <mach/audio.h>
33 33
34#include "pxa2xx-pcm.h" 34#include "pxa2xx-pcm.h"
35 35
diff --git a/sound/arm/pxa2xx-pcm.c b/sound/arm/pxa2xx-pcm.c
index 0ede9e4656a8..381094aab235 100644
--- a/sound/arm/pxa2xx-pcm.c
+++ b/sound/arm/pxa2xx-pcm.c
@@ -21,8 +21,8 @@
21#include <sound/pcm_params.h> 21#include <sound/pcm_params.h>
22 22
23#include <asm/dma.h> 23#include <asm/dma.h>
24#include <asm/hardware.h> 24#include <mach/hardware.h>
25#include <asm/arch/pxa-regs.h> 25#include <mach/pxa-regs.h>
26 26
27#include "pxa2xx-pcm.h" 27#include "pxa2xx-pcm.h"
28 28
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c
index faeddf3ecedb..b9c51bf8cd71 100644
--- a/sound/arm/sa11xx-uda1341.c
+++ b/sound/arm/sa11xx-uda1341.c
@@ -71,8 +71,8 @@
71#include <linux/pm.h> 71#include <linux/pm.h>
72#endif 72#endif
73 73
74#include <asm/hardware.h> 74#include <mach/hardware.h>
75#include <asm/arch/h3600.h> 75#include <mach/h3600.h>
76#include <asm/mach-types.h> 76#include <asm/mach-types.h>
77#include <asm/dma.h> 77#include <asm/dma.h>
78 78
diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c
index 558dadbf45f1..e024e4588b82 100644
--- a/sound/core/seq/oss/seq_oss_synth.c
+++ b/sound/core/seq/oss/seq_oss_synth.c
@@ -604,6 +604,9 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in
604{ 604{
605 struct seq_oss_synth *rec; 605 struct seq_oss_synth *rec;
606 606
607 if (dev < 0 || dev >= dp->max_synthdev)
608 return -ENXIO;
609
607 if (dp->synths[dev].is_midi) { 610 if (dp->synths[dev].is_midi) {
608 struct midi_info minf; 611 struct midi_info minf;
609 snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf); 612 snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf);
diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c
index bb4a0969f461..725fef0f59a3 100644
--- a/sound/oss/vidc.c
+++ b/sound/oss/vidc.c
@@ -22,7 +22,7 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24 24
25#include <asm/hardware.h> 25#include <mach/hardware.h>
26#include <asm/dma.h> 26#include <asm/dma.h>
27#include <asm/io.h> 27#include <asm/io.h>
28#include <asm/hardware/iomd.h> 28#include <asm/hardware/iomd.h>
diff --git a/sound/oss/vidc_fill.S b/sound/oss/vidc_fill.S
index 01ccc074cc11..bed34921d176 100644
--- a/sound/oss/vidc_fill.S
+++ b/sound/oss/vidc_fill.S
@@ -11,7 +11,7 @@
11 */ 11 */
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/hardware.h> 14#include <mach/hardware.h>
15#include <asm/hardware/iomd.h> 15#include <asm/hardware/iomd.h>
16 16
17 .text 17 .text
diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c
index 88490418f932..c47842fad657 100644
--- a/sound/oss/waveartist.c
+++ b/sound/oss/waveartist.c
@@ -47,7 +47,7 @@
47#include "waveartist.h" 47#include "waveartist.h"
48 48
49#ifdef CONFIG_ARM 49#ifdef CONFIG_ARM
50#include <asm/hardware.h> 50#include <mach/hardware.h>
51#include <asm/mach-types.h> 51#include <asm/mach-types.h>
52#endif 52#endif
53 53
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index f7d95b224a98..31f52d3fc21f 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -845,7 +845,7 @@ config SND_VIRTUOSO
845 select SND_OXYGEN_LIB 845 select SND_OXYGEN_LIB
846 help 846 help
847 Say Y here to include support for sound cards based on the 847 Say Y here to include support for sound cards based on the
848 Asus AV100/AV200 chips, i.e., Xonar D2, DX and D2X. 848 Asus AV100/AV200 chips, i.e., Xonar D1, DX, D2 and D2X.
849 849
850 To compile this driver as a module, choose M here: the module 850 To compile this driver as a module, choose M here: the module
851 will be called snd-virtuoso. 851 will be called snd-virtuoso.
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ef9f072b47fc..a73d6ca0a906 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -101,6 +101,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
101 "{Intel, ICH8}," 101 "{Intel, ICH8},"
102 "{Intel, ICH9}," 102 "{Intel, ICH9},"
103 "{Intel, ICH10}," 103 "{Intel, ICH10},"
104 "{Intel, PCH},"
104 "{Intel, SCH}," 105 "{Intel, SCH},"
105 "{ATI, SB450}," 106 "{ATI, SB450},"
106 "{ATI, SB600}," 107 "{ATI, SB600},"
@@ -2263,6 +2264,8 @@ static struct pci_device_id azx_ids[] = {
2263 { PCI_DEVICE(0x8086, 0x293f), .driver_data = AZX_DRIVER_ICH }, 2264 { PCI_DEVICE(0x8086, 0x293f), .driver_data = AZX_DRIVER_ICH },
2264 { PCI_DEVICE(0x8086, 0x3a3e), .driver_data = AZX_DRIVER_ICH }, 2265 { PCI_DEVICE(0x8086, 0x3a3e), .driver_data = AZX_DRIVER_ICH },
2265 { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH }, 2266 { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH },
2267 /* PCH */
2268 { PCI_DEVICE(0x8086, 0x3b56), .driver_data = AZX_DRIVER_ICH },
2266 /* SCH */ 2269 /* SCH */
2267 { PCI_DEVICE(0x8086, 0x811b), .driver_data = AZX_DRIVER_SCH }, 2270 { PCI_DEVICE(0x8086, 0x811b), .driver_data = AZX_DRIVER_SCH },
2268 /* ATI SB 450/600 */ 2271 /* ATI SB 450/600 */
@@ -2272,6 +2275,7 @@ static struct pci_device_id azx_ids[] = {
2272 { PCI_DEVICE(0x1002, 0x793b), .driver_data = AZX_DRIVER_ATIHDMI }, 2275 { PCI_DEVICE(0x1002, 0x793b), .driver_data = AZX_DRIVER_ATIHDMI },
2273 { PCI_DEVICE(0x1002, 0x7919), .driver_data = AZX_DRIVER_ATIHDMI }, 2276 { PCI_DEVICE(0x1002, 0x7919), .driver_data = AZX_DRIVER_ATIHDMI },
2274 { PCI_DEVICE(0x1002, 0x960f), .driver_data = AZX_DRIVER_ATIHDMI }, 2277 { PCI_DEVICE(0x1002, 0x960f), .driver_data = AZX_DRIVER_ATIHDMI },
2278 { PCI_DEVICE(0x1002, 0x970f), .driver_data = AZX_DRIVER_ATIHDMI },
2275 { PCI_DEVICE(0x1002, 0xaa00), .driver_data = AZX_DRIVER_ATIHDMI }, 2279 { PCI_DEVICE(0x1002, 0xaa00), .driver_data = AZX_DRIVER_ATIHDMI },
2276 { PCI_DEVICE(0x1002, 0xaa08), .driver_data = AZX_DRIVER_ATIHDMI }, 2280 { PCI_DEVICE(0x1002, 0xaa08), .driver_data = AZX_DRIVER_ATIHDMI },
2277 { PCI_DEVICE(0x1002, 0xaa10), .driver_data = AZX_DRIVER_ATIHDMI }, 2281 { PCI_DEVICE(0x1002, 0xaa10), .driver_data = AZX_DRIVER_ATIHDMI },
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index add4e87e0b20..b80e725432f0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6437,6 +6437,39 @@ static void alc882_auto_init_analog_input(struct hda_codec *codec)
6437 } 6437 }
6438} 6438}
6439 6439
6440static void alc882_auto_init_input_src(struct hda_codec *codec)
6441{
6442 struct alc_spec *spec = codec->spec;
6443 const struct hda_input_mux *imux = spec->input_mux;
6444 int c;
6445
6446 for (c = 0; c < spec->num_adc_nids; c++) {
6447 hda_nid_t conn_list[HDA_MAX_NUM_INPUTS];
6448 hda_nid_t nid = spec->capsrc_nids[c];
6449 int conns, mute, idx, item;
6450
6451 conns = snd_hda_get_connections(codec, nid, conn_list,
6452 ARRAY_SIZE(conn_list));
6453 if (conns < 0)
6454 continue;
6455 for (idx = 0; idx < conns; idx++) {
6456 /* if the current connection is the selected one,
6457 * unmute it as default - otherwise mute it
6458 */
6459 mute = AMP_IN_MUTE(idx);
6460 for (item = 0; item < imux->num_items; item++) {
6461 if (imux->items[item].index == idx) {
6462 if (spec->cur_mux[c] == item)
6463 mute = AMP_IN_UNMUTE(idx);
6464 break;
6465 }
6466 }
6467 snd_hda_codec_write(codec, nid, 0,
6468 AC_VERB_SET_AMP_GAIN_MUTE, mute);
6469 }
6470 }
6471}
6472
6440/* add mic boosts if needed */ 6473/* add mic boosts if needed */
6441static int alc_auto_add_mic_boost(struct hda_codec *codec) 6474static int alc_auto_add_mic_boost(struct hda_codec *codec)
6442{ 6475{
@@ -6491,6 +6524,7 @@ static void alc882_auto_init(struct hda_codec *codec)
6491 alc882_auto_init_multi_out(codec); 6524 alc882_auto_init_multi_out(codec);
6492 alc882_auto_init_hp_out(codec); 6525 alc882_auto_init_hp_out(codec);
6493 alc882_auto_init_analog_input(codec); 6526 alc882_auto_init_analog_input(codec);
6527 alc882_auto_init_input_src(codec);
6494 if (spec->unsol_event) 6528 if (spec->unsol_event)
6495 alc_sku_automute(codec); 6529 alc_sku_automute(codec);
6496} 6530}
@@ -8285,6 +8319,8 @@ static void alc883_auto_init_analog_input(struct hda_codec *codec)
8285 } 8319 }
8286} 8320}
8287 8321
8322#define alc883_auto_init_input_src alc882_auto_init_input_src
8323
8288/* almost identical with ALC880 parser... */ 8324/* almost identical with ALC880 parser... */
8289static int alc883_parse_auto_config(struct hda_codec *codec) 8325static int alc883_parse_auto_config(struct hda_codec *codec)
8290{ 8326{
@@ -8315,6 +8351,7 @@ static void alc883_auto_init(struct hda_codec *codec)
8315 alc883_auto_init_multi_out(codec); 8351 alc883_auto_init_multi_out(codec);
8316 alc883_auto_init_hp_out(codec); 8352 alc883_auto_init_hp_out(codec);
8317 alc883_auto_init_analog_input(codec); 8353 alc883_auto_init_analog_input(codec);
8354 alc883_auto_init_input_src(codec);
8318 if (spec->unsol_event) 8355 if (spec->unsol_event)
8319 alc_sku_automute(codec); 8356 alc_sku_automute(codec);
8320} 8357}
@@ -9663,6 +9700,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
9663#define alc262_auto_init_multi_out alc882_auto_init_multi_out 9700#define alc262_auto_init_multi_out alc882_auto_init_multi_out
9664#define alc262_auto_init_hp_out alc882_auto_init_hp_out 9701#define alc262_auto_init_hp_out alc882_auto_init_hp_out
9665#define alc262_auto_init_analog_input alc882_auto_init_analog_input 9702#define alc262_auto_init_analog_input alc882_auto_init_analog_input
9703#define alc262_auto_init_input_src alc882_auto_init_input_src
9666 9704
9667 9705
9668/* init callback for auto-configuration model -- overriding the default init */ 9706/* init callback for auto-configuration model -- overriding the default init */
@@ -9672,6 +9710,7 @@ static void alc262_auto_init(struct hda_codec *codec)
9672 alc262_auto_init_multi_out(codec); 9710 alc262_auto_init_multi_out(codec);
9673 alc262_auto_init_hp_out(codec); 9711 alc262_auto_init_hp_out(codec);
9674 alc262_auto_init_analog_input(codec); 9712 alc262_auto_init_analog_input(codec);
9713 alc262_auto_init_input_src(codec);
9675 if (spec->unsol_event) 9714 if (spec->unsol_event)
9676 alc_sku_automute(codec); 9715 alc_sku_automute(codec);
9677} 9716}
@@ -13330,6 +13369,8 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec)
13330 } 13369 }
13331} 13370}
13332 13371
13372#define alc861vd_auto_init_input_src alc882_auto_init_input_src
13373
13333#define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02) 13374#define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02)
13334#define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c) 13375#define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c)
13335 13376
@@ -13512,6 +13553,7 @@ static void alc861vd_auto_init(struct hda_codec *codec)
13512 alc861vd_auto_init_multi_out(codec); 13553 alc861vd_auto_init_multi_out(codec);
13513 alc861vd_auto_init_hp_out(codec); 13554 alc861vd_auto_init_hp_out(codec);
13514 alc861vd_auto_init_analog_input(codec); 13555 alc861vd_auto_init_analog_input(codec);
13556 alc861vd_auto_init_input_src(codec);
13515 if (spec->unsol_event) 13557 if (spec->unsol_event)
13516 alc_sku_automute(codec); 13558 alc_sku_automute(codec);
13517} 13559}
@@ -14677,6 +14719,8 @@ static void alc662_auto_init_analog_input(struct hda_codec *codec)
14677 } 14719 }
14678} 14720}
14679 14721
14722#define alc662_auto_init_input_src alc882_auto_init_input_src
14723
14680static int alc662_parse_auto_config(struct hda_codec *codec) 14724static int alc662_parse_auto_config(struct hda_codec *codec)
14681{ 14725{
14682 struct alc_spec *spec = codec->spec; 14726 struct alc_spec *spec = codec->spec;
@@ -14733,6 +14777,7 @@ static void alc662_auto_init(struct hda_codec *codec)
14733 alc662_auto_init_multi_out(codec); 14777 alc662_auto_init_multi_out(codec);
14734 alc662_auto_init_hp_out(codec); 14778 alc662_auto_init_hp_out(codec);
14735 alc662_auto_init_analog_input(codec); 14779 alc662_auto_init_analog_input(codec);
14780 alc662_auto_init_input_src(codec);
14736 if (spec->unsol_event) 14781 if (spec->unsol_event)
14737 alc_sku_automute(codec); 14782 alc_sku_automute(codec);
14738} 14783}
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
index 9a2c16bf94e0..01d7b75f9182 100644
--- a/sound/pci/oxygen/virtuoso.c
+++ b/sound/pci/oxygen/virtuoso.c
@@ -36,15 +36,15 @@
36 */ 36 */
37 37
38/* 38/*
39 * Xonar DX 39 * Xonar D1/DX
40 * -------- 40 * -----------
41 * 41 *
42 * CMI8788: 42 * CMI8788:
43 * 43 *
44 * I²C <-> CS4398 (front) 44 * I²C <-> CS4398 (front)
45 * <-> CS4362A (surround, center/LFE, back) 45 * <-> CS4362A (surround, center/LFE, back)
46 * 46 *
47 * GPI 0 <- external power present 47 * GPI 0 <- external power present (DX only)
48 * 48 *
49 * GPIO 0 -> enable output to speakers 49 * GPIO 0 -> enable output to speakers
50 * GPIO 1 -> enable front panel I/O 50 * GPIO 1 -> enable front panel I/O
@@ -96,6 +96,7 @@ MODULE_PARM_DESC(enable, "enable card");
96enum { 96enum {
97 MODEL_D2, 97 MODEL_D2,
98 MODEL_D2X, 98 MODEL_D2X,
99 MODEL_D1,
99 MODEL_DX, 100 MODEL_DX,
100}; 101};
101 102
@@ -103,6 +104,7 @@ static struct pci_device_id xonar_ids[] __devinitdata = {
103 { OXYGEN_PCI_SUBID(0x1043, 0x8269), .driver_data = MODEL_D2 }, 104 { OXYGEN_PCI_SUBID(0x1043, 0x8269), .driver_data = MODEL_D2 },
104 { OXYGEN_PCI_SUBID(0x1043, 0x8275), .driver_data = MODEL_DX }, 105 { OXYGEN_PCI_SUBID(0x1043, 0x8275), .driver_data = MODEL_DX },
105 { OXYGEN_PCI_SUBID(0x1043, 0x82b7), .driver_data = MODEL_D2X }, 106 { OXYGEN_PCI_SUBID(0x1043, 0x82b7), .driver_data = MODEL_D2X },
107 { OXYGEN_PCI_SUBID(0x1043, 0x834f), .driver_data = MODEL_D1 },
106 { } 108 { }
107}; 109};
108MODULE_DEVICE_TABLE(pci, xonar_ids); 110MODULE_DEVICE_TABLE(pci, xonar_ids);
@@ -313,15 +315,12 @@ static void cs43xx_init(struct oxygen *chip)
313 cs4362a_write(chip, 0x01, CS4362A_CPEN); 315 cs4362a_write(chip, 0x01, CS4362A_CPEN);
314} 316}
315 317
316static void xonar_dx_init(struct oxygen *chip) 318static void xonar_d1_init(struct oxygen *chip)
317{ 319{
318 struct xonar_data *data = chip->model_data; 320 struct xonar_data *data = chip->model_data;
319 321
320 data->anti_pop_delay = 800; 322 data->anti_pop_delay = 800;
321 data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE; 323 data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE;
322 data->ext_power_reg = OXYGEN_GPI_DATA;
323 data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
324 data->ext_power_bit = GPI_DX_EXT_POWER;
325 data->cs4398_fm = CS4398_FM_SINGLE | CS4398_DEM_NONE | CS4398_DIF_LJUST; 324 data->cs4398_fm = CS4398_FM_SINGLE | CS4398_DEM_NONE | CS4398_DIF_LJUST;
326 data->cs4362a_fm = CS4362A_FM_SINGLE | 325 data->cs4362a_fm = CS4362A_FM_SINGLE |
327 CS4362A_ATAPI_B_R | CS4362A_ATAPI_A_L; 326 CS4362A_ATAPI_B_R | CS4362A_ATAPI_A_L;
@@ -345,6 +344,16 @@ static void xonar_dx_init(struct oxygen *chip)
345 snd_component_add(chip->card, "CS5361"); 344 snd_component_add(chip->card, "CS5361");
346} 345}
347 346
347static void xonar_dx_init(struct oxygen *chip)
348{
349 struct xonar_data *data = chip->model_data;
350
351 data->ext_power_reg = OXYGEN_GPI_DATA;
352 data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
353 data->ext_power_bit = GPI_DX_EXT_POWER;
354 xonar_d1_init(chip);
355}
356
348static void xonar_cleanup(struct oxygen *chip) 357static void xonar_cleanup(struct oxygen *chip)
349{ 358{
350 struct xonar_data *data = chip->model_data; 359 struct xonar_data *data = chip->model_data;
@@ -352,7 +361,7 @@ static void xonar_cleanup(struct oxygen *chip)
352 oxygen_clear_bits16(chip, OXYGEN_GPIO_DATA, data->output_enable_bit); 361 oxygen_clear_bits16(chip, OXYGEN_GPIO_DATA, data->output_enable_bit);
353} 362}
354 363
355static void xonar_dx_cleanup(struct oxygen *chip) 364static void xonar_d1_cleanup(struct oxygen *chip)
356{ 365{
357 xonar_cleanup(chip); 366 xonar_cleanup(chip);
358 cs4362a_write(chip, 0x01, CS4362A_PDN | CS4362A_CPEN); 367 cs4362a_write(chip, 0x01, CS4362A_PDN | CS4362A_CPEN);
@@ -365,7 +374,7 @@ static void xonar_d2_resume(struct oxygen *chip)
365 xonar_enable_output(chip); 374 xonar_enable_output(chip);
366} 375}
367 376
368static void xonar_dx_resume(struct oxygen *chip) 377static void xonar_d1_resume(struct oxygen *chip)
369{ 378{
370 cs43xx_init(chip); 379 cs43xx_init(chip);
371 xonar_enable_output(chip); 380 xonar_enable_output(chip);
@@ -513,7 +522,7 @@ static const struct snd_kcontrol_new front_panel_switch = {
513 .put = front_panel_put, 522 .put = front_panel_put,
514}; 523};
515 524
516static void xonar_dx_ac97_switch(struct oxygen *chip, 525static void xonar_d1_ac97_switch(struct oxygen *chip,
517 unsigned int reg, unsigned int mute) 526 unsigned int reg, unsigned int mute)
518{ 527{
519 if (reg == AC97_LINE) { 528 if (reg == AC97_LINE) {
@@ -536,7 +545,7 @@ static int xonar_d2_control_filter(struct snd_kcontrol_new *template)
536 return 0; 545 return 0;
537} 546}
538 547
539static int xonar_dx_control_filter(struct snd_kcontrol_new *template) 548static int xonar_d1_control_filter(struct snd_kcontrol_new *template)
540{ 549{
541 if (!strncmp(template->name, "CD Capture ", 11)) 550 if (!strncmp(template->name, "CD Capture ", 11))
542 return 1; /* no CD input */ 551 return 1; /* no CD input */
@@ -548,7 +557,7 @@ static int xonar_mixer_init(struct oxygen *chip)
548 return snd_ctl_add(chip->card, snd_ctl_new1(&alt_switch, chip)); 557 return snd_ctl_add(chip->card, snd_ctl_new1(&alt_switch, chip));
549} 558}
550 559
551static int xonar_dx_mixer_init(struct oxygen *chip) 560static int xonar_d1_mixer_init(struct oxygen *chip)
552{ 561{
553 return snd_ctl_add(chip->card, snd_ctl_new1(&front_panel_switch, chip)); 562 return snd_ctl_add(chip->card, snd_ctl_new1(&front_panel_switch, chip));
554} 563}
@@ -615,23 +624,51 @@ static const struct oxygen_model xonar_models[] = {
615 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 624 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
616 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, 625 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
617 }, 626 },
627 [MODEL_D1] = {
628 .shortname = "Xonar D1",
629 .longname = "Asus Virtuoso 100",
630 .chip = "AV200",
631 .owner = THIS_MODULE,
632 .init = xonar_d1_init,
633 .control_filter = xonar_d1_control_filter,
634 .mixer_init = xonar_d1_mixer_init,
635 .cleanup = xonar_d1_cleanup,
636 .suspend = xonar_d1_cleanup,
637 .resume = xonar_d1_resume,
638 .set_dac_params = set_cs43xx_params,
639 .set_adc_params = set_cs53x1_params,
640 .update_dac_volume = update_cs43xx_volume,
641 .update_dac_mute = update_cs43xx_mute,
642 .ac97_switch = xonar_d1_ac97_switch,
643 .dac_tlv = cs4362a_db_scale,
644 .model_data_size = sizeof(struct xonar_data),
645 .pcm_dev_cfg = PLAYBACK_0_TO_I2S |
646 PLAYBACK_1_TO_SPDIF |
647 CAPTURE_0_FROM_I2S_2,
648 .dac_channels = 8,
649 .dac_volume_min = 0,
650 .dac_volume_max = 127,
651 .function_flags = OXYGEN_FUNCTION_2WIRE,
652 .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
653 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
654 },
618 [MODEL_DX] = { 655 [MODEL_DX] = {
619 .shortname = "Xonar DX", 656 .shortname = "Xonar DX",
620 .longname = "Asus Virtuoso 100", 657 .longname = "Asus Virtuoso 100",
621 .chip = "AV200", 658 .chip = "AV200",
622 .owner = THIS_MODULE, 659 .owner = THIS_MODULE,
623 .init = xonar_dx_init, 660 .init = xonar_dx_init,
624 .control_filter = xonar_dx_control_filter, 661 .control_filter = xonar_d1_control_filter,
625 .mixer_init = xonar_dx_mixer_init, 662 .mixer_init = xonar_d1_mixer_init,
626 .cleanup = xonar_dx_cleanup, 663 .cleanup = xonar_d1_cleanup,
627 .suspend = xonar_dx_cleanup, 664 .suspend = xonar_d1_cleanup,
628 .resume = xonar_dx_resume, 665 .resume = xonar_d1_resume,
629 .set_dac_params = set_cs43xx_params, 666 .set_dac_params = set_cs43xx_params,
630 .set_adc_params = set_cs53x1_params, 667 .set_adc_params = set_cs53x1_params,
631 .update_dac_volume = update_cs43xx_volume, 668 .update_dac_volume = update_cs43xx_volume,
632 .update_dac_mute = update_cs43xx_mute, 669 .update_dac_mute = update_cs43xx_mute,
633 .gpio_changed = xonar_gpio_changed, 670 .gpio_changed = xonar_gpio_changed,
634 .ac97_switch = xonar_dx_ac97_switch, 671 .ac97_switch = xonar_d1_ac97_switch,
635 .dac_tlv = cs4362a_db_scale, 672 .dac_tlv = cs4362a_db_scale,
636 .model_data_size = sizeof(struct xonar_data), 673 .model_data_size = sizeof(struct xonar_data),
637 .pcm_dev_cfg = PLAYBACK_0_TO_I2S | 674 .pcm_dev_cfg = PLAYBACK_0_TO_I2S |
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index 9ca113326143..54df8baf916f 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -42,7 +42,7 @@
42#include <sound/info.h> 42#include <sound/info.h>
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/dma.h> 44#include <asm/dma.h>
45#include <asm/dreamcast/sysasic.h> 45#include <mach/sysasic.h>
46#include "aica.h" 46#include "aica.h"
47 47
48MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>"); 48MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
diff --git a/sound/soc/at32/playpaq_wm8510.c b/sound/soc/at32/playpaq_wm8510.c
index fee5f8e58957..3f326219f1ec 100644
--- a/sound/soc/at32/playpaq_wm8510.c
+++ b/sound/soc/at32/playpaq_wm8510.c
@@ -36,8 +36,8 @@
36#include <sound/soc.h> 36#include <sound/soc.h>
37#include <sound/soc-dapm.h> 37#include <sound/soc-dapm.h>
38 38
39#include <asm/arch/at32ap700x.h> 39#include <mach/at32ap700x.h>
40#include <asm/arch/portmux.h> 40#include <mach/portmux.h>
41 41
42#include "../codecs/wm8510.h" 42#include "../codecs/wm8510.h"
43#include "at32-pcm.h" 43#include "at32-pcm.h"
diff --git a/sound/soc/at91/at91-pcm.c b/sound/soc/at91/at91-pcm.c
index d47492b2b6e5..7ab48bd25e4c 100644
--- a/sound/soc/at91/at91-pcm.c
+++ b/sound/soc/at91/at91-pcm.c
@@ -28,8 +28,8 @@
28#include <sound/pcm_params.h> 28#include <sound/pcm_params.h>
29#include <sound/soc.h> 29#include <sound/soc.h>
30 30
31#include <asm/arch/hardware.h> 31#include <mach/hardware.h>
32#include <asm/arch/at91_ssc.h> 32#include <mach/at91_ssc.h>
33 33
34#include "at91-pcm.h" 34#include "at91-pcm.h"
35 35
diff --git a/sound/soc/at91/at91-pcm.h b/sound/soc/at91/at91-pcm.h
index 58d0f00a07b2..e5aada2cb102 100644
--- a/sound/soc/at91/at91-pcm.h
+++ b/sound/soc/at91/at91-pcm.h
@@ -19,7 +19,7 @@
19#ifndef _AT91_PCM_H 19#ifndef _AT91_PCM_H
20#define _AT91_PCM_H 20#define _AT91_PCM_H
21 21
22#include <asm/arch/hardware.h> 22#include <mach/hardware.h>
23 23
24struct at91_ssc_periph { 24struct at91_ssc_periph {
25 void __iomem *base; 25 void __iomem *base;
diff --git a/sound/soc/at91/at91-ssc.c b/sound/soc/at91/at91-ssc.c
index 090e607f8692..5d44515e62e0 100644
--- a/sound/soc/at91/at91-ssc.c
+++ b/sound/soc/at91/at91-ssc.c
@@ -28,9 +28,9 @@
28#include <sound/initval.h> 28#include <sound/initval.h>
29#include <sound/soc.h> 29#include <sound/soc.h>
30 30
31#include <asm/arch/hardware.h> 31#include <mach/hardware.h>
32#include <asm/arch/at91_pmc.h> 32#include <mach/at91_pmc.h>
33#include <asm/arch/at91_ssc.h> 33#include <mach/at91_ssc.h>
34 34
35#include "at91-pcm.h" 35#include "at91-pcm.h"
36#include "at91-ssc.h" 36#include "at91-ssc.h"
diff --git a/sound/soc/at91/eti_b1_wm8731.c b/sound/soc/at91/eti_b1_wm8731.c
index d532de954241..b081e83766b7 100644
--- a/sound/soc/at91/eti_b1_wm8731.c
+++ b/sound/soc/at91/eti_b1_wm8731.c
@@ -33,8 +33,8 @@
33#include <sound/soc.h> 33#include <sound/soc.h>
34#include <sound/soc-dapm.h> 34#include <sound/soc-dapm.h>
35 35
36#include <asm/hardware.h> 36#include <mach/hardware.h>
37#include <asm/arch/gpio.h> 37#include <mach/gpio.h>
38 38
39#include "../codecs/wm8731.h" 39#include "../codecs/wm8731.h"
40#include "at91-pcm.h" 40#include "at91-pcm.h"
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index e23cb09f0d14..c6a8edf302ad 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -348,8 +348,9 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
348 SND_SOC_DAPM_OUTPUT("ROUT1"), 348 SND_SOC_DAPM_OUTPUT("ROUT1"),
349 SND_SOC_DAPM_OUTPUT("LOUT2"), 349 SND_SOC_DAPM_OUTPUT("LOUT2"),
350 SND_SOC_DAPM_OUTPUT("ROUT2"), 350 SND_SOC_DAPM_OUTPUT("ROUT2"),
351 SND_SOC_DAPM_OUTPUT("MONO"), 351 SND_SOC_DAPM_OUTPUT("MONO1"),
352 SND_SOC_DAPM_OUTPUT("OUT3"), 352 SND_SOC_DAPM_OUTPUT("OUT3"),
353 SND_SOC_DAPM_OUTPUT("VREF"),
353 354
354 SND_SOC_DAPM_INPUT("LINPUT1"), 355 SND_SOC_DAPM_INPUT("LINPUT1"),
355 SND_SOC_DAPM_INPUT("LINPUT2"), 356 SND_SOC_DAPM_INPUT("LINPUT2"),
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index 3ecce5168e94..e44153fa38de 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -82,7 +82,7 @@ static const u16 wm8990_reg[] = {
82 0x0003, /* R35 - ClassD1 */ 82 0x0003, /* R35 - ClassD1 */
83 0x0000, /* R36 */ 83 0x0000, /* R36 */
84 0x0100, /* R37 - ClassD3 */ 84 0x0100, /* R37 - ClassD3 */
85 0x0000, /* R38 */ 85 0x0079, /* R38 - ClassD4 */
86 0x0000, /* R39 - Input Mixer1 */ 86 0x0000, /* R39 - Input Mixer1 */
87 0x0000, /* R40 - Input Mixer2 */ 87 0x0000, /* R40 - Input Mixer2 */
88 0x0000, /* R41 - Input Mixer3 */ 88 0x0000, /* R41 - Input Mixer3 */
@@ -311,11 +311,15 @@ SOC_SINGLE("Speaker Mode Switch", WM8990_CLASSD1,
311 WM8990_CDMODE_BIT, 1, 0), 311 WM8990_CDMODE_BIT, 1, 0),
312 312
313SOC_SINGLE("Speaker Output Attenuation Volume", WM8990_SPEAKER_VOLUME, 313SOC_SINGLE("Speaker Output Attenuation Volume", WM8990_SPEAKER_VOLUME,
314 WM8990_SPKVOL_SHIFT, WM8990_SPKVOL_MASK, 0), 314 WM8990_SPKATTN_SHIFT, WM8990_SPKATTN_MASK, 0),
315SOC_SINGLE("Speaker DC Boost Volume", WM8990_CLASSD3, 315SOC_SINGLE("Speaker DC Boost Volume", WM8990_CLASSD3,
316 WM8990_DCGAIN_SHIFT, WM8990_DCGAIN_MASK, 0), 316 WM8990_DCGAIN_SHIFT, WM8990_DCGAIN_MASK, 0),
317SOC_SINGLE("Speaker AC Boost Volume", WM8990_CLASSD3, 317SOC_SINGLE("Speaker AC Boost Volume", WM8990_CLASSD3,
318 WM8990_ACGAIN_SHIFT, WM8990_ACGAIN_MASK, 0), 318 WM8990_ACGAIN_SHIFT, WM8990_ACGAIN_MASK, 0),
319SOC_SINGLE_TLV("Speaker Volume", WM8990_CLASSD4,
320 WM8990_SPKVOL_SHIFT, WM8990_SPKVOL_MASK, 0, out_pga_tlv),
321SOC_SINGLE("Speaker ZC Switch", WM8990_CLASSD4,
322 WM8990_SPKZC_SHIFT, WM8990_SPKZC_MASK, 0),
319 323
320SOC_WM899X_OUTPGA_SINGLE_R_TLV("Left DAC Digital Volume", 324SOC_WM899X_OUTPGA_SINGLE_R_TLV("Left DAC Digital Volume",
321 WM8990_LEFT_DAC_DIGITAL_VOLUME, 325 WM8990_LEFT_DAC_DIGITAL_VOLUME,
@@ -920,7 +924,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
920 {"SPKMIX", "SPKMIX Left Mixer PGA Switch", "LOPGA"}, 924 {"SPKMIX", "SPKMIX Left Mixer PGA Switch", "LOPGA"},
921 {"SPKMIX", "SPKMIX Right Mixer PGA Switch", "ROPGA"}, 925 {"SPKMIX", "SPKMIX Right Mixer PGA Switch", "ROPGA"},
922 {"SPKMIX", "SPKMIX Right DAC Switch", "Right DAC"}, 926 {"SPKMIX", "SPKMIX Right DAC Switch", "Right DAC"},
923 {"SPKMIX", "SPKMIX Left DAC Switch", "Right DAC"}, 927 {"SPKMIX", "SPKMIX Left DAC Switch", "Left DAC"},
924 928
925 /* LONMIX */ 929 /* LONMIX */
926 {"LONMIX", "LONMIX Left Mixer PGA Switch", "LOPGA"}, 930 {"LONMIX", "LONMIX Left Mixer PGA Switch", "LOPGA"},
diff --git a/sound/soc/codecs/wm8990.h b/sound/soc/codecs/wm8990.h
index 6bea57485283..0a08325d5443 100644
--- a/sound/soc/codecs/wm8990.h
+++ b/sound/soc/codecs/wm8990.h
@@ -54,6 +54,7 @@
54#define WM8990_SPEAKER_VOLUME 0x22 54#define WM8990_SPEAKER_VOLUME 0x22
55#define WM8990_CLASSD1 0x23 55#define WM8990_CLASSD1 0x23
56#define WM8990_CLASSD3 0x25 56#define WM8990_CLASSD3 0x25
57#define WM8990_CLASSD4 0x26
57#define WM8990_INPUT_MIXER1 0x27 58#define WM8990_INPUT_MIXER1 0x27
58#define WM8990_INPUT_MIXER2 0x28 59#define WM8990_INPUT_MIXER2 0x28
59#define WM8990_INPUT_MIXER3 0x29 60#define WM8990_INPUT_MIXER3 0x29
@@ -528,8 +529,8 @@
528/* 529/*
529 * R34 (0x22) - Speaker Volume 530 * R34 (0x22) - Speaker Volume
530 */ 531 */
531#define WM8990_SPKVOL_MASK 0x0003 /* SPKVOL - [1:0] */ 532#define WM8990_SPKATTN_MASK 0x0003 /* SPKATTN - [1:0] */
532#define WM8990_SPKVOL_SHIFT 0 533#define WM8990_SPKATTN_SHIFT 0
533 534
534/* 535/*
535 * R35 (0x23) - ClassD1 536 * R35 (0x23) - ClassD1
@@ -544,6 +545,15 @@
544#define WM8990_DCGAIN_SHIFT 3 545#define WM8990_DCGAIN_SHIFT 3
545#define WM8990_ACGAIN_MASK 0x0007 /* ACGAIN - [2:0] */ 546#define WM8990_ACGAIN_MASK 0x0007 /* ACGAIN - [2:0] */
546#define WM8990_ACGAIN_SHIFT 0 547#define WM8990_ACGAIN_SHIFT 0
548
549/*
550 * R38 (0x26) - ClassD4
551 */
552#define WM8990_SPKZC_MASK 0x0001 /* SPKZC */
553#define WM8990_SPKZC_SHIFT 7 /* SPKZC */
554#define WM8990_SPKVOL_MASK 0x007F /* SPKVOL - [6:0] */
555#define WM8990_SPKVOL_SHIFT 0 /* SPKVOL - [6:0] */
556
547/* 557/*
548 * R39 (0x27) - Input Mixer1 558 * R39 (0x27) - Input Mixer1
549 */ 559 */
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 5e2c306399ed..65fdbd81a379 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -19,9 +19,8 @@
19#include <sound/soc.h> 19#include <sound/soc.h>
20#include <sound/soc-dapm.h> 20#include <sound/soc-dapm.h>
21 21
22#include <asm/mach-types.h>
23#include <asm/dma.h> 22#include <asm/dma.h>
24#include <asm/arch/hardware.h> 23#include <mach/hardware.h>
25 24
26#include "../codecs/tlv320aic3x.h" 25#include "../codecs/tlv320aic3x.h"
27#include "davinci-pcm.h" 26#include "davinci-pcm.h"
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index da2bc5902864..d2d3da9729f2 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -132,12 +132,17 @@ struct fsl_dma_private {
132 * Since each link descriptor has a 32-bit byte count field, we set 132 * Since each link descriptor has a 32-bit byte count field, we set
133 * period_bytes_max to the largest 32-bit number. We also have no maximum 133 * period_bytes_max to the largest 32-bit number. We also have no maximum
134 * number of periods. 134 * number of periods.
135 *
136 * Note that we specify SNDRV_PCM_INFO_JOINT_DUPLEX here, but only because a
137 * limitation in the SSI driver requires the sample rates for playback and
138 * capture to be the same.
135 */ 139 */
136static const struct snd_pcm_hardware fsl_dma_hardware = { 140static const struct snd_pcm_hardware fsl_dma_hardware = {
137 141
138 .info = SNDRV_PCM_INFO_INTERLEAVED | 142 .info = SNDRV_PCM_INFO_INTERLEAVED |
139 SNDRV_PCM_INFO_MMAP | 143 SNDRV_PCM_INFO_MMAP |
140 SNDRV_PCM_INFO_MMAP_VALID, 144 SNDRV_PCM_INFO_MMAP_VALID |
145 SNDRV_PCM_INFO_JOINT_DUPLEX,
141 .formats = FSLDMA_PCM_FORMATS, 146 .formats = FSLDMA_PCM_FORMATS,
142 .rates = FSLDMA_PCM_RATES, 147 .rates = FSLDMA_PCM_RATES,
143 .rate_min = 5512, 148 .rate_min = 5512,
@@ -322,14 +327,75 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
322 * fsl_dma_open: open a new substream. 327 * fsl_dma_open: open a new substream.
323 * 328 *
324 * Each substream has its own DMA buffer. 329 * Each substream has its own DMA buffer.
330 *
331 * ALSA divides the DMA buffer into N periods. We create NUM_DMA_LINKS link
332 * descriptors that ping-pong from one period to the next. For example, if
333 * there are six periods and two link descriptors, this is how they look
334 * before playback starts:
335 *
336 * The last link descriptor
337 * ____________ points back to the first
338 * | |
339 * V |
340 * ___ ___ |
341 * | |->| |->|
342 * |___| |___|
343 * | |
344 * | |
345 * V V
346 * _________________________________________
347 * | | | | | | | The DMA buffer is
348 * | | | | | | | divided into 6 parts
349 * |______|______|______|______|______|______|
350 *
351 * and here's how they look after the first period is finished playing:
352 *
353 * ____________
354 * | |
355 * V |
356 * ___ ___ |
357 * | |->| |->|
358 * |___| |___|
359 * | |
360 * |______________
361 * | |
362 * V V
363 * _________________________________________
364 * | | | | | | |
365 * | | | | | | |
366 * |______|______|______|______|______|______|
367 *
368 * The first link descriptor now points to the third period. The DMA
369 * controller is currently playing the second period. When it finishes, it
370 * will jump back to the first descriptor and play the third period.
371 *
372 * There are four reasons we do this:
373 *
374 * 1. The only way to get the DMA controller to automatically restart the
375 * transfer when it gets to the end of the buffer is to use chaining
376 * mode. Basic direct mode doesn't offer that feature.
377 * 2. We need to receive an interrupt at the end of every period. The DMA
378 * controller can generate an interrupt at the end of every link transfer
379 * (aka segment). Making each period into a DMA segment will give us the
380 * interrupts we need.
381 * 3. By creating only two link descriptors, regardless of the number of
382 * periods, we do not need to reallocate the link descriptors if the
383 * number of periods changes.
384 * 4. All of the audio data is still stored in a single, contiguous DMA
385 * buffer, which is what ALSA expects. We're just dividing it into
386 * contiguous parts, and creating a link descriptor for each one.
325 */ 387 */
326static int fsl_dma_open(struct snd_pcm_substream *substream) 388static int fsl_dma_open(struct snd_pcm_substream *substream)
327{ 389{
328 struct snd_pcm_runtime *runtime = substream->runtime; 390 struct snd_pcm_runtime *runtime = substream->runtime;
329 struct fsl_dma_private *dma_private; 391 struct fsl_dma_private *dma_private;
392 struct ccsr_dma_channel __iomem *dma_channel;
330 dma_addr_t ld_buf_phys; 393 dma_addr_t ld_buf_phys;
394 u64 temp_link; /* Pointer to next link descriptor */
395 u32 mr;
331 unsigned int channel; 396 unsigned int channel;
332 int ret = 0; 397 int ret = 0;
398 unsigned int i;
333 399
334 /* 400 /*
335 * Reject any DMA buffer whose size is not a multiple of the period 401 * Reject any DMA buffer whose size is not a multiple of the period
@@ -390,68 +456,74 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
390 snd_soc_set_runtime_hwparams(substream, &fsl_dma_hardware); 456 snd_soc_set_runtime_hwparams(substream, &fsl_dma_hardware);
391 runtime->private_data = dma_private; 457 runtime->private_data = dma_private;
392 458
459 /* Program the fixed DMA controller parameters */
460
461 dma_channel = dma_private->dma_channel;
462
463 temp_link = dma_private->ld_buf_phys +
464 sizeof(struct fsl_dma_link_descriptor);
465
466 for (i = 0; i < NUM_DMA_LINKS; i++) {
467 struct fsl_dma_link_descriptor *link = &dma_private->link[i];
468
469 link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP);
470 link->dest_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP);
471 link->next = cpu_to_be64(temp_link);
472
473 temp_link += sizeof(struct fsl_dma_link_descriptor);
474 }
475 /* The last link descriptor points to the first */
476 dma_private->link[i - 1].next = cpu_to_be64(dma_private->ld_buf_phys);
477
478 /* Tell the DMA controller where the first link descriptor is */
479 out_be32(&dma_channel->clndar,
480 CCSR_DMA_CLNDAR_ADDR(dma_private->ld_buf_phys));
481 out_be32(&dma_channel->eclndar,
482 CCSR_DMA_ECLNDAR_ADDR(dma_private->ld_buf_phys));
483
484 /* The manual says the BCR must be clear before enabling EMP */
485 out_be32(&dma_channel->bcr, 0);
486
487 /*
488 * Program the mode register for interrupts, external master control,
489 * and source/destination hold. Also clear the Channel Abort bit.
490 */
491 mr = in_be32(&dma_channel->mr) &
492 ~(CCSR_DMA_MR_CA | CCSR_DMA_MR_DAHE | CCSR_DMA_MR_SAHE);
493
494 /*
495 * We want External Master Start and External Master Pause enabled,
496 * because the SSI is controlling the DMA controller. We want the DMA
497 * controller to be set up in advance, and then we signal only the SSI
498 * to start transferring.
499 *
500 * We want End-Of-Segment Interrupts enabled, because this will generate
501 * an interrupt at the end of each segment (each link descriptor
502 * represents one segment). Each DMA segment is the same thing as an
503 * ALSA period, so this is how we get an interrupt at the end of every
504 * period.
505 *
506 * We want Error Interrupt enabled, so that we can get an error if
507 * the DMA controller is mis-programmed somehow.
508 */
509 mr |= CCSR_DMA_MR_EOSIE | CCSR_DMA_MR_EIE | CCSR_DMA_MR_EMP_EN |
510 CCSR_DMA_MR_EMS_EN;
511
512 /* For playback, we want the destination address to be held. For
513 capture, set the source address to be held. */
514 mr |= (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
515 CCSR_DMA_MR_DAHE : CCSR_DMA_MR_SAHE;
516
517 out_be32(&dma_channel->mr, mr);
518
393 return 0; 519 return 0;
394} 520}
395 521
396/** 522/**
397 * fsl_dma_hw_params: allocate the DMA buffer and the DMA link descriptors. 523 * fsl_dma_hw_params: continue initializing the DMA links
398 * 524 *
399 * ALSA divides the DMA buffer into N periods. We create NUM_DMA_LINKS link 525 * This function obtains hardware parameters about the opened stream and
400 * descriptors that ping-pong from one period to the next. For example, if 526 * programs the DMA controller accordingly.
401 * there are six periods and two link descriptors, this is how they look
402 * before playback starts:
403 *
404 * The last link descriptor
405 * ____________ points back to the first
406 * | |
407 * V |
408 * ___ ___ |
409 * | |->| |->|
410 * |___| |___|
411 * | |
412 * | |
413 * V V
414 * _________________________________________
415 * | | | | | | | The DMA buffer is
416 * | | | | | | | divided into 6 parts
417 * |______|______|______|______|______|______|
418 *
419 * and here's how they look after the first period is finished playing:
420 *
421 * ____________
422 * | |
423 * V |
424 * ___ ___ |
425 * | |->| |->|
426 * |___| |___|
427 * | |
428 * |______________
429 * | |
430 * V V
431 * _________________________________________
432 * | | | | | | |
433 * | | | | | | |
434 * |______|______|______|______|______|______|
435 *
436 * The first link descriptor now points to the third period. The DMA
437 * controller is currently playing the second period. When it finishes, it
438 * will jump back to the first descriptor and play the third period.
439 *
440 * There are four reasons we do this:
441 *
442 * 1. The only way to get the DMA controller to automatically restart the
443 * transfer when it gets to the end of the buffer is to use chaining
444 * mode. Basic direct mode doesn't offer that feature.
445 * 2. We need to receive an interrupt at the end of every period. The DMA
446 * controller can generate an interrupt at the end of every link transfer
447 * (aka segment). Making each period into a DMA segment will give us the
448 * interrupts we need.
449 * 3. By creating only two link descriptors, regardless of the number of
450 * periods, we do not need to reallocate the link descriptors if the
451 * number of periods changes.
452 * 4. All of the audio data is still stored in a single, contiguous DMA
453 * buffer, which is what ALSA expects. We're just dividing it into
454 * contiguous parts, and creating a link descriptor for each one.
455 * 527 *
456 * Note that due to a quirk of the SSI's STX register, the target address 528 * Note that due to a quirk of the SSI's STX register, the target address
457 * for the DMA operations depends on the sample size. So we don't program 529 * for the DMA operations depends on the sample size. So we don't program
@@ -463,11 +535,8 @@ static int fsl_dma_hw_params(struct snd_pcm_substream *substream,
463{ 535{
464 struct snd_pcm_runtime *runtime = substream->runtime; 536 struct snd_pcm_runtime *runtime = substream->runtime;
465 struct fsl_dma_private *dma_private = runtime->private_data; 537 struct fsl_dma_private *dma_private = runtime->private_data;
466 struct ccsr_dma_channel __iomem *dma_channel = dma_private->dma_channel;
467 538
468 dma_addr_t temp_addr; /* Pointer to next period */ 539 dma_addr_t temp_addr; /* Pointer to next period */
469 u64 temp_link; /* Pointer to next link descriptor */
470 u32 mr; /* Temporary variable for MR register */
471 540
472 unsigned int i; 541 unsigned int i;
473 542
@@ -485,8 +554,6 @@ static int fsl_dma_hw_params(struct snd_pcm_substream *substream,
485 dma_private->dma_buf_next = dma_private->dma_buf_phys; 554 dma_private->dma_buf_next = dma_private->dma_buf_phys;
486 555
487 /* 556 /*
488 * Initialize each link descriptor.
489 *
490 * The actual address in STX0 (destination for playback, source for 557 * The actual address in STX0 (destination for playback, source for
491 * capture) is based on the sample size, but we don't know the sample 558 * capture) is based on the sample size, but we don't know the sample
492 * size in this function, so we'll have to adjust that later. See 559 * size in this function, so we'll have to adjust that later. See
@@ -502,16 +569,11 @@ static int fsl_dma_hw_params(struct snd_pcm_substream *substream,
502 * buffer itself. 569 * buffer itself.
503 */ 570 */
504 temp_addr = substream->dma_buffer.addr; 571 temp_addr = substream->dma_buffer.addr;
505 temp_link = dma_private->ld_buf_phys +
506 sizeof(struct fsl_dma_link_descriptor);
507 572
508 for (i = 0; i < NUM_DMA_LINKS; i++) { 573 for (i = 0; i < NUM_DMA_LINKS; i++) {
509 struct fsl_dma_link_descriptor *link = &dma_private->link[i]; 574 struct fsl_dma_link_descriptor *link = &dma_private->link[i];
510 575
511 link->count = cpu_to_be32(period_size); 576 link->count = cpu_to_be32(period_size);
512 link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP);
513 link->dest_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP);
514 link->next = cpu_to_be64(temp_link);
515 577
516 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 578 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
517 link->source_addr = cpu_to_be32(temp_addr); 579 link->source_addr = cpu_to_be32(temp_addr);
@@ -519,51 +581,7 @@ static int fsl_dma_hw_params(struct snd_pcm_substream *substream,
519 link->dest_addr = cpu_to_be32(temp_addr); 581 link->dest_addr = cpu_to_be32(temp_addr);
520 582
521 temp_addr += period_size; 583 temp_addr += period_size;
522 temp_link += sizeof(struct fsl_dma_link_descriptor);
523 } 584 }
524 /* The last link descriptor points to the first */
525 dma_private->link[i - 1].next = cpu_to_be64(dma_private->ld_buf_phys);
526
527 /* Tell the DMA controller where the first link descriptor is */
528 out_be32(&dma_channel->clndar,
529 CCSR_DMA_CLNDAR_ADDR(dma_private->ld_buf_phys));
530 out_be32(&dma_channel->eclndar,
531 CCSR_DMA_ECLNDAR_ADDR(dma_private->ld_buf_phys));
532
533 /* The manual says the BCR must be clear before enabling EMP */
534 out_be32(&dma_channel->bcr, 0);
535
536 /*
537 * Program the mode register for interrupts, external master control,
538 * and source/destination hold. Also clear the Channel Abort bit.
539 */
540 mr = in_be32(&dma_channel->mr) &
541 ~(CCSR_DMA_MR_CA | CCSR_DMA_MR_DAHE | CCSR_DMA_MR_SAHE);
542
543 /*
544 * We want External Master Start and External Master Pause enabled,
545 * because the SSI is controlling the DMA controller. We want the DMA
546 * controller to be set up in advance, and then we signal only the SSI
547 * to start transfering.
548 *
549 * We want End-Of-Segment Interrupts enabled, because this will generate
550 * an interrupt at the end of each segment (each link descriptor
551 * represents one segment). Each DMA segment is the same thing as an
552 * ALSA period, so this is how we get an interrupt at the end of every
553 * period.
554 *
555 * We want Error Interrupt enabled, so that we can get an error if
556 * the DMA controller is mis-programmed somehow.
557 */
558 mr |= CCSR_DMA_MR_EOSIE | CCSR_DMA_MR_EIE | CCSR_DMA_MR_EMP_EN |
559 CCSR_DMA_MR_EMS_EN;
560
561 /* For playback, we want the destination address to be held. For
562 capture, set the source address to be held. */
563 mr |= (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
564 CCSR_DMA_MR_DAHE : CCSR_DMA_MR_SAHE;
565
566 out_be32(&dma_channel->mr, mr);
567 585
568 return 0; 586 return 0;
569} 587}
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 71bff33f5528..157a7895ffa1 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -67,6 +67,8 @@
67 * @ssi: pointer to the SSI's registers 67 * @ssi: pointer to the SSI's registers
68 * @ssi_phys: physical address of the SSI registers 68 * @ssi_phys: physical address of the SSI registers
69 * @irq: IRQ of this SSI 69 * @irq: IRQ of this SSI
70 * @first_stream: pointer to the stream that was opened first
71 * @second_stream: pointer to second stream
70 * @dev: struct device pointer 72 * @dev: struct device pointer
71 * @playback: the number of playback streams opened 73 * @playback: the number of playback streams opened
72 * @capture: the number of capture streams opened 74 * @capture: the number of capture streams opened
@@ -79,6 +81,8 @@ struct fsl_ssi_private {
79 struct ccsr_ssi __iomem *ssi; 81 struct ccsr_ssi __iomem *ssi;
80 dma_addr_t ssi_phys; 82 dma_addr_t ssi_phys;
81 unsigned int irq; 83 unsigned int irq;
84 struct snd_pcm_substream *first_stream;
85 struct snd_pcm_substream *second_stream;
82 struct device *dev; 86 struct device *dev;
83 unsigned int playback; 87 unsigned int playback;
84 unsigned int capture; 88 unsigned int capture;
@@ -342,6 +346,49 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream)
342 */ 346 */
343 } 347 }
344 348
349 if (!ssi_private->first_stream)
350 ssi_private->first_stream = substream;
351 else {
352 /* This is the second stream open, so we need to impose sample
353 * rate and maybe sample size constraints. Note that this can
354 * cause a race condition if the second stream is opened before
355 * the first stream is fully initialized.
356 *
357 * We provide some protection by checking to make sure the first
358 * stream is initialized, but it's not perfect. ALSA sometimes
359 * re-initializes the driver with a different sample rate or
360 * size. If the second stream is opened before the first stream
361 * has received its final parameters, then the second stream may
362 * be constrained to the wrong sample rate or size.
363 *
364 * FIXME: This code does not handle opening and closing streams
365 * repeatedly. If you open two streams and then close the first
366 * one, you may not be able to open another stream until you
367 * close the second one as well.
368 */
369 struct snd_pcm_runtime *first_runtime =
370 ssi_private->first_stream->runtime;
371
372 if (!first_runtime->rate || !first_runtime->sample_bits) {
373 dev_err(substream->pcm->card->dev,
374 "set sample rate and size in %s stream first\n",
375 substream->stream == SNDRV_PCM_STREAM_PLAYBACK
376 ? "capture" : "playback");
377 return -EAGAIN;
378 }
379
380 snd_pcm_hw_constraint_minmax(substream->runtime,
381 SNDRV_PCM_HW_PARAM_RATE,
382 first_runtime->rate, first_runtime->rate);
383
384 snd_pcm_hw_constraint_minmax(substream->runtime,
385 SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
386 first_runtime->sample_bits,
387 first_runtime->sample_bits);
388
389 ssi_private->second_stream = substream;
390 }
391
345 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 392 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
346 ssi_private->playback++; 393 ssi_private->playback++;
347 394
@@ -371,18 +418,16 @@ static int fsl_ssi_prepare(struct snd_pcm_substream *substream)
371 struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data; 418 struct fsl_ssi_private *ssi_private = rtd->dai->cpu_dai->private_data;
372 419
373 struct ccsr_ssi __iomem *ssi = ssi_private->ssi; 420 struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
374 u32 wl;
375 421
376 wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format)); 422 if (substream == ssi_private->first_stream) {
423 u32 wl;
377 424
378 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN); 425 /* The SSI should always be disabled at this points (SSIEN=0) */
426 wl = CCSR_SSI_SxCCR_WL(snd_pcm_format_width(runtime->format));
379 427
380 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 428 /* In synchronous mode, the SSI uses STCCR for capture */
381 clrsetbits_be32(&ssi->stccr, CCSR_SSI_SxCCR_WL_MASK, wl); 429 clrsetbits_be32(&ssi->stccr, CCSR_SSI_SxCCR_WL_MASK, wl);
382 else 430 }
383 clrsetbits_be32(&ssi->srccr, CCSR_SSI_SxCCR_WL_MASK, wl);
384
385 setbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
386 431
387 return 0; 432 return 0;
388} 433}
@@ -407,9 +452,13 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd)
407 case SNDRV_PCM_TRIGGER_RESUME: 452 case SNDRV_PCM_TRIGGER_RESUME:
408 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 453 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
409 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 454 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
410 setbits32(&ssi->scr, CCSR_SSI_SCR_TE); 455 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
456 setbits32(&ssi->scr,
457 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE);
411 } else { 458 } else {
412 setbits32(&ssi->scr, CCSR_SSI_SCR_RE); 459 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN);
460 setbits32(&ssi->scr,
461 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
413 462
414 /* 463 /*
415 * I think we need this delay to allow time for the SSI 464 * I think we need this delay to allow time for the SSI
@@ -452,6 +501,11 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream)
452 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) 501 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
453 ssi_private->capture--; 502 ssi_private->capture--;
454 503
504 if (ssi_private->first_stream == substream)
505 ssi_private->first_stream = ssi_private->second_stream;
506
507 ssi_private->second_stream = NULL;
508
455 /* 509 /*
456 * If this is the last active substream, disable the SSI and release 510 * If this is the last active substream, disable the SSI and release
457 * the IRQ. 511 * the IRQ.
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 02cec96859b8..7694621ec40b 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -29,9 +29,9 @@
29#include <sound/soc-dapm.h> 29#include <sound/soc-dapm.h>
30 30
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32#include <asm/arch/hardware.h> 32#include <mach/hardware.h>
33#include <linux/gpio.h> 33#include <linux/gpio.h>
34#include <asm/arch/mcbsp.h> 34#include <mach/mcbsp.h>
35 35
36#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
37#include "omap-pcm.h" 37#include "omap-pcm.h"
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 00b0c9d73cd4..35310e16d7f3 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -30,9 +30,9 @@
30#include <sound/initval.h> 30#include <sound/initval.h>
31#include <sound/soc.h> 31#include <sound/soc.h>
32 32
33#include <asm/arch/control.h> 33#include <mach/control.h>
34#include <asm/arch/dma.h> 34#include <mach/dma.h>
35#include <asm/arch/mcbsp.h> 35#include <mach/mcbsp.h>
36#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
37#include "omap-pcm.h" 37#include "omap-pcm.h"
38 38
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index e092f3d836d0..690bfeaec4a0 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -27,7 +27,7 @@
27#include <sound/pcm_params.h> 27#include <sound/pcm_params.h>
28#include <sound/soc.h> 28#include <sound/soc.h>
29 29
30#include <asm/arch/dma.h> 30#include <mach/dma.h>
31#include "omap-pcm.h" 31#include "omap-pcm.h"
32 32
33static const struct snd_pcm_hardware omap_pcm_hardware = { 33static const struct snd_pcm_hardware omap_pcm_hardware = {
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c
index c0294464a23a..0a53f72077fd 100644
--- a/sound/soc/pxa/corgi.c
+++ b/sound/soc/pxa/corgi.c
@@ -25,10 +25,10 @@
25 25
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/hardware/scoop.h> 27#include <asm/hardware/scoop.h>
28#include <asm/arch/pxa-regs.h> 28#include <mach/pxa-regs.h>
29#include <asm/arch/hardware.h> 29#include <mach/hardware.h>
30#include <asm/arch/corgi.h> 30#include <mach/corgi.h>
31#include <asm/arch/audio.h> 31#include <mach/audio.h>
32 32
33#include "../codecs/wm8731.h" 33#include "../codecs/wm8731.h"
34#include "pxa2xx-pcm.h" 34#include "pxa2xx-pcm.h"
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c
index 06e8afb25277..6781c5be242f 100644
--- a/sound/soc/pxa/e800_wm9712.c
+++ b/sound/soc/pxa/e800_wm9712.c
@@ -21,9 +21,9 @@
21#include <sound/soc-dapm.h> 21#include <sound/soc-dapm.h>
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24#include <asm/arch/pxa-regs.h> 24#include <mach/pxa-regs.h>
25#include <asm/arch/hardware.h> 25#include <mach/hardware.h>
26#include <asm/arch/audio.h> 26#include <mach/audio.h>
27 27
28#include "../codecs/wm9712.h" 28#include "../codecs/wm9712.h"
29#include "pxa2xx-pcm.h" 29#include "pxa2xx-pcm.h"
diff --git a/sound/soc/pxa/em-x270.c b/sound/soc/pxa/em-x270.c
index 02dcac39cdf6..d9c3f7b28be2 100644
--- a/sound/soc/pxa/em-x270.c
+++ b/sound/soc/pxa/em-x270.c
@@ -30,9 +30,9 @@
30#include <sound/soc-dapm.h> 30#include <sound/soc-dapm.h>
31 31
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/arch/pxa-regs.h> 33#include <mach/pxa-regs.h>
34#include <asm/arch/hardware.h> 34#include <mach/hardware.h>
35#include <asm/arch/audio.h> 35#include <mach/audio.h>
36 36
37#include "../codecs/wm9712.h" 37#include "../codecs/wm9712.h"
38#include "pxa2xx-pcm.h" 38#include "pxa2xx-pcm.h"
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
index 65a4e9a8c39e..a4697f7e2921 100644
--- a/sound/soc/pxa/poodle.c
+++ b/sound/soc/pxa/poodle.c
@@ -26,10 +26,10 @@
26 26
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28#include <asm/hardware/locomo.h> 28#include <asm/hardware/locomo.h>
29#include <asm/arch/pxa-regs.h> 29#include <mach/pxa-regs.h>
30#include <asm/arch/hardware.h> 30#include <mach/hardware.h>
31#include <asm/arch/poodle.h> 31#include <mach/poodle.h>
32#include <asm/arch/audio.h> 32#include <mach/audio.h>
33 33
34#include "../codecs/wm8731.h" 34#include "../codecs/wm8731.h"
35#include "pxa2xx-pcm.h" 35#include "pxa2xx-pcm.h"
@@ -85,17 +85,13 @@ static int poodle_startup(struct snd_pcm_substream *substream)
85} 85}
86 86
87/* we need to unmute the HP at shutdown as the mute burns power on poodle */ 87/* we need to unmute the HP at shutdown as the mute burns power on poodle */
88static int poodle_shutdown(struct snd_pcm_substream *substream) 88static void poodle_shutdown(struct snd_pcm_substream *substream)
89{ 89{
90 struct snd_soc_pcm_runtime *rtd = substream->private_data;
91 struct snd_soc_codec *codec = rtd->socdev->codec;
92
93 /* set = unmute headphone */ 90 /* set = unmute headphone */
94 locomo_gpio_write(&poodle_locomo_device.dev, 91 locomo_gpio_write(&poodle_locomo_device.dev,
95 POODLE_LOCOMO_GPIO_MUTE_L, 1); 92 POODLE_LOCOMO_GPIO_MUTE_L, 1);
96 locomo_gpio_write(&poodle_locomo_device.dev, 93 locomo_gpio_write(&poodle_locomo_device.dev,
97 POODLE_LOCOMO_GPIO_MUTE_R, 1); 94 POODLE_LOCOMO_GPIO_MUTE_R, 1);
98 return 0;
99} 95}
100 96
101static int poodle_hw_params(struct snd_pcm_substream *substream, 97static int poodle_hw_params(struct snd_pcm_substream *substream,
@@ -232,7 +228,7 @@ static const struct soc_enum poodle_enum[] = {
232 SOC_ENUM_SINGLE_EXT(2, spk_function), 228 SOC_ENUM_SINGLE_EXT(2, spk_function),
233}; 229};
234 230
235static const snd_kcontrol_new_t wm8731_poodle_controls[] = { 231static const struct snd_kcontrol_new wm8731_poodle_controls[] = {
236 SOC_ENUM_EXT("Jack Function", poodle_enum[0], poodle_get_jack, 232 SOC_ENUM_EXT("Jack Function", poodle_enum[0], poodle_get_jack,
237 poodle_set_jack), 233 poodle_set_jack),
238 SOC_ENUM_EXT("Speaker Function", poodle_enum[1], poodle_get_spk, 234 SOC_ENUM_EXT("Speaker Function", poodle_enum[1], poodle_get_spk,
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 059af815ea0c..d94a495bd6bd 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -26,10 +26,10 @@
26 26
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <linux/mutex.h> 28#include <linux/mutex.h>
29#include <asm/hardware.h> 29#include <mach/hardware.h>
30#include <asm/arch/pxa-regs.h> 30#include <mach/pxa-regs.h>
31#include <asm/arch/pxa2xx-gpio.h> 31#include <mach/pxa2xx-gpio.h>
32#include <asm/arch/audio.h> 32#include <mach/audio.h>
33 33
34#include "pxa2xx-pcm.h" 34#include "pxa2xx-pcm.h"
35#include "pxa2xx-ac97.h" 35#include "pxa2xx-ac97.h"
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 8f96d87f7b4b..8548818eea08 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -21,10 +21,10 @@
21#include <sound/initval.h> 21#include <sound/initval.h>
22#include <sound/soc.h> 22#include <sound/soc.h>
23 23
24#include <asm/hardware.h> 24#include <mach/hardware.h>
25#include <asm/arch/pxa-regs.h> 25#include <mach/pxa-regs.h>
26#include <asm/arch/pxa2xx-gpio.h> 26#include <mach/pxa2xx-gpio.h>
27#include <asm/arch/audio.h> 27#include <mach/audio.h>
28 28
29#include "pxa2xx-pcm.h" 29#include "pxa2xx-pcm.h"
30#include "pxa2xx-i2s.h" 30#include "pxa2xx-i2s.h"
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index 2df03ee5819e..4345f387fe41 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -22,9 +22,9 @@
22#include <sound/soc.h> 22#include <sound/soc.h>
23 23
24#include <asm/dma.h> 24#include <asm/dma.h>
25#include <asm/hardware.h> 25#include <mach/hardware.h>
26#include <asm/arch/pxa-regs.h> 26#include <mach/pxa-regs.h>
27#include <asm/arch/audio.h> 27#include <mach/audio.h>
28 28
29#include "pxa2xx-pcm.h" 29#include "pxa2xx-pcm.h"
30 30
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
index 64385797da5d..37cb768fc933 100644
--- a/sound/soc/pxa/spitz.c
+++ b/sound/soc/pxa/spitz.c
@@ -26,10 +26,10 @@
26 26
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28#include <asm/hardware/scoop.h> 28#include <asm/hardware/scoop.h>
29#include <asm/arch/pxa-regs.h> 29#include <mach/pxa-regs.h>
30#include <asm/arch/hardware.h> 30#include <mach/hardware.h>
31#include <asm/arch/akita.h> 31#include <mach/akita.h>
32#include <asm/arch/spitz.h> 32#include <mach/spitz.h>
33#include "../codecs/wm8750.h" 33#include "../codecs/wm8750.h"
34#include "pxa2xx-pcm.h" 34#include "pxa2xx-pcm.h"
35#include "pxa2xx-i2s.h" 35#include "pxa2xx-i2s.h"
@@ -297,7 +297,7 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
297 snd_soc_dapm_disable_pin(codec, "LINPUT3"); 297 snd_soc_dapm_disable_pin(codec, "LINPUT3");
298 snd_soc_dapm_disable_pin(codec, "RINPUT3"); 298 snd_soc_dapm_disable_pin(codec, "RINPUT3");
299 snd_soc_dapm_disable_pin(codec, "OUT3"); 299 snd_soc_dapm_disable_pin(codec, "OUT3");
300 snd_soc_dapm_disable_pin(codec, "MONO"); 300 snd_soc_dapm_disable_pin(codec, "MONO1");
301 301
302 /* Add spitz specific controls */ 302 /* Add spitz specific controls */
303 for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) { 303 for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) {
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index fe6cca9c9e76..2baaa750f123 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -29,11 +29,10 @@
29#include <sound/soc-dapm.h> 29#include <sound/soc-dapm.h>
30 30
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32#include <asm/arch/tosa.h> 32#include <mach/tosa.h>
33#include <asm/arch/pxa-regs.h> 33#include <mach/pxa-regs.h>
34#include <asm/arch/hardware.h> 34#include <mach/hardware.h>
35#include <asm/arch/audio.h> 35#include <mach/audio.h>
36#include <asm/arch/tosa.h>
37 36
38#include "../codecs/wm9712.h" 37#include "../codecs/wm9712.h"
39#include "pxa2xx-pcm.h" 38#include "pxa2xx-pcm.h"
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
index 4d7a9aa15f1a..8089f8ee05c0 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -24,14 +24,13 @@
24#include <sound/soc-dapm.h> 24#include <sound/soc-dapm.h>
25#include <sound/tlv.h> 25#include <sound/tlv.h>
26 26
27#include <asm/mach-types.h>
28#include <asm/hardware/scoop.h> 27#include <asm/hardware/scoop.h>
29#include <asm/arch/regs-clock.h> 28#include <mach/regs-clock.h>
30#include <asm/arch/regs-gpio.h> 29#include <mach/regs-gpio.h>
31#include <asm/hardware.h> 30#include <mach/hardware.h>
32#include <asm/arch/audio.h> 31#include <mach/audio.h>
33#include <linux/io.h> 32#include <linux/io.h>
34#include <asm/arch/spi-gpio.h> 33#include <mach/spi-gpio.h>
35 34
36#include <asm/plat-s3c24xx/regs-iis.h> 35#include <asm/plat-s3c24xx/regs-iis.h>
37 36
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c
index ee4676ed1283..ded7d995a922 100644
--- a/sound/soc/s3c24xx/s3c2412-i2s.c
+++ b/sound/soc/s3c24xx/s3c2412-i2s.c
@@ -28,16 +28,16 @@
28#include <sound/pcm_params.h> 28#include <sound/pcm_params.h>
29#include <sound/initval.h> 29#include <sound/initval.h>
30#include <sound/soc.h> 30#include <sound/soc.h>
31#include <asm/hardware.h> 31#include <mach/hardware.h>
32 32
33#include <linux/io.h> 33#include <linux/io.h>
34#include <asm/dma.h> 34#include <asm/dma.h>
35 35
36#include <asm/plat-s3c24xx/regs-s3c2412-iis.h> 36#include <asm/plat-s3c24xx/regs-s3c2412-iis.h>
37 37
38#include <asm/arch/regs-gpio.h> 38#include <mach/regs-gpio.h>
39#include <asm/arch/audio.h> 39#include <mach/audio.h>
40#include <asm/arch/dma.h> 40#include <mach/dma.h>
41 41
42#include "s3c24xx-pcm.h" 42#include "s3c24xx-pcm.h"
43#include "s3c2412-i2s.h" 43#include "s3c2412-i2s.h"
diff --git a/sound/soc/s3c24xx/s3c2443-ac97.c b/sound/soc/s3c24xx/s3c2443-ac97.c
index 783349b7fede..19c5c3cf5d8c 100644
--- a/sound/soc/s3c24xx/s3c2443-ac97.c
+++ b/sound/soc/s3c24xx/s3c2443-ac97.c
@@ -27,13 +27,13 @@
27#include <sound/initval.h> 27#include <sound/initval.h>
28#include <sound/soc.h> 28#include <sound/soc.h>
29 29
30#include <asm/hardware.h> 30#include <mach/hardware.h>
31#include <asm/plat-s3c/regs-ac97.h> 31#include <asm/plat-s3c/regs-ac97.h>
32#include <asm/arch/regs-gpio.h> 32#include <mach/regs-gpio.h>
33#include <asm/arch/regs-clock.h> 33#include <mach/regs-clock.h>
34#include <asm/arch/audio.h> 34#include <mach/audio.h>
35#include <asm/dma.h> 35#include <asm/dma.h>
36#include <asm/arch/dma.h> 36#include <mach/dma.h>
37 37
38#include "s3c24xx-pcm.h" 38#include "s3c24xx-pcm.h"
39#include "s3c24xx-ac97.h" 39#include "s3c24xx-ac97.h"
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
index 397524282b57..ba4476b55fbc 100644
--- a/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -27,12 +27,12 @@
27#include <sound/initval.h> 27#include <sound/initval.h>
28#include <sound/soc.h> 28#include <sound/soc.h>
29 29
30#include <asm/hardware.h> 30#include <mach/hardware.h>
31#include <asm/arch/regs-gpio.h> 31#include <mach/regs-gpio.h>
32#include <asm/arch/regs-clock.h> 32#include <mach/regs-clock.h>
33#include <asm/arch/audio.h> 33#include <mach/audio.h>
34#include <asm/dma.h> 34#include <asm/dma.h>
35#include <asm/arch/dma.h> 35#include <mach/dma.h>
36 36
37#include <asm/plat-s3c24xx/regs-iis.h> 37#include <asm/plat-s3c24xx/regs-iis.h>
38 38
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index cef79b34dc6f..e13e614bada9 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -27,9 +27,9 @@
27#include <sound/soc.h> 27#include <sound/soc.h>
28 28
29#include <asm/dma.h> 29#include <asm/dma.h>
30#include <asm/hardware.h> 30#include <mach/hardware.h>
31#include <asm/arch/dma.h> 31#include <mach/dma.h>
32#include <asm/arch/audio.h> 32#include <mach/audio.h>
33 33
34#include "s3c24xx-pcm.h" 34#include "s3c24xx-pcm.h"
35 35
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 820347c9ae4b..f9d100bc8479 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -470,6 +470,7 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w,
470 470
471 return 0; 471 return 0;
472} 472}
473EXPORT_SYMBOL_GPL(dapm_reg_event);
473 474
474/* 475/*
475 * Scan each dapm widget for complete audio path. 476 * Scan each dapm widget for complete audio path.