aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-11-03 10:51:26 -0400
committerTakashi Iwai <tiwai@suse.de>2010-11-03 10:51:26 -0400
commit69dbdd819599e2f3b77c172e83af512845bca5ad (patch)
tree49939d8b80ec2115a801eae2aebc21f23867c876 /sound
parent87232dd49aeb6b7d1af291edca8bd129a82ef4b5 (diff)
parent75e3f3137cb570661c2ad3035a139dda671fbb63 (diff)
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'sound')
-rw-r--r--sound/core/init.c11
-rw-r--r--sound/core/seq/oss/seq_oss.c1
-rw-r--r--sound/core/sound.c3
-rw-r--r--sound/oss/ac97_codec.c7
-rw-r--r--sound/oss/msnd_pinnacle.c1
-rw-r--r--sound/pci/ens1370.c2
-rw-r--r--sound/pci/intel8x0.c2
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c16
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.h1
-rw-r--r--sound/pcmcia/vx/vxpocket.c15
-rw-r--r--sound/pcmcia/vx/vxpocket.h1
-rw-r--r--sound/sh/aica.c2
-rw-r--r--sound/soc/codecs/Kconfig3
-rw-r--r--sound/soc/codecs/tlv320dac33.c36
-rw-r--r--sound/soc/codecs/tpa6130a2.c6
-rw-r--r--sound/soc/codecs/wm8900.c6
-rw-r--r--sound/soc/codecs/wm_hubs.c2
-rw-r--r--sound/soc/omap/omap-mcbsp.c119
-rw-r--r--sound/soc/omap/omap-mcpdm.c1
-rw-r--r--sound/soc/pxa/tosa.c2
-rw-r--r--sound/soc/sh/sh7760-ac97.c4
-rw-r--r--sound/soc/sh/siu_pcm.c2
-rw-r--r--sound/soc/soc-core.c6
-rw-r--r--sound/soc/soc-dapm.c1
-rw-r--r--sound/sound_core.c1
25 files changed, 98 insertions, 153 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index 2de45fbd70fb..57b792e2439a 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -395,12 +395,10 @@ int snd_card_disconnect(struct snd_card *card)
395 snd_printk(KERN_ERR "not all devices for card %i can be disconnected\n", card->number); 395 snd_printk(KERN_ERR "not all devices for card %i can be disconnected\n", card->number);
396 396
397 snd_info_card_disconnect(card); 397 snd_info_card_disconnect(card);
398#ifndef CONFIG_SYSFS_DEPRECATED
399 if (card->card_dev) { 398 if (card->card_dev) {
400 device_unregister(card->card_dev); 399 device_unregister(card->card_dev);
401 card->card_dev = NULL; 400 card->card_dev = NULL;
402 } 401 }
403#endif
404#ifdef CONFIG_PM 402#ifdef CONFIG_PM
405 wake_up(&card->power_sleep); 403 wake_up(&card->power_sleep);
406#endif 404#endif
@@ -573,7 +571,6 @@ void snd_card_set_id(struct snd_card *card, const char *nid)
573} 571}
574EXPORT_SYMBOL(snd_card_set_id); 572EXPORT_SYMBOL(snd_card_set_id);
575 573
576#ifndef CONFIG_SYSFS_DEPRECATED
577static ssize_t 574static ssize_t
578card_id_show_attr(struct device *dev, 575card_id_show_attr(struct device *dev,
579 struct device_attribute *attr, char *buf) 576 struct device_attribute *attr, char *buf)
@@ -635,7 +632,6 @@ card_number_show_attr(struct device *dev,
635 632
636static struct device_attribute card_number_attrs = 633static struct device_attribute card_number_attrs =
637 __ATTR(number, S_IRUGO, card_number_show_attr, NULL); 634 __ATTR(number, S_IRUGO, card_number_show_attr, NULL);
638#endif /* CONFIG_SYSFS_DEPRECATED */
639 635
640/** 636/**
641 * snd_card_register - register the soundcard 637 * snd_card_register - register the soundcard
@@ -654,7 +650,7 @@ int snd_card_register(struct snd_card *card)
654 650
655 if (snd_BUG_ON(!card)) 651 if (snd_BUG_ON(!card))
656 return -EINVAL; 652 return -EINVAL;
657#ifndef CONFIG_SYSFS_DEPRECATED 653
658 if (!card->card_dev) { 654 if (!card->card_dev) {
659 card->card_dev = device_create(sound_class, card->dev, 655 card->card_dev = device_create(sound_class, card->dev,
660 MKDEV(0, 0), card, 656 MKDEV(0, 0), card,
@@ -662,7 +658,7 @@ int snd_card_register(struct snd_card *card)
662 if (IS_ERR(card->card_dev)) 658 if (IS_ERR(card->card_dev))
663 card->card_dev = NULL; 659 card->card_dev = NULL;
664 } 660 }
665#endif 661
666 if ((err = snd_device_register_all(card)) < 0) 662 if ((err = snd_device_register_all(card)) < 0)
667 return err; 663 return err;
668 mutex_lock(&snd_card_mutex); 664 mutex_lock(&snd_card_mutex);
@@ -679,7 +675,6 @@ int snd_card_register(struct snd_card *card)
679 if (snd_mixer_oss_notify_callback) 675 if (snd_mixer_oss_notify_callback)
680 snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER); 676 snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER);
681#endif 677#endif
682#ifndef CONFIG_SYSFS_DEPRECATED
683 if (card->card_dev) { 678 if (card->card_dev) {
684 err = device_create_file(card->card_dev, &card_id_attrs); 679 err = device_create_file(card->card_dev, &card_id_attrs);
685 if (err < 0) 680 if (err < 0)
@@ -688,7 +683,7 @@ int snd_card_register(struct snd_card *card)
688 if (err < 0) 683 if (err < 0)
689 return err; 684 return err;
690 } 685 }
691#endif 686
692 return 0; 687 return 0;
693} 688}
694 689
diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c
index f25e3cc7ddfa..a1f1a2f00ccb 100644
--- a/sound/core/seq/oss/seq_oss.c
+++ b/sound/core/seq/oss/seq_oss.c
@@ -220,6 +220,7 @@ static const struct file_operations seq_oss_f_ops =
220 .poll = odev_poll, 220 .poll = odev_poll,
221 .unlocked_ioctl = odev_ioctl, 221 .unlocked_ioctl = odev_ioctl,
222 .compat_ioctl = odev_ioctl_compat, 222 .compat_ioctl = odev_ioctl_compat,
223 .llseek = noop_llseek,
223}; 224};
224 225
225static int __init 226static int __init
diff --git a/sound/core/sound.c b/sound/core/sound.c
index ac42af42b787..62a093efb453 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -184,7 +184,8 @@ static int snd_open(struct inode *inode, struct file *file)
184static const struct file_operations snd_fops = 184static const struct file_operations snd_fops =
185{ 185{
186 .owner = THIS_MODULE, 186 .owner = THIS_MODULE,
187 .open = snd_open 187 .open = snd_open,
188 .llseek = noop_llseek,
188}; 189};
189 190
190#ifdef CONFIG_SND_DYNAMIC_MINORS 191#ifdef CONFIG_SND_DYNAMIC_MINORS
diff --git a/sound/oss/ac97_codec.c b/sound/oss/ac97_codec.c
index 456a1b4d7832..854c303264dc 100644
--- a/sound/oss/ac97_codec.c
+++ b/sound/oss/ac97_codec.c
@@ -21,11 +21,8 @@
21 * 21 *
22 ************************************************************************** 22 **************************************************************************
23 * 23 *
24 * The Intel Audio Codec '97 specification is available at the Intel 24 * The Intel Audio Codec '97 specification is available at:
25 * audio homepage: http://developer.intel.com/ial/scalableplatforms/audio/ 25 * http://download.intel.com/support/motherboards/desktop/sb/ac97_r23.pdf
26 *
27 * The specification itself is currently available at:
28 * ftp://download.intel.com/ial/scalableplatforms/ac97r22.pdf
29 * 26 *
30 ************************************************************************** 27 **************************************************************************
31 * 28 *
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index b4c1eb504c22..7b5c77b32a90 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -1118,6 +1118,7 @@ static const struct file_operations dev_fileops = {
1118 .unlocked_ioctl = dev_ioctl, 1118 .unlocked_ioctl = dev_ioctl,
1119 .open = dev_open, 1119 .open = dev_open,
1120 .release = dev_release, 1120 .release = dev_release,
1121 .llseek = noop_llseek,
1121}; 1122};
1122 1123
1123static int reset_dsp(void) 1124static int reset_dsp(void)
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index c7fba5379813..537cfba829a5 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -22,7 +22,7 @@
22/* Power-Management-Code ( CONFIG_PM ) 22/* Power-Management-Code ( CONFIG_PM )
23 * for ens1371 only ( FIXME ) 23 * for ens1371 only ( FIXME )
24 * derived from cs4281.c, atiixp.c and via82xx.c 24 * derived from cs4281.c, atiixp.c and via82xx.c
25 * using http://www.alsa-project.org/~iwai/writing-an-alsa-driver/c1540.htm 25 * using http://www.alsa-project.org/~tiwai/writing-an-alsa-driver/
26 * by Kurt J. Bosch 26 * by Kurt J. Bosch
27 */ 27 */
28 28
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 467749249576..400f9ebd243e 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -716,7 +716,7 @@ static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ich
716 * Intel 82443MX running a 100MHz processor system bus has a hardware bug, 716 * Intel 82443MX running a 100MHz processor system bus has a hardware bug,
717 * which aborts PCI busmaster for audio transfer. A workaround is to set 717 * which aborts PCI busmaster for audio transfer. A workaround is to set
718 * the pages as non-cached. For details, see the errata in 718 * the pages as non-cached. For details, see the errata in
719 * http://www.intel.com/design/chipsets/specupdt/245051.htm 719 * http://download.intel.com/design/chipsets/specupdt/24505108.pdf
720 */ 720 */
721static void fill_nocache(void *buf, int size, int nocache) 721static void fill_nocache(void *buf, int size, int nocache)
722{ 722{
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index 7ab9174a8a84..8cc4733698a0 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -142,10 +142,9 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
142 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; 142 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
143 link->resource[0]->end = 16; 143 link->resource[0]->end = 16;
144 144
145 link->conf.Attributes = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; 145 link->config_flags = CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
146 link->conf.IntType = INT_MEMORY_AND_IO; 146 link->config_index = 1;
147 link->conf.ConfigIndex = 1; 147 link->config_regs = PRESENT_OPTION;
148 link->conf.Present = PRESENT_OPTION;
149 148
150 return pdacf_config(link); 149 return pdacf_config(link);
151} 150}
@@ -217,7 +216,8 @@ static int pdacf_config(struct pcmcia_device *link)
217 int ret; 216 int ret;
218 217
219 snd_printdd(KERN_DEBUG "pdacf_config called\n"); 218 snd_printdd(KERN_DEBUG "pdacf_config called\n");
220 link->conf.ConfigIndex = 0x5; 219 link->config_index = 0x5;
220 link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
221 221
222 ret = pcmcia_request_io(link); 222 ret = pcmcia_request_io(link);
223 if (ret) 223 if (ret)
@@ -227,7 +227,7 @@ static int pdacf_config(struct pcmcia_device *link)
227 if (ret) 227 if (ret)
228 goto failed; 228 goto failed;
229 229
230 ret = pcmcia_request_configuration(link, &link->conf); 230 ret = pcmcia_enable_device(link);
231 if (ret) 231 if (ret)
232 goto failed; 232 goto failed;
233 233
@@ -287,9 +287,7 @@ MODULE_DEVICE_TABLE(pcmcia, snd_pdacf_ids);
287 287
288static struct pcmcia_driver pdacf_cs_driver = { 288static struct pcmcia_driver pdacf_cs_driver = {
289 .owner = THIS_MODULE, 289 .owner = THIS_MODULE,
290 .drv = { 290 .name = "snd-pdaudiocf",
291 .name = "snd-pdaudiocf",
292 },
293 .probe = snd_pdacf_probe, 291 .probe = snd_pdacf_probe,
294 .remove = snd_pdacf_detach, 292 .remove = snd_pdacf_detach,
295 .id_table = snd_pdacf_ids, 293 .id_table = snd_pdacf_ids,
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h
index 5cc3e4573074..bd26e092aead 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.h
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h
@@ -24,7 +24,6 @@
24#include <sound/pcm.h> 24#include <sound/pcm.h>
25#include <asm/io.h> 25#include <asm/io.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <pcmcia/cs.h>
28#include <pcmcia/cistpl.h> 27#include <pcmcia/cistpl.h>
29#include <pcmcia/ds.h> 28#include <pcmcia/ds.h>
30 29
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index a6edfc3be29a..80000d631f88 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -2,7 +2,7 @@
2 * Driver for Digigram VXpocket V2/440 soundcards 2 * Driver for Digigram VXpocket V2/440 soundcards
3 * 3 *
4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de> 4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
5 * 5
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
@@ -162,10 +162,9 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl,
162 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; 162 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
163 link->resource[0]->end = 16; 163 link->resource[0]->end = 16;
164 164
165 link->conf.Attributes = CONF_ENABLE_IRQ; 165 link->config_flags |= CONF_ENABLE_IRQ;
166 link->conf.IntType = INT_MEMORY_AND_IO; 166 link->config_index = 1;
167 link->conf.ConfigIndex = 1; 167 link->config_regs = PRESENT_OPTION;
168 link->conf.Present = PRESENT_OPTION;
169 168
170 *chip_ret = vxp; 169 *chip_ret = vxp;
171 return 0; 170 return 0;
@@ -234,7 +233,7 @@ static int vxpocket_config(struct pcmcia_device *link)
234 if (ret) 233 if (ret)
235 goto failed; 234 goto failed;
236 235
237 ret = pcmcia_request_configuration(link, &link->conf); 236 ret = pcmcia_enable_device(link);
238 if (ret) 237 if (ret)
239 goto failed; 238 goto failed;
240 239
@@ -359,9 +358,7 @@ MODULE_DEVICE_TABLE(pcmcia, vxp_ids);
359 358
360static struct pcmcia_driver vxp_cs_driver = { 359static struct pcmcia_driver vxp_cs_driver = {
361 .owner = THIS_MODULE, 360 .owner = THIS_MODULE,
362 .drv = { 361 .name = "snd-vxpocket",
363 .name = "snd-vxpocket",
364 },
365 .probe = vxpocket_probe, 362 .probe = vxpocket_probe,
366 .remove = vxpocket_detach, 363 .remove = vxpocket_detach,
367 .id_table = vxp_ids, 364 .id_table = vxp_ids,
diff --git a/sound/pcmcia/vx/vxpocket.h b/sound/pcmcia/vx/vxpocket.h
index d9110669d042..13d658c1a216 100644
--- a/sound/pcmcia/vx/vxpocket.h
+++ b/sound/pcmcia/vx/vxpocket.h
@@ -23,7 +23,6 @@
23 23
24#include <sound/vx_core.h> 24#include <sound/vx_core.h>
25 25
26#include <pcmcia/cs.h>
27#include <pcmcia/cistpl.h> 26#include <pcmcia/cistpl.h>
28#include <pcmcia/ds.h> 27#include <pcmcia/ds.h>
29 28
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index a0df401ebb9f..94c6ea7fa7c2 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -188,7 +188,7 @@ static void spu_reset(void)
188 spu_memset(0, 0, 0x200000 / 4); 188 spu_memset(0, 0, 0x200000 / 4);
189 /* Put ARM7 in endless loop */ 189 /* Put ARM7 in endless loop */
190 local_irq_save(flags); 190 local_irq_save(flags);
191 ctrl_outl(0xea000002, SPU_MEMORY_BASE); 191 __raw_writel(0xea000002, SPU_MEMORY_BASE);
192 local_irq_restore(flags); 192 local_irq_restore(flags);
193 spu_enable(); 193 spu_enable();
194} 194}
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 94a9d06b9027..3b5690d28b8b 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -25,8 +25,9 @@ config SND_SOC_ALL_CODECS
25 select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC 25 select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC
26 select SND_SOC_CS42L51 if I2C 26 select SND_SOC_CS42L51 if I2C
27 select SND_SOC_CS4270 if I2C 27 select SND_SOC_CS4270 if I2C
28 select SND_SOC_CX20442
28 select SND_SOC_DA7210 if I2C 29 select SND_SOC_DA7210 if I2C
29 select SND_SOC_JZ4740 if SOC_JZ4740 30 select SND_SOC_JZ4740_CODEC if SOC_JZ4740
30 select SND_SOC_MAX98088 if I2C 31 select SND_SOC_MAX98088 if I2C
31 select SND_SOC_MAX9877 if I2C 32 select SND_SOC_MAX9877 if I2C
32 select SND_SOC_PCM3008 33 select SND_SOC_PCM3008
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index d251ff54a2d3..c5ab8c805771 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -58,7 +58,7 @@
58 (1000000000 / ((rate * 1000) / samples)) 58 (1000000000 / ((rate * 1000) / samples))
59 59
60#define US_TO_SAMPLES(rate, us) \ 60#define US_TO_SAMPLES(rate, us) \
61 (rate / (1000000 / us)) 61 (rate / (1000000 / (us < 1000000 ? us : 1000000)))
62 62
63#define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \ 63#define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \
64 ((samples * 5000) / ((burstrate * 5000) / (burstrate - playrate))) 64 ((samples * 5000) / ((burstrate * 5000) / (burstrate - playrate)))
@@ -200,7 +200,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
200 u8 *value) 200 u8 *value)
201{ 201{
202 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 202 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
203 int val; 203 int val, ret = 0;
204 204
205 *value = reg & 0xff; 205 *value = reg & 0xff;
206 206
@@ -210,6 +210,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
210 if (val < 0) { 210 if (val < 0) {
211 dev_err(codec->dev, "Read failed (%d)\n", val); 211 dev_err(codec->dev, "Read failed (%d)\n", val);
212 value[0] = dac33_read_reg_cache(codec, reg); 212 value[0] = dac33_read_reg_cache(codec, reg);
213 ret = val;
213 } else { 214 } else {
214 value[0] = val; 215 value[0] = val;
215 dac33_write_reg_cache(codec, reg, val); 216 dac33_write_reg_cache(codec, reg, val);
@@ -218,7 +219,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg,
218 value[0] = dac33_read_reg_cache(codec, reg); 219 value[0] = dac33_read_reg_cache(codec, reg);
219 } 220 }
220 221
221 return 0; 222 return ret;
222} 223}
223 224
224static int dac33_write(struct snd_soc_codec *codec, unsigned int reg, 225static int dac33_write(struct snd_soc_codec *codec, unsigned int reg,
@@ -329,13 +330,18 @@ static void dac33_init_chip(struct snd_soc_codec *codec)
329 dac33_read_reg_cache(codec, DAC33_LINER_TO_RLO_VOL)); 330 dac33_read_reg_cache(codec, DAC33_LINER_TO_RLO_VOL));
330} 331}
331 332
332static inline void dac33_read_id(struct snd_soc_codec *codec) 333static inline int dac33_read_id(struct snd_soc_codec *codec)
333{ 334{
335 int i, ret = 0;
334 u8 reg; 336 u8 reg;
335 337
336 dac33_read(codec, DAC33_DEVICE_ID_MSB, &reg); 338 for (i = 0; i < 3; i++) {
337 dac33_read(codec, DAC33_DEVICE_ID_LSB, &reg); 339 ret = dac33_read(codec, DAC33_DEVICE_ID_MSB + i, &reg);
338 dac33_read(codec, DAC33_DEVICE_REV_ID, &reg); 340 if (ret < 0)
341 break;
342 }
343
344 return ret;
339} 345}
340 346
341static inline void dac33_soft_power(struct snd_soc_codec *codec, int power) 347static inline void dac33_soft_power(struct snd_soc_codec *codec, int power)
@@ -1076,6 +1082,9 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
1076 /* Number of samples under i2c latency */ 1082 /* Number of samples under i2c latency */
1077 dac33->alarm_threshold = US_TO_SAMPLES(rate, 1083 dac33->alarm_threshold = US_TO_SAMPLES(rate,
1078 dac33->mode1_latency); 1084 dac33->mode1_latency);
1085 nsample_limit = DAC33_BUFFER_SIZE_SAMPLES -
1086 dac33->alarm_threshold;
1087
1079 if (dac33->auto_fifo_config) { 1088 if (dac33->auto_fifo_config) {
1080 if (period_size <= dac33->alarm_threshold) 1089 if (period_size <= dac33->alarm_threshold)
1081 /* 1090 /*
@@ -1086,6 +1095,8 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
1086 ((dac33->alarm_threshold / period_size) + 1095 ((dac33->alarm_threshold / period_size) +
1087 (dac33->alarm_threshold % period_size ? 1096 (dac33->alarm_threshold % period_size ?
1088 1 : 0)); 1097 1 : 0));
1098 else if (period_size > nsample_limit)
1099 dac33->nsample = nsample_limit;
1089 else 1100 else
1090 dac33->nsample = period_size; 1101 dac33->nsample = period_size;
1091 } else { 1102 } else {
@@ -1097,8 +1108,7 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream)
1097 */ 1108 */
1098 dac33->nsample_max = substream->runtime->buffer_size - 1109 dac33->nsample_max = substream->runtime->buffer_size -
1099 period_size; 1110 period_size;
1100 nsample_limit = DAC33_BUFFER_SIZE_SAMPLES - 1111
1101 dac33->alarm_threshold;
1102 if (dac33->nsample_max > nsample_limit) 1112 if (dac33->nsample_max > nsample_limit)
1103 dac33->nsample_max = nsample_limit; 1113 dac33->nsample_max = nsample_limit;
1104 1114
@@ -1414,9 +1424,15 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
1414 dev_err(codec->dev, "Failed to power up codec: %d\n", ret); 1424 dev_err(codec->dev, "Failed to power up codec: %d\n", ret);
1415 goto err_power; 1425 goto err_power;
1416 } 1426 }
1417 dac33_read_id(codec); 1427 ret = dac33_read_id(codec);
1418 dac33_hard_power(codec, 0); 1428 dac33_hard_power(codec, 0);
1419 1429
1430 if (ret < 0) {
1431 dev_err(codec->dev, "Failed to read chip ID: %d\n", ret);
1432 ret = -ENODEV;
1433 goto err_power;
1434 }
1435
1420 /* Check if the IRQ number is valid and request it */ 1436 /* Check if the IRQ number is valid and request it */
1421 if (dac33->irq >= 0) { 1437 if (dac33->irq >= 0) {
1422 ret = request_irq(dac33->irq, dac33_interrupt_handler, 1438 ret = request_irq(dac33->irq, dac33_interrupt_handler,
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 329acc1a2074..ee4fb201de60 100644
--- a/sound/soc/codecs/tpa6130a2.c
+++ b/sound/soc/codecs/tpa6130a2.c
@@ -119,13 +119,13 @@ static int tpa6130a2_power(int power)
119{ 119{
120 struct tpa6130a2_data *data; 120 struct tpa6130a2_data *data;
121 u8 val; 121 u8 val;
122 int ret; 122 int ret = 0;
123 123
124 BUG_ON(tpa6130a2_client == NULL); 124 BUG_ON(tpa6130a2_client == NULL);
125 data = i2c_get_clientdata(tpa6130a2_client); 125 data = i2c_get_clientdata(tpa6130a2_client);
126 126
127 mutex_lock(&data->mutex); 127 mutex_lock(&data->mutex);
128 if (power) { 128 if (power && !data->power_state) {
129 /* Power on */ 129 /* Power on */
130 if (data->power_gpio >= 0) 130 if (data->power_gpio >= 0)
131 gpio_set_value(data->power_gpio, 1); 131 gpio_set_value(data->power_gpio, 1);
@@ -153,7 +153,7 @@ static int tpa6130a2_power(int power)
153 val = tpa6130a2_read(TPA6130A2_REG_CONTROL); 153 val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
154 val &= ~TPA6130A2_SWS; 154 val &= ~TPA6130A2_SWS;
155 tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); 155 tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val);
156 } else { 156 } else if (!power && data->power_state) {
157 /* set SWS */ 157 /* set SWS */
158 val = tpa6130a2_read(TPA6130A2_REG_CONTROL); 158 val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
159 val |= TPA6130A2_SWS; 159 val |= TPA6130A2_SWS;
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c
index b4f11724a63f..aca4b1ea10bb 100644
--- a/sound/soc/codecs/wm8900.c
+++ b/sound/soc/codecs/wm8900.c
@@ -186,7 +186,6 @@ static int wm8900_volatile_register(unsigned int reg)
186{ 186{
187 switch (reg) { 187 switch (reg) {
188 case WM8900_REG_ID: 188 case WM8900_REG_ID:
189 case WM8900_REG_POWER1:
190 return 1; 189 return 1;
191 default: 190 default:
192 return 0; 191 return 0;
@@ -1200,11 +1199,6 @@ static int wm8900_probe(struct snd_soc_codec *codec)
1200 return -ENODEV; 1199 return -ENODEV;
1201 } 1200 }
1202 1201
1203 /* Read back from the chip */
1204 reg = snd_soc_read(codec, WM8900_REG_POWER1);
1205 reg = (reg >> 12) & 0xf;
1206 dev_info(codec->dev, "WM8900 revision %d\n", reg);
1207
1208 wm8900_reset(codec); 1202 wm8900_reset(codec);
1209 1203
1210 /* Turn the chip on */ 1204 /* Turn the chip on */
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
index 2cb81538cd91..19ca782ac970 100644
--- a/sound/soc/codecs/wm_hubs.c
+++ b/sound/soc/codecs/wm_hubs.c
@@ -123,7 +123,7 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec)
123 reg_r = reg & WM8993_DCS_DAC_WR_VAL_0_MASK; 123 reg_r = reg & WM8993_DCS_DAC_WR_VAL_0_MASK;
124 break; 124 break;
125 default: 125 default:
126 WARN(1, "Unknown DCS readback method"); 126 WARN(1, "Unknown DCS readback method\n");
127 break; 127 break;
128 } 128 }
129 129
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 99696187b55a..d211c9fa5a91 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -31,7 +31,6 @@
31#include <sound/initval.h> 31#include <sound/initval.h>
32#include <sound/soc.h> 32#include <sound/soc.h>
33 33
34#include <plat/control.h>
35#include <plat/dma.h> 34#include <plat/dma.h>
36#include <plat/mcbsp.h> 35#include <plat/mcbsp.h>
37#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
@@ -598,93 +597,6 @@ static int omap_mcbsp_dai_set_clkdiv(struct snd_soc_dai *cpu_dai,
598 return 0; 597 return 0;
599} 598}
600 599
601static int omap_mcbsp_dai_set_clks_src(struct omap_mcbsp_data *mcbsp_data,
602 int clk_id)
603{
604 int sel_bit;
605 u16 reg, reg_devconf1 = OMAP243X_CONTROL_DEVCONF1;
606
607 if (cpu_class_is_omap1()) {
608 /* OMAP1's can use only external source clock */
609 if (unlikely(clk_id == OMAP_MCBSP_SYSCLK_CLKS_FCLK))
610 return -EINVAL;
611 else
612 return 0;
613 }
614
615 if (cpu_is_omap2420() && mcbsp_data->bus_id > 1)
616 return -EINVAL;
617
618 if (cpu_is_omap343x())
619 reg_devconf1 = OMAP343X_CONTROL_DEVCONF1;
620
621 switch (mcbsp_data->bus_id) {
622 case 0:
623 reg = OMAP2_CONTROL_DEVCONF0;
624 sel_bit = 2;
625 break;
626 case 1:
627 reg = OMAP2_CONTROL_DEVCONF0;
628 sel_bit = 6;
629 break;
630 case 2:
631 reg = reg_devconf1;
632 sel_bit = 0;
633 break;
634 case 3:
635 reg = reg_devconf1;
636 sel_bit = 2;
637 break;
638 case 4:
639 reg = reg_devconf1;
640 sel_bit = 4;
641 break;
642 default:
643 return -EINVAL;
644 }
645
646 if (clk_id == OMAP_MCBSP_SYSCLK_CLKS_FCLK)
647 omap_ctrl_writel(omap_ctrl_readl(reg) & ~(1 << sel_bit), reg);
648 else
649 omap_ctrl_writel(omap_ctrl_readl(reg) | (1 << sel_bit), reg);
650
651 return 0;
652}
653
654static int omap_mcbsp_dai_set_rcvr_src(struct omap_mcbsp_data *mcbsp_data,
655 int clk_id)
656{
657 int sel_bit, set = 0;
658 u16 reg = OMAP2_CONTROL_DEVCONF0;
659
660 if (cpu_class_is_omap1())
661 return -EINVAL; /* TODO: Can this be implemented for OMAP1? */
662 if (mcbsp_data->bus_id != 0)
663 return -EINVAL;
664
665 switch (clk_id) {
666 case OMAP_MCBSP_CLKR_SRC_CLKX:
667 set = 1;
668 case OMAP_MCBSP_CLKR_SRC_CLKR:
669 sel_bit = 3;
670 break;
671 case OMAP_MCBSP_FSR_SRC_FSX:
672 set = 1;
673 case OMAP_MCBSP_FSR_SRC_FSR:
674 sel_bit = 4;
675 break;
676 default:
677 return -EINVAL;
678 }
679
680 if (set)
681 omap_ctrl_writel(omap_ctrl_readl(reg) | (1 << sel_bit), reg);
682 else
683 omap_ctrl_writel(omap_ctrl_readl(reg) & ~(1 << sel_bit), reg);
684
685 return 0;
686}
687
688static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, 600static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
689 int clk_id, unsigned int freq, 601 int clk_id, unsigned int freq,
690 int dir) 602 int dir)
@@ -693,6 +605,14 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
693 struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; 605 struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
694 int err = 0; 606 int err = 0;
695 607
608 /* The McBSP signal muxing functions are only available on McBSP1 */
609 if (clk_id == OMAP_MCBSP_CLKR_SRC_CLKR ||
610 clk_id == OMAP_MCBSP_CLKR_SRC_CLKX ||
611 clk_id == OMAP_MCBSP_FSR_SRC_FSR ||
612 clk_id == OMAP_MCBSP_FSR_SRC_FSX)
613 if (cpu_class_is_omap1() || mcbsp_data->bus_id != 0)
614 return -EINVAL;
615
696 mcbsp_data->in_freq = freq; 616 mcbsp_data->in_freq = freq;
697 617
698 switch (clk_id) { 618 switch (clk_id) {
@@ -700,8 +620,20 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
700 regs->srgr2 |= CLKSM; 620 regs->srgr2 |= CLKSM;
701 break; 621 break;
702 case OMAP_MCBSP_SYSCLK_CLKS_FCLK: 622 case OMAP_MCBSP_SYSCLK_CLKS_FCLK:
623 if (cpu_class_is_omap1()) {
624 err = -EINVAL;
625 break;
626 }
627 err = omap2_mcbsp_set_clks_src(mcbsp_data->bus_id,
628 MCBSP_CLKS_PRCM_SRC);
629 break;
703 case OMAP_MCBSP_SYSCLK_CLKS_EXT: 630 case OMAP_MCBSP_SYSCLK_CLKS_EXT:
704 err = omap_mcbsp_dai_set_clks_src(mcbsp_data, clk_id); 631 if (cpu_class_is_omap1()) {
632 err = 0;
633 break;
634 }
635 err = omap2_mcbsp_set_clks_src(mcbsp_data->bus_id,
636 MCBSP_CLKS_PAD_SRC);
705 break; 637 break;
706 638
707 case OMAP_MCBSP_SYSCLK_CLKX_EXT: 639 case OMAP_MCBSP_SYSCLK_CLKX_EXT:
@@ -710,11 +642,18 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
710 regs->pcr0 |= SCLKME; 642 regs->pcr0 |= SCLKME;
711 break; 643 break;
712 644
645
713 case OMAP_MCBSP_CLKR_SRC_CLKR: 646 case OMAP_MCBSP_CLKR_SRC_CLKR:
647 omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKR);
648 break;
714 case OMAP_MCBSP_CLKR_SRC_CLKX: 649 case OMAP_MCBSP_CLKR_SRC_CLKX:
650 omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKX);
651 break;
715 case OMAP_MCBSP_FSR_SRC_FSR: 652 case OMAP_MCBSP_FSR_SRC_FSR:
653 omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSR);
654 break;
716 case OMAP_MCBSP_FSR_SRC_FSX: 655 case OMAP_MCBSP_FSR_SRC_FSX:
717 err = omap_mcbsp_dai_set_rcvr_src(mcbsp_data, clk_id); 656 omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSX);
718 break; 657 break;
719 default: 658 default:
720 err = -ENODEV; 659 err = -ENODEV;
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index f161c2f5ed36..bed09c27e44c 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -32,7 +32,6 @@
32#include <sound/initval.h> 32#include <sound/initval.h>
33#include <sound/soc.h> 33#include <sound/soc.h>
34 34
35#include <plat/control.h>
36#include <plat/dma.h> 35#include <plat/dma.h>
37#include <plat/mcbsp.h> 36#include <plat/mcbsp.h>
38#include "mcpdm.h" 37#include "mcpdm.h"
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index a3bfb2e8b70f..73d0edd8ded9 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -79,7 +79,7 @@ static void tosa_ext_control(struct snd_soc_codec *codec)
79static int tosa_startup(struct snd_pcm_substream *substream) 79static int tosa_startup(struct snd_pcm_substream *substream)
80{ 80{
81 struct snd_soc_pcm_runtime *rtd = substream->private_data; 81 struct snd_soc_pcm_runtime *rtd = substream->private_data;
82 struct snd_soc_codec *codec = rtd->card->codec; 82 struct snd_soc_codec *codec = rtd->codec;
83 83
84 /* check the jack status at stream startup */ 84 /* check the jack status at stream startup */
85 tosa_ext_control(codec); 85 tosa_ext_control(codec);
diff --git a/sound/soc/sh/sh7760-ac97.c b/sound/soc/sh/sh7760-ac97.c
index b897f7b96d89..f8e0ab82ef59 100644
--- a/sound/soc/sh/sh7760-ac97.c
+++ b/sound/soc/sh/sh7760-ac97.c
@@ -52,8 +52,8 @@ static int __init sh7760_ac97_init(void)
52 unsigned short ipsel; 52 unsigned short ipsel;
53 53
54 /* enable both AC97 controllers in pinmux reg */ 54 /* enable both AC97 controllers in pinmux reg */
55 ipsel = ctrl_inw(IPSEL); 55 ipsel = __raw_readw(IPSEL);
56 ctrl_outw(ipsel | (3 << 10), IPSEL); 56 __raw_writew(ipsel | (3 << 10), IPSEL);
57 57
58 ret = -ENOMEM; 58 ret = -ENOMEM;
59 sh7760_ac97_snd_device = platform_device_alloc("soc-audio", -1); 59 sh7760_ac97_snd_device = platform_device_alloc("soc-audio", -1);
diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c
index d6c79fa56d12..ed29c9e1ed4e 100644
--- a/sound/soc/sh/siu_pcm.c
+++ b/sound/soc/sh/siu_pcm.c
@@ -127,6 +127,7 @@ static int siu_pcm_wr_set(struct siu_port *port_info,
127 sg_init_table(&sg, 1); 127 sg_init_table(&sg, 1);
128 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)), 128 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)),
129 size, offset_in_page(buff)); 129 size, offset_in_page(buff));
130 sg_dma_len(&sg) = size;
130 sg_dma_address(&sg) = buff; 131 sg_dma_address(&sg) = buff;
131 132
132 desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, 133 desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,
@@ -176,6 +177,7 @@ static int siu_pcm_rd_set(struct siu_port *port_info,
176 sg_init_table(&sg, 1); 177 sg_init_table(&sg, 1);
177 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)), 178 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)),
178 size, offset_in_page(buff)); 179 size, offset_in_page(buff));
180 sg_dma_len(&sg) = size;
179 sg_dma_address(&sg) = buff; 181 sg_dma_address(&sg) = buff;
180 182
181 desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, 183 desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 70d9a7394b2b..614a8b30d87b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -165,8 +165,11 @@ static ssize_t pmdown_time_set(struct device *dev,
165{ 165{
166 struct snd_soc_pcm_runtime *rtd = 166 struct snd_soc_pcm_runtime *rtd =
167 container_of(dev, struct snd_soc_pcm_runtime, dev); 167 container_of(dev, struct snd_soc_pcm_runtime, dev);
168 int ret;
168 169
169 strict_strtol(buf, 10, &rtd->pmdown_time); 170 ret = strict_strtol(buf, 10, &rtd->pmdown_time);
171 if (ret)
172 return ret;
170 173
171 return count; 174 return count;
172} 175}
@@ -230,6 +233,7 @@ static const struct file_operations codec_reg_fops = {
230 .open = codec_reg_open_file, 233 .open = codec_reg_open_file,
231 .read = codec_reg_read_file, 234 .read = codec_reg_read_file,
232 .write = codec_reg_write_file, 235 .write = codec_reg_write_file,
236 .llseek = default_llseek,
233}; 237};
234 238
235static void soc_init_codec_debugfs(struct snd_soc_codec *codec) 239static void soc_init_codec_debugfs(struct snd_soc_codec *codec)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 035cab85cb66..7d85c6496afa 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1084,6 +1084,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
1084static const struct file_operations dapm_widget_power_fops = { 1084static const struct file_operations dapm_widget_power_fops = {
1085 .open = dapm_widget_power_open_file, 1085 .open = dapm_widget_power_open_file,
1086 .read = dapm_widget_power_read_file, 1086 .read = dapm_widget_power_read_file,
1087 .llseek = default_llseek,
1087}; 1088};
1088 1089
1089void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec) 1090void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec)
diff --git a/sound/sound_core.c b/sound/sound_core.c
index cb61317df509..c03bbaefdbc3 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -165,6 +165,7 @@ static const struct file_operations soundcore_fops =
165 /* We must have an owner or the module locking fails */ 165 /* We must have an owner or the module locking fails */
166 .owner = THIS_MODULE, 166 .owner = THIS_MODULE,
167 .open = soundcore_open, 167 .open = soundcore_open,
168 .llseek = noop_llseek,
168}; 169};
169 170
170/* 171/*