aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/aaci.c2
-rw-r--r--sound/arm/pxa2xx-ac97-lib.c2
-rw-r--r--sound/core/pcm_lib.c10
-rw-r--r--sound/core/pcm_native.c6
-rw-r--r--sound/drivers/pcsp/pcsp_mixer.c4
-rw-r--r--sound/drivers/serial-u16550.c11
-rw-r--r--sound/pci/ac97/ac97_patch.c7
-rw-r--r--sound/pci/ca0106/ca0106_mixer.c2
-rw-r--r--sound/pci/hda/hda_intel.c1
-rw-r--r--sound/pci/hda/patch_conexant.c1
-rw-r--r--sound/pci/hda/patch_realtek.c7
-rw-r--r--sound/pci/hda/patch_sigmatel.c17
-rw-r--r--sound/pci/riptide/riptide.c10
-rw-r--r--sound/pci/via82xx.c2
-rw-r--r--sound/soc/codecs/wm8990.c40
-rw-r--r--sound/soc/davinci/Kconfig7
-rw-r--r--sound/soc/davinci/davinci-evm.c63
-rw-r--r--sound/soc/davinci/davinci-i2s.c26
-rw-r--r--sound/soc/davinci/davinci-pcm.c71
-rw-r--r--sound/soc/soc-core.c3
-rw-r--r--sound/usb/usbaudio.c2
-rw-r--r--sound/usb/usbaudio.h2
-rw-r--r--sound/usb/usbmidi.c12
-rw-r--r--sound/usb/usbquirks.h2
24 files changed, 217 insertions, 93 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index 7fbd68fab94..5c48e36038f 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -1074,7 +1074,7 @@ static unsigned int __devinit aaci_size_fifo(struct aaci *aaci)
1074 return i; 1074 return i;
1075} 1075}
1076 1076
1077static int __devinit aaci_probe(struct amba_device *dev, void *id) 1077static int __devinit aaci_probe(struct amba_device *dev, struct amba_id *id)
1078{ 1078{
1079 struct aaci *aaci; 1079 struct aaci *aaci;
1080 int ret, i; 1080 int ret, i;
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index a2c12d105c9..6fdca97186e 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -65,7 +65,7 @@ static void set_resetgpio_mode(int resetgpio_action)
65 switch (resetgpio_action) { 65 switch (resetgpio_action) {
66 case RESETGPIO_NORMAL_ALTFUNC: 66 case RESETGPIO_NORMAL_ALTFUNC:
67 if (reset_gpio == 113) 67 if (reset_gpio == 113)
68 mode = 113 | GPIO_OUT | GPIO_DFLT_LOW; 68 mode = 113 | GPIO_ALT_FN_2_OUT;
69 if (reset_gpio == 95) 69 if (reset_gpio == 95)
70 mode = 95 | GPIO_ALT_FN_1_OUT; 70 mode = 95 | GPIO_ALT_FN_1_OUT;
71 break; 71 break;
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index a2a792c18c4..d659995ac3a 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -249,6 +249,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
249 new_hw_ptr = hw_base + pos; 249 new_hw_ptr = hw_base + pos;
250 } 250 }
251 } 251 }
252
253 /* Do jiffies check only in xrun_debug mode */
254 if (!xrun_debug(substream))
255 goto no_jiffies_check;
256
252 /* Skip the jiffies check for hardwares with BATCH flag. 257 /* Skip the jiffies check for hardwares with BATCH flag.
253 * Such hardware usually just increases the position at each IRQ, 258 * Such hardware usually just increases the position at each IRQ,
254 * thus it can't give any strange position. 259 * thus it can't give any strange position.
@@ -336,7 +341,9 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
336 hw_base = 0; 341 hw_base = 0;
337 new_hw_ptr = hw_base + pos; 342 new_hw_ptr = hw_base + pos;
338 } 343 }
339 if (((delta * HZ) / runtime->rate) > jdelta + HZ/100) { 344 /* Do jiffies check only in xrun_debug mode */
345 if (xrun_debug(substream) &&
346 ((delta * HZ) / runtime->rate) > jdelta + HZ/100) {
340 hw_ptr_error(substream, 347 hw_ptr_error(substream,
341 "hw_ptr skipping! " 348 "hw_ptr skipping! "
342 "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n", 349 "(pos=%ld, delta=%ld, period=%ld, jdelta=%lu/%lu)\n",
@@ -1478,7 +1485,6 @@ static int snd_pcm_lib_ioctl_reset(struct snd_pcm_substream *substream,
1478 runtime->status->hw_ptr %= runtime->buffer_size; 1485 runtime->status->hw_ptr %= runtime->buffer_size;
1479 else 1486 else
1480 runtime->status->hw_ptr = 0; 1487 runtime->status->hw_ptr = 0;
1481 runtime->hw_ptr_jiffies = jiffies;
1482 snd_pcm_stream_unlock_irqrestore(substream, flags); 1488 snd_pcm_stream_unlock_irqrestore(substream, flags);
1483 return 0; 1489 return 0;
1484} 1490}
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index fc6f98e257d..b5da656d1ec 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -848,6 +848,7 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state)
848{ 848{
849 struct snd_pcm_runtime *runtime = substream->runtime; 849 struct snd_pcm_runtime *runtime = substream->runtime;
850 snd_pcm_trigger_tstamp(substream); 850 snd_pcm_trigger_tstamp(substream);
851 runtime->hw_ptr_jiffies = jiffies;
851 runtime->status->state = state; 852 runtime->status->state = state;
852 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 853 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
853 runtime->silence_size > 0) 854 runtime->silence_size > 0)
@@ -961,6 +962,11 @@ static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push)
961{ 962{
962 if (substream->runtime->trigger_master != substream) 963 if (substream->runtime->trigger_master != substream)
963 return 0; 964 return 0;
965 /* The jiffies check in snd_pcm_update_hw_ptr*() is done by
966 * a delta betwen the current jiffies, this gives a large enough
967 * delta, effectively to skip the check once.
968 */
969 substream->runtime->hw_ptr_jiffies = jiffies - HZ * 1000;
964 return substream->ops->trigger(substream, 970 return substream->ops->trigger(substream,
965 push ? SNDRV_PCM_TRIGGER_PAUSE_PUSH : 971 push ? SNDRV_PCM_TRIGGER_PAUSE_PUSH :
966 SNDRV_PCM_TRIGGER_PAUSE_RELEASE); 972 SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
diff --git a/sound/drivers/pcsp/pcsp_mixer.c b/sound/drivers/pcsp/pcsp_mixer.c
index caeb0f57fcc..199b0337714 100644
--- a/sound/drivers/pcsp/pcsp_mixer.c
+++ b/sound/drivers/pcsp/pcsp_mixer.c
@@ -50,8 +50,8 @@ static int pcsp_treble_info(struct snd_kcontrol *kcontrol,
50 uinfo->value.enumerated.items = chip->max_treble + 1; 50 uinfo->value.enumerated.items = chip->max_treble + 1;
51 if (uinfo->value.enumerated.item > chip->max_treble) 51 if (uinfo->value.enumerated.item > chip->max_treble)
52 uinfo->value.enumerated.item = chip->max_treble; 52 uinfo->value.enumerated.item = chip->max_treble;
53 sprintf(uinfo->value.enumerated.name, "%d", 53 sprintf(uinfo->value.enumerated.name, "%lu",
54 PCSP_CALC_RATE(uinfo->value.enumerated.item)); 54 (unsigned long)PCSP_CALC_RATE(uinfo->value.enumerated.item));
55 return 0; 55 return 0;
56} 56}
57 57
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index b2b6d50c942..a25fb7b1f44 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -963,16 +963,11 @@ static int __devinit snd_serial_probe(struct platform_device *devptr)
963 if (err < 0) 963 if (err < 0)
964 goto _err; 964 goto _err;
965 965
966 sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d", 966 sprintf(card->longname, "%s [%s] at %#lx, irq %d",
967 card->shortname, 967 card->shortname,
968 uart->base,
969 uart->irq,
970 uart->speed,
971 (int)uart->divisor,
972 outs[dev],
973 ins[dev],
974 adaptor_names[uart->adaptor], 968 adaptor_names[uart->adaptor],
975 uart->drop_on_full); 969 uart->base,
970 uart->irq);
976 971
977 snd_card_set_dev(card, &devptr->dev); 972 snd_card_set_dev(card, &devptr->dev);
978 973
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 81bc93e5f1e..7337abdbe4e 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -958,10 +958,13 @@ static int patch_sigmatel_stac9708_3d(struct snd_ac97 * ac97)
958} 958}
959 959
960static const struct snd_kcontrol_new snd_ac97_sigmatel_4speaker = 960static const struct snd_kcontrol_new snd_ac97_sigmatel_4speaker =
961AC97_SINGLE("Sigmatel 4-Speaker Stereo Playback Switch", AC97_SIGMATEL_DAC2INVERT, 2, 1, 0); 961AC97_SINGLE("Sigmatel 4-Speaker Stereo Playback Switch",
962 AC97_SIGMATEL_DAC2INVERT, 2, 1, 0);
962 963
964/* "Sigmatel " removed due to excessive name length: */
963static const struct snd_kcontrol_new snd_ac97_sigmatel_phaseinvert = 965static const struct snd_kcontrol_new snd_ac97_sigmatel_phaseinvert =
964AC97_SINGLE("Sigmatel Surround Phase Inversion Playback Switch", AC97_SIGMATEL_DAC2INVERT, 3, 1, 0); 966AC97_SINGLE("Surround Phase Inversion Playback Switch",
967 AC97_SIGMATEL_DAC2INVERT, 3, 1, 0);
965 968
966static const struct snd_kcontrol_new snd_ac97_sigmatel_controls[] = { 969static const struct snd_kcontrol_new snd_ac97_sigmatel_controls[] = {
967AC97_SINGLE("Sigmatel DAC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 1, 1, 0), 970AC97_SINGLE("Sigmatel DAC 6dB Attenuate", AC97_SIGMATEL_ANALOG, 1, 1, 0),
diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c
index ad2888705d2..c111efe61c3 100644
--- a/sound/pci/ca0106/ca0106_mixer.c
+++ b/sound/pci/ca0106/ca0106_mixer.c
@@ -800,7 +800,7 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
800 "Capture Volume", 800 "Capture Volume",
801 "External Amplifier", 801 "External Amplifier",
802 "Sigmatel 4-Speaker Stereo Playback Switch", 802 "Sigmatel 4-Speaker Stereo Playback Switch",
803 "Sigmatel Surround Phase Inversion Playback ", 803 "Surround Phase Inversion Playback Switch",
804 NULL 804 NULL
805 }; 805 };
806 static char *ca0106_rename_ctls[] = { 806 static char *ca0106_rename_ctls[] = {
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 21e99cfa8c4..3128e1a6bc6 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2141,6 +2141,7 @@ static struct snd_pci_quirk probe_mask_list[] __devinitdata = {
2141 /* including bogus ALC268 in slot#2 that conflicts with ALC888 */ 2141 /* including bogus ALC268 in slot#2 that conflicts with ALC888 */
2142 SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01), 2142 SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01),
2143 /* forced codec slots */ 2143 /* forced codec slots */
2144 SND_PCI_QUIRK(0x1043, 0x1262, "ASUS W5Fm", 0x103),
2144 SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103), 2145 SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103),
2145 {} 2146 {}
2146}; 2147};
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 56ce19e68cb..4fcbe21829a 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1848,6 +1848,7 @@ static const char *cxt5051_models[CXT5051_MODELS] = {
1848 1848
1849static struct snd_pci_quirk cxt5051_cfg_tbl[] = { 1849static struct snd_pci_quirk cxt5051_cfg_tbl[] = {
1850 SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736), 1850 SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736),
1851 SND_PCI_QUIRK(0x103c, 0x360b, "Compaq Presario CQ60", CXT5051_HP),
1851 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board", 1852 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board",
1852 CXT5051_LAPTOP), 1853 CXT5051_LAPTOP),
1853 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), 1854 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP),
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b8a0d3e7927..0fd258eba3a 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -776,6 +776,12 @@ static void alc_set_input_pin(struct hda_codec *codec, hda_nid_t nid,
776 pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT; 776 pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
777 if (pincap & AC_PINCAP_VREF_80) 777 if (pincap & AC_PINCAP_VREF_80)
778 val = PIN_VREF80; 778 val = PIN_VREF80;
779 else if (pincap & AC_PINCAP_VREF_50)
780 val = PIN_VREF50;
781 else if (pincap & AC_PINCAP_VREF_100)
782 val = PIN_VREF100;
783 else if (pincap & AC_PINCAP_VREF_GRD)
784 val = PIN_VREFGRD;
779 } 785 }
780 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, val); 786 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, val);
781} 787}
@@ -12058,6 +12064,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
12058 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), 12064 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
12059 SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL), 12065 SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL),
12060 SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), 12066 SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA),
12067 SND_PCI_QUIRK(0x103c, 0x30f1, "HP TX25xx series", ALC268_TOSHIBA),
12061 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 12068 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
12062 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), 12069 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA),
12063 SND_PCI_QUIRK(0x1179, 0xff50, "TOSHIBA A305", ALC268_TOSHIBA), 12070 SND_PCI_QUIRK(0x1179, 0xff50, "TOSHIBA A305", ALC268_TOSHIBA),
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 917bc5d3ac2..d2fd8ef6aef 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -150,6 +150,7 @@ enum {
150 STAC_D965_REF, 150 STAC_D965_REF,
151 STAC_D965_3ST, 151 STAC_D965_3ST,
152 STAC_D965_5ST, 152 STAC_D965_5ST,
153 STAC_D965_5ST_NO_FP,
153 STAC_DELL_3ST, 154 STAC_DELL_3ST,
154 STAC_DELL_BIOS, 155 STAC_DELL_BIOS,
155 STAC_927X_MODELS 156 STAC_927X_MODELS
@@ -2154,6 +2155,13 @@ static unsigned int d965_5st_pin_configs[14] = {
2154 0x40000100, 0x40000100 2155 0x40000100, 0x40000100
2155}; 2156};
2156 2157
2158static unsigned int d965_5st_no_fp_pin_configs[14] = {
2159 0x40000100, 0x40000100, 0x0181304e, 0x01014010,
2160 0x01a19040, 0x01011012, 0x01016011, 0x40000100,
2161 0x40000100, 0x40000100, 0x40000100, 0x01442070,
2162 0x40000100, 0x40000100
2163};
2164
2157static unsigned int dell_3st_pin_configs[14] = { 2165static unsigned int dell_3st_pin_configs[14] = {
2158 0x02211230, 0x02a11220, 0x01a19040, 0x01114210, 2166 0x02211230, 0x02a11220, 0x01a19040, 0x01114210,
2159 0x01111212, 0x01116211, 0x01813050, 0x01112214, 2167 0x01111212, 0x01116211, 0x01813050, 0x01112214,
@@ -2166,6 +2174,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
2166 [STAC_D965_REF] = ref927x_pin_configs, 2174 [STAC_D965_REF] = ref927x_pin_configs,
2167 [STAC_D965_3ST] = d965_3st_pin_configs, 2175 [STAC_D965_3ST] = d965_3st_pin_configs,
2168 [STAC_D965_5ST] = d965_5st_pin_configs, 2176 [STAC_D965_5ST] = d965_5st_pin_configs,
2177 [STAC_D965_5ST_NO_FP] = d965_5st_no_fp_pin_configs,
2169 [STAC_DELL_3ST] = dell_3st_pin_configs, 2178 [STAC_DELL_3ST] = dell_3st_pin_configs,
2170 [STAC_DELL_BIOS] = NULL, 2179 [STAC_DELL_BIOS] = NULL,
2171}; 2180};
@@ -2176,6 +2185,7 @@ static const char *stac927x_models[STAC_927X_MODELS] = {
2176 [STAC_D965_REF] = "ref", 2185 [STAC_D965_REF] = "ref",
2177 [STAC_D965_3ST] = "3stack", 2186 [STAC_D965_3ST] = "3stack",
2178 [STAC_D965_5ST] = "5stack", 2187 [STAC_D965_5ST] = "5stack",
2188 [STAC_D965_5ST_NO_FP] = "5stack-no-fp",
2179 [STAC_DELL_3ST] = "dell-3stack", 2189 [STAC_DELL_3ST] = "dell-3stack",
2180 [STAC_DELL_BIOS] = "dell-bios", 2190 [STAC_DELL_BIOS] = "dell-bios",
2181}; 2191};
@@ -4079,7 +4089,12 @@ static int stac92xx_init(struct hda_codec *codec)
4079 pinctl = snd_hda_codec_read(codec, nid, 0, 4089 pinctl = snd_hda_codec_read(codec, nid, 0,
4080 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 4090 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
4081 /* if PINCTL already set then skip */ 4091 /* if PINCTL already set then skip */
4082 if (!(pinctl & AC_PINCTL_IN_EN)) { 4092 /* Also, if both INPUT and OUTPUT are set,
4093 * it must be a BIOS bug; need to override, too
4094 */
4095 if (!(pinctl & AC_PINCTL_IN_EN) ||
4096 (pinctl & AC_PINCTL_OUT_EN)) {
4097 pinctl &= ~AC_PINCTL_OUT_EN;
4083 pinctl |= AC_PINCTL_IN_EN; 4098 pinctl |= AC_PINCTL_IN_EN;
4084 stac92xx_auto_set_pinctl(codec, nid, 4099 stac92xx_auto_set_pinctl(codec, nid,
4085 pinctl); 4100 pinctl);
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 6f1034417a0..e51a5ef1954 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -889,7 +889,7 @@ static int sendcmd(struct cmdif *cif, u32 flags, u32 cmd, u32 parm,
889 spin_lock_irqsave(&cif->lock, irqflags); 889 spin_lock_irqsave(&cif->lock, irqflags);
890 while (i++ < CMDIF_TIMEOUT && !IS_READY(cif->hwport)) 890 while (i++ < CMDIF_TIMEOUT && !IS_READY(cif->hwport))
891 udelay(10); 891 udelay(10);
892 if (i >= CMDIF_TIMEOUT) { 892 if (i > CMDIF_TIMEOUT) {
893 err = -EBUSY; 893 err = -EBUSY;
894 goto errout; 894 goto errout;
895 } 895 }
@@ -907,8 +907,10 @@ static int sendcmd(struct cmdif *cif, u32 flags, u32 cmd, u32 parm,
907 WRITE_PORT_ULONG(cmdport->data1, cmd); /* write cmd */ 907 WRITE_PORT_ULONG(cmdport->data1, cmd); /* write cmd */
908 if ((flags & RESP) && ret) { 908 if ((flags & RESP) && ret) {
909 while (!IS_DATF(cmdport) && 909 while (!IS_DATF(cmdport) &&
910 time++ < CMDIF_TIMEOUT) 910 time < CMDIF_TIMEOUT) {
911 udelay(10); 911 udelay(10);
912 time++;
913 }
912 if (time < CMDIF_TIMEOUT) { /* read response */ 914 if (time < CMDIF_TIMEOUT) { /* read response */
913 ret->retlongs[0] = 915 ret->retlongs[0] =
914 READ_PORT_ULONG(cmdport->data1); 916 READ_PORT_ULONG(cmdport->data1);
@@ -1454,7 +1456,7 @@ static int snd_riptide_trigger(struct snd_pcm_substream *substream, int cmd)
1454 SEND_GPOS(cif, 0, data->id, &rptr); 1456 SEND_GPOS(cif, 0, data->id, &rptr);
1455 udelay(1); 1457 udelay(1);
1456 } while (i != rptr.retlongs[1] && j++ < MAX_WRITE_RETRY); 1458 } while (i != rptr.retlongs[1] && j++ < MAX_WRITE_RETRY);
1457 if (j >= MAX_WRITE_RETRY) 1459 if (j > MAX_WRITE_RETRY)
1458 snd_printk(KERN_ERR "Riptide: Could not stop stream!"); 1460 snd_printk(KERN_ERR "Riptide: Could not stop stream!");
1459 break; 1461 break;
1460 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 1462 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
@@ -1783,7 +1785,7 @@ snd_riptide_codec_write(struct snd_ac97 *ac97, unsigned short reg,
1783 SEND_SACR(cif, val, reg); 1785 SEND_SACR(cif, val, reg);
1784 SEND_RACR(cif, reg, &rptr); 1786 SEND_RACR(cif, reg, &rptr);
1785 } while (rptr.retwords[1] != val && i++ < MAX_WRITE_RETRY); 1787 } while (rptr.retwords[1] != val && i++ < MAX_WRITE_RETRY);
1786 if (i == MAX_WRITE_RETRY) 1788 if (i > MAX_WRITE_RETRY)
1787 snd_printdd("Write AC97 reg failed\n"); 1789 snd_printdd("Write AC97 reg failed\n");
1788} 1790}
1789 1791
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 809b233dd4a..1ef58c51c21 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -1687,7 +1687,7 @@ static int snd_via8233_pcmdxs_volume_put(struct snd_kcontrol *kcontrol,
1687 return change; 1687 return change;
1688} 1688}
1689 1689
1690static const DECLARE_TLV_DB_SCALE(db_scale_dxs, -9450, 150, 1); 1690static const DECLARE_TLV_DB_SCALE(db_scale_dxs, -4650, 150, 1);
1691 1691
1692static struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control __devinitdata = { 1692static struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control __devinitdata = {
1693 .name = "PCM Playback Volume", 1693 .name = "PCM Playback Volume",
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index c518c3e5aa3..40cd274eb1e 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -729,7 +729,7 @@ SND_SOC_DAPM_MIXER_E("INMIXL", WM8990_INTDRIVBITS, WM8990_INMIXL_PWR_BIT, 0,
729 inmixer_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 729 inmixer_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
730 730
731/* AINLMUX */ 731/* AINLMUX */
732SND_SOC_DAPM_MUX_E("AILNMUX", WM8990_INTDRIVBITS, WM8990_AINLMUX_PWR_BIT, 0, 732SND_SOC_DAPM_MUX_E("AINLMUX", WM8990_INTDRIVBITS, WM8990_AINLMUX_PWR_BIT, 0,
733 &wm8990_dapm_ainlmux_controls, inmixer_event, 733 &wm8990_dapm_ainlmux_controls, inmixer_event,
734 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 734 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
735 735
@@ -740,7 +740,7 @@ SND_SOC_DAPM_MIXER_E("INMIXR", WM8990_INTDRIVBITS, WM8990_INMIXR_PWR_BIT, 0,
740 inmixer_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 740 inmixer_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
741 741
742/* AINRMUX */ 742/* AINRMUX */
743SND_SOC_DAPM_MUX_E("AIRNMUX", WM8990_INTDRIVBITS, WM8990_AINRMUX_PWR_BIT, 0, 743SND_SOC_DAPM_MUX_E("AINRMUX", WM8990_INTDRIVBITS, WM8990_AINRMUX_PWR_BIT, 0,
744 &wm8990_dapm_ainrmux_controls, inmixer_event, 744 &wm8990_dapm_ainrmux_controls, inmixer_event,
745 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 745 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
746 746
@@ -848,40 +848,40 @@ static const struct snd_soc_dapm_route audio_map[] = {
848 {"LIN12 PGA", "LIN2 Switch", "LIN2"}, 848 {"LIN12 PGA", "LIN2 Switch", "LIN2"},
849 /* LIN34 PGA */ 849 /* LIN34 PGA */
850 {"LIN34 PGA", "LIN3 Switch", "LIN3"}, 850 {"LIN34 PGA", "LIN3 Switch", "LIN3"},
851 {"LIN34 PGA", "LIN4 Switch", "LIN4"}, 851 {"LIN34 PGA", "LIN4 Switch", "LIN4/RXN"},
852 /* INMIXL */ 852 /* INMIXL */
853 {"INMIXL", "Record Left Volume", "LOMIX"}, 853 {"INMIXL", "Record Left Volume", "LOMIX"},
854 {"INMIXL", "LIN2 Volume", "LIN2"}, 854 {"INMIXL", "LIN2 Volume", "LIN2"},
855 {"INMIXL", "LINPGA12 Switch", "LIN12 PGA"}, 855 {"INMIXL", "LINPGA12 Switch", "LIN12 PGA"},
856 {"INMIXL", "LINPGA34 Switch", "LIN34 PGA"}, 856 {"INMIXL", "LINPGA34 Switch", "LIN34 PGA"},
857 /* AILNMUX */ 857 /* AINLMUX */
858 {"AILNMUX", "INMIXL Mix", "INMIXL"}, 858 {"AINLMUX", "INMIXL Mix", "INMIXL"},
859 {"AILNMUX", "DIFFINL Mix", "LIN12PGA"}, 859 {"AINLMUX", "DIFFINL Mix", "LIN12 PGA"},
860 {"AILNMUX", "DIFFINL Mix", "LIN34PGA"}, 860 {"AINLMUX", "DIFFINL Mix", "LIN34 PGA"},
861 {"AILNMUX", "RXVOICE Mix", "LIN4/RXN"}, 861 {"AINLMUX", "RXVOICE Mix", "LIN4/RXN"},
862 {"AILNMUX", "RXVOICE Mix", "RIN4/RXP"}, 862 {"AINLMUX", "RXVOICE Mix", "RIN4/RXP"},
863 /* ADC */ 863 /* ADC */
864 {"Left ADC", NULL, "AILNMUX"}, 864 {"Left ADC", NULL, "AINLMUX"},
865 865
866 /* RIN12 PGA */ 866 /* RIN12 PGA */
867 {"RIN12 PGA", "RIN1 Switch", "RIN1"}, 867 {"RIN12 PGA", "RIN1 Switch", "RIN1"},
868 {"RIN12 PGA", "RIN2 Switch", "RIN2"}, 868 {"RIN12 PGA", "RIN2 Switch", "RIN2"},
869 /* RIN34 PGA */ 869 /* RIN34 PGA */
870 {"RIN34 PGA", "RIN3 Switch", "RIN3"}, 870 {"RIN34 PGA", "RIN3 Switch", "RIN3"},
871 {"RIN34 PGA", "RIN4 Switch", "RIN4"}, 871 {"RIN34 PGA", "RIN4 Switch", "RIN4/RXP"},
872 /* INMIXL */ 872 /* INMIXL */
873 {"INMIXR", "Record Right Volume", "ROMIX"}, 873 {"INMIXR", "Record Right Volume", "ROMIX"},
874 {"INMIXR", "RIN2 Volume", "RIN2"}, 874 {"INMIXR", "RIN2 Volume", "RIN2"},
875 {"INMIXR", "RINPGA12 Switch", "RIN12 PGA"}, 875 {"INMIXR", "RINPGA12 Switch", "RIN12 PGA"},
876 {"INMIXR", "RINPGA34 Switch", "RIN34 PGA"}, 876 {"INMIXR", "RINPGA34 Switch", "RIN34 PGA"},
877 /* AIRNMUX */ 877 /* AINRMUX */
878 {"AIRNMUX", "INMIXR Mix", "INMIXR"}, 878 {"AINRMUX", "INMIXR Mix", "INMIXR"},
879 {"AIRNMUX", "DIFFINR Mix", "RIN12PGA"}, 879 {"AINRMUX", "DIFFINR Mix", "RIN12 PGA"},
880 {"AIRNMUX", "DIFFINR Mix", "RIN34PGA"}, 880 {"AINRMUX", "DIFFINR Mix", "RIN34 PGA"},
881 {"AIRNMUX", "RXVOICE Mix", "RIN4/RXN"}, 881 {"AINRMUX", "RXVOICE Mix", "LIN4/RXN"},
882 {"AIRNMUX", "RXVOICE Mix", "RIN4/RXP"}, 882 {"AINRMUX", "RXVOICE Mix", "RIN4/RXP"},
883 /* ADC */ 883 /* ADC */
884 {"Right ADC", NULL, "AIRNMUX"}, 884 {"Right ADC", NULL, "AINRMUX"},
885 885
886 /* LOMIX */ 886 /* LOMIX */
887 {"LOMIX", "LOMIX RIN3 Bypass Switch", "RIN3"}, 887 {"LOMIX", "LOMIX RIN3 Bypass Switch", "RIN3"},
@@ -922,7 +922,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
922 {"LOPMIX", "LOPMIX Left Mixer PGA Switch", "LOPGA"}, 922 {"LOPMIX", "LOPMIX Left Mixer PGA Switch", "LOPGA"},
923 923
924 /* OUT3MIX */ 924 /* OUT3MIX */
925 {"OUT3MIX", "OUT3MIX LIN4/RXP Bypass Switch", "LIN4/RXP"}, 925 {"OUT3MIX", "OUT3MIX LIN4/RXP Bypass Switch", "LIN4/RXN"},
926 {"OUT3MIX", "OUT3MIX Left Out PGA Switch", "LOPGA"}, 926 {"OUT3MIX", "OUT3MIX Left Out PGA Switch", "LOPGA"},
927 927
928 /* OUT4MIX */ 928 /* OUT4MIX */
@@ -949,7 +949,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
949 /* Output Pins */ 949 /* Output Pins */
950 {"LON", NULL, "LONMIX"}, 950 {"LON", NULL, "LONMIX"},
951 {"LOP", NULL, "LOPMIX"}, 951 {"LOP", NULL, "LOPMIX"},
952 {"OUT", NULL, "OUT3MIX"}, 952 {"OUT3", NULL, "OUT3MIX"},
953 {"LOUT", NULL, "LOUT PGA"}, 953 {"LOUT", NULL, "LOUT PGA"},
954 {"SPKN", NULL, "SPKMIX"}, 954 {"SPKN", NULL, "SPKMIX"},
955 {"ROUT", NULL, "ROUT PGA"}, 955 {"ROUT", NULL, "ROUT PGA"},
diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig
index bd7392c9657..411a710be66 100644
--- a/sound/soc/davinci/Kconfig
+++ b/sound/soc/davinci/Kconfig
@@ -10,13 +10,14 @@ config SND_DAVINCI_SOC_I2S
10 tristate 10 tristate
11 11
12config SND_DAVINCI_SOC_EVM 12config SND_DAVINCI_SOC_EVM
13 tristate "SoC Audio support for DaVinci EVM" 13 tristate "SoC Audio support for DaVinci DM6446 or DM355 EVM"
14 depends on SND_DAVINCI_SOC && MACH_DAVINCI_EVM 14 depends on SND_DAVINCI_SOC
15 depends on MACH_DAVINCI_EVM || MACH_DAVINCI_DM355_EVM
15 select SND_DAVINCI_SOC_I2S 16 select SND_DAVINCI_SOC_I2S
16 select SND_SOC_TLV320AIC3X 17 select SND_SOC_TLV320AIC3X
17 help 18 help
18 Say Y if you want to add support for SoC audio on TI 19 Say Y if you want to add support for SoC audio on TI
19 DaVinci EVM platform. 20 DaVinci DM6446 or DM355 EVM platforms.
20 21
21config SND_DAVINCI_SOC_SFFSDR 22config SND_DAVINCI_SOC_SFFSDR
22 tristate "SoC Audio support for SFFSDR" 23 tristate "SoC Audio support for SFFSDR"
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 9b90b347007..58fd1cbedd8 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -20,7 +20,11 @@
20#include <sound/soc-dapm.h> 20#include <sound/soc-dapm.h>
21 21
22#include <asm/dma.h> 22#include <asm/dma.h>
23#include <mach/hardware.h> 23#include <asm/mach-types.h>
24
25#include <mach/asp.h>
26#include <mach/edma.h>
27#include <mach/mux.h>
24 28
25#include "../codecs/tlv320aic3x.h" 29#include "../codecs/tlv320aic3x.h"
26#include "davinci-pcm.h" 30#include "davinci-pcm.h"
@@ -150,7 +154,7 @@ static struct snd_soc_card snd_soc_card_evm = {
150 154
151/* evm audio private data */ 155/* evm audio private data */
152static struct aic3x_setup_data evm_aic3x_setup = { 156static struct aic3x_setup_data evm_aic3x_setup = {
153 .i2c_bus = 0, 157 .i2c_bus = 1,
154 .i2c_address = 0x1b, 158 .i2c_address = 0x1b,
155}; 159};
156 160
@@ -161,36 +165,73 @@ static struct snd_soc_device evm_snd_devdata = {
161 .codec_data = &evm_aic3x_setup, 165 .codec_data = &evm_aic3x_setup,
162}; 166};
163 167
168/* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */
164static struct resource evm_snd_resources[] = { 169static struct resource evm_snd_resources[] = {
165 { 170 {
166 .start = DAVINCI_MCBSP_BASE, 171 .start = DAVINCI_ASP0_BASE,
167 .end = DAVINCI_MCBSP_BASE + SZ_8K - 1, 172 .end = DAVINCI_ASP0_BASE + SZ_8K - 1,
168 .flags = IORESOURCE_MEM, 173 .flags = IORESOURCE_MEM,
169 }, 174 },
170}; 175};
171 176
172static struct evm_snd_platform_data evm_snd_data = { 177static struct evm_snd_platform_data evm_snd_data = {
173 .tx_dma_ch = DM644X_DMACH_MCBSP_TX, 178 .tx_dma_ch = DAVINCI_DMA_ASP0_TX,
174 .rx_dma_ch = DM644X_DMACH_MCBSP_RX, 179 .rx_dma_ch = DAVINCI_DMA_ASP0_RX,
180};
181
182/* DM335 EVM uses ASP1; line-out is a stereo mini-jack */
183static struct resource dm335evm_snd_resources[] = {
184 {
185 .start = DAVINCI_ASP1_BASE,
186 .end = DAVINCI_ASP1_BASE + SZ_8K - 1,
187 .flags = IORESOURCE_MEM,
188 },
189};
190
191static struct evm_snd_platform_data dm335evm_snd_data = {
192 .tx_dma_ch = DAVINCI_DMA_ASP1_TX,
193 .rx_dma_ch = DAVINCI_DMA_ASP1_RX,
175}; 194};
176 195
177static struct platform_device *evm_snd_device; 196static struct platform_device *evm_snd_device;
178 197
179static int __init evm_init(void) 198static int __init evm_init(void)
180{ 199{
200 struct resource *resources;
201 unsigned num_resources;
202 struct evm_snd_platform_data *data;
203 int index;
181 int ret; 204 int ret;
182 205
183 evm_snd_device = platform_device_alloc("soc-audio", 0); 206 if (machine_is_davinci_evm()) {
207 davinci_cfg_reg(DM644X_MCBSP);
208
209 resources = evm_snd_resources;
210 num_resources = ARRAY_SIZE(evm_snd_resources);
211 data = &evm_snd_data;
212 index = 0;
213 } else if (machine_is_davinci_dm355_evm()) {
214 /* we don't use ASP1 IRQs, or we'd need to mux them ... */
215 davinci_cfg_reg(DM355_EVT8_ASP1_TX);
216 davinci_cfg_reg(DM355_EVT9_ASP1_RX);
217
218 resources = dm335evm_snd_resources;
219 num_resources = ARRAY_SIZE(dm335evm_snd_resources);
220 data = &dm335evm_snd_data;
221 index = 1;
222 } else
223 return -EINVAL;
224
225 evm_snd_device = platform_device_alloc("soc-audio", index);
184 if (!evm_snd_device) 226 if (!evm_snd_device)
185 return -ENOMEM; 227 return -ENOMEM;
186 228
187 platform_set_drvdata(evm_snd_device, &evm_snd_devdata); 229 platform_set_drvdata(evm_snd_device, &evm_snd_devdata);
188 evm_snd_devdata.dev = &evm_snd_device->dev; 230 evm_snd_devdata.dev = &evm_snd_device->dev;
189 platform_device_add_data(evm_snd_device, &evm_snd_data, 231 platform_device_add_data(evm_snd_device, data, sizeof(*data));
190 sizeof(evm_snd_data));
191 232
192 ret = platform_device_add_resources(evm_snd_device, evm_snd_resources, 233 ret = platform_device_add_resources(evm_snd_device, resources,
193 ARRAY_SIZE(evm_snd_resources)); 234 num_resources);
194 if (ret) { 235 if (ret) {
195 platform_device_put(evm_snd_device); 236 platform_device_put(evm_snd_device);
196 return ret; 237 return ret;
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index ffdb9439d3d..b1ea52fc83c 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -24,6 +24,26 @@
24 24
25#include "davinci-pcm.h" 25#include "davinci-pcm.h"
26 26
27
28/*
29 * NOTE: terminology here is confusing.
30 *
31 * - This driver supports the "Audio Serial Port" (ASP),
32 * found on dm6446, dm355, and other DaVinci chips.
33 *
34 * - But it labels it a "Multi-channel Buffered Serial Port"
35 * (McBSP) as on older chips like the dm642 ... which was
36 * backward-compatible, possibly explaining that confusion.
37 *
38 * - OMAP chips have a controller called McBSP, which is
39 * incompatible with the DaVinci flavor of McBSP.
40 *
41 * - Newer DaVinci chips have a controller called McASP,
42 * incompatible with ASP and with either McBSP.
43 *
44 * In short: this uses ASP to implement I2S, not McBSP.
45 * And it won't be the only DaVinci implemention of I2S.
46 */
27#define DAVINCI_MCBSP_DRR_REG 0x00 47#define DAVINCI_MCBSP_DRR_REG 0x00
28#define DAVINCI_MCBSP_DXR_REG 0x04 48#define DAVINCI_MCBSP_DXR_REG 0x04
29#define DAVINCI_MCBSP_SPCR_REG 0x08 49#define DAVINCI_MCBSP_SPCR_REG 0x08
@@ -421,7 +441,7 @@ static int davinci_i2s_probe(struct platform_device *pdev,
421{ 441{
422 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 442 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
423 struct snd_soc_card *card = socdev->card; 443 struct snd_soc_card *card = socdev->card;
424 struct snd_soc_dai *cpu_dai = card->dai_link[pdev->id].cpu_dai; 444 struct snd_soc_dai *cpu_dai = card->dai_link->cpu_dai;
425 struct davinci_mcbsp_dev *dev; 445 struct davinci_mcbsp_dev *dev;
426 struct resource *mem, *ioarea; 446 struct resource *mem, *ioarea;
427 struct evm_snd_platform_data *pdata; 447 struct evm_snd_platform_data *pdata;
@@ -448,7 +468,7 @@ static int davinci_i2s_probe(struct platform_device *pdev,
448 468
449 cpu_dai->private_data = dev; 469 cpu_dai->private_data = dev;
450 470
451 dev->clk = clk_get(&pdev->dev, "McBSPCLK"); 471 dev->clk = clk_get(&pdev->dev, NULL);
452 if (IS_ERR(dev->clk)) { 472 if (IS_ERR(dev->clk)) {
453 ret = -ENODEV; 473 ret = -ENODEV;
454 goto err_free_mem; 474 goto err_free_mem;
@@ -483,7 +503,7 @@ static void davinci_i2s_remove(struct platform_device *pdev,
483{ 503{
484 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 504 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
485 struct snd_soc_card *card = socdev->card; 505 struct snd_soc_card *card = socdev->card;
486 struct snd_soc_dai *cpu_dai = card->dai_link[pdev->id].cpu_dai; 506 struct snd_soc_dai *cpu_dai = card->dai_link->cpu_dai;
487 struct davinci_mcbsp_dev *dev = cpu_dai->private_data; 507 struct davinci_mcbsp_dev *dev = cpu_dai->private_data;
488 struct resource *mem; 508 struct resource *mem;
489 509
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
index 7af3b5b3a53..a0599658848 100644
--- a/sound/soc/davinci/davinci-pcm.c
+++ b/sound/soc/davinci/davinci-pcm.c
@@ -22,6 +22,7 @@
22#include <sound/soc.h> 22#include <sound/soc.h>
23 23
24#include <asm/dma.h> 24#include <asm/dma.h>
25#include <mach/edma.h>
25 26
26#include "davinci-pcm.h" 27#include "davinci-pcm.h"
27 28
@@ -51,7 +52,7 @@ struct davinci_runtime_data {
51 spinlock_t lock; 52 spinlock_t lock;
52 int period; /* current DMA period */ 53 int period; /* current DMA period */
53 int master_lch; /* Master DMA channel */ 54 int master_lch; /* Master DMA channel */
54 int slave_lch; /* Slave DMA channel */ 55 int slave_lch; /* linked parameter RAM reload slot */
55 struct davinci_pcm_dma_params *params; /* DMA params */ 56 struct davinci_pcm_dma_params *params; /* DMA params */
56}; 57};
57 58
@@ -90,18 +91,18 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream)
90 dst_bidx = data_type; 91 dst_bidx = data_type;
91 } 92 }
92 93
93 davinci_set_dma_src_params(lch, src, INCR, W8BIT); 94 edma_set_src(lch, src, INCR, W8BIT);
94 davinci_set_dma_dest_params(lch, dst, INCR, W8BIT); 95 edma_set_dest(lch, dst, INCR, W8BIT);
95 davinci_set_dma_src_index(lch, src_bidx, 0); 96 edma_set_src_index(lch, src_bidx, 0);
96 davinci_set_dma_dest_index(lch, dst_bidx, 0); 97 edma_set_dest_index(lch, dst_bidx, 0);
97 davinci_set_dma_transfer_params(lch, data_type, count, 1, 0, ASYNC); 98 edma_set_transfer_params(lch, data_type, count, 1, 0, ASYNC);
98 99
99 prtd->period++; 100 prtd->period++;
100 if (unlikely(prtd->period >= runtime->periods)) 101 if (unlikely(prtd->period >= runtime->periods))
101 prtd->period = 0; 102 prtd->period = 0;
102} 103}
103 104
104static void davinci_pcm_dma_irq(int lch, u16 ch_status, void *data) 105static void davinci_pcm_dma_irq(unsigned lch, u16 ch_status, void *data)
105{ 106{
106 struct snd_pcm_substream *substream = data; 107 struct snd_pcm_substream *substream = data;
107 struct davinci_runtime_data *prtd = substream->runtime->private_data; 108 struct davinci_runtime_data *prtd = substream->runtime->private_data;
@@ -125,7 +126,7 @@ static int davinci_pcm_dma_request(struct snd_pcm_substream *substream)
125 struct davinci_runtime_data *prtd = substream->runtime->private_data; 126 struct davinci_runtime_data *prtd = substream->runtime->private_data;
126 struct snd_soc_pcm_runtime *rtd = substream->private_data; 127 struct snd_soc_pcm_runtime *rtd = substream->private_data;
127 struct davinci_pcm_dma_params *dma_data = rtd->dai->cpu_dai->dma_data; 128 struct davinci_pcm_dma_params *dma_data = rtd->dai->cpu_dai->dma_data;
128 int tcc = TCC_ANY; 129 struct edmacc_param p_ram;
129 int ret; 130 int ret;
130 131
131 if (!dma_data) 132 if (!dma_data)
@@ -134,22 +135,34 @@ static int davinci_pcm_dma_request(struct snd_pcm_substream *substream)
134 prtd->params = dma_data; 135 prtd->params = dma_data;
135 136
136 /* Request master DMA channel */ 137 /* Request master DMA channel */
137 ret = davinci_request_dma(prtd->params->channel, prtd->params->name, 138 ret = edma_alloc_channel(prtd->params->channel,
138 davinci_pcm_dma_irq, substream, 139 davinci_pcm_dma_irq, substream,
139 &prtd->master_lch, &tcc, EVENTQ_0); 140 EVENTQ_0);
140 if (ret) 141 if (ret < 0)
141 return ret; 142 return ret;
143 prtd->master_lch = ret;
142 144
143 /* Request slave DMA channel */ 145 /* Request parameter RAM reload slot */
144 ret = davinci_request_dma(PARAM_ANY, "Link", 146 ret = edma_alloc_slot(EDMA_SLOT_ANY);
145 NULL, NULL, &prtd->slave_lch, &tcc, EVENTQ_0); 147 if (ret < 0) {
146 if (ret) { 148 edma_free_channel(prtd->master_lch);
147 davinci_free_dma(prtd->master_lch);
148 return ret; 149 return ret;
149 } 150 }
150 151 prtd->slave_lch = ret;
151 /* Link slave DMA channel in loopback */ 152
152 davinci_dma_link_lch(prtd->slave_lch, prtd->slave_lch); 153 /* Issue transfer completion IRQ when the channel completes a
154 * transfer, then always reload from the same slot (by a kind
155 * of loopback link). The completion IRQ handler will update
156 * the reload slot with a new buffer.
157 *
158 * REVISIT save p_ram here after setting up everything except
159 * the buffer and its length (ccnt) ... use it as a template
160 * so davinci_pcm_enqueue_dma() takes less time in IRQ.
161 */
162 edma_read_slot(prtd->slave_lch, &p_ram);
163 p_ram.opt |= TCINTEN | EDMA_TCC(prtd->master_lch);
164 p_ram.link_bcntrld = prtd->slave_lch << 5;
165 edma_write_slot(prtd->slave_lch, &p_ram);
153 166
154 return 0; 167 return 0;
155} 168}
@@ -165,12 +178,12 @@ static int davinci_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
165 case SNDRV_PCM_TRIGGER_START: 178 case SNDRV_PCM_TRIGGER_START:
166 case SNDRV_PCM_TRIGGER_RESUME: 179 case SNDRV_PCM_TRIGGER_RESUME:
167 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 180 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
168 davinci_start_dma(prtd->master_lch); 181 edma_start(prtd->master_lch);
169 break; 182 break;
170 case SNDRV_PCM_TRIGGER_STOP: 183 case SNDRV_PCM_TRIGGER_STOP:
171 case SNDRV_PCM_TRIGGER_SUSPEND: 184 case SNDRV_PCM_TRIGGER_SUSPEND:
172 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 185 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
173 davinci_stop_dma(prtd->master_lch); 186 edma_stop(prtd->master_lch);
174 break; 187 break;
175 default: 188 default:
176 ret = -EINVAL; 189 ret = -EINVAL;
@@ -185,14 +198,14 @@ static int davinci_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
185static int davinci_pcm_prepare(struct snd_pcm_substream *substream) 198static int davinci_pcm_prepare(struct snd_pcm_substream *substream)
186{ 199{
187 struct davinci_runtime_data *prtd = substream->runtime->private_data; 200 struct davinci_runtime_data *prtd = substream->runtime->private_data;
188 struct paramentry_descriptor temp; 201 struct edmacc_param temp;
189 202
190 prtd->period = 0; 203 prtd->period = 0;
191 davinci_pcm_enqueue_dma(substream); 204 davinci_pcm_enqueue_dma(substream);
192 205
193 /* Get slave channel dma params for master channel startup */ 206 /* Copy self-linked parameter RAM entry into master channel */
194 davinci_get_dma_params(prtd->slave_lch, &temp); 207 edma_read_slot(prtd->slave_lch, &temp);
195 davinci_set_dma_params(prtd->master_lch, &temp); 208 edma_write_slot(prtd->master_lch, &temp);
196 209
197 return 0; 210 return 0;
198} 211}
@@ -208,7 +221,7 @@ davinci_pcm_pointer(struct snd_pcm_substream *substream)
208 221
209 spin_lock(&prtd->lock); 222 spin_lock(&prtd->lock);
210 223
211 davinci_dma_getposition(prtd->master_lch, &src, &dst); 224 edma_get_position(prtd->master_lch, &src, &dst);
212 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 225 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
213 count = src - runtime->dma_addr; 226 count = src - runtime->dma_addr;
214 else 227 else
@@ -253,10 +266,10 @@ static int davinci_pcm_close(struct snd_pcm_substream *substream)
253 struct snd_pcm_runtime *runtime = substream->runtime; 266 struct snd_pcm_runtime *runtime = substream->runtime;
254 struct davinci_runtime_data *prtd = runtime->private_data; 267 struct davinci_runtime_data *prtd = runtime->private_data;
255 268
256 davinci_dma_unlink_lch(prtd->slave_lch, prtd->slave_lch); 269 edma_unlink(prtd->slave_lch);
257 270
258 davinci_free_dma(prtd->slave_lch); 271 edma_free_slot(prtd->slave_lch);
259 davinci_free_dma(prtd->master_lch); 272 edma_free_channel(prtd->master_lch);
260 273
261 kfree(prtd); 274 kfree(prtd);
262 275
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 99712f652d0..1cd149b9ce6 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -954,6 +954,9 @@ static int soc_remove(struct platform_device *pdev)
954 struct snd_soc_platform *platform = card->platform; 954 struct snd_soc_platform *platform = card->platform;
955 struct snd_soc_codec_device *codec_dev = socdev->codec_dev; 955 struct snd_soc_codec_device *codec_dev = socdev->codec_dev;
956 956
957 if (!card->instantiated)
958 return 0;
959
957 run_delayed_work(&card->delayed_work); 960 run_delayed_work(&card->delayed_work);
958 961
959 if (platform->remove) 962 if (platform->remove)
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 823296d7d57..a6b88482637 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3347,7 +3347,7 @@ static int snd_usb_create_quirk(struct snd_usb_audio *chip,
3347 [QUIRK_MIDI_YAMAHA] = snd_usb_create_midi_interface, 3347 [QUIRK_MIDI_YAMAHA] = snd_usb_create_midi_interface,
3348 [QUIRK_MIDI_MIDIMAN] = snd_usb_create_midi_interface, 3348 [QUIRK_MIDI_MIDIMAN] = snd_usb_create_midi_interface,
3349 [QUIRK_MIDI_NOVATION] = snd_usb_create_midi_interface, 3349 [QUIRK_MIDI_NOVATION] = snd_usb_create_midi_interface,
3350 [QUIRK_MIDI_RAW] = snd_usb_create_midi_interface, 3350 [QUIRK_MIDI_FASTLANE] = snd_usb_create_midi_interface,
3351 [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface, 3351 [QUIRK_MIDI_EMAGIC] = snd_usb_create_midi_interface,
3352 [QUIRK_MIDI_CME] = snd_usb_create_midi_interface, 3352 [QUIRK_MIDI_CME] = snd_usb_create_midi_interface,
3353 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk, 3353 [QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 36e4f7a29ad..8e7f78941ba 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -153,7 +153,7 @@ enum quirk_type {
153 QUIRK_MIDI_YAMAHA, 153 QUIRK_MIDI_YAMAHA,
154 QUIRK_MIDI_MIDIMAN, 154 QUIRK_MIDI_MIDIMAN,
155 QUIRK_MIDI_NOVATION, 155 QUIRK_MIDI_NOVATION,
156 QUIRK_MIDI_RAW, 156 QUIRK_MIDI_FASTLANE,
157 QUIRK_MIDI_EMAGIC, 157 QUIRK_MIDI_EMAGIC,
158 QUIRK_MIDI_CME, 158 QUIRK_MIDI_CME,
159 QUIRK_MIDI_US122L, 159 QUIRK_MIDI_US122L,
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index 26bad373fe6..2fb35cc22a3 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -1778,8 +1778,18 @@ int snd_usb_create_midi_interface(struct snd_usb_audio* chip,
1778 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops; 1778 umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
1779 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 1779 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
1780 break; 1780 break;
1781 case QUIRK_MIDI_RAW: 1781 case QUIRK_MIDI_FASTLANE:
1782 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops; 1782 umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
1783 /*
1784 * Interface 1 contains isochronous endpoints, but with the same
1785 * numbers as in interface 0. Since it is interface 1 that the
1786 * USB core has most recently seen, these descriptors are now
1787 * associated with the endpoint numbers. This will foul up our
1788 * attempts to submit bulk/interrupt URBs to the endpoints in
1789 * interface 0, so we have to make sure that the USB core looks
1790 * again at interface 0 by calling usb_set_interface() on it.
1791 */
1792 usb_set_interface(umidi->chip->dev, 0, 0);
1783 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints); 1793 err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
1784 break; 1794 break;
1785 case QUIRK_MIDI_EMAGIC: 1795 case QUIRK_MIDI_EMAGIC:
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
index 647ef502965..5d955aaad85 100644
--- a/sound/usb/usbquirks.h
+++ b/sound/usb/usbquirks.h
@@ -1868,7 +1868,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1868 .data = & (const struct snd_usb_audio_quirk[]) { 1868 .data = & (const struct snd_usb_audio_quirk[]) {
1869 { 1869 {
1870 .ifnum = 0, 1870 .ifnum = 0,
1871 .type = QUIRK_MIDI_RAW 1871 .type = QUIRK_MIDI_FASTLANE
1872 }, 1872 },
1873 { 1873 {
1874 .ifnum = 1, 1874 .ifnum = 1,