aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-04-07 06:28:00 -0400
committerTakashi Iwai <tiwai@suse.de>2012-04-07 06:28:00 -0400
commitc38f62b08d800104fa9b0e9d6e9141459986c06d (patch)
tree1d04d768c8aa0c1a544d1f068317c7beb0101be2 /sound
parent250f32747e62cb415b85083e247184188f24e566 (diff)
parent8abe05c6eb358967f16bce8a02c88d57c82cfbd6 (diff)
Merge tag 'asoc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: fixes for 3.4 A bunch of driver-specific fixes and one generic fix for the new support for platform DAPM contexts - we were picking the wrong default for the idle_bias_off setting which was meaning we weren't actually achieving any useful runtime PM on platform devices.
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/aaci.c13
-rw-r--r--sound/arm/pxa2xx-ac97-lib.c3
-rw-r--r--sound/arm/pxa2xx-ac97.c1
-rw-r--r--sound/atmel/abdac.c18
-rw-r--r--sound/atmel/ac97c.c41
-rw-r--r--sound/core/init.c1
-rw-r--r--sound/core/pcm.c1
-rw-r--r--sound/core/seq/seq.c1
-rw-r--r--sound/core/seq/seq_dummy.c2
-rw-r--r--sound/core/timer.c1
-rw-r--r--sound/drivers/Kconfig3
-rw-r--r--sound/firewire/isight.c4
-rw-r--r--sound/firewire/speakers.c4
-rw-r--r--sound/i2c/other/tea575x-tuner.c169
-rw-r--r--sound/oss/os.h1
-rw-r--r--sound/oss/vidc.c1
-rw-r--r--sound/oss/waveartist.c1
-rw-r--r--sound/pci/asihpi/hpios.h1
-rw-r--r--sound/pci/aw2/aw2-saa7146.c1
-rw-r--r--sound/pci/es1968.c15
-rw-r--r--sound/pci/fm801.c20
-rw-r--r--sound/pci/hda/patch_conexant.c2
-rw-r--r--sound/soc/codecs/ak4642.c2
-rw-r--r--sound/soc/codecs/sgtl5000.c25
-rw-r--r--sound/soc/codecs/wm8994.c25
-rw-r--r--sound/soc/imx/imx-audmux.c13
-rw-r--r--sound/soc/imx/imx-pcm-dma-mx2.c3
-rw-r--r--sound/soc/mxs/mxs-pcm.c2
-rw-r--r--sound/soc/mxs/mxs-saif.c2
-rw-r--r--sound/soc/omap/ams-delta.c34
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c1
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c1
-rw-r--r--sound/soc/samsung/Kconfig12
-rw-r--r--sound/soc/sh/siu_pcm.c4
-rw-r--r--sound/soc/soc-core.c2
-rw-r--r--sound/soc/tegra/tegra_i2s.c6
-rw-r--r--sound/soc/tegra/tegra_spdif.c4
-rw-r--r--sound/soc/txx9/txx9aclc.c2
38 files changed, 257 insertions, 185 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index b37b702a3a6a..5119fdabcb98 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -1110,18 +1110,7 @@ static struct amba_driver aaci_driver = {
1110 .id_table = aaci_ids, 1110 .id_table = aaci_ids,
1111}; 1111};
1112 1112
1113static int __init aaci_init(void) 1113module_amba_driver(aaci_driver);
1114{
1115 return amba_driver_register(&aaci_driver);
1116}
1117
1118static void __exit aaci_exit(void)
1119{
1120 amba_driver_unregister(&aaci_driver);
1121}
1122
1123module_init(aaci_init);
1124module_exit(aaci_exit);
1125 1114
1126MODULE_LICENSE("GPL"); 1115MODULE_LICENSE("GPL");
1127MODULE_DESCRIPTION("ARM PrimeCell PL041 Advanced Audio CODEC Interface driver"); 1116MODULE_DESCRIPTION("ARM PrimeCell PL041 Advanced Audio CODEC Interface driver");
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index d1aa4218f129..48d7c0aa5073 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -17,11 +17,12 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/io.h>
20 21
21#include <sound/ac97_codec.h> 22#include <sound/ac97_codec.h>
22#include <sound/pxa2xx-lib.h> 23#include <sound/pxa2xx-lib.h>
23 24
24#include <asm/irq.h> 25#include <mach/irqs.h>
25#include <mach/regs-ac97.h> 26#include <mach/regs-ac97.h>
26#include <mach/audio.h> 27#include <mach/audio.h>
27 28
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 3a39626a82d6..afef72c4f0d3 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -11,6 +11,7 @@
11 */ 11 */
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/io.h>
14#include <linux/module.h> 15#include <linux/module.h>
15#include <linux/platform_device.h> 16#include <linux/platform_device.h>
16 17
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c
index 4fa1dbd8ee83..f7c2bb08055d 100644
--- a/sound/atmel/abdac.c
+++ b/sound/atmel/abdac.c
@@ -16,6 +16,7 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/types.h>
19#include <linux/io.h> 20#include <linux/io.h>
20 21
21#include <sound/core.h> 22#include <sound/core.h>
@@ -467,15 +468,24 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev)
467 snd_card_set_dev(card, &pdev->dev); 468 snd_card_set_dev(card, &pdev->dev);
468 469
469 if (pdata->dws.dma_dev) { 470 if (pdata->dws.dma_dev) {
470 struct dw_dma_slave *dws = &pdata->dws;
471 dma_cap_mask_t mask; 471 dma_cap_mask_t mask;
472 472
473 dws->tx_reg = regs->start + DAC_DATA;
474
475 dma_cap_zero(mask); 473 dma_cap_zero(mask);
476 dma_cap_set(DMA_SLAVE, mask); 474 dma_cap_set(DMA_SLAVE, mask);
477 475
478 dac->dma.chan = dma_request_channel(mask, filter, dws); 476 dac->dma.chan = dma_request_channel(mask, filter, &pdata->dws);
477 if (dac->dma.chan) {
478 struct dma_slave_config dma_conf = {
479 .dst_addr = regs->start + DAC_DATA,
480 .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
481 .src_maxburst = 1,
482 .dst_maxburst = 1,
483 .direction = DMA_MEM_TO_DEV,
484 .device_fc = false,
485 };
486
487 dmaengine_slave_config(dac->dma.chan, &dma_conf);
488 }
479 } 489 }
480 if (!pdata->dws.dma_dev || !dac->dma.chan) { 490 if (!pdata->dws.dma_dev || !dac->dma.chan) {
481 dev_dbg(&pdev->dev, "DMA not available\n"); 491 dev_dbg(&pdev->dev, "DMA not available\n");
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 61dade698358..115313ef54d6 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -20,6 +20,7 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/types.h>
23#include <linux/io.h> 24#include <linux/io.h>
24 25
25#include <sound/core.h> 26#include <sound/core.h>
@@ -1014,16 +1015,28 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
1014 1015
1015 if (cpu_is_at32ap7000()) { 1016 if (cpu_is_at32ap7000()) {
1016 if (pdata->rx_dws.dma_dev) { 1017 if (pdata->rx_dws.dma_dev) {
1017 struct dw_dma_slave *dws = &pdata->rx_dws;
1018 dma_cap_mask_t mask; 1018 dma_cap_mask_t mask;
1019 1019
1020 dws->rx_reg = regs->start + AC97C_CARHR + 2;
1021
1022 dma_cap_zero(mask); 1020 dma_cap_zero(mask);
1023 dma_cap_set(DMA_SLAVE, mask); 1021 dma_cap_set(DMA_SLAVE, mask);
1024 1022
1025 chip->dma.rx_chan = dma_request_channel(mask, filter, 1023 chip->dma.rx_chan = dma_request_channel(mask, filter,
1026 dws); 1024 &pdata->rx_dws);
1025 if (chip->dma.rx_chan) {
1026 struct dma_slave_config dma_conf = {
1027 .src_addr = regs->start + AC97C_CARHR +
1028 2,
1029 .src_addr_width =
1030 DMA_SLAVE_BUSWIDTH_2_BYTES,
1031 .src_maxburst = 1,
1032 .dst_maxburst = 1,
1033 .direction = DMA_DEV_TO_MEM,
1034 .device_fc = false,
1035 };
1036
1037 dmaengine_slave_config(chip->dma.rx_chan,
1038 &dma_conf);
1039 }
1027 1040
1028 dev_info(&chip->pdev->dev, "using %s for DMA RX\n", 1041 dev_info(&chip->pdev->dev, "using %s for DMA RX\n",
1029 dev_name(&chip->dma.rx_chan->dev->device)); 1042 dev_name(&chip->dma.rx_chan->dev->device));
@@ -1031,16 +1044,28 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
1031 } 1044 }
1032 1045
1033 if (pdata->tx_dws.dma_dev) { 1046 if (pdata->tx_dws.dma_dev) {
1034 struct dw_dma_slave *dws = &pdata->tx_dws;
1035 dma_cap_mask_t mask; 1047 dma_cap_mask_t mask;
1036 1048
1037 dws->tx_reg = regs->start + AC97C_CATHR + 2;
1038
1039 dma_cap_zero(mask); 1049 dma_cap_zero(mask);
1040 dma_cap_set(DMA_SLAVE, mask); 1050 dma_cap_set(DMA_SLAVE, mask);
1041 1051
1042 chip->dma.tx_chan = dma_request_channel(mask, filter, 1052 chip->dma.tx_chan = dma_request_channel(mask, filter,
1043 dws); 1053 &pdata->tx_dws);
1054 if (chip->dma.tx_chan) {
1055 struct dma_slave_config dma_conf = {
1056 .dst_addr = regs->start + AC97C_CATHR +
1057 2,
1058 .dst_addr_width =
1059 DMA_SLAVE_BUSWIDTH_2_BYTES,
1060 .src_maxburst = 1,
1061 .dst_maxburst = 1,
1062 .direction = DMA_MEM_TO_DEV,
1063 .device_fc = false,
1064 };
1065
1066 dmaengine_slave_config(chip->dma.tx_chan,
1067 &dma_conf);
1068 }
1044 1069
1045 dev_info(&chip->pdev->dev, "using %s for DMA TX\n", 1070 dev_info(&chip->pdev->dev, "using %s for DMA TX\n",
1046 dev_name(&chip->dma.tx_chan->dev->device)); 1071 dev_name(&chip->dma.tx_chan->dev->device));
diff --git a/sound/core/init.c b/sound/core/init.c
index 068cf08d3ffb..d8ec849af128 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -22,6 +22,7 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/device.h>
25#include <linux/file.h> 26#include <linux/file.h>
26#include <linux/slab.h> 27#include <linux/slab.h>
27#include <linux/time.h> 28#include <linux/time.h>
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 6e4bfcc14254..1a3070b4e5b5 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -24,6 +24,7 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/mutex.h> 26#include <linux/mutex.h>
27#include <linux/device.h>
27#include <sound/core.h> 28#include <sound/core.h>
28#include <sound/minors.h> 29#include <sound/minors.h>
29#include <sound/pcm.h> 30#include <sound/pcm.h>
diff --git a/sound/core/seq/seq.c b/sound/core/seq/seq.c
index 9d8379aedf40..712110561082 100644
--- a/sound/core/seq/seq.c
+++ b/sound/core/seq/seq.c
@@ -21,6 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/device.h>
24#include <sound/core.h> 25#include <sound/core.h>
25#include <sound/initval.h> 26#include <sound/initval.h>
26 27
diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c
index bbe32d2177d9..dbc550716790 100644
--- a/sound/core/seq/seq_dummy.c
+++ b/sound/core/seq/seq_dummy.c
@@ -46,7 +46,7 @@
46 46
47 The number of ports to be created can be specified via the module 47 The number of ports to be created can be specified via the module
48 parameter "ports". For example, to create four ports, add the 48 parameter "ports". For example, to create four ports, add the
49 following option in /etc/modprobe.conf: 49 following option in a configuration file under /etc/modprobe.d/:
50 50
51 option snd-seq-dummy ports=4 51 option snd-seq-dummy ports=4
52 52
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 8e7561dfc5fc..6ddcf06f52f9 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -24,6 +24,7 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/mutex.h> 26#include <linux/mutex.h>
27#include <linux/device.h>
27#include <linux/module.h> 28#include <linux/module.h>
28#include <linux/string.h> 29#include <linux/string.h>
29#include <sound/core.h> 30#include <sound/core.h>
diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig
index c8961165277c..fe5ae09ffccb 100644
--- a/sound/drivers/Kconfig
+++ b/sound/drivers/Kconfig
@@ -50,7 +50,8 @@ config SND_PCSP
50 before the other sound driver of yours, making the 50 before the other sound driver of yours, making the
51 pc-speaker a default sound device. Which is likely not 51 pc-speaker a default sound device. Which is likely not
52 what you want. To make this driver play nicely with other 52 what you want. To make this driver play nicely with other
53 sound driver, you can add this into your /etc/modprobe.conf: 53 sound driver, you can add this in a configuration file under
54 /etc/modprobe.d/ directory:
54 options snd-pcsp index=2 55 options snd-pcsp index=2
55 56
56 You don't need this driver if you only want your pc-speaker to beep. 57 You don't need this driver if you only want your pc-speaker to beep.
diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c
index cd094ecaca3b..d428ffede4f3 100644
--- a/sound/firewire/isight.c
+++ b/sound/firewire/isight.c
@@ -611,7 +611,6 @@ static void isight_card_free(struct snd_card *card)
611 611
612 fw_iso_resources_destroy(&isight->resources); 612 fw_iso_resources_destroy(&isight->resources);
613 fw_unit_put(isight->unit); 613 fw_unit_put(isight->unit);
614 fw_device_put(isight->device);
615 mutex_destroy(&isight->mutex); 614 mutex_destroy(&isight->mutex);
616} 615}
617 616
@@ -644,7 +643,7 @@ static int isight_probe(struct device *unit_dev)
644 isight->card = card; 643 isight->card = card;
645 mutex_init(&isight->mutex); 644 mutex_init(&isight->mutex);
646 isight->unit = fw_unit_get(unit); 645 isight->unit = fw_unit_get(unit);
647 isight->device = fw_device_get(fw_dev); 646 isight->device = fw_dev;
648 isight->audio_base = get_unit_base(unit); 647 isight->audio_base = get_unit_base(unit);
649 if (!isight->audio_base) { 648 if (!isight->audio_base) {
650 dev_err(&unit->device, "audio unit base not found\n"); 649 dev_err(&unit->device, "audio unit base not found\n");
@@ -681,7 +680,6 @@ static int isight_probe(struct device *unit_dev)
681 680
682err_unit: 681err_unit:
683 fw_unit_put(isight->unit); 682 fw_unit_put(isight->unit);
684 fw_device_put(isight->device);
685 mutex_destroy(&isight->mutex); 683 mutex_destroy(&isight->mutex);
686error: 684error:
687 snd_card_free(card); 685 snd_card_free(card);
diff --git a/sound/firewire/speakers.c b/sound/firewire/speakers.c
index cbe6bb9e53b6..297244e658d9 100644
--- a/sound/firewire/speakers.c
+++ b/sound/firewire/speakers.c
@@ -656,12 +656,10 @@ static u32 fwspk_read_firmware_version(struct fw_unit *unit)
656static void fwspk_card_free(struct snd_card *card) 656static void fwspk_card_free(struct snd_card *card)
657{ 657{
658 struct fwspk *fwspk = card->private_data; 658 struct fwspk *fwspk = card->private_data;
659 struct fw_device *dev = fw_parent_device(fwspk->unit);
660 659
661 amdtp_out_stream_destroy(&fwspk->stream); 660 amdtp_out_stream_destroy(&fwspk->stream);
662 cmp_connection_destroy(&fwspk->connection); 661 cmp_connection_destroy(&fwspk->connection);
663 fw_unit_put(fwspk->unit); 662 fw_unit_put(fwspk->unit);
664 fw_device_put(dev);
665 mutex_destroy(&fwspk->mutex); 663 mutex_destroy(&fwspk->mutex);
666} 664}
667 665
@@ -718,7 +716,6 @@ static int __devinit fwspk_probe(struct device *unit_dev)
718 fwspk = card->private_data; 716 fwspk = card->private_data;
719 fwspk->card = card; 717 fwspk->card = card;
720 mutex_init(&fwspk->mutex); 718 mutex_init(&fwspk->mutex);
721 fw_device_get(fw_dev);
722 fwspk->unit = fw_unit_get(unit); 719 fwspk->unit = fw_unit_get(unit);
723 fwspk->device_info = fwspk_detect(fw_dev); 720 fwspk->device_info = fwspk_detect(fw_dev);
724 if (!fwspk->device_info) { 721 if (!fwspk->device_info) {
@@ -767,7 +764,6 @@ err_connection:
767 cmp_connection_destroy(&fwspk->connection); 764 cmp_connection_destroy(&fwspk->connection);
768err_unit: 765err_unit:
769 fw_unit_put(fwspk->unit); 766 fw_unit_put(fwspk->unit);
770 fw_device_put(fw_dev);
771 mutex_destroy(&fwspk->mutex); 767 mutex_destroy(&fwspk->mutex);
772error: 768error:
773 snd_card_free(card); 769 snd_card_free(card);
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index 6b68c8206805..a63faec5e7fd 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -25,21 +25,20 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/version.h> 28#include <linux/sched.h>
29#include <media/v4l2-device.h>
29#include <media/v4l2-dev.h> 30#include <media/v4l2-dev.h>
31#include <media/v4l2-fh.h>
30#include <media/v4l2-ioctl.h> 32#include <media/v4l2-ioctl.h>
33#include <media/v4l2-event.h>
31#include <sound/tea575x-tuner.h> 34#include <sound/tea575x-tuner.h>
32 35
33MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); 36MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
34MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips"); 37MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips");
35MODULE_LICENSE("GPL"); 38MODULE_LICENSE("GPL");
36 39
37static int radio_nr = -1; 40#define FREQ_LO (76U * 16000)
38module_param(radio_nr, int, 0); 41#define FREQ_HI (108U * 16000)
39
40#define RADIO_VERSION KERNEL_VERSION(0, 0, 2)
41#define FREQ_LO (50UL * 16000)
42#define FREQ_HI (150UL * 16000)
43 42
44/* 43/*
45 * definitions 44 * definitions
@@ -90,7 +89,7 @@ static void snd_tea575x_write(struct snd_tea575x *tea, unsigned int val)
90 tea->ops->set_pins(tea, 0); 89 tea->ops->set_pins(tea, 0);
91} 90}
92 91
93static unsigned int snd_tea575x_read(struct snd_tea575x *tea) 92static u32 snd_tea575x_read(struct snd_tea575x *tea)
94{ 93{
95 u16 l, rdata; 94 u16 l, rdata;
96 u32 data = 0; 95 u32 data = 0;
@@ -121,11 +120,13 @@ static unsigned int snd_tea575x_read(struct snd_tea575x *tea)
121 return data; 120 return data;
122} 121}
123 122
124static void snd_tea575x_get_freq(struct snd_tea575x *tea) 123static u32 snd_tea575x_get_freq(struct snd_tea575x *tea)
125{ 124{
126 unsigned long freq; 125 u32 freq = snd_tea575x_read(tea) & TEA575X_BIT_FREQ_MASK;
126
127 if (freq == 0)
128 return freq;
127 129
128 freq = snd_tea575x_read(tea) & TEA575X_BIT_FREQ_MASK;
129 /* freq *= 12.5 */ 130 /* freq *= 12.5 */
130 freq *= 125; 131 freq *= 125;
131 freq /= 10; 132 freq /= 10;
@@ -135,14 +136,13 @@ static void snd_tea575x_get_freq(struct snd_tea575x *tea)
135 else 136 else
136 freq -= TEA575X_FMIF; 137 freq -= TEA575X_FMIF;
137 138
138 tea->freq = freq * 16; /* from kHz */ 139 return clamp(freq * 16, FREQ_LO, FREQ_HI); /* from kHz */
139} 140}
140 141
141static void snd_tea575x_set_freq(struct snd_tea575x *tea) 142static void snd_tea575x_set_freq(struct snd_tea575x *tea)
142{ 143{
143 unsigned long freq; 144 u32 freq = tea->freq;
144 145
145 freq = clamp(tea->freq, FREQ_LO, FREQ_HI);
146 freq /= 16; /* to kHz */ 146 freq /= 16; /* to kHz */
147 /* crystal fixup */ 147 /* crystal fixup */
148 if (tea->tea5759) 148 if (tea->tea5759)
@@ -167,12 +167,14 @@ static int vidioc_querycap(struct file *file, void *priv,
167{ 167{
168 struct snd_tea575x *tea = video_drvdata(file); 168 struct snd_tea575x *tea = video_drvdata(file);
169 169
170 strlcpy(v->driver, "tea575x-tuner", sizeof(v->driver)); 170 strlcpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
171 strlcpy(v->card, tea->card, sizeof(v->card)); 171 strlcpy(v->card, tea->card, sizeof(v->card));
172 strlcat(v->card, tea->tea5759 ? " TEA5759" : " TEA5757", sizeof(v->card)); 172 strlcat(v->card, tea->tea5759 ? " TEA5759" : " TEA5757", sizeof(v->card));
173 strlcpy(v->bus_info, tea->bus_info, sizeof(v->bus_info)); 173 strlcpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
174 v->version = RADIO_VERSION; 174 v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
175 v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO; 175 if (!tea->cannot_read_data)
176 v->device_caps |= V4L2_CAP_HW_FREQ_SEEK;
177 v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
176 return 0; 178 return 0;
177} 179}
178 180
@@ -191,18 +193,24 @@ static int vidioc_g_tuner(struct file *file, void *priv,
191 v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; 193 v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;
192 v->rangelow = FREQ_LO; 194 v->rangelow = FREQ_LO;
193 v->rangehigh = FREQ_HI; 195 v->rangehigh = FREQ_HI;
194 v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; 196 v->rxsubchans = tea->stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
195 v->audmode = tea->stereo ? V4L2_TUNER_MODE_STEREO : V4L2_TUNER_MODE_MONO; 197 v->audmode = (tea->val & TEA575X_BIT_MONO) ?
198 V4L2_TUNER_MODE_MONO : V4L2_TUNER_MODE_STEREO;
196 v->signal = tea->tuned ? 0xffff : 0; 199 v->signal = tea->tuned ? 0xffff : 0;
197
198 return 0; 200 return 0;
199} 201}
200 202
201static int vidioc_s_tuner(struct file *file, void *priv, 203static int vidioc_s_tuner(struct file *file, void *priv,
202 struct v4l2_tuner *v) 204 struct v4l2_tuner *v)
203{ 205{
204 if (v->index > 0) 206 struct snd_tea575x *tea = video_drvdata(file);
207
208 if (v->index)
205 return -EINVAL; 209 return -EINVAL;
210 tea->val &= ~TEA575X_BIT_MONO;
211 if (v->audmode == V4L2_TUNER_MODE_MONO)
212 tea->val |= TEA575X_BIT_MONO;
213 snd_tea575x_write(tea, tea->val);
206 return 0; 214 return 0;
207} 215}
208 216
@@ -214,7 +222,6 @@ static int vidioc_g_frequency(struct file *file, void *priv,
214 if (f->tuner != 0) 222 if (f->tuner != 0)
215 return -EINVAL; 223 return -EINVAL;
216 f->type = V4L2_TUNER_RADIO; 224 f->type = V4L2_TUNER_RADIO;
217 snd_tea575x_get_freq(tea);
218 f->frequency = tea->freq; 225 f->frequency = tea->freq;
219 return 0; 226 return 0;
220} 227}
@@ -227,33 +234,72 @@ static int vidioc_s_frequency(struct file *file, void *priv,
227 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO) 234 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
228 return -EINVAL; 235 return -EINVAL;
229 236
230 if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) 237 tea->val &= ~TEA575X_BIT_SEARCH;
231 return -EINVAL; 238 tea->freq = clamp(f->frequency, FREQ_LO, FREQ_HI);
232
233 tea->freq = f->frequency;
234
235 snd_tea575x_set_freq(tea); 239 snd_tea575x_set_freq(tea);
236
237 return 0; 240 return 0;
238} 241}
239 242
240static int vidioc_g_audio(struct file *file, void *priv, 243static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
241 struct v4l2_audio *a) 244 struct v4l2_hw_freq_seek *a)
242{ 245{
243 if (a->index > 1) 246 struct snd_tea575x *tea = video_drvdata(file);
244 return -EINVAL; 247 unsigned long timeout;
245 248 int i;
246 strcpy(a->name, "Radio");
247 a->capability = V4L2_AUDCAP_STEREO;
248 return 0;
249}
250 249
251static int vidioc_s_audio(struct file *file, void *priv, 250 if (tea->cannot_read_data)
252 struct v4l2_audio *a) 251 return -ENOTTY;
253{ 252 if (a->tuner || a->wrap_around)
254 if (a->index != 0)
255 return -EINVAL; 253 return -EINVAL;
256 return 0; 254
255 /* clear the frequency, HW will fill it in */
256 tea->val &= ~TEA575X_BIT_FREQ_MASK;
257 tea->val |= TEA575X_BIT_SEARCH;
258 if (a->seek_upward)
259 tea->val |= TEA575X_BIT_UPDOWN;
260 else
261 tea->val &= ~TEA575X_BIT_UPDOWN;
262 snd_tea575x_write(tea, tea->val);
263 timeout = jiffies + msecs_to_jiffies(10000);
264 for (;;) {
265 if (time_after(jiffies, timeout))
266 break;
267 if (schedule_timeout_interruptible(msecs_to_jiffies(10))) {
268 /* some signal arrived, stop search */
269 tea->val &= ~TEA575X_BIT_SEARCH;
270 snd_tea575x_set_freq(tea);
271 return -ERESTARTSYS;
272 }
273 if (!(snd_tea575x_read(tea) & TEA575X_BIT_SEARCH)) {
274 u32 freq;
275
276 /* Found a frequency, wait until it can be read */
277 for (i = 0; i < 100; i++) {
278 msleep(10);
279 freq = snd_tea575x_get_freq(tea);
280 if (freq) /* available */
281 break;
282 }
283 if (freq == 0) /* shouldn't happen */
284 break;
285 /*
286 * if we moved by less than 50 kHz, or in the wrong
287 * direction, continue seeking
288 */
289 if (abs(tea->freq - freq) < 16 * 50 ||
290 (a->seek_upward && freq < tea->freq) ||
291 (!a->seek_upward && freq > tea->freq)) {
292 snd_tea575x_write(tea, tea->val);
293 continue;
294 }
295 tea->freq = freq;
296 tea->val &= ~TEA575X_BIT_SEARCH;
297 return 0;
298 }
299 }
300 tea->val &= ~TEA575X_BIT_SEARCH;
301 snd_tea575x_set_freq(tea);
302 return -EAGAIN;
257} 303}
258 304
259static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl) 305static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl)
@@ -273,23 +319,27 @@ static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl)
273static const struct v4l2_file_operations tea575x_fops = { 319static const struct v4l2_file_operations tea575x_fops = {
274 .owner = THIS_MODULE, 320 .owner = THIS_MODULE,
275 .unlocked_ioctl = video_ioctl2, 321 .unlocked_ioctl = video_ioctl2,
322 .open = v4l2_fh_open,
323 .release = v4l2_fh_release,
324 .poll = v4l2_ctrl_poll,
276}; 325};
277 326
278static const struct v4l2_ioctl_ops tea575x_ioctl_ops = { 327static const struct v4l2_ioctl_ops tea575x_ioctl_ops = {
279 .vidioc_querycap = vidioc_querycap, 328 .vidioc_querycap = vidioc_querycap,
280 .vidioc_g_tuner = vidioc_g_tuner, 329 .vidioc_g_tuner = vidioc_g_tuner,
281 .vidioc_s_tuner = vidioc_s_tuner, 330 .vidioc_s_tuner = vidioc_s_tuner,
282 .vidioc_g_audio = vidioc_g_audio,
283 .vidioc_s_audio = vidioc_s_audio,
284 .vidioc_g_frequency = vidioc_g_frequency, 331 .vidioc_g_frequency = vidioc_g_frequency,
285 .vidioc_s_frequency = vidioc_s_frequency, 332 .vidioc_s_frequency = vidioc_s_frequency,
333 .vidioc_s_hw_freq_seek = vidioc_s_hw_freq_seek,
334 .vidioc_log_status = v4l2_ctrl_log_status,
335 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
336 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
286}; 337};
287 338
288static struct video_device tea575x_radio = { 339static const struct video_device tea575x_radio = {
289 .name = "tea575x-tuner",
290 .fops = &tea575x_fops, 340 .fops = &tea575x_fops,
291 .ioctl_ops = &tea575x_ioctl_ops, 341 .ioctl_ops = &tea575x_ioctl_ops,
292 .release = video_device_release_empty, 342 .release = video_device_release_empty,
293}; 343};
294 344
295static const struct v4l2_ctrl_ops tea575x_ctrl_ops = { 345static const struct v4l2_ctrl_ops tea575x_ctrl_ops = {
@@ -303,27 +353,34 @@ int snd_tea575x_init(struct snd_tea575x *tea)
303{ 353{
304 int retval; 354 int retval;
305 355
306 tea->mute = 1; 356 tea->mute = true;
307 357
308 snd_tea575x_write(tea, 0x55AA); 358 /* Not all devices can or know how to read the data back.
309 if (snd_tea575x_read(tea) != 0x55AA) 359 Such devices can set cannot_read_data to true. */
310 return -ENODEV; 360 if (!tea->cannot_read_data) {
361 snd_tea575x_write(tea, 0x55AA);
362 if (snd_tea575x_read(tea) != 0x55AA)
363 return -ENODEV;
364 }
311 365
312 tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_10_40; 366 tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_5_28;
313 tea->freq = 90500 * 16; /* 90.5Mhz default */ 367 tea->freq = 90500 * 16; /* 90.5Mhz default */
314 snd_tea575x_set_freq(tea); 368 snd_tea575x_set_freq(tea);
315 369
316 tea->vd = tea575x_radio; 370 tea->vd = tea575x_radio;
317 video_set_drvdata(&tea->vd, tea); 371 video_set_drvdata(&tea->vd, tea);
318 mutex_init(&tea->mutex); 372 mutex_init(&tea->mutex);
373 strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
319 tea->vd.lock = &tea->mutex; 374 tea->vd.lock = &tea->mutex;
375 tea->vd.v4l2_dev = tea->v4l2_dev;
376 tea->vd.ctrl_handler = &tea->ctrl_handler;
377 set_bit(V4L2_FL_USE_FH_PRIO, &tea->vd.flags);
320 378
321 v4l2_ctrl_handler_init(&tea->ctrl_handler, 1); 379 v4l2_ctrl_handler_init(&tea->ctrl_handler, 1);
322 tea->vd.ctrl_handler = &tea->ctrl_handler;
323 v4l2_ctrl_new_std(&tea->ctrl_handler, &tea575x_ctrl_ops, V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1); 380 v4l2_ctrl_new_std(&tea->ctrl_handler, &tea575x_ctrl_ops, V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
324 retval = tea->ctrl_handler.error; 381 retval = tea->ctrl_handler.error;
325 if (retval) { 382 if (retval) {
326 printk(KERN_ERR "tea575x-tuner: can't initialize controls\n"); 383 v4l2_err(tea->v4l2_dev, "can't initialize controls\n");
327 v4l2_ctrl_handler_free(&tea->ctrl_handler); 384 v4l2_ctrl_handler_free(&tea->ctrl_handler);
328 return retval; 385 return retval;
329 } 386 }
@@ -338,9 +395,9 @@ int snd_tea575x_init(struct snd_tea575x *tea)
338 395
339 v4l2_ctrl_handler_setup(&tea->ctrl_handler); 396 v4l2_ctrl_handler_setup(&tea->ctrl_handler);
340 397
341 retval = video_register_device(&tea->vd, VFL_TYPE_RADIO, radio_nr); 398 retval = video_register_device(&tea->vd, VFL_TYPE_RADIO, tea->radio_nr);
342 if (retval) { 399 if (retval) {
343 printk(KERN_ERR "tea575x-tuner: can't register video device!\n"); 400 v4l2_err(tea->v4l2_dev, "can't register video device!\n");
344 v4l2_ctrl_handler_free(&tea->ctrl_handler); 401 v4l2_ctrl_handler_free(&tea->ctrl_handler);
345 return retval; 402 return retval;
346 } 403 }
diff --git a/sound/oss/os.h b/sound/oss/os.h
index a1a962d7f67d..75ad0cd0c0ab 100644
--- a/sound/oss/os.h
+++ b/sound/oss/os.h
@@ -16,7 +16,6 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/system.h>
20#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
21#include <asm/uaccess.h> 20#include <asm/uaccess.h>
22#include <linux/poll.h> 21#include <linux/poll.h>
diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c
index 12ba28e7b933..92ca5bee1860 100644
--- a/sound/oss/vidc.c
+++ b/sound/oss/vidc.c
@@ -28,7 +28,6 @@
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/hardware/iomd.h> 29#include <asm/hardware/iomd.h>
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <asm/system.h>
32 31
33#include "sound_config.h" 32#include "sound_config.h"
34#include "vidc.h" 33#include "vidc.h"
diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c
index 52468742d9f2..24c430f721d4 100644
--- a/sound/oss/waveartist.c
+++ b/sound/oss/waveartist.c
@@ -42,7 +42,6 @@
42#include <linux/spinlock.h> 42#include <linux/spinlock.h>
43#include <linux/bitops.h> 43#include <linux/bitops.h>
44 44
45#include <asm/system.h>
46 45
47#include "sound_config.h" 46#include "sound_config.h"
48#include "waveartist.h" 47#include "waveartist.h"
diff --git a/sound/pci/asihpi/hpios.h b/sound/pci/asihpi/hpios.h
index c5cef113c209..d3fbd0d76c37 100644
--- a/sound/pci/asihpi/hpios.h
+++ b/sound/pci/asihpi/hpios.h
@@ -30,7 +30,6 @@ HPI Operating System Specific macros for Linux Kernel driver
30#define HPI_BUILD_KERNEL_MODE 30#define HPI_BUILD_KERNEL_MODE
31 31
32#include <linux/io.h> 32#include <linux/io.h>
33#include <asm/system.h>
34#include <linux/ioctl.h> 33#include <linux/ioctl.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
36#include <linux/string.h> 35#include <linux/string.h>
diff --git a/sound/pci/aw2/aw2-saa7146.c b/sound/pci/aw2/aw2-saa7146.c
index 8afd8b5d1ac7..4439636971eb 100644
--- a/sound/pci/aw2/aw2-saa7146.c
+++ b/sound/pci/aw2/aw2-saa7146.c
@@ -27,7 +27,6 @@
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <asm/system.h>
31#include <asm/io.h> 30#include <asm/io.h>
32#include <sound/core.h> 31#include <sound/core.h>
33#include <sound/initval.h> 32#include <sound/initval.h>
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index cb557c603a80..a8faae1c85e4 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -142,6 +142,7 @@ static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
142#ifdef SUPPORT_JOYSTICK 142#ifdef SUPPORT_JOYSTICK
143static bool joystick[SNDRV_CARDS]; 143static bool joystick[SNDRV_CARDS];
144#endif 144#endif
145static int radio_nr[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
145 146
146module_param_array(index, int, NULL, 0444); 147module_param_array(index, int, NULL, 0444);
147MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); 148MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
@@ -165,6 +166,9 @@ MODULE_PARM_DESC(enable_mpu, "Enable MPU401. (0 = off, 1 = on, 2 = auto)");
165module_param_array(joystick, bool, NULL, 0444); 166module_param_array(joystick, bool, NULL, 0444);
166MODULE_PARM_DESC(joystick, "Enable joystick."); 167MODULE_PARM_DESC(joystick, "Enable joystick.");
167#endif 168#endif
169module_param_array(radio_nr, int, NULL, 0444);
170MODULE_PARM_DESC(radio_nr, "Radio device numbers");
171
168 172
169 173
170#define NR_APUS 64 174#define NR_APUS 64
@@ -558,6 +562,7 @@ struct es1968 {
558 struct work_struct hwvol_work; 562 struct work_struct hwvol_work;
559 563
560#ifdef CONFIG_SND_ES1968_RADIO 564#ifdef CONFIG_SND_ES1968_RADIO
565 struct v4l2_device v4l2_dev;
561 struct snd_tea575x tea; 566 struct snd_tea575x tea;
562#endif 567#endif
563}; 568};
@@ -2613,6 +2618,7 @@ static int snd_es1968_free(struct es1968 *chip)
2613 2618
2614#ifdef CONFIG_SND_ES1968_RADIO 2619#ifdef CONFIG_SND_ES1968_RADIO
2615 snd_tea575x_exit(&chip->tea); 2620 snd_tea575x_exit(&chip->tea);
2621 v4l2_device_unregister(&chip->v4l2_dev);
2616#endif 2622#endif
2617 2623
2618 if (chip->irq >= 0) 2624 if (chip->irq >= 0)
@@ -2655,6 +2661,7 @@ static int __devinit snd_es1968_create(struct snd_card *card,
2655 int capt_streams, 2661 int capt_streams,
2656 int chip_type, 2662 int chip_type,
2657 int do_pm, 2663 int do_pm,
2664 int radio_nr,
2658 struct es1968 **chip_ret) 2665 struct es1968 **chip_ret)
2659{ 2666{
2660 static struct snd_device_ops ops = { 2667 static struct snd_device_ops ops = {
@@ -2751,7 +2758,14 @@ static int __devinit snd_es1968_create(struct snd_card *card,
2751 snd_card_set_dev(card, &pci->dev); 2758 snd_card_set_dev(card, &pci->dev);
2752 2759
2753#ifdef CONFIG_SND_ES1968_RADIO 2760#ifdef CONFIG_SND_ES1968_RADIO
2761 err = v4l2_device_register(&pci->dev, &chip->v4l2_dev);
2762 if (err < 0) {
2763 snd_es1968_free(chip);
2764 return err;
2765 }
2766 chip->tea.v4l2_dev = &chip->v4l2_dev;
2754 chip->tea.private_data = chip; 2767 chip->tea.private_data = chip;
2768 chip->tea.radio_nr = radio_nr;
2755 chip->tea.ops = &snd_es1968_tea_ops; 2769 chip->tea.ops = &snd_es1968_tea_ops;
2756 strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card)); 2770 strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card));
2757 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); 2771 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
@@ -2797,6 +2811,7 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
2797 pcm_substreams_c[dev], 2811 pcm_substreams_c[dev],
2798 pci_id->driver_data, 2812 pci_id->driver_data,
2799 use_pm[dev], 2813 use_pm[dev],
2814 radio_nr[dev],
2800 &chip)) < 0) { 2815 &chip)) < 0) {
2801 snd_card_free(card); 2816 snd_card_free(card);
2802 return err; 2817 return err;
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 9597ef1eccca..a416ea8af3e9 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -58,6 +58,7 @@ static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card
58 * High 16-bits are video (radio) device number + 1 58 * High 16-bits are video (radio) device number + 1
59 */ 59 */
60static int tea575x_tuner[SNDRV_CARDS]; 60static int tea575x_tuner[SNDRV_CARDS];
61static int radio_nr[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
61 62
62module_param_array(index, int, NULL, 0444); 63module_param_array(index, int, NULL, 0444);
63MODULE_PARM_DESC(index, "Index value for the FM801 soundcard."); 64MODULE_PARM_DESC(index, "Index value for the FM801 soundcard.");
@@ -67,6 +68,9 @@ module_param_array(enable, bool, NULL, 0444);
67MODULE_PARM_DESC(enable, "Enable FM801 soundcard."); 68MODULE_PARM_DESC(enable, "Enable FM801 soundcard.");
68module_param_array(tea575x_tuner, int, NULL, 0444); 69module_param_array(tea575x_tuner, int, NULL, 0444);
69MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only)."); 70MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only).");
71module_param_array(radio_nr, int, NULL, 0444);
72MODULE_PARM_DESC(radio_nr, "Radio device numbers");
73
70 74
71#define TUNER_DISABLED (1<<3) 75#define TUNER_DISABLED (1<<3)
72#define TUNER_ONLY (1<<4) 76#define TUNER_ONLY (1<<4)
@@ -197,6 +201,7 @@ struct fm801 {
197 struct snd_info_entry *proc_entry; 201 struct snd_info_entry *proc_entry;
198 202
199#ifdef CONFIG_SND_FM801_TEA575X_BOOL 203#ifdef CONFIG_SND_FM801_TEA575X_BOOL
204 struct v4l2_device v4l2_dev;
200 struct snd_tea575x tea; 205 struct snd_tea575x tea;
201#endif 206#endif
202 207
@@ -1154,8 +1159,10 @@ static int snd_fm801_free(struct fm801 *chip)
1154 1159
1155 __end_hw: 1160 __end_hw:
1156#ifdef CONFIG_SND_FM801_TEA575X_BOOL 1161#ifdef CONFIG_SND_FM801_TEA575X_BOOL
1157 if (!(chip->tea575x_tuner & TUNER_DISABLED)) 1162 if (!(chip->tea575x_tuner & TUNER_DISABLED)) {
1158 snd_tea575x_exit(&chip->tea); 1163 snd_tea575x_exit(&chip->tea);
1164 v4l2_device_unregister(&chip->v4l2_dev);
1165 }
1159#endif 1166#endif
1160 if (chip->irq >= 0) 1167 if (chip->irq >= 0)
1161 free_irq(chip->irq, chip); 1168 free_irq(chip->irq, chip);
@@ -1175,6 +1182,7 @@ static int snd_fm801_dev_free(struct snd_device *device)
1175static int __devinit snd_fm801_create(struct snd_card *card, 1182static int __devinit snd_fm801_create(struct snd_card *card,
1176 struct pci_dev * pci, 1183 struct pci_dev * pci,
1177 int tea575x_tuner, 1184 int tea575x_tuner,
1185 int radio_nr,
1178 struct fm801 ** rchip) 1186 struct fm801 ** rchip)
1179{ 1187{
1180 struct fm801 *chip; 1188 struct fm801 *chip;
@@ -1234,6 +1242,13 @@ static int __devinit snd_fm801_create(struct snd_card *card,
1234 snd_card_set_dev(card, &pci->dev); 1242 snd_card_set_dev(card, &pci->dev);
1235 1243
1236#ifdef CONFIG_SND_FM801_TEA575X_BOOL 1244#ifdef CONFIG_SND_FM801_TEA575X_BOOL
1245 err = v4l2_device_register(&pci->dev, &chip->v4l2_dev);
1246 if (err < 0) {
1247 snd_fm801_free(chip);
1248 return err;
1249 }
1250 chip->tea.v4l2_dev = &chip->v4l2_dev;
1251 chip->tea.radio_nr = radio_nr;
1237 chip->tea.private_data = chip; 1252 chip->tea.private_data = chip;
1238 chip->tea.ops = &snd_fm801_tea_ops; 1253 chip->tea.ops = &snd_fm801_tea_ops;
1239 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); 1254 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
@@ -1241,6 +1256,7 @@ static int __devinit snd_fm801_create(struct snd_card *card,
1241 (tea575x_tuner & TUNER_TYPE_MASK) < 4) { 1256 (tea575x_tuner & TUNER_TYPE_MASK) < 4) {
1242 if (snd_tea575x_init(&chip->tea)) { 1257 if (snd_tea575x_init(&chip->tea)) {
1243 snd_printk(KERN_ERR "TEA575x radio not found\n"); 1258 snd_printk(KERN_ERR "TEA575x radio not found\n");
1259 snd_fm801_free(chip);
1244 return -ENODEV; 1260 return -ENODEV;
1245 } 1261 }
1246 } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) { 1262 } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) {
@@ -1287,7 +1303,7 @@ static int __devinit snd_card_fm801_probe(struct pci_dev *pci,
1287 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); 1303 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
1288 if (err < 0) 1304 if (err < 0)
1289 return err; 1305 return err;
1290 if ((err = snd_fm801_create(card, pci, tea575x_tuner[dev], &chip)) < 0) { 1306 if ((err = snd_fm801_create(card, pci, tea575x_tuner[dev], radio_nr[dev], &chip)) < 0) {
1291 snd_card_free(card); 1307 snd_card_free(card);
1292 return err; 1308 return err;
1293 } 1309 }
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 3848711d89f7..a36488d94aaa 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1607,7 +1607,7 @@ static void cxt5051_update_speaker(struct hda_codec *codec)
1607 pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0; 1607 pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0;
1608 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 1608 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
1609 pinctl); 1609 pinctl);
1610 /* on ideapad there is an aditional speaker (subwoofer) to mute */ 1610 /* on ideapad there is an additional speaker (subwoofer) to mute */
1611 if (spec->ideapad) 1611 if (spec->ideapad)
1612 snd_hda_codec_write(codec, 0x1b, 0, 1612 snd_hda_codec_write(codec, 0x1b, 0,
1613 AC_VERB_SET_PIN_WIDGET_CONTROL, 1613 AC_VERB_SET_PIN_WIDGET_CONTROL,
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index f8e10ced244a..b3e24f289421 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -140,7 +140,7 @@
140 * min : 0xFE : -115.0 dB 140 * min : 0xFE : -115.0 dB
141 * mute: 0xFF 141 * mute: 0xFF
142 */ 142 */
143static const DECLARE_TLV_DB_SCALE(out_tlv, -11500, 50, 1); 143static const DECLARE_TLV_DB_SCALE(out_tlv, -11550, 50, 1);
144 144
145static const struct snd_kcontrol_new ak4642_snd_controls[] = { 145static const struct snd_kcontrol_new ak4642_snd_controls[] = {
146 146
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index d1926266fe00..8e92fb88ed09 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -143,11 +143,11 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
143} 143}
144 144
145/* 145/*
146 * using codec assist to small pop, hp_powerup or lineout_powerup 146 * As manual described, ADC/DAC only works when VAG powerup,
147 * should stay setting until vag_powerup is fully ramped down, 147 * So enabled VAG before ADC/DAC up.
148 * vag fully ramped down require 400ms. 148 * In power down case, we need wait 400ms when vag fully ramped down.
149 */ 149 */
150static int small_pop_event(struct snd_soc_dapm_widget *w, 150static int power_vag_event(struct snd_soc_dapm_widget *w,
151 struct snd_kcontrol *kcontrol, int event) 151 struct snd_kcontrol *kcontrol, int event)
152{ 152{
153 switch (event) { 153 switch (event) {
@@ -156,7 +156,7 @@ static int small_pop_event(struct snd_soc_dapm_widget *w,
156 SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP); 156 SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
157 break; 157 break;
158 158
159 case SND_SOC_DAPM_PRE_PMD: 159 case SND_SOC_DAPM_POST_PMD:
160 snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, 160 snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
161 SGTL5000_VAG_POWERUP, 0); 161 SGTL5000_VAG_POWERUP, 0);
162 msleep(400); 162 msleep(400);
@@ -201,12 +201,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
201 mic_bias_event, 201 mic_bias_event,
202 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 202 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
203 203
204 SND_SOC_DAPM_PGA_E("HP", SGTL5000_CHIP_ANA_POWER, 4, 0, NULL, 0, 204 SND_SOC_DAPM_PGA("HP", SGTL5000_CHIP_ANA_POWER, 4, 0, NULL, 0),
205 small_pop_event, 205 SND_SOC_DAPM_PGA("LO", SGTL5000_CHIP_ANA_POWER, 0, 0, NULL, 0),
206 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
207 SND_SOC_DAPM_PGA_E("LO", SGTL5000_CHIP_ANA_POWER, 0, 0, NULL, 0,
208 small_pop_event,
209 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
210 206
211 SND_SOC_DAPM_MUX("Capture Mux", SND_SOC_NOPM, 0, 0, &adc_mux), 207 SND_SOC_DAPM_MUX("Capture Mux", SND_SOC_NOPM, 0, 0, &adc_mux),
212 SND_SOC_DAPM_MUX("Headphone Mux", SND_SOC_NOPM, 0, 0, &dac_mux), 208 SND_SOC_DAPM_MUX("Headphone Mux", SND_SOC_NOPM, 0, 0, &dac_mux),
@@ -221,8 +217,11 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
221 0, SGTL5000_CHIP_DIG_POWER, 217 0, SGTL5000_CHIP_DIG_POWER,
222 1, 0), 218 1, 0),
223 219
224 SND_SOC_DAPM_ADC("ADC", "Capture", SGTL5000_CHIP_ANA_POWER, 1, 0), 220 SND_SOC_DAPM_SUPPLY("VAG_POWER", SGTL5000_CHIP_ANA_POWER, 7, 0,
221 power_vag_event,
222 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
225 223
224 SND_SOC_DAPM_ADC("ADC", "Capture", SGTL5000_CHIP_ANA_POWER, 1, 0),
226 SND_SOC_DAPM_DAC("DAC", "Playback", SGTL5000_CHIP_ANA_POWER, 3, 0), 225 SND_SOC_DAPM_DAC("DAC", "Playback", SGTL5000_CHIP_ANA_POWER, 3, 0),
227}; 226};
228 227
@@ -231,9 +230,11 @@ static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
231 {"Capture Mux", "LINE_IN", "LINE_IN"}, /* line_in --> adc_mux */ 230 {"Capture Mux", "LINE_IN", "LINE_IN"}, /* line_in --> adc_mux */
232 {"Capture Mux", "MIC_IN", "MIC_IN"}, /* mic_in --> adc_mux */ 231 {"Capture Mux", "MIC_IN", "MIC_IN"}, /* mic_in --> adc_mux */
233 232
233 {"ADC", NULL, "VAG_POWER"},
234 {"ADC", NULL, "Capture Mux"}, /* adc_mux --> adc */ 234 {"ADC", NULL, "Capture Mux"}, /* adc_mux --> adc */
235 {"AIFOUT", NULL, "ADC"}, /* adc --> i2s_out */ 235 {"AIFOUT", NULL, "ADC"}, /* adc --> i2s_out */
236 236
237 {"DAC", NULL, "VAG_POWER"},
237 {"DAC", NULL, "AIFIN"}, /* i2s-->dac,skip audio mux */ 238 {"DAC", NULL, "AIFIN"}, /* i2s-->dac,skip audio mux */
238 {"Headphone Mux", "DAC", "DAC"}, /* dac --> hp_mux */ 239 {"Headphone Mux", "DAC", "DAC"}, /* dac --> hp_mux */
239 {"LO", NULL, "DAC"}, /* dac --> line_out */ 240 {"LO", NULL, "DAC"}, /* dac --> line_out */
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 10d27890eed5..7c49642af052 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2181,26 +2181,9 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
2181 case SND_SOC_BIAS_STANDBY: 2181 case SND_SOC_BIAS_STANDBY:
2182 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { 2182 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
2183 switch (control->type) { 2183 switch (control->type) {
2184 case WM8994:
2185 if (wm8994->revision < 4) {
2186 /* Tweak DC servo and DSP
2187 * configuration for improved
2188 * performance. */
2189 snd_soc_write(codec, 0x102, 0x3);
2190 snd_soc_write(codec, 0x56, 0x3);
2191 snd_soc_write(codec, 0x817, 0);
2192 snd_soc_write(codec, 0x102, 0);
2193 }
2194 break;
2195
2196 case WM8958: 2184 case WM8958:
2197 if (wm8994->revision == 0) { 2185 if (wm8994->revision == 0) {
2198 /* Optimise performance for rev A */ 2186 /* Optimise performance for rev A */
2199 snd_soc_write(codec, 0x102, 0x3);
2200 snd_soc_write(codec, 0xcb, 0x81);
2201 snd_soc_write(codec, 0x817, 0);
2202 snd_soc_write(codec, 0x102, 0);
2203
2204 snd_soc_update_bits(codec, 2187 snd_soc_update_bits(codec,
2205 WM8958_CHARGE_PUMP_2, 2188 WM8958_CHARGE_PUMP_2,
2206 WM8958_CP_DISCH, 2189 WM8958_CP_DISCH,
@@ -2208,13 +2191,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
2208 } 2191 }
2209 break; 2192 break;
2210 2193
2211 case WM1811: 2194 default:
2212 if (wm8994->revision < 2) {
2213 snd_soc_write(codec, 0x102, 0x3);
2214 snd_soc_write(codec, 0x5d, 0x7e);
2215 snd_soc_write(codec, 0x5e, 0x0);
2216 snd_soc_write(codec, 0x102, 0x0);
2217 }
2218 break; 2195 break;
2219 } 2196 }
2220 2197
diff --git a/sound/soc/imx/imx-audmux.c b/sound/soc/imx/imx-audmux.c
index a839494c5ea8..0fe66c3dde12 100644
--- a/sound/soc/imx/imx-audmux.c
+++ b/sound/soc/imx/imx-audmux.c
@@ -79,14 +79,17 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
79 if (!buf) 79 if (!buf)
80 return -ENOMEM; 80 return -ENOMEM;
81 81
82 if (!audmux_base)
83 return -ENOSYS;
84
82 if (audmux_clk) 85 if (audmux_clk)
83 clk_enable(audmux_clk); 86 clk_prepare_enable(audmux_clk);
84 87
85 ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port)); 88 ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port));
86 pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port)); 89 pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port));
87 90
88 if (audmux_clk) 91 if (audmux_clk)
89 clk_disable(audmux_clk); 92 clk_disable_unprepare(audmux_clk);
90 93
91 ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n", 94 ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
92 pdcr, ptcr); 95 pdcr, ptcr);
@@ -158,7 +161,7 @@ static void __init audmux_debugfs_init(void)
158 return; 161 return;
159 } 162 }
160 163
161 for (i = 1; i < 8; i++) { 164 for (i = 0; i < MX31_AUDMUX_PORT6_SSI_PINS_6 + 1; i++) {
162 snprintf(buf, sizeof(buf), "ssi%d", i); 165 snprintf(buf, sizeof(buf), "ssi%d", i);
163 if (!debugfs_create_file(buf, 0444, audmux_debugfs_root, 166 if (!debugfs_create_file(buf, 0444, audmux_debugfs_root,
164 (void *)i, &audmux_debugfs_fops)) 167 (void *)i, &audmux_debugfs_fops))
@@ -237,13 +240,13 @@ int imx_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
237 return -ENOSYS; 240 return -ENOSYS;
238 241
239 if (audmux_clk) 242 if (audmux_clk)
240 clk_enable(audmux_clk); 243 clk_prepare_enable(audmux_clk);
241 244
242 writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(port)); 245 writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(port));
243 writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(port)); 246 writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(port));
244 247
245 if (audmux_clk) 248 if (audmux_clk)
246 clk_disable(audmux_clk); 249 clk_disable_unprepare(audmux_clk);
247 250
248 return 0; 251 return 0;
249} 252}
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c
index e43c8fa2788b..6b818de2fc03 100644
--- a/sound/soc/imx/imx-pcm-dma-mx2.c
+++ b/sound/soc/imx/imx-pcm-dma-mx2.c
@@ -21,6 +21,7 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/dmaengine.h> 23#include <linux/dmaengine.h>
24#include <linux/types.h>
24 25
25#include <sound/core.h> 26#include <sound/core.h>
26#include <sound/initval.h> 27#include <sound/initval.h>
@@ -58,6 +59,8 @@ static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream,
58 if (ret) 59 if (ret)
59 return ret; 60 return ret;
60 61
62 slave_config.device_fc = false;
63
61 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 64 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
62 slave_config.dst_addr = dma_params->dma_addr; 65 slave_config.dst_addr = dma_params->dma_addr;
63 slave_config.dst_maxburst = dma_params->burstsize; 66 slave_config.dst_maxburst = dma_params->burstsize;
diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c
index 6ca1f46d84a4..e373fbbc97a0 100644
--- a/sound/soc/mxs/mxs-pcm.c
+++ b/sound/soc/mxs/mxs-pcm.c
@@ -28,6 +28,7 @@
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/dmaengine.h> 30#include <linux/dmaengine.h>
31#include <linux/fsl/mxs-dma.h>
31 32
32#include <sound/core.h> 33#include <sound/core.h>
33#include <sound/initval.h> 34#include <sound/initval.h>
@@ -36,7 +37,6 @@
36#include <sound/soc.h> 37#include <sound/soc.h>
37#include <sound/dmaengine_pcm.h> 38#include <sound/dmaengine_pcm.h>
38 39
39#include <mach/dma.h>
40#include "mxs-pcm.h" 40#include "mxs-pcm.h"
41 41
42struct mxs_pcm_dma_data { 42struct mxs_pcm_dma_data {
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 12be05b16880..53f4fd8feced 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -24,12 +24,12 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/fsl/mxs-dma.h>
27#include <sound/core.h> 28#include <sound/core.h>
28#include <sound/pcm.h> 29#include <sound/pcm.h>
29#include <sound/pcm_params.h> 30#include <sound/pcm_params.h>
30#include <sound/soc.h> 31#include <sound/soc.h>
31#include <sound/saif.h> 32#include <sound/saif.h>
32#include <mach/dma.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <mach/mxs.h> 35#include <mach/mxs.h>
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 49fe63ce51f7..7d4fa8ed6699 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -426,29 +426,6 @@ static struct snd_soc_ops ams_delta_ops = {
426}; 426};
427 427
428 428
429/* Board specific codec bias level control */
430static int ams_delta_set_bias_level(struct snd_soc_card *card,
431 struct snd_soc_dapm_context *dapm,
432 enum snd_soc_bias_level level)
433{
434 switch (level) {
435 case SND_SOC_BIAS_ON:
436 case SND_SOC_BIAS_PREPARE:
437 case SND_SOC_BIAS_STANDBY:
438 if (card->dapm.bias_level == SND_SOC_BIAS_OFF)
439 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
440 AMS_DELTA_LATCH2_MODEM_NRESET);
441 break;
442 case SND_SOC_BIAS_OFF:
443 if (card->dapm.bias_level != SND_SOC_BIAS_OFF)
444 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
445 0);
446 }
447 card->dapm.bias_level = level;
448
449 return 0;
450}
451
452/* Digital mute implemented using modem/CPU multiplexer. 429/* Digital mute implemented using modem/CPU multiplexer.
453 * Shares hardware with codec config pulse generation */ 430 * Shares hardware with codec config pulse generation */
454static bool ams_delta_muted = 1; 431static bool ams_delta_muted = 1;
@@ -512,9 +489,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
512 ams_delta_ops.shutdown = ams_delta_shutdown; 489 ams_delta_ops.shutdown = ams_delta_shutdown;
513 } 490 }
514 491
515 /* Set codec bias level */
516 ams_delta_set_bias_level(card, dapm, SND_SOC_BIAS_STANDBY);
517
518 /* Add hook switch - can be used to control the codec from userspace 492 /* Add hook switch - can be used to control the codec from userspace
519 * even if line discipline fails */ 493 * even if line discipline fails */
520 ret = snd_soc_jack_new(rtd->codec, "hook_switch", 494 ret = snd_soc_jack_new(rtd->codec, "hook_switch",
@@ -598,7 +572,6 @@ static struct snd_soc_card ams_delta_audio_card = {
598 .owner = THIS_MODULE, 572 .owner = THIS_MODULE,
599 .dai_link = &ams_delta_dai_link, 573 .dai_link = &ams_delta_dai_link,
600 .num_links = 1, 574 .num_links = 1,
601 .set_bias_level = ams_delta_set_bias_level,
602}; 575};
603 576
604/* Module init/exit */ 577/* Module init/exit */
@@ -635,7 +608,7 @@ err:
635 platform_device_put(ams_delta_audio_platform_device); 608 platform_device_put(ams_delta_audio_platform_device);
636 return ret; 609 return ret;
637} 610}
638module_init(ams_delta_module_init); 611late_initcall(ams_delta_module_init);
639 612
640static void __exit ams_delta_module_exit(void) 613static void __exit ams_delta_module_exit(void)
641{ 614{
@@ -647,11 +620,6 @@ static void __exit ams_delta_module_exit(void)
647 ARRAY_SIZE(ams_delta_hook_switch_gpios), 620 ARRAY_SIZE(ams_delta_hook_switch_gpios),
648 ams_delta_hook_switch_gpios); 621 ams_delta_hook_switch_gpios);
649 622
650 /* Keep modem power on */
651 ams_delta_set_bias_level(&ams_delta_audio_card,
652 &ams_delta_audio_card.rtd[0].codec->dapm,
653 SND_SOC_BIAS_STANDBY);
654
655 platform_device_unregister(cx20442_platform_device); 623 platform_device_unregister(cx20442_platform_device);
656 platform_device_unregister(ams_delta_audio_platform_device); 624 platform_device_unregister(ams_delta_audio_platform_device);
657} 625}
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 4800d5fe568d..06ea2744cc88 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -11,6 +11,7 @@
11 */ 11 */
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/io.h>
14#include <linux/module.h> 15#include <linux/module.h>
15#include <linux/platform_device.h> 16#include <linux/platform_device.h>
16 17
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 609abd51e55f..d08583790d23 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -17,6 +17,7 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/io.h>
20#include <sound/core.h> 21#include <sound/core.h>
21#include <sound/pcm.h> 22#include <sound/pcm.h>
22#include <sound/initval.h> 23#include <sound/initval.h>
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig
index f3417f2311b8..fe3995ce9b38 100644
--- a/sound/soc/samsung/Kconfig
+++ b/sound/soc/samsung/Kconfig
@@ -1,8 +1,8 @@
1config SND_SOC_SAMSUNG 1config SND_SOC_SAMSUNG
2 tristate "ASoC support for Samsung" 2 tristate "ASoC support for Samsung"
3 depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 || ARCH_EXYNOS4 3 depends on ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 || ARCH_EXYNOS4
4 select S3C64XX_DMA if ARCH_S3C64XX 4 select S3C64XX_DMA if ARCH_S3C64XX
5 select S3C2410_DMA if ARCH_S3C2410 5 select S3C2410_DMA if ARCH_S3C24XX
6 help 6 help
7 Say Y or M if you want to add support for codecs attached to 7 Say Y or M if you want to add support for codecs attached to
8 the Samsung SoCs' Audio interfaces. You will also need to 8 the Samsung SoCs' Audio interfaces. You will also need to
@@ -84,7 +84,7 @@ config SND_SOC_SAMSUNG_SMDK2443_WM9710
84 84
85config SND_SOC_SAMSUNG_LN2440SBC_ALC650 85config SND_SOC_SAMSUNG_LN2440SBC_ALC650
86 tristate "SoC AC97 Audio support for LN2440SBC - ALC650" 86 tristate "SoC AC97 Audio support for LN2440SBC - ALC650"
87 depends on SND_SOC_SAMSUNG && ARCH_S3C2410 87 depends on SND_SOC_SAMSUNG && ARCH_S3C24XX
88 select S3C2410_DMA 88 select S3C2410_DMA
89 select AC97_BUS 89 select AC97_BUS
90 select SND_SOC_AC97_CODEC 90 select SND_SOC_AC97_CODEC
@@ -95,7 +95,7 @@ config SND_SOC_SAMSUNG_LN2440SBC_ALC650
95 95
96config SND_SOC_SAMSUNG_S3C24XX_UDA134X 96config SND_SOC_SAMSUNG_S3C24XX_UDA134X
97 tristate "SoC I2S Audio support UDA134X wired to a S3C24XX" 97 tristate "SoC I2S Audio support UDA134X wired to a S3C24XX"
98 depends on SND_SOC_SAMSUNG && ARCH_S3C2410 98 depends on SND_SOC_SAMSUNG && ARCH_S3C24XX
99 select SND_S3C24XX_I2S 99 select SND_S3C24XX_I2S
100 select SND_SOC_L3 100 select SND_SOC_L3
101 select SND_SOC_UDA134X 101 select SND_SOC_UDA134X
@@ -107,14 +107,14 @@ config SND_SOC_SAMSUNG_SIMTEC
107 107
108config SND_SOC_SAMSUNG_SIMTEC_TLV320AIC23 108config SND_SOC_SAMSUNG_SIMTEC_TLV320AIC23
109 tristate "SoC I2S Audio support for TLV320AIC23 on Simtec boards" 109 tristate "SoC I2S Audio support for TLV320AIC23 on Simtec boards"
110 depends on SND_SOC_SAMSUNG && ARCH_S3C2410 110 depends on SND_SOC_SAMSUNG && ARCH_S3C24XX
111 select SND_S3C24XX_I2S 111 select SND_S3C24XX_I2S
112 select SND_SOC_TLV320AIC23 112 select SND_SOC_TLV320AIC23
113 select SND_SOC_SAMSUNG_SIMTEC 113 select SND_SOC_SAMSUNG_SIMTEC
114 114
115config SND_SOC_SAMSUNG_SIMTEC_HERMES 115config SND_SOC_SAMSUNG_SIMTEC_HERMES
116 tristate "SoC I2S Audio support for Simtec Hermes board" 116 tristate "SoC I2S Audio support for Simtec Hermes board"
117 depends on SND_SOC_SAMSUNG && ARCH_S3C2410 117 depends on SND_SOC_SAMSUNG && ARCH_S3C24XX
118 select SND_S3C24XX_I2S 118 select SND_S3C24XX_I2S
119 select SND_SOC_TLV320AIC3X 119 select SND_SOC_TLV320AIC3X
120 select SND_SOC_SAMSUNG_SIMTEC 120 select SND_SOC_SAMSUNG_SIMTEC
diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c
index 0193e595d415..5cfcc655e95f 100644
--- a/sound/soc/sh/siu_pcm.c
+++ b/sound/soc/sh/siu_pcm.c
@@ -130,7 +130,7 @@ static int siu_pcm_wr_set(struct siu_port *port_info,
130 sg_dma_len(&sg) = size; 130 sg_dma_len(&sg) = size;
131 sg_dma_address(&sg) = buff; 131 sg_dma_address(&sg) = buff;
132 132
133 desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, 133 desc = dmaengine_prep_slave_sg(siu_stream->chan,
134 &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 134 &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
135 if (!desc) { 135 if (!desc) {
136 dev_err(dev, "Failed to allocate a dma descriptor\n"); 136 dev_err(dev, "Failed to allocate a dma descriptor\n");
@@ -180,7 +180,7 @@ static int siu_pcm_rd_set(struct siu_port *port_info,
180 sg_dma_len(&sg) = size; 180 sg_dma_len(&sg) = size;
181 sg_dma_address(&sg) = buff; 181 sg_dma_address(&sg) = buff;
182 182
183 desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, 183 desc = dmaengine_prep_slave_sg(siu_stream->chan,
184 &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 184 &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
185 if (!desc) { 185 if (!desc) {
186 dev_err(dev, "Failed to allocate dma descriptor\n"); 186 dev_err(dev, "Failed to allocate dma descriptor\n");
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a4deebc0801a..8d2ebf502df4 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1087,6 +1087,8 @@ static int soc_probe_platform(struct snd_soc_card *card,
1087 snd_soc_dapm_new_controls(&platform->dapm, 1087 snd_soc_dapm_new_controls(&platform->dapm,
1088 driver->dapm_widgets, driver->num_dapm_widgets); 1088 driver->dapm_widgets, driver->num_dapm_widgets);
1089 1089
1090 platform->dapm.idle_bias_off = 1;
1091
1090 if (driver->probe) { 1092 if (driver->probe) {
1091 ret = driver->probe(platform); 1093 ret = driver->probe(platform);
1092 if (ret < 0) { 1094 if (ret < 0) {
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c
index 33509de52540..e53349912b2e 100644
--- a/sound/soc/tegra/tegra_i2s.c
+++ b/sound/soc/tegra/tegra_i2s.c
@@ -79,11 +79,15 @@ static int tegra_i2s_show(struct seq_file *s, void *unused)
79 struct tegra_i2s *i2s = s->private; 79 struct tegra_i2s *i2s = s->private;
80 int i; 80 int i;
81 81
82 clk_enable(i2s->clk_i2s);
83
82 for (i = 0; i < ARRAY_SIZE(regs); i++) { 84 for (i = 0; i < ARRAY_SIZE(regs); i++) {
83 u32 val = tegra_i2s_read(i2s, regs[i].offset); 85 u32 val = tegra_i2s_read(i2s, regs[i].offset);
84 seq_printf(s, "%s = %08x\n", regs[i].name, val); 86 seq_printf(s, "%s = %08x\n", regs[i].name, val);
85 } 87 }
86 88
89 clk_disable(i2s->clk_i2s);
90
87 return 0; 91 return 0;
88} 92}
89 93
@@ -112,7 +116,7 @@ static void tegra_i2s_debug_remove(struct tegra_i2s *i2s)
112 debugfs_remove(i2s->debug); 116 debugfs_remove(i2s->debug);
113} 117}
114#else 118#else
115static inline void tegra_i2s_debug_add(struct tegra_i2s *i2s, int id) 119static inline void tegra_i2s_debug_add(struct tegra_i2s *i2s)
116{ 120{
117} 121}
118 122
diff --git a/sound/soc/tegra/tegra_spdif.c b/sound/soc/tegra/tegra_spdif.c
index 475428cf270e..9ff2c601445f 100644
--- a/sound/soc/tegra/tegra_spdif.c
+++ b/sound/soc/tegra/tegra_spdif.c
@@ -79,11 +79,15 @@ static int tegra_spdif_show(struct seq_file *s, void *unused)
79 struct tegra_spdif *spdif = s->private; 79 struct tegra_spdif *spdif = s->private;
80 int i; 80 int i;
81 81
82 clk_enable(spdif->clk_spdif_out);
83
82 for (i = 0; i < ARRAY_SIZE(regs); i++) { 84 for (i = 0; i < ARRAY_SIZE(regs); i++) {
83 u32 val = tegra_spdif_read(spdif, regs[i].offset); 85 u32 val = tegra_spdif_read(spdif, regs[i].offset);
84 seq_printf(s, "%s = %08x\n", regs[i].name, val); 86 seq_printf(s, "%s = %08x\n", regs[i].name, val);
85 } 87 }
86 88
89 clk_disable(spdif->clk_spdif_out);
90
87 return 0; 91 return 0;
88} 92}
89 93
diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c
index 21554611557c..b609d2c64c55 100644
--- a/sound/soc/txx9/txx9aclc.c
+++ b/sound/soc/txx9/txx9aclc.c
@@ -132,7 +132,7 @@ txx9aclc_dma_submit(struct txx9aclc_dmadata *dmadata, dma_addr_t buf_dma_addr)
132 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf_dma_addr)), 132 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf_dma_addr)),
133 dmadata->frag_bytes, buf_dma_addr & (PAGE_SIZE - 1)); 133 dmadata->frag_bytes, buf_dma_addr & (PAGE_SIZE - 1));
134 sg_dma_address(&sg) = buf_dma_addr; 134 sg_dma_address(&sg) = buf_dma_addr;
135 desc = chan->device->device_prep_slave_sg(chan, &sg, 1, 135 desc = dmaengine_prep_slave_sg(chan, &sg, 1,
136 dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 136 dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
137 DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, 137 DMA_MEM_TO_DEV : DMA_DEV_TO_MEM,
138 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 138 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);