diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-01-31 09:13:14 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-01-31 09:13:14 -0500 |
commit | ea51e5040e24eefe44d70bc654a237ca1f0225b0 (patch) | |
tree | df2e5922dcdfafae62a10d8cd97f98121064fc23 /sound | |
parent | 3422a47041b8cb8f14ac1e3926bcf711121df6dc (diff) | |
parent | 8dbd52daee38adaae4d5a674bcca837e694a4f4c (diff) |
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'sound')
37 files changed, 272 insertions, 281 deletions
diff --git a/sound/aoa/codecs/Kconfig b/sound/aoa/codecs/Kconfig index 808eb11ebacd..0c68e32834c3 100644 --- a/sound/aoa/codecs/Kconfig +++ b/sound/aoa/codecs/Kconfig | |||
@@ -7,14 +7,6 @@ config SND_AOA_ONYX | |||
7 | codec chip found in the latest Apple machines | 7 | codec chip found in the latest Apple machines |
8 | (most of those with digital audio output). | 8 | (most of those with digital audio output). |
9 | 9 | ||
10 | #config SND_AOA_TOPAZ | ||
11 | # tristate "support Topaz chips" | ||
12 | # ---help--- | ||
13 | # This option enables support for the Topaz (CS84xx) | ||
14 | # codec chips found in the latest Apple machines, | ||
15 | # these chips do the digital input and output on | ||
16 | # some PowerMacs. | ||
17 | |||
18 | config SND_AOA_TAS | 10 | config SND_AOA_TAS |
19 | tristate "support TAS chips" | 11 | tristate "support TAS chips" |
20 | select I2C | 12 | select I2C |
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index e518d38b1c74..b37b702a3a6a 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c | |||
@@ -1097,6 +1097,8 @@ static struct amba_id aaci_ids[] = { | |||
1097 | { 0, 0 }, | 1097 | { 0, 0 }, |
1098 | }; | 1098 | }; |
1099 | 1099 | ||
1100 | MODULE_DEVICE_TABLE(amba, aaci_ids); | ||
1101 | |||
1100 | static struct amba_driver aaci_driver = { | 1102 | static struct amba_driver aaci_driver = { |
1101 | .drv = { | 1103 | .drv = { |
1102 | .name = DRIVER_NAME, | 1104 | .name = DRIVER_NAME, |
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index 6fd9391b3a6c..4fa1dbd8ee83 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c | |||
@@ -133,7 +133,7 @@ static int atmel_abdac_prepare_dma(struct atmel_abdac *dac, | |||
133 | period_len = frames_to_bytes(runtime, runtime->period_size); | 133 | period_len = frames_to_bytes(runtime, runtime->period_size); |
134 | 134 | ||
135 | cdesc = dw_dma_cyclic_prep(chan, runtime->dma_addr, buffer_len, | 135 | cdesc = dw_dma_cyclic_prep(chan, runtime->dma_addr, buffer_len, |
136 | period_len, DMA_TO_DEVICE); | 136 | period_len, DMA_MEM_TO_DEV); |
137 | if (IS_ERR(cdesc)) { | 137 | if (IS_ERR(cdesc)) { |
138 | dev_dbg(&dac->pdev->dev, "could not prepare cyclic DMA\n"); | 138 | dev_dbg(&dac->pdev->dev, "could not prepare cyclic DMA\n"); |
139 | return PTR_ERR(cdesc); | 139 | return PTR_ERR(cdesc); |
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 6e5addeb236b..61dade698358 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c | |||
@@ -102,7 +102,7 @@ static void atmel_ac97c_dma_capture_period_done(void *arg) | |||
102 | 102 | ||
103 | static int atmel_ac97c_prepare_dma(struct atmel_ac97c *chip, | 103 | static int atmel_ac97c_prepare_dma(struct atmel_ac97c *chip, |
104 | struct snd_pcm_substream *substream, | 104 | struct snd_pcm_substream *substream, |
105 | enum dma_data_direction direction) | 105 | enum dma_transfer_direction direction) |
106 | { | 106 | { |
107 | struct dma_chan *chan; | 107 | struct dma_chan *chan; |
108 | struct dw_cyclic_desc *cdesc; | 108 | struct dw_cyclic_desc *cdesc; |
@@ -118,7 +118,7 @@ static int atmel_ac97c_prepare_dma(struct atmel_ac97c *chip, | |||
118 | return -EINVAL; | 118 | return -EINVAL; |
119 | } | 119 | } |
120 | 120 | ||
121 | if (direction == DMA_TO_DEVICE) | 121 | if (direction == DMA_MEM_TO_DEV) |
122 | chan = chip->dma.tx_chan; | 122 | chan = chip->dma.tx_chan; |
123 | else | 123 | else |
124 | chan = chip->dma.rx_chan; | 124 | chan = chip->dma.rx_chan; |
@@ -133,7 +133,7 @@ static int atmel_ac97c_prepare_dma(struct atmel_ac97c *chip, | |||
133 | return PTR_ERR(cdesc); | 133 | return PTR_ERR(cdesc); |
134 | } | 134 | } |
135 | 135 | ||
136 | if (direction == DMA_TO_DEVICE) { | 136 | if (direction == DMA_MEM_TO_DEV) { |
137 | cdesc->period_callback = atmel_ac97c_dma_playback_period_done; | 137 | cdesc->period_callback = atmel_ac97c_dma_playback_period_done; |
138 | set_bit(DMA_TX_READY, &chip->flags); | 138 | set_bit(DMA_TX_READY, &chip->flags); |
139 | } else { | 139 | } else { |
@@ -393,7 +393,7 @@ static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream) | |||
393 | if (cpu_is_at32ap7000()) { | 393 | if (cpu_is_at32ap7000()) { |
394 | if (!test_bit(DMA_TX_READY, &chip->flags)) | 394 | if (!test_bit(DMA_TX_READY, &chip->flags)) |
395 | retval = atmel_ac97c_prepare_dma(chip, substream, | 395 | retval = atmel_ac97c_prepare_dma(chip, substream, |
396 | DMA_TO_DEVICE); | 396 | DMA_MEM_TO_DEV); |
397 | } else { | 397 | } else { |
398 | /* Initialize and start the PDC */ | 398 | /* Initialize and start the PDC */ |
399 | writel(runtime->dma_addr, chip->regs + ATMEL_PDC_TPR); | 399 | writel(runtime->dma_addr, chip->regs + ATMEL_PDC_TPR); |
@@ -484,7 +484,7 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream) | |||
484 | if (cpu_is_at32ap7000()) { | 484 | if (cpu_is_at32ap7000()) { |
485 | if (!test_bit(DMA_RX_READY, &chip->flags)) | 485 | if (!test_bit(DMA_RX_READY, &chip->flags)) |
486 | retval = atmel_ac97c_prepare_dma(chip, substream, | 486 | retval = atmel_ac97c_prepare_dma(chip, substream, |
487 | DMA_FROM_DEVICE); | 487 | DMA_DEV_TO_MEM); |
488 | } else { | 488 | } else { |
489 | /* Initialize and start the PDC */ | 489 | /* Initialize and start the PDC */ |
490 | writel(runtime->dma_addr, chip->regs + ATMEL_PDC_RPR); | 490 | writel(runtime->dma_addr, chip->regs + ATMEL_PDC_RPR); |
@@ -899,6 +899,10 @@ static void atmel_ac97c_reset(struct atmel_ac97c *chip) | |||
899 | /* AC97 v2.2 specifications says minimum 1 us. */ | 899 | /* AC97 v2.2 specifications says minimum 1 us. */ |
900 | udelay(2); | 900 | udelay(2); |
901 | gpio_set_value(chip->reset_pin, 1); | 901 | gpio_set_value(chip->reset_pin, 1); |
902 | } else { | ||
903 | ac97c_writel(chip, MR, AC97C_MR_WRST | AC97C_MR_ENA); | ||
904 | udelay(2); | ||
905 | ac97c_writel(chip, MR, AC97C_MR_ENA); | ||
902 | } | 906 | } |
903 | } | 907 | } |
904 | 908 | ||
diff --git a/sound/core/Kconfig b/sound/core/Kconfig index 349756978ed3..b413ed05e74d 100644 --- a/sound/core/Kconfig +++ b/sound/core/Kconfig | |||
@@ -5,7 +5,6 @@ config SND_TIMER | |||
5 | config SND_PCM | 5 | config SND_PCM |
6 | tristate | 6 | tristate |
7 | select SND_TIMER | 7 | select SND_TIMER |
8 | select GCD | ||
9 | 8 | ||
10 | config SND_HWDEP | 9 | config SND_HWDEP |
11 | tristate | 10 | tristate |
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig index 6c9e8e8f45f8..5849b129e50d 100644 --- a/sound/oss/Kconfig +++ b/sound/oss/Kconfig | |||
@@ -521,7 +521,7 @@ config SC6600_CDROMBASE | |||
521 | 521 | ||
522 | config SOUND_VIDC | 522 | config SOUND_VIDC |
523 | tristate "VIDC 16-bit sound" | 523 | tristate "VIDC 16-bit sound" |
524 | depends on ARM && (ARCH_ACORN || ARCH_CLPS7500) | 524 | depends on ARM && ARCH_ACORN |
525 | help | 525 | help |
526 | 16-bit support for the VIDC onboard sound hardware found on Acorn | 526 | 16-bit support for the VIDC onboard sound hardware found on Acorn |
527 | machines. | 527 | machines. |
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 40b181bab930..9f3b01bb72c8 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -95,13 +95,13 @@ module_param(ac97_quirk, charp, 0444); | |||
95 | MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); | 95 | MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); |
96 | module_param(buggy_semaphore, bool, 0444); | 96 | module_param(buggy_semaphore, bool, 0444); |
97 | MODULE_PARM_DESC(buggy_semaphore, "Enable workaround for hardwares with problematic codec semaphores."); | 97 | MODULE_PARM_DESC(buggy_semaphore, "Enable workaround for hardwares with problematic codec semaphores."); |
98 | module_param(buggy_irq, bool, 0444); | 98 | module_param(buggy_irq, bint, 0444); |
99 | MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards."); | 99 | MODULE_PARM_DESC(buggy_irq, "Enable workaround for buggy interrupts on some motherboards."); |
100 | module_param(xbox, bool, 0444); | 100 | module_param(xbox, bool, 0444); |
101 | MODULE_PARM_DESC(xbox, "Set to 1 for Xbox, if you have problems with the AC'97 codec detection."); | 101 | MODULE_PARM_DESC(xbox, "Set to 1 for Xbox, if you have problems with the AC'97 codec detection."); |
102 | module_param(spdif_aclink, int, 0444); | 102 | module_param(spdif_aclink, int, 0444); |
103 | MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link."); | 103 | MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link."); |
104 | module_param(inside_vm, bool, 0444); | 104 | module_param(inside_vm, bint, 0444); |
105 | MODULE_PARM_DESC(inside_vm, "KVM/Parallels optimization."); | 105 | MODULE_PARM_DESC(inside_vm, "KVM/Parallels optimization."); |
106 | 106 | ||
107 | /* just for backward compatibility */ | 107 | /* just for backward compatibility */ |
diff --git a/sound/soc/au1x/Kconfig b/sound/soc/au1x/Kconfig index e908a8123110..a56104040e83 100644 --- a/sound/soc/au1x/Kconfig +++ b/sound/soc/au1x/Kconfig | |||
@@ -1,13 +1,13 @@ | |||
1 | ## | 1 | ## |
2 | ## Au1200/Au1550 PSC + DBDMA | 2 | ## Au1200/Au1550/Au1300 PSC + DBDMA |
3 | ## | 3 | ## |
4 | config SND_SOC_AU1XPSC | 4 | config SND_SOC_AU1XPSC |
5 | tristate "SoC Audio for Au1200/Au1250/Au1550" | 5 | tristate "SoC Audio for Au12xx/Au13xx/Au1550" |
6 | depends on MIPS_ALCHEMY | 6 | depends on MIPS_ALCHEMY |
7 | help | 7 | help |
8 | This option enables support for the Programmable Serial | 8 | This option enables support for the Programmable Serial |
9 | Controllers in AC97 and I2S mode, and the Descriptor-Based DMA | 9 | Controllers in AC97 and I2S mode, and the Descriptor-Based DMA |
10 | Controller (DBDMA) as found on the Au1200/Au1250/Au1550 SoC. | 10 | Controller (DBDMA) as found on the Au12xx/Au13xx/Au1550 SoC. |
11 | 11 | ||
12 | config SND_SOC_AU1XPSC_I2S | 12 | config SND_SOC_AU1XPSC_I2S |
13 | tristate | 13 | tristate |
@@ -51,12 +51,14 @@ config SND_SOC_DB1000 | |||
51 | of boards (DB1000/DB1500/DB1100). | 51 | of boards (DB1000/DB1500/DB1100). |
52 | 52 | ||
53 | config SND_SOC_DB1200 | 53 | config SND_SOC_DB1200 |
54 | tristate "DB1200 AC97+I2S audio support" | 54 | tristate "DB1200/DB1300/DB1550 Audio support" |
55 | depends on SND_SOC_AU1XPSC | 55 | depends on SND_SOC_AU1XPSC |
56 | select SND_SOC_AU1XPSC_AC97 | 56 | select SND_SOC_AU1XPSC_AC97 |
57 | select SND_SOC_AC97_CODEC | 57 | select SND_SOC_AC97_CODEC |
58 | select SND_SOC_WM9712 | ||
58 | select SND_SOC_AU1XPSC_I2S | 59 | select SND_SOC_AU1XPSC_I2S |
59 | select SND_SOC_WM8731 | 60 | select SND_SOC_WM8731 |
60 | help | 61 | help |
61 | Select this option to enable audio (AC97 or I2S) on the | 62 | Select this option to enable audio (AC97 and I2S) on the |
62 | Alchemy/AMD/RMI DB1200 demoboard. | 63 | Alchemy/AMD/RMI/NetLogic Db1200, Db1550 and Db1300 evaluation boards. |
64 | If you need Db1300 touchscreen support, you definitely want to say Y. | ||
diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c index 1c629393df78..30ea513d81d7 100644 --- a/sound/soc/au1x/db1200.c +++ b/sound/soc/au1x/db1200.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * DB1200 ASoC audio fabric support code. | 2 | * DB1200/DB1300/DB1550 ASoC audio fabric support code. |
3 | * | 3 | * |
4 | * (c) 2008-2011 Manuel Lauss <manuel.lauss@googlemail.com> | 4 | * (c) 2008-2011 Manuel Lauss <manuel.lauss@googlemail.com> |
5 | * | 5 | * |
@@ -28,6 +28,18 @@ static struct platform_device_id db1200_pids[] = { | |||
28 | }, { | 28 | }, { |
29 | .name = "db1200-i2s", | 29 | .name = "db1200-i2s", |
30 | .driver_data = 1, | 30 | .driver_data = 1, |
31 | }, { | ||
32 | .name = "db1300-ac97", | ||
33 | .driver_data = 2, | ||
34 | }, { | ||
35 | .name = "db1300-i2s", | ||
36 | .driver_data = 3, | ||
37 | }, { | ||
38 | .name = "db1550-ac97", | ||
39 | .driver_data = 4, | ||
40 | }, { | ||
41 | .name = "db1550-i2s", | ||
42 | .driver_data = 5, | ||
31 | }, | 43 | }, |
32 | {}, | 44 | {}, |
33 | }; | 45 | }; |
@@ -50,6 +62,27 @@ static struct snd_soc_card db1200_ac97_machine = { | |||
50 | .num_links = 1, | 62 | .num_links = 1, |
51 | }; | 63 | }; |
52 | 64 | ||
65 | static struct snd_soc_dai_link db1300_ac97_dai = { | ||
66 | .name = "AC97", | ||
67 | .stream_name = "AC97 HiFi", | ||
68 | .codec_dai_name = "wm9712-hifi", | ||
69 | .cpu_dai_name = "au1xpsc_ac97.1", | ||
70 | .platform_name = "au1xpsc-pcm.1", | ||
71 | .codec_name = "wm9712-codec.1", | ||
72 | }; | ||
73 | |||
74 | static struct snd_soc_card db1300_ac97_machine = { | ||
75 | .name = "DB1300_AC97", | ||
76 | .dai_link = &db1300_ac97_dai, | ||
77 | .num_links = 1, | ||
78 | }; | ||
79 | |||
80 | static struct snd_soc_card db1550_ac97_machine = { | ||
81 | .name = "DB1550_AC97", | ||
82 | .dai_link = &db1200_ac97_dai, | ||
83 | .num_links = 1, | ||
84 | }; | ||
85 | |||
53 | /*------------------------- I2S PART ---------------------------*/ | 86 | /*------------------------- I2S PART ---------------------------*/ |
54 | 87 | ||
55 | static int db1200_i2s_startup(struct snd_pcm_substream *substream) | 88 | static int db1200_i2s_startup(struct snd_pcm_substream *substream) |
@@ -100,11 +133,47 @@ static struct snd_soc_card db1200_i2s_machine = { | |||
100 | .num_links = 1, | 133 | .num_links = 1, |
101 | }; | 134 | }; |
102 | 135 | ||
136 | static struct snd_soc_dai_link db1300_i2s_dai = { | ||
137 | .name = "WM8731", | ||
138 | .stream_name = "WM8731 PCM", | ||
139 | .codec_dai_name = "wm8731-hifi", | ||
140 | .cpu_dai_name = "au1xpsc_i2s.2", | ||
141 | .platform_name = "au1xpsc-pcm.2", | ||
142 | .codec_name = "wm8731.0-001b", | ||
143 | .ops = &db1200_i2s_wm8731_ops, | ||
144 | }; | ||
145 | |||
146 | static struct snd_soc_card db1300_i2s_machine = { | ||
147 | .name = "DB1300_I2S", | ||
148 | .dai_link = &db1300_i2s_dai, | ||
149 | .num_links = 1, | ||
150 | }; | ||
151 | |||
152 | static struct snd_soc_dai_link db1550_i2s_dai = { | ||
153 | .name = "WM8731", | ||
154 | .stream_name = "WM8731 PCM", | ||
155 | .codec_dai_name = "wm8731-hifi", | ||
156 | .cpu_dai_name = "au1xpsc_i2s.3", | ||
157 | .platform_name = "au1xpsc-pcm.3", | ||
158 | .codec_name = "wm8731.0-001b", | ||
159 | .ops = &db1200_i2s_wm8731_ops, | ||
160 | }; | ||
161 | |||
162 | static struct snd_soc_card db1550_i2s_machine = { | ||
163 | .name = "DB1550_I2S", | ||
164 | .dai_link = &db1550_i2s_dai, | ||
165 | .num_links = 1, | ||
166 | }; | ||
167 | |||
103 | /*------------------------- COMMON PART ---------------------------*/ | 168 | /*------------------------- COMMON PART ---------------------------*/ |
104 | 169 | ||
105 | static struct snd_soc_card *db1200_cards[] __devinitdata = { | 170 | static struct snd_soc_card *db1200_cards[] __devinitdata = { |
106 | &db1200_ac97_machine, | 171 | &db1200_ac97_machine, |
107 | &db1200_i2s_machine, | 172 | &db1200_i2s_machine, |
173 | &db1300_ac97_machine, | ||
174 | &db1300_i2s_machine, | ||
175 | &db1550_ac97_machine, | ||
176 | &db1550_i2s_machine, | ||
108 | }; | 177 | }; |
109 | 178 | ||
110 | static int __devinit db1200_audio_probe(struct platform_device *pdev) | 179 | static int __devinit db1200_audio_probe(struct platform_device *pdev) |
@@ -138,5 +207,5 @@ static struct platform_driver db1200_audio_driver = { | |||
138 | module_platform_driver(db1200_audio_driver); | 207 | module_platform_driver(db1200_audio_driver); |
139 | 208 | ||
140 | MODULE_LICENSE("GPL"); | 209 | MODULE_LICENSE("GPL"); |
141 | MODULE_DESCRIPTION("DB1200 ASoC audio support"); | 210 | MODULE_DESCRIPTION("DB1200/DB1300/DB1550 ASoC audio support"); |
142 | MODULE_AUTHOR("Manuel Lauss"); | 211 | MODULE_AUTHOR("Manuel Lauss"); |
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index fc9b127206e2..7f4ba819a9f6 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -832,7 +832,7 @@ static int ldo_regulator_register(struct snd_soc_codec *codec, | |||
832 | ldo->voltage = voltage; | 832 | ldo->voltage = voltage; |
833 | 833 | ||
834 | ldo->dev = regulator_register(&ldo->desc, codec->dev, | 834 | ldo->dev = regulator_register(&ldo->desc, codec->dev, |
835 | init_data, ldo); | 835 | init_data, ldo, NULL); |
836 | if (IS_ERR(ldo->dev)) { | 836 | if (IS_ERR(ldo->dev)) { |
837 | int ret = PTR_ERR(ldo->dev); | 837 | int ret = PTR_ERR(ldo->dev); |
838 | 838 | ||
@@ -987,12 +987,12 @@ static int sgtl5000_restore_regs(struct snd_soc_codec *codec) | |||
987 | /* restore regular registers */ | 987 | /* restore regular registers */ |
988 | for (reg = 0; reg <= SGTL5000_CHIP_SHORT_CTRL; reg += 2) { | 988 | for (reg = 0; reg <= SGTL5000_CHIP_SHORT_CTRL; reg += 2) { |
989 | 989 | ||
990 | /* this regs depends on the others */ | 990 | /* These regs should restore in particular order */ |
991 | if (reg == SGTL5000_CHIP_ANA_POWER || | 991 | if (reg == SGTL5000_CHIP_ANA_POWER || |
992 | reg == SGTL5000_CHIP_CLK_CTRL || | 992 | reg == SGTL5000_CHIP_CLK_CTRL || |
993 | reg == SGTL5000_CHIP_LINREG_CTRL || | 993 | reg == SGTL5000_CHIP_LINREG_CTRL || |
994 | reg == SGTL5000_CHIP_LINE_OUT_CTRL || | 994 | reg == SGTL5000_CHIP_LINE_OUT_CTRL || |
995 | reg == SGTL5000_CHIP_CLK_CTRL) | 995 | reg == SGTL5000_CHIP_REF_CTRL) |
996 | continue; | 996 | continue; |
997 | 997 | ||
998 | snd_soc_write(codec, reg, cache[reg]); | 998 | snd_soc_write(codec, reg, cache[reg]); |
@@ -1003,8 +1003,17 @@ static int sgtl5000_restore_regs(struct snd_soc_codec *codec) | |||
1003 | snd_soc_write(codec, reg, cache[reg]); | 1003 | snd_soc_write(codec, reg, cache[reg]); |
1004 | 1004 | ||
1005 | /* | 1005 | /* |
1006 | * restore power and other regs according | 1006 | * restore these regs according to the power setting sequence in |
1007 | * to set_power() and set_clock() | 1007 | * sgtl5000_set_power_regs() and clock setting sequence in |
1008 | * sgtl5000_set_clock(). | ||
1009 | * | ||
1010 | * The order of restore is: | ||
1011 | * 1. SGTL5000_CHIP_CLK_CTRL MCLK_FREQ bits (1:0) should be restore after | ||
1012 | * SGTL5000_CHIP_ANA_POWER PLL bits set | ||
1013 | * 2. SGTL5000_CHIP_LINREG_CTRL should be set before | ||
1014 | * SGTL5000_CHIP_ANA_POWER LINREG_D restored | ||
1015 | * 3. SGTL5000_CHIP_REF_CTRL controls Analog Ground Voltage, | ||
1016 | * prefer to resotre it after SGTL5000_CHIP_ANA_POWER restored | ||
1008 | */ | 1017 | */ |
1009 | snd_soc_write(codec, SGTL5000_CHIP_LINREG_CTRL, | 1018 | snd_soc_write(codec, SGTL5000_CHIP_LINREG_CTRL, |
1010 | cache[SGTL5000_CHIP_LINREG_CTRL]); | 1019 | cache[SGTL5000_CHIP_LINREG_CTRL]); |
@@ -1457,5 +1466,5 @@ static void __exit sgtl5000_exit(void) | |||
1457 | module_exit(sgtl5000_exit); | 1466 | module_exit(sgtl5000_exit); |
1458 | 1467 | ||
1459 | MODULE_DESCRIPTION("Freescale SGTL5000 ALSA SoC Codec Driver"); | 1468 | MODULE_DESCRIPTION("Freescale SGTL5000 ALSA SoC Codec Driver"); |
1460 | MODULE_AUTHOR("Zeng Zhaoming <zhaoming.zeng@freescale.com>"); | 1469 | MODULE_AUTHOR("Zeng Zhaoming <zengzm.kernel@gmail.com>"); |
1461 | MODULE_LICENSE("GPL"); | 1470 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index eb401ef021fb..372b0b83bd9f 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c | |||
@@ -60,7 +60,6 @@ struct aic32x4_rate_divs { | |||
60 | 60 | ||
61 | struct aic32x4_priv { | 61 | struct aic32x4_priv { |
62 | u32 sysclk; | 62 | u32 sysclk; |
63 | s32 master; | ||
64 | u8 page_no; | 63 | u8 page_no; |
65 | void *control_data; | 64 | void *control_data; |
66 | u32 power_cfg; | 65 | u32 power_cfg; |
@@ -369,7 +368,6 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
369 | static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | 368 | static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) |
370 | { | 369 | { |
371 | struct snd_soc_codec *codec = codec_dai->codec; | 370 | struct snd_soc_codec *codec = codec_dai->codec; |
372 | struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); | ||
373 | u8 iface_reg_1; | 371 | u8 iface_reg_1; |
374 | u8 iface_reg_2; | 372 | u8 iface_reg_2; |
375 | u8 iface_reg_3; | 373 | u8 iface_reg_3; |
@@ -384,11 +382,9 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
384 | /* set master/slave audio interface */ | 382 | /* set master/slave audio interface */ |
385 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | 383 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
386 | case SND_SOC_DAIFMT_CBM_CFM: | 384 | case SND_SOC_DAIFMT_CBM_CFM: |
387 | aic32x4->master = 1; | ||
388 | iface_reg_1 |= AIC32X4_BCLKMASTER | AIC32X4_WCLKMASTER; | 385 | iface_reg_1 |= AIC32X4_BCLKMASTER | AIC32X4_WCLKMASTER; |
389 | break; | 386 | break; |
390 | case SND_SOC_DAIFMT_CBS_CFS: | 387 | case SND_SOC_DAIFMT_CBS_CFS: |
391 | aic32x4->master = 0; | ||
392 | break; | 388 | break; |
393 | default: | 389 | default: |
394 | printk(KERN_ERR "aic32x4: invalid DAI master/slave interface\n"); | 390 | printk(KERN_ERR "aic32x4: invalid DAI master/slave interface\n"); |
@@ -526,64 +522,58 @@ static int aic32x4_mute(struct snd_soc_dai *dai, int mute) | |||
526 | static int aic32x4_set_bias_level(struct snd_soc_codec *codec, | 522 | static int aic32x4_set_bias_level(struct snd_soc_codec *codec, |
527 | enum snd_soc_bias_level level) | 523 | enum snd_soc_bias_level level) |
528 | { | 524 | { |
529 | struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); | ||
530 | |||
531 | switch (level) { | 525 | switch (level) { |
532 | case SND_SOC_BIAS_ON: | 526 | case SND_SOC_BIAS_ON: |
533 | if (aic32x4->master) { | 527 | /* Switch on PLL */ |
534 | /* Switch on PLL */ | 528 | snd_soc_update_bits(codec, AIC32X4_PLLPR, |
535 | snd_soc_update_bits(codec, AIC32X4_PLLPR, | 529 | AIC32X4_PLLEN, AIC32X4_PLLEN); |
536 | AIC32X4_PLLEN, AIC32X4_PLLEN); | 530 | |
537 | 531 | /* Switch on NDAC Divider */ | |
538 | /* Switch on NDAC Divider */ | 532 | snd_soc_update_bits(codec, AIC32X4_NDAC, |
539 | snd_soc_update_bits(codec, AIC32X4_NDAC, | 533 | AIC32X4_NDACEN, AIC32X4_NDACEN); |
540 | AIC32X4_NDACEN, AIC32X4_NDACEN); | 534 | |
541 | 535 | /* Switch on MDAC Divider */ | |
542 | /* Switch on MDAC Divider */ | 536 | snd_soc_update_bits(codec, AIC32X4_MDAC, |
543 | snd_soc_update_bits(codec, AIC32X4_MDAC, | 537 | AIC32X4_MDACEN, AIC32X4_MDACEN); |
544 | AIC32X4_MDACEN, AIC32X4_MDACEN); | 538 | |
545 | 539 | /* Switch on NADC Divider */ | |
546 | /* Switch on NADC Divider */ | 540 | snd_soc_update_bits(codec, AIC32X4_NADC, |
547 | snd_soc_update_bits(codec, AIC32X4_NADC, | 541 | AIC32X4_NADCEN, AIC32X4_NADCEN); |
548 | AIC32X4_NADCEN, AIC32X4_NADCEN); | 542 | |
549 | 543 | /* Switch on MADC Divider */ | |
550 | /* Switch on MADC Divider */ | 544 | snd_soc_update_bits(codec, AIC32X4_MADC, |
551 | snd_soc_update_bits(codec, AIC32X4_MADC, | 545 | AIC32X4_MADCEN, AIC32X4_MADCEN); |
552 | AIC32X4_MADCEN, AIC32X4_MADCEN); | 546 | |
553 | 547 | /* Switch on BCLK_N Divider */ | |
554 | /* Switch on BCLK_N Divider */ | 548 | snd_soc_update_bits(codec, AIC32X4_BCLKN, |
555 | snd_soc_update_bits(codec, AIC32X4_BCLKN, | 549 | AIC32X4_BCLKEN, AIC32X4_BCLKEN); |
556 | AIC32X4_BCLKEN, AIC32X4_BCLKEN); | ||
557 | } | ||
558 | break; | 550 | break; |
559 | case SND_SOC_BIAS_PREPARE: | 551 | case SND_SOC_BIAS_PREPARE: |
560 | break; | 552 | break; |
561 | case SND_SOC_BIAS_STANDBY: | 553 | case SND_SOC_BIAS_STANDBY: |
562 | if (aic32x4->master) { | 554 | /* Switch off PLL */ |
563 | /* Switch off PLL */ | 555 | snd_soc_update_bits(codec, AIC32X4_PLLPR, |
564 | snd_soc_update_bits(codec, AIC32X4_PLLPR, | 556 | AIC32X4_PLLEN, 0); |
565 | AIC32X4_PLLEN, 0); | 557 | |
566 | 558 | /* Switch off NDAC Divider */ | |
567 | /* Switch off NDAC Divider */ | 559 | snd_soc_update_bits(codec, AIC32X4_NDAC, |
568 | snd_soc_update_bits(codec, AIC32X4_NDAC, | 560 | AIC32X4_NDACEN, 0); |
569 | AIC32X4_NDACEN, 0); | 561 | |
570 | 562 | /* Switch off MDAC Divider */ | |
571 | /* Switch off MDAC Divider */ | 563 | snd_soc_update_bits(codec, AIC32X4_MDAC, |
572 | snd_soc_update_bits(codec, AIC32X4_MDAC, | 564 | AIC32X4_MDACEN, 0); |
573 | AIC32X4_MDACEN, 0); | 565 | |
574 | 566 | /* Switch off NADC Divider */ | |
575 | /* Switch off NADC Divider */ | 567 | snd_soc_update_bits(codec, AIC32X4_NADC, |
576 | snd_soc_update_bits(codec, AIC32X4_NADC, | 568 | AIC32X4_NADCEN, 0); |
577 | AIC32X4_NADCEN, 0); | 569 | |
578 | 570 | /* Switch off MADC Divider */ | |
579 | /* Switch off MADC Divider */ | 571 | snd_soc_update_bits(codec, AIC32X4_MADC, |
580 | snd_soc_update_bits(codec, AIC32X4_MADC, | 572 | AIC32X4_MADCEN, 0); |
581 | AIC32X4_MADCEN, 0); | 573 | |
582 | 574 | /* Switch off BCLK_N Divider */ | |
583 | /* Switch off BCLK_N Divider */ | 575 | snd_soc_update_bits(codec, AIC32X4_BCLKN, |
584 | snd_soc_update_bits(codec, AIC32X4_BCLKN, | 576 | AIC32X4_BCLKEN, 0); |
585 | AIC32X4_BCLKEN, 0); | ||
586 | } | ||
587 | break; | 577 | break; |
588 | case SND_SOC_BIAS_OFF: | 578 | case SND_SOC_BIAS_OFF: |
589 | break; | 579 | break; |
@@ -651,9 +641,11 @@ static int aic32x4_probe(struct snd_soc_codec *codec) | |||
651 | if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE) { | 641 | if (aic32x4->power_cfg & AIC32X4_PWR_AVDD_DVDD_WEAK_DISABLE) { |
652 | snd_soc_write(codec, AIC32X4_PWRCFG, AIC32X4_AVDDWEAKDISABLE); | 642 | snd_soc_write(codec, AIC32X4_PWRCFG, AIC32X4_AVDDWEAKDISABLE); |
653 | } | 643 | } |
654 | if (aic32x4->power_cfg & AIC32X4_PWR_AIC32X4_LDO_ENABLE) { | 644 | |
655 | snd_soc_write(codec, AIC32X4_LDOCTL, AIC32X4_LDOCTLEN); | 645 | tmp_reg = (aic32x4->power_cfg & AIC32X4_PWR_AIC32X4_LDO_ENABLE) ? |
656 | } | 646 | AIC32X4_LDOCTLEN : 0; |
647 | snd_soc_write(codec, AIC32X4_LDOCTL, tmp_reg); | ||
648 | |||
657 | tmp_reg = snd_soc_read(codec, AIC32X4_CMMODE); | 649 | tmp_reg = snd_soc_read(codec, AIC32X4_CMMODE); |
658 | if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36) { | 650 | if (aic32x4->power_cfg & AIC32X4_PWR_CMMODE_LDOIN_RANGE_18_36) { |
659 | tmp_reg |= AIC32X4_LDOIN_18_36; | 651 | tmp_reg |= AIC32X4_LDOIN_18_36; |
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index c2880907fced..a75c3766aede 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c | |||
@@ -733,8 +733,9 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
733 | struct wm2000_priv *wm2000; | 733 | struct wm2000_priv *wm2000; |
734 | struct wm2000_platform_data *pdata; | 734 | struct wm2000_platform_data *pdata; |
735 | const char *filename; | 735 | const char *filename; |
736 | const struct firmware *fw; | 736 | const struct firmware *fw = NULL; |
737 | int reg, ret; | 737 | int ret; |
738 | int reg; | ||
738 | u16 id; | 739 | u16 id; |
739 | 740 | ||
740 | wm2000 = devm_kzalloc(&i2c->dev, sizeof(struct wm2000_priv), | 741 | wm2000 = devm_kzalloc(&i2c->dev, sizeof(struct wm2000_priv), |
@@ -751,7 +752,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
751 | ret = PTR_ERR(wm2000->regmap); | 752 | ret = PTR_ERR(wm2000->regmap); |
752 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | 753 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", |
753 | ret); | 754 | ret); |
754 | goto err; | 755 | goto out; |
755 | } | 756 | } |
756 | 757 | ||
757 | /* Verify that this is a WM2000 */ | 758 | /* Verify that this is a WM2000 */ |
@@ -763,7 +764,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
763 | if (id != 0x2000) { | 764 | if (id != 0x2000) { |
764 | dev_err(&i2c->dev, "Device is not a WM2000 - ID %x\n", id); | 765 | dev_err(&i2c->dev, "Device is not a WM2000 - ID %x\n", id); |
765 | ret = -ENODEV; | 766 | ret = -ENODEV; |
766 | goto err_regmap; | 767 | goto out_regmap_exit; |
767 | } | 768 | } |
768 | 769 | ||
769 | reg = wm2000_read(i2c, WM2000_REG_REVISON); | 770 | reg = wm2000_read(i2c, WM2000_REG_REVISON); |
@@ -782,7 +783,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
782 | ret = request_firmware(&fw, filename, &i2c->dev); | 783 | ret = request_firmware(&fw, filename, &i2c->dev); |
783 | if (ret != 0) { | 784 | if (ret != 0) { |
784 | dev_err(&i2c->dev, "Failed to acquire ANC data: %d\n", ret); | 785 | dev_err(&i2c->dev, "Failed to acquire ANC data: %d\n", ret); |
785 | goto err_regmap; | 786 | goto out_regmap_exit; |
786 | } | 787 | } |
787 | 788 | ||
788 | /* Pre-cook the concatenation of the register address onto the image */ | 789 | /* Pre-cook the concatenation of the register address onto the image */ |
@@ -793,15 +794,13 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
793 | if (wm2000->anc_download == NULL) { | 794 | if (wm2000->anc_download == NULL) { |
794 | dev_err(&i2c->dev, "Out of memory\n"); | 795 | dev_err(&i2c->dev, "Out of memory\n"); |
795 | ret = -ENOMEM; | 796 | ret = -ENOMEM; |
796 | goto err_fw; | 797 | goto out_regmap_exit; |
797 | } | 798 | } |
798 | 799 | ||
799 | wm2000->anc_download[0] = 0x80; | 800 | wm2000->anc_download[0] = 0x80; |
800 | wm2000->anc_download[1] = 0x00; | 801 | wm2000->anc_download[1] = 0x00; |
801 | memcpy(wm2000->anc_download + 2, fw->data, fw->size); | 802 | memcpy(wm2000->anc_download + 2, fw->data, fw->size); |
802 | 803 | ||
803 | release_firmware(fw); | ||
804 | |||
805 | wm2000->anc_eng_ena = 1; | 804 | wm2000->anc_eng_ena = 1; |
806 | wm2000->anc_active = 1; | 805 | wm2000->anc_active = 1; |
807 | wm2000->spk_ena = 1; | 806 | wm2000->spk_ena = 1; |
@@ -809,18 +808,14 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
809 | 808 | ||
810 | wm2000_reset(wm2000); | 809 | wm2000_reset(wm2000); |
811 | 810 | ||
812 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm2000, | 811 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm2000, NULL, 0); |
813 | NULL, 0); | 812 | if (!ret) |
814 | if (ret != 0) | 813 | goto out; |
815 | goto err_fw; | ||
816 | 814 | ||
817 | return 0; | 815 | out_regmap_exit: |
818 | |||
819 | err_fw: | ||
820 | release_firmware(fw); | ||
821 | err_regmap: | ||
822 | regmap_exit(wm2000->regmap); | 816 | regmap_exit(wm2000->regmap); |
823 | err: | 817 | out: |
818 | release_firmware(fw); | ||
824 | return ret; | 819 | return ret; |
825 | } | 820 | } |
826 | 821 | ||
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 8b24323d6b2c..89f2af77b1c3 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c | |||
@@ -1377,6 +1377,7 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec, | |||
1377 | 1377 | ||
1378 | switch (wm5100->rev) { | 1378 | switch (wm5100->rev) { |
1379 | case 0: | 1379 | case 0: |
1380 | regcache_cache_bypass(wm5100->regmap, true); | ||
1380 | snd_soc_write(codec, 0x11, 0x3); | 1381 | snd_soc_write(codec, 0x11, 0x3); |
1381 | snd_soc_write(codec, 0x203, 0xc); | 1382 | snd_soc_write(codec, 0x203, 0xc); |
1382 | snd_soc_write(codec, 0x206, 0); | 1383 | snd_soc_write(codec, 0x206, 0); |
@@ -1392,6 +1393,7 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec, | |||
1392 | snd_soc_write(codec, | 1393 | snd_soc_write(codec, |
1393 | wm5100_reva_patches[i].reg, | 1394 | wm5100_reva_patches[i].reg, |
1394 | wm5100_reva_patches[i].val); | 1395 | wm5100_reva_patches[i].val); |
1396 | regcache_cache_bypass(wm5100->regmap, false); | ||
1395 | break; | 1397 | break; |
1396 | default: | 1398 | default: |
1397 | break; | 1399 | break; |
@@ -1402,6 +1404,8 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec, | |||
1402 | break; | 1404 | break; |
1403 | 1405 | ||
1404 | case SND_SOC_BIAS_OFF: | 1406 | case SND_SOC_BIAS_OFF: |
1407 | regcache_cache_only(wm5100->regmap, true); | ||
1408 | regcache_mark_dirty(wm5100->regmap); | ||
1405 | if (wm5100->pdata.ldo_ena) | 1409 | if (wm5100->pdata.ldo_ena) |
1406 | gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); | 1410 | gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); |
1407 | regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies), | 1411 | regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies), |
@@ -2180,6 +2184,7 @@ static void wm5100_micd_irq(struct snd_soc_codec *codec) | |||
2180 | if (wm5100->jack_detecting) { | 2184 | if (wm5100->jack_detecting) { |
2181 | dev_dbg(codec->dev, "Microphone detected\n"); | 2185 | dev_dbg(codec->dev, "Microphone detected\n"); |
2182 | wm5100->jack_mic = true; | 2186 | wm5100->jack_mic = true; |
2187 | wm5100->jack_detecting = false; | ||
2183 | snd_soc_jack_report(wm5100->jack, | 2188 | snd_soc_jack_report(wm5100->jack, |
2184 | SND_JACK_HEADSET, | 2189 | SND_JACK_HEADSET, |
2185 | SND_JACK_HEADSET | SND_JACK_BTN_0); | 2190 | SND_JACK_HEADSET | SND_JACK_BTN_0); |
@@ -2218,6 +2223,7 @@ static void wm5100_micd_irq(struct snd_soc_codec *codec) | |||
2218 | SND_JACK_BTN_0); | 2223 | SND_JACK_BTN_0); |
2219 | } else if (wm5100->jack_detecting) { | 2224 | } else if (wm5100->jack_detecting) { |
2220 | dev_dbg(codec->dev, "Headphone detected\n"); | 2225 | dev_dbg(codec->dev, "Headphone detected\n"); |
2226 | wm5100->jack_detecting = false; | ||
2221 | snd_soc_jack_report(wm5100->jack, SND_JACK_HEADPHONE, | 2227 | snd_soc_jack_report(wm5100->jack, SND_JACK_HEADPHONE, |
2222 | SND_JACK_HEADPHONE); | 2228 | SND_JACK_HEADPHONE); |
2223 | 2229 | ||
@@ -2607,6 +2613,13 @@ static const struct regmap_config wm5100_regmap = { | |||
2607 | .cache_type = REGCACHE_RBTREE, | 2613 | .cache_type = REGCACHE_RBTREE, |
2608 | }; | 2614 | }; |
2609 | 2615 | ||
2616 | static const unsigned int wm5100_mic_ctrl_reg[] = { | ||
2617 | WM5100_IN1L_CONTROL, | ||
2618 | WM5100_IN2L_CONTROL, | ||
2619 | WM5100_IN3L_CONTROL, | ||
2620 | WM5100_IN4L_CONTROL, | ||
2621 | }; | ||
2622 | |||
2610 | static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, | 2623 | static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, |
2611 | const struct i2c_device_id *id) | 2624 | const struct i2c_device_id *id) |
2612 | { | 2625 | { |
@@ -2739,7 +2752,7 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, | |||
2739 | } | 2752 | } |
2740 | 2753 | ||
2741 | for (i = 0; i < ARRAY_SIZE(wm5100->pdata.in_mode); i++) { | 2754 | for (i = 0; i < ARRAY_SIZE(wm5100->pdata.in_mode); i++) { |
2742 | regmap_update_bits(wm5100->regmap, WM5100_IN1L_CONTROL, | 2755 | regmap_update_bits(wm5100->regmap, wm5100_mic_ctrl_reg[i], |
2743 | WM5100_IN1_MODE_MASK | | 2756 | WM5100_IN1_MODE_MASK | |
2744 | WM5100_IN1_DMIC_SUP_MASK, | 2757 | WM5100_IN1_DMIC_SUP_MASK, |
2745 | (wm5100->pdata.in_mode[i] << | 2758 | (wm5100->pdata.in_mode[i] << |
diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c index 8d4ea43d40a3..40ac888faf3d 100644 --- a/sound/soc/codecs/wm8958-dsp2.c +++ b/sound/soc/codecs/wm8958-dsp2.c | |||
@@ -55,7 +55,7 @@ static int wm8958_dsp2_fw(struct snd_soc_codec *codec, const char *name, | |||
55 | return 0; | 55 | return 0; |
56 | 56 | ||
57 | if (fw->size < 32) { | 57 | if (fw->size < 32) { |
58 | dev_err(codec->dev, "%s: firmware too short (%d bytes)\n", | 58 | dev_err(codec->dev, "%s: firmware too short (%zd bytes)\n", |
59 | name, fw->size); | 59 | name, fw->size); |
60 | goto err; | 60 | goto err; |
61 | } | 61 | } |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 296de4e30d26..bda3da887d7e 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -96,7 +96,7 @@ static int wm8962_regulator_event_##n(struct notifier_block *nb, \ | |||
96 | struct wm8962_priv *wm8962 = container_of(nb, struct wm8962_priv, \ | 96 | struct wm8962_priv *wm8962 = container_of(nb, struct wm8962_priv, \ |
97 | disable_nb[n]); \ | 97 | disable_nb[n]); \ |
98 | if (event & REGULATOR_EVENT_DISABLE) { \ | 98 | if (event & REGULATOR_EVENT_DISABLE) { \ |
99 | regcache_cache_only(wm8962->regmap, true); \ | 99 | regcache_mark_dirty(wm8962->regmap); \ |
100 | } \ | 100 | } \ |
101 | return 0; \ | 101 | return 0; \ |
102 | } | 102 | } |
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index 2b40c93601ed..7c7fd925db8d 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c | |||
@@ -444,6 +444,12 @@ static int _wm8993_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
444 | /* Enable the FLL */ | 444 | /* Enable the FLL */ |
445 | snd_soc_write(codec, WM8993_FLL_CONTROL_1, reg1 | WM8993_FLL_ENA); | 445 | snd_soc_write(codec, WM8993_FLL_CONTROL_1, reg1 | WM8993_FLL_ENA); |
446 | 446 | ||
447 | /* Both overestimates */ | ||
448 | if (Fref < 1000000) | ||
449 | msleep(3); | ||
450 | else | ||
451 | msleep(1); | ||
452 | |||
447 | dev_dbg(codec->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); | 453 | dev_dbg(codec->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); |
448 | 454 | ||
449 | wm8993->fll_fref = Fref; | 455 | wm8993->fll_fref = Fref; |
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index d8da10fe5b52..61f7daa4d0e6 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c | |||
@@ -108,7 +108,7 @@ static int wm8996_regulator_event_##n(struct notifier_block *nb, \ | |||
108 | struct wm8996_priv *wm8996 = container_of(nb, struct wm8996_priv, \ | 108 | struct wm8996_priv *wm8996 = container_of(nb, struct wm8996_priv, \ |
109 | disable_nb[n]); \ | 109 | disable_nb[n]); \ |
110 | if (event & REGULATOR_EVENT_DISABLE) { \ | 110 | if (event & REGULATOR_EVENT_DISABLE) { \ |
111 | regcache_cache_only(wm8996->regmap, true); \ | 111 | regcache_mark_dirty(wm8996->regmap); \ |
112 | } \ | 112 | } \ |
113 | return 0; \ | 113 | return 0; \ |
114 | } | 114 | } |
@@ -1120,7 +1120,8 @@ SND_SOC_DAPM_SUPPLY_S("SYSCLK", 1, WM8996_AIF_CLOCKING_1, 0, 0, NULL, 0), | |||
1120 | SND_SOC_DAPM_SUPPLY_S("SYSDSPCLK", 2, WM8996_CLOCKING_1, 1, 0, NULL, 0), | 1120 | SND_SOC_DAPM_SUPPLY_S("SYSDSPCLK", 2, WM8996_CLOCKING_1, 1, 0, NULL, 0), |
1121 | SND_SOC_DAPM_SUPPLY_S("AIFCLK", 2, WM8996_CLOCKING_1, 2, 0, NULL, 0), | 1121 | SND_SOC_DAPM_SUPPLY_S("AIFCLK", 2, WM8996_CLOCKING_1, 2, 0, NULL, 0), |
1122 | SND_SOC_DAPM_SUPPLY_S("Charge Pump", 2, WM8996_CHARGE_PUMP_1, 15, 0, cp_event, | 1122 | SND_SOC_DAPM_SUPPLY_S("Charge Pump", 2, WM8996_CHARGE_PUMP_1, 15, 0, cp_event, |
1123 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | 1123 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
1124 | SND_SOC_DAPM_POST_PMD), | ||
1124 | SND_SOC_DAPM_SUPPLY("Bandgap", SND_SOC_NOPM, 0, 0, bg_event, | 1125 | SND_SOC_DAPM_SUPPLY("Bandgap", SND_SOC_NOPM, 0, 0, bg_event, |
1125 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | 1126 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), |
1126 | SND_SOC_DAPM_SUPPLY("LDO2", WM8996_POWER_MANAGEMENT_2, 1, 0, NULL, 0), | 1127 | SND_SOC_DAPM_SUPPLY("LDO2", WM8996_POWER_MANAGEMENT_2, 1, 0, NULL, 0), |
@@ -2007,6 +2008,7 @@ static int wm8996_set_sysclk(struct snd_soc_dai *dai, | |||
2007 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); | 2008 | struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); |
2008 | int lfclk = 0; | 2009 | int lfclk = 0; |
2009 | int ratediv = 0; | 2010 | int ratediv = 0; |
2011 | int sync = WM8996_REG_SYNC; | ||
2010 | int src; | 2012 | int src; |
2011 | int old; | 2013 | int old; |
2012 | 2014 | ||
@@ -2051,6 +2053,7 @@ static int wm8996_set_sysclk(struct snd_soc_dai *dai, | |||
2051 | case 32000: | 2053 | case 32000: |
2052 | case 32768: | 2054 | case 32768: |
2053 | lfclk = WM8996_LFCLK_ENA; | 2055 | lfclk = WM8996_LFCLK_ENA; |
2056 | sync = 0; | ||
2054 | break; | 2057 | break; |
2055 | default: | 2058 | default: |
2056 | dev_warn(codec->dev, "Unsupported clock rate %dHz\n", | 2059 | dev_warn(codec->dev, "Unsupported clock rate %dHz\n", |
@@ -2064,6 +2067,8 @@ static int wm8996_set_sysclk(struct snd_soc_dai *dai, | |||
2064 | WM8996_SYSCLK_SRC_MASK | WM8996_SYSCLK_DIV_MASK, | 2067 | WM8996_SYSCLK_SRC_MASK | WM8996_SYSCLK_DIV_MASK, |
2065 | src << WM8996_SYSCLK_SRC_SHIFT | ratediv); | 2068 | src << WM8996_SYSCLK_SRC_SHIFT | ratediv); |
2066 | snd_soc_update_bits(codec, WM8996_CLOCKING_1, WM8996_LFCLK_ENA, lfclk); | 2069 | snd_soc_update_bits(codec, WM8996_CLOCKING_1, WM8996_LFCLK_ENA, lfclk); |
2070 | snd_soc_update_bits(codec, WM8996_CONTROL_INTERFACE_1, | ||
2071 | WM8996_REG_SYNC, sync); | ||
2067 | snd_soc_update_bits(codec, WM8996_AIF_CLOCKING_1, | 2072 | snd_soc_update_bits(codec, WM8996_AIF_CLOCKING_1, |
2068 | WM8996_SYSCLK_ENA, old); | 2073 | WM8996_SYSCLK_ENA, old); |
2069 | 2074 | ||
diff --git a/sound/soc/codecs/wm8996.h b/sound/soc/codecs/wm8996.h index 0fde643194ce..de9ac3e44aec 100644 --- a/sound/soc/codecs/wm8996.h +++ b/sound/soc/codecs/wm8996.h | |||
@@ -1567,6 +1567,10 @@ int wm8996_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
1567 | /* | 1567 | /* |
1568 | * R257 (0x101) - Control Interface (1) | 1568 | * R257 (0x101) - Control Interface (1) |
1569 | */ | 1569 | */ |
1570 | #define WM8996_REG_SYNC 0x8000 /* REG_SYNC */ | ||
1571 | #define WM8996_REG_SYNC_MASK 0x8000 /* REG_SYNC */ | ||
1572 | #define WM8996_REG_SYNC_SHIFT 15 /* REG_SYNC */ | ||
1573 | #define WM8996_REG_SYNC_WIDTH 1 /* REG_SYNC */ | ||
1570 | #define WM8996_AUTO_INC 0x0004 /* AUTO_INC */ | 1574 | #define WM8996_AUTO_INC 0x0004 /* AUTO_INC */ |
1571 | #define WM8996_AUTO_INC_MASK 0x0004 /* AUTO_INC */ | 1575 | #define WM8996_AUTO_INC_MASK 0x0004 /* AUTO_INC */ |
1572 | #define WM8996_AUTO_INC_SHIFT 2 /* AUTO_INC */ | 1576 | #define WM8996_AUTO_INC_SHIFT 2 /* AUTO_INC */ |
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 2a61094075f8..ea2672455d07 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
@@ -592,8 +592,8 @@ SOC_DAPM_SINGLE("Output Switch", WM8993_LINE_MIXER2, 0, 1, 0), | |||
592 | }; | 592 | }; |
593 | 593 | ||
594 | static const struct snd_kcontrol_new line2n_mix[] = { | 594 | static const struct snd_kcontrol_new line2n_mix[] = { |
595 | SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 6, 1, 0), | 595 | SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 5, 1, 0), |
596 | SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 5, 1, 0), | 596 | SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 6, 1, 0), |
597 | }; | 597 | }; |
598 | 598 | ||
599 | static const struct snd_kcontrol_new line2p_mix[] = { | 599 | static const struct snd_kcontrol_new line2p_mix[] = { |
@@ -613,6 +613,8 @@ SND_SOC_DAPM_INPUT("IN2RP:VXRP"), | |||
613 | SND_SOC_DAPM_SUPPLY("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0, NULL, 0), | 613 | SND_SOC_DAPM_SUPPLY("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0, NULL, 0), |
614 | SND_SOC_DAPM_SUPPLY("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0, NULL, 0), | 614 | SND_SOC_DAPM_SUPPLY("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0, NULL, 0), |
615 | 615 | ||
616 | SND_SOC_DAPM_SUPPLY("LINEOUT_VMID_BUF", WM8993_ANTIPOP1, 7, 0, NULL, 0), | ||
617 | |||
616 | SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0, | 618 | SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0, |
617 | in1l_pga, ARRAY_SIZE(in1l_pga)), | 619 | in1l_pga, ARRAY_SIZE(in1l_pga)), |
618 | SND_SOC_DAPM_MIXER("IN1R PGA", WM8993_POWER_MANAGEMENT_2, 4, 0, | 620 | SND_SOC_DAPM_MIXER("IN1R PGA", WM8993_POWER_MANAGEMENT_2, 4, 0, |
@@ -834,9 +836,11 @@ static const struct snd_soc_dapm_route lineout1_diff_routes[] = { | |||
834 | }; | 836 | }; |
835 | 837 | ||
836 | static const struct snd_soc_dapm_route lineout1_se_routes[] = { | 838 | static const struct snd_soc_dapm_route lineout1_se_routes[] = { |
839 | { "LINEOUT1N Mixer", NULL, "LINEOUT_VMID_BUF" }, | ||
837 | { "LINEOUT1N Mixer", "Left Output Switch", "Left Output PGA" }, | 840 | { "LINEOUT1N Mixer", "Left Output Switch", "Left Output PGA" }, |
838 | { "LINEOUT1N Mixer", "Right Output Switch", "Right Output PGA" }, | 841 | { "LINEOUT1N Mixer", "Right Output Switch", "Right Output PGA" }, |
839 | 842 | ||
843 | { "LINEOUT1P Mixer", NULL, "LINEOUT_VMID_BUF" }, | ||
840 | { "LINEOUT1P Mixer", "Left Output Switch", "Left Output PGA" }, | 844 | { "LINEOUT1P Mixer", "Left Output Switch", "Left Output PGA" }, |
841 | 845 | ||
842 | { "LINEOUT1N Driver", NULL, "LINEOUT1N Mixer" }, | 846 | { "LINEOUT1N Driver", NULL, "LINEOUT1N Mixer" }, |
@@ -853,9 +857,11 @@ static const struct snd_soc_dapm_route lineout2_diff_routes[] = { | |||
853 | }; | 857 | }; |
854 | 858 | ||
855 | static const struct snd_soc_dapm_route lineout2_se_routes[] = { | 859 | static const struct snd_soc_dapm_route lineout2_se_routes[] = { |
860 | { "LINEOUT2N Mixer", NULL, "LINEOUT_VMID_BUF" }, | ||
856 | { "LINEOUT2N Mixer", "Left Output Switch", "Left Output PGA" }, | 861 | { "LINEOUT2N Mixer", "Left Output Switch", "Left Output PGA" }, |
857 | { "LINEOUT2N Mixer", "Right Output Switch", "Right Output PGA" }, | 862 | { "LINEOUT2N Mixer", "Right Output Switch", "Right Output PGA" }, |
858 | 863 | ||
864 | { "LINEOUT2P Mixer", NULL, "LINEOUT_VMID_BUF" }, | ||
859 | { "LINEOUT2P Mixer", "Right Output Switch", "Right Output PGA" }, | 865 | { "LINEOUT2P Mixer", "Right Output Switch", "Right Output PGA" }, |
860 | 866 | ||
861 | { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" }, | 867 | { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" }, |
diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c index 3fc96130d1a6..de8390449873 100644 --- a/sound/soc/ep93xx/ep93xx-pcm.c +++ b/sound/soc/ep93xx/ep93xx-pcm.c | |||
@@ -113,9 +113,9 @@ static int ep93xx_pcm_open(struct snd_pcm_substream *substream) | |||
113 | rtd->dma_data.name = dma_params->name; | 113 | rtd->dma_data.name = dma_params->name; |
114 | 114 | ||
115 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 115 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
116 | rtd->dma_data.direction = DMA_TO_DEVICE; | 116 | rtd->dma_data.direction = DMA_MEM_TO_DEV; |
117 | else | 117 | else |
118 | rtd->dma_data.direction = DMA_FROM_DEVICE; | 118 | rtd->dma_data.direction = DMA_DEV_TO_MEM; |
119 | 119 | ||
120 | rtd->dma_chan = dma_request_channel(mask, ep93xx_pcm_dma_filter, | 120 | rtd->dma_chan = dma_request_channel(mask, ep93xx_pcm_dma_filter, |
121 | &rtd->dma_data); | 121 | &rtd->dma_data); |
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 1cf2fe889f6a..5780c9b9d569 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c | |||
@@ -88,11 +88,13 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, | |||
88 | iprtd->dma_data.dma_request = dma_params->dma; | 88 | iprtd->dma_data.dma_request = dma_params->dma; |
89 | 89 | ||
90 | /* Try to grab a DMA channel */ | 90 | /* Try to grab a DMA channel */ |
91 | dma_cap_zero(mask); | 91 | if (!iprtd->dma_chan) { |
92 | dma_cap_set(DMA_SLAVE, mask); | 92 | dma_cap_zero(mask); |
93 | iprtd->dma_chan = dma_request_channel(mask, filter, iprtd); | 93 | dma_cap_set(DMA_SLAVE, mask); |
94 | if (!iprtd->dma_chan) | 94 | iprtd->dma_chan = dma_request_channel(mask, filter, iprtd); |
95 | return -EINVAL; | 95 | if (!iprtd->dma_chan) |
96 | return -EINVAL; | ||
97 | } | ||
96 | 98 | ||
97 | switch (params_format(params)) { | 99 | switch (params_format(params)) { |
98 | case SNDRV_PCM_FORMAT_S16_LE: | 100 | case SNDRV_PCM_FORMAT_S16_LE: |
@@ -107,12 +109,12 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, | |||
107 | } | 109 | } |
108 | 110 | ||
109 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 111 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
110 | slave_config.direction = DMA_TO_DEVICE; | 112 | slave_config.direction = DMA_MEM_TO_DEV; |
111 | slave_config.dst_addr = dma_params->dma_addr; | 113 | slave_config.dst_addr = dma_params->dma_addr; |
112 | slave_config.dst_addr_width = buswidth; | 114 | slave_config.dst_addr_width = buswidth; |
113 | slave_config.dst_maxburst = dma_params->burstsize; | 115 | slave_config.dst_maxburst = dma_params->burstsize; |
114 | } else { | 116 | } else { |
115 | slave_config.direction = DMA_FROM_DEVICE; | 117 | slave_config.direction = DMA_DEV_TO_MEM; |
116 | slave_config.src_addr = dma_params->dma_addr; | 118 | slave_config.src_addr = dma_params->dma_addr; |
117 | slave_config.src_addr_width = buswidth; | 119 | slave_config.src_addr_width = buswidth; |
118 | slave_config.src_maxburst = dma_params->burstsize; | 120 | slave_config.src_maxburst = dma_params->burstsize; |
@@ -159,7 +161,7 @@ static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, | |||
159 | iprtd->period_bytes * iprtd->periods, | 161 | iprtd->period_bytes * iprtd->periods, |
160 | iprtd->period_bytes, | 162 | iprtd->period_bytes, |
161 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? | 163 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
162 | DMA_TO_DEVICE : DMA_FROM_DEVICE); | 164 | DMA_MEM_TO_DEV : DMA_DEV_TO_MEM); |
163 | if (!iprtd->desc) { | 165 | if (!iprtd->desc) { |
164 | dev_err(&chan->dev->device, "cannot prepare slave dma\n"); | 166 | dev_err(&chan->dev->device, "cannot prepare slave dma\n"); |
165 | return -EINVAL; | 167 | return -EINVAL; |
diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index d4a17780cef4..d03854027128 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c | |||
@@ -94,9 +94,10 @@ static irqreturn_t kirkwood_dma_irq(int irq, void *dev_id) | |||
94 | return IRQ_HANDLED; | 94 | return IRQ_HANDLED; |
95 | } | 95 | } |
96 | 96 | ||
97 | static void kirkwood_dma_conf_mbus_windows(void __iomem *base, int win, | 97 | static void |
98 | unsigned long dma, | 98 | kirkwood_dma_conf_mbus_windows(void __iomem *base, int win, |
99 | struct mbus_dram_target_info *dram) | 99 | unsigned long dma, |
100 | const struct mbus_dram_target_info *dram) | ||
100 | { | 101 | { |
101 | int i; | 102 | int i; |
102 | 103 | ||
@@ -106,7 +107,7 @@ static void kirkwood_dma_conf_mbus_windows(void __iomem *base, int win, | |||
106 | 107 | ||
107 | /* try to find matching cs for current dma address */ | 108 | /* try to find matching cs for current dma address */ |
108 | for (i = 0; i < dram->num_cs; i++) { | 109 | for (i = 0; i < dram->num_cs; i++) { |
109 | struct mbus_dram_window *cs = dram->cs + i; | 110 | const struct mbus_dram_window *cs = dram->cs + i; |
110 | if ((cs->base & 0xffff0000) < (dma & 0xffff0000)) { | 111 | if ((cs->base & 0xffff0000) < (dma & 0xffff0000)) { |
111 | writel(cs->base & 0xffff0000, | 112 | writel(cs->base & 0xffff0000, |
112 | base + KIRKWOOD_AUDIO_WIN_BASE_REG(win)); | 113 | base + KIRKWOOD_AUDIO_WIN_BASE_REG(win)); |
@@ -127,6 +128,7 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream) | |||
127 | struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai; | 128 | struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai; |
128 | struct kirkwood_dma_data *priv; | 129 | struct kirkwood_dma_data *priv; |
129 | struct kirkwood_dma_priv *prdata = snd_soc_platform_get_drvdata(platform); | 130 | struct kirkwood_dma_priv *prdata = snd_soc_platform_get_drvdata(platform); |
131 | const struct mbus_dram_target_info *dram; | ||
130 | unsigned long addr; | 132 | unsigned long addr; |
131 | 133 | ||
132 | priv = snd_soc_dai_get_dma_data(cpu_dai, substream); | 134 | priv = snd_soc_dai_get_dma_data(cpu_dai, substream); |
@@ -175,15 +177,16 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream) | |||
175 | writel((unsigned long)-1, priv->io + KIRKWOOD_ERR_MASK); | 177 | writel((unsigned long)-1, priv->io + KIRKWOOD_ERR_MASK); |
176 | } | 178 | } |
177 | 179 | ||
180 | dram = mv_mbus_dram_info(); | ||
178 | addr = virt_to_phys(substream->dma_buffer.area); | 181 | addr = virt_to_phys(substream->dma_buffer.area); |
179 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 182 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
180 | prdata->play_stream = substream; | 183 | prdata->play_stream = substream; |
181 | kirkwood_dma_conf_mbus_windows(priv->io, | 184 | kirkwood_dma_conf_mbus_windows(priv->io, |
182 | KIRKWOOD_PLAYBACK_WIN, addr, priv->dram); | 185 | KIRKWOOD_PLAYBACK_WIN, addr, dram); |
183 | } else { | 186 | } else { |
184 | prdata->rec_stream = substream; | 187 | prdata->rec_stream = substream; |
185 | kirkwood_dma_conf_mbus_windows(priv->io, | 188 | kirkwood_dma_conf_mbus_windows(priv->io, |
186 | KIRKWOOD_RECORD_WIN, addr, priv->dram); | 189 | KIRKWOOD_RECORD_WIN, addr, dram); |
187 | } | 190 | } |
188 | 191 | ||
189 | return 0; | 192 | return 0; |
diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index 0e12f4e0a76d..105f42a394df 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c | |||
@@ -136,7 +136,7 @@ static int snd_mxs_pcm_hw_params(struct snd_pcm_substream *substream, | |||
136 | iprtd->period_bytes * iprtd->periods, | 136 | iprtd->period_bytes * iprtd->periods, |
137 | iprtd->period_bytes, | 137 | iprtd->period_bytes, |
138 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? | 138 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
139 | DMA_TO_DEVICE : DMA_FROM_DEVICE); | 139 | DMA_MEM_TO_DEV : DMA_DEV_TO_MEM); |
140 | if (!iprtd->desc) { | 140 | if (!iprtd->desc) { |
141 | dev_err(&chan->dev->device, "cannot prepare slave dma\n"); | 141 | dev_err(&chan->dev->device, "cannot prepare slave dma\n"); |
142 | return -EINVAL; | 142 | return -EINVAL; |
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 1a13ab8b8e0d..f204dbac11d4 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c | |||
@@ -124,6 +124,8 @@ static int mxs_saif_set_clk(struct mxs_saif *saif, | |||
124 | * | 124 | * |
125 | * If MCLK is not used, we just set saif clk to 512*fs. | 125 | * If MCLK is not used, we just set saif clk to 512*fs. |
126 | */ | 126 | */ |
127 | clk_prepare_enable(master_saif->clk); | ||
128 | |||
127 | if (master_saif->mclk_in_use) { | 129 | if (master_saif->mclk_in_use) { |
128 | if (mclk % 32 == 0) { | 130 | if (mclk % 32 == 0) { |
129 | scr &= ~BM_SAIF_CTRL_BITCLK_BASE_RATE; | 131 | scr &= ~BM_SAIF_CTRL_BITCLK_BASE_RATE; |
@@ -133,6 +135,7 @@ static int mxs_saif_set_clk(struct mxs_saif *saif, | |||
133 | ret = clk_set_rate(master_saif->clk, 384 * rate); | 135 | ret = clk_set_rate(master_saif->clk, 384 * rate); |
134 | } else { | 136 | } else { |
135 | /* SAIF MCLK should be either 32x or 48x */ | 137 | /* SAIF MCLK should be either 32x or 48x */ |
138 | clk_disable_unprepare(master_saif->clk); | ||
136 | return -EINVAL; | 139 | return -EINVAL; |
137 | } | 140 | } |
138 | } else { | 141 | } else { |
@@ -140,6 +143,8 @@ static int mxs_saif_set_clk(struct mxs_saif *saif, | |||
140 | scr &= ~BM_SAIF_CTRL_BITCLK_BASE_RATE; | 143 | scr &= ~BM_SAIF_CTRL_BITCLK_BASE_RATE; |
141 | } | 144 | } |
142 | 145 | ||
146 | clk_disable_unprepare(master_saif->clk); | ||
147 | |||
143 | if (ret) | 148 | if (ret) |
144 | return ret; | 149 | return ret; |
145 | 150 | ||
@@ -210,7 +215,7 @@ int mxs_saif_put_mclk(unsigned int saif_id) | |||
210 | return -EBUSY; | 215 | return -EBUSY; |
211 | } | 216 | } |
212 | 217 | ||
213 | clk_disable(saif->clk); | 218 | clk_disable_unprepare(saif->clk); |
214 | 219 | ||
215 | /* disable MCLK output */ | 220 | /* disable MCLK output */ |
216 | __raw_writel(BM_SAIF_CTRL_CLKGATE, | 221 | __raw_writel(BM_SAIF_CTRL_CLKGATE, |
@@ -264,7 +269,7 @@ int mxs_saif_get_mclk(unsigned int saif_id, unsigned int mclk, | |||
264 | if (ret) | 269 | if (ret) |
265 | return ret; | 270 | return ret; |
266 | 271 | ||
267 | ret = clk_enable(saif->clk); | 272 | ret = clk_prepare_enable(saif->clk); |
268 | if (ret) | 273 | if (ret) |
269 | return ret; | 274 | return ret; |
270 | 275 | ||
@@ -625,13 +630,6 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
625 | if (pdev->id >= ARRAY_SIZE(mxs_saif)) | 630 | if (pdev->id >= ARRAY_SIZE(mxs_saif)) |
626 | return -EINVAL; | 631 | return -EINVAL; |
627 | 632 | ||
628 | pdata = pdev->dev.platform_data; | ||
629 | if (pdata && pdata->init) { | ||
630 | ret = pdata->init(); | ||
631 | if (ret) | ||
632 | return ret; | ||
633 | } | ||
634 | |||
635 | saif = kzalloc(sizeof(*saif), GFP_KERNEL); | 633 | saif = kzalloc(sizeof(*saif), GFP_KERNEL); |
636 | if (!saif) | 634 | if (!saif) |
637 | return -ENOMEM; | 635 | return -ENOMEM; |
@@ -639,12 +637,17 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
639 | mxs_saif[pdev->id] = saif; | 637 | mxs_saif[pdev->id] = saif; |
640 | saif->id = pdev->id; | 638 | saif->id = pdev->id; |
641 | 639 | ||
642 | saif->master_id = saif->id; | 640 | pdata = pdev->dev.platform_data; |
643 | if (pdata && pdata->get_master_id) { | 641 | if (pdata && !pdata->master_mode) { |
644 | saif->master_id = pdata->get_master_id(saif->id); | 642 | saif->master_id = pdata->master_id; |
645 | if (saif->master_id < 0 || | 643 | if (saif->master_id < 0 || |
646 | saif->master_id >= ARRAY_SIZE(mxs_saif)) | 644 | saif->master_id >= ARRAY_SIZE(mxs_saif) || |
645 | saif->master_id == saif->id) { | ||
646 | dev_err(&pdev->dev, "get wrong master id\n"); | ||
647 | return -EINVAL; | 647 | return -EINVAL; |
648 | } | ||
649 | } else { | ||
650 | saif->master_id = saif->id; | ||
648 | } | 651 | } |
649 | 652 | ||
650 | saif->clk = clk_get(&pdev->dev, NULL); | 653 | saif->clk = clk_get(&pdev->dev, NULL); |
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index f0c790451bd6..946020a647db 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c | |||
@@ -365,7 +365,8 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) | |||
365 | if (ret) | 365 | if (ret) |
366 | goto out3; | 366 | goto out3; |
367 | 367 | ||
368 | mfp_set_groupg(nuc900_audio->dev); /* enbale ac97 multifunction pin*/ | 368 | /* enbale ac97 multifunction pin */ |
369 | mfp_set_groupg(nuc900_audio->dev, NULL); | ||
369 | 370 | ||
370 | return 0; | 371 | return 0; |
371 | 372 | ||
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index 427ae0d9817b..e4ba17ce6b32 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c | |||
@@ -86,7 +86,7 @@ static void dma_enqueue(struct snd_pcm_substream *substream) | |||
86 | dma_info.cap = (samsung_dma_has_circular() ? DMA_CYCLIC : DMA_SLAVE); | 86 | dma_info.cap = (samsung_dma_has_circular() ? DMA_CYCLIC : DMA_SLAVE); |
87 | dma_info.direction = | 87 | dma_info.direction = |
88 | (substream->stream == SNDRV_PCM_STREAM_PLAYBACK | 88 | (substream->stream == SNDRV_PCM_STREAM_PLAYBACK |
89 | ? DMA_TO_DEVICE : DMA_FROM_DEVICE); | 89 | ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM); |
90 | dma_info.fp = audio_buffdone; | 90 | dma_info.fp = audio_buffdone; |
91 | dma_info.fp_param = substream; | 91 | dma_info.fp_param = substream; |
92 | dma_info.period = prtd->dma_period; | 92 | dma_info.period = prtd->dma_period; |
@@ -171,7 +171,7 @@ static int dma_hw_params(struct snd_pcm_substream *substream, | |||
171 | dma_info.client = prtd->params->client; | 171 | dma_info.client = prtd->params->client; |
172 | dma_info.direction = | 172 | dma_info.direction = |
173 | (substream->stream == SNDRV_PCM_STREAM_PLAYBACK | 173 | (substream->stream == SNDRV_PCM_STREAM_PLAYBACK |
174 | ? DMA_TO_DEVICE : DMA_FROM_DEVICE); | 174 | ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM); |
175 | dma_info.width = prtd->params->dma_size; | 175 | dma_info.width = prtd->params->dma_size; |
176 | dma_info.fifo = prtd->params->dma_addr; | 176 | dma_info.fifo = prtd->params->dma_addr; |
177 | prtd->params->ch = prtd->params->ops->request( | 177 | prtd->params->ch = prtd->params->ops->request( |
diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c index 7ac0ba2025c3..c6012ff5bd3e 100644 --- a/sound/soc/samsung/neo1973_wm8753.c +++ b/sound/soc/samsung/neo1973_wm8753.c | |||
@@ -230,8 +230,6 @@ static const struct snd_kcontrol_new neo1973_wm8753_controls[] = { | |||
230 | 230 | ||
231 | /* GTA02 specific routes and controls */ | 231 | /* GTA02 specific routes and controls */ |
232 | 232 | ||
233 | #ifdef CONFIG_MACH_NEO1973_GTA02 | ||
234 | |||
235 | static int gta02_speaker_enabled; | 233 | static int gta02_speaker_enabled; |
236 | 234 | ||
237 | static int lm4853_set_spk(struct snd_kcontrol *kcontrol, | 235 | static int lm4853_set_spk(struct snd_kcontrol *kcontrol, |
@@ -311,10 +309,6 @@ static int neo1973_gta02_wm8753_init(struct snd_soc_codec *codec) | |||
311 | return 0; | 309 | return 0; |
312 | } | 310 | } |
313 | 311 | ||
314 | #else | ||
315 | static int neo1973_gta02_wm8753_init(struct snd_soc_code *codec) { return 0; } | ||
316 | #endif | ||
317 | |||
318 | static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd) | 312 | static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd) |
319 | { | 313 | { |
320 | struct snd_soc_codec *codec = rtd->codec; | 314 | struct snd_soc_codec *codec = rtd->codec; |
@@ -322,10 +316,6 @@ static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd) | |||
322 | int ret; | 316 | int ret; |
323 | 317 | ||
324 | /* set up NC codec pins */ | 318 | /* set up NC codec pins */ |
325 | if (machine_is_neo1973_gta01()) { | ||
326 | snd_soc_dapm_nc_pin(dapm, "LOUT2"); | ||
327 | snd_soc_dapm_nc_pin(dapm, "ROUT2"); | ||
328 | } | ||
329 | snd_soc_dapm_nc_pin(dapm, "OUT3"); | 319 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
330 | snd_soc_dapm_nc_pin(dapm, "OUT4"); | 320 | snd_soc_dapm_nc_pin(dapm, "OUT4"); |
331 | snd_soc_dapm_nc_pin(dapm, "LINE1"); | 321 | snd_soc_dapm_nc_pin(dapm, "LINE1"); |
@@ -370,50 +360,6 @@ static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd) | |||
370 | return 0; | 360 | return 0; |
371 | } | 361 | } |
372 | 362 | ||
373 | /* GTA01 specific controls */ | ||
374 | |||
375 | #ifdef CONFIG_MACH_NEO1973_GTA01 | ||
376 | |||
377 | static const struct snd_soc_dapm_route neo1973_lm4857_routes[] = { | ||
378 | {"Amp IN", NULL, "ROUT1"}, | ||
379 | {"Amp IN", NULL, "LOUT1"}, | ||
380 | |||
381 | {"Handset Spk", NULL, "Amp EP"}, | ||
382 | {"Stereo Out", NULL, "Amp LS"}, | ||
383 | {"Headphone", NULL, "Amp HP"}, | ||
384 | }; | ||
385 | |||
386 | static const struct snd_soc_dapm_widget neo1973_lm4857_dapm_widgets[] = { | ||
387 | SND_SOC_DAPM_SPK("Handset Spk", NULL), | ||
388 | SND_SOC_DAPM_SPK("Stereo Out", NULL), | ||
389 | SND_SOC_DAPM_HP("Headphone", NULL), | ||
390 | }; | ||
391 | |||
392 | static int neo1973_lm4857_init(struct snd_soc_dapm_context *dapm) | ||
393 | { | ||
394 | int ret; | ||
395 | |||
396 | ret = snd_soc_dapm_new_controls(dapm, neo1973_lm4857_dapm_widgets, | ||
397 | ARRAY_SIZE(neo1973_lm4857_dapm_widgets)); | ||
398 | if (ret) | ||
399 | return ret; | ||
400 | |||
401 | ret = snd_soc_dapm_add_routes(dapm, neo1973_lm4857_routes, | ||
402 | ARRAY_SIZE(neo1973_lm4857_routes)); | ||
403 | if (ret) | ||
404 | return ret; | ||
405 | |||
406 | snd_soc_dapm_ignore_suspend(dapm, "Stereo Out"); | ||
407 | snd_soc_dapm_ignore_suspend(dapm, "Handset Spk"); | ||
408 | snd_soc_dapm_ignore_suspend(dapm, "Headphone"); | ||
409 | |||
410 | return 0; | ||
411 | } | ||
412 | |||
413 | #else | ||
414 | static int neo1973_lm4857_init(struct snd_soc_dapm_context *dapm) { return 0; }; | ||
415 | #endif | ||
416 | |||
417 | static struct snd_soc_dai_link neo1973_dai[] = { | 363 | static struct snd_soc_dai_link neo1973_dai[] = { |
418 | { /* Hifi Playback - for similatious use with voice below */ | 364 | { /* Hifi Playback - for similatious use with voice below */ |
419 | .name = "WM8753", | 365 | .name = "WM8753", |
@@ -440,11 +386,6 @@ static struct snd_soc_aux_dev neo1973_aux_devs[] = { | |||
440 | .name = "dfbmcs320", | 386 | .name = "dfbmcs320", |
441 | .codec_name = "dfbmcs320.0", | 387 | .codec_name = "dfbmcs320.0", |
442 | }, | 388 | }, |
443 | { | ||
444 | .name = "lm4857", | ||
445 | .codec_name = "lm4857.0-007c", | ||
446 | .init = neo1973_lm4857_init, | ||
447 | }, | ||
448 | }; | 389 | }; |
449 | 390 | ||
450 | static struct snd_soc_codec_conf neo1973_codec_conf[] = { | 391 | static struct snd_soc_codec_conf neo1973_codec_conf[] = { |
@@ -454,14 +395,10 @@ static struct snd_soc_codec_conf neo1973_codec_conf[] = { | |||
454 | }, | 395 | }, |
455 | }; | 396 | }; |
456 | 397 | ||
457 | #ifdef CONFIG_MACH_NEO1973_GTA02 | ||
458 | static const struct gpio neo1973_gta02_gpios[] = { | 398 | static const struct gpio neo1973_gta02_gpios[] = { |
459 | { GTA02_GPIO_HP_IN, GPIOF_OUT_INIT_HIGH, "GTA02_HP_IN" }, | 399 | { GTA02_GPIO_HP_IN, GPIOF_OUT_INIT_HIGH, "GTA02_HP_IN" }, |
460 | { GTA02_GPIO_AMP_SHUT, GPIOF_OUT_INIT_HIGH, "GTA02_AMP_SHUT" }, | 400 | { GTA02_GPIO_AMP_SHUT, GPIOF_OUT_INIT_HIGH, "GTA02_AMP_SHUT" }, |
461 | }; | 401 | }; |
462 | #else | ||
463 | static const struct gpio neo1973_gta02_gpios[] = {}; | ||
464 | #endif | ||
465 | 402 | ||
466 | static struct snd_soc_card neo1973 = { | 403 | static struct snd_soc_card neo1973 = { |
467 | .name = "neo1973", | 404 | .name = "neo1973", |
@@ -480,7 +417,7 @@ static int __init neo1973_init(void) | |||
480 | { | 417 | { |
481 | int ret; | 418 | int ret; |
482 | 419 | ||
483 | if (!machine_is_neo1973_gta01() && !machine_is_neo1973_gta02()) | 420 | if (!machine_is_neo1973_gta02()) |
484 | return -ENODEV; | 421 | return -ENODEV; |
485 | 422 | ||
486 | if (machine_is_neo1973_gta02()) { | 423 | if (machine_is_neo1973_gta02()) { |
diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index f8f681690a71..0193e595d415 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c | |||
@@ -131,7 +131,7 @@ static int siu_pcm_wr_set(struct siu_port *port_info, | |||
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 = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, |
134 | &sg, 1, DMA_TO_DEVICE, 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"); |
137 | return -ENOMEM; | 137 | return -ENOMEM; |
@@ -181,7 +181,7 @@ static int siu_pcm_rd_set(struct siu_port *port_info, | |||
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 = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, |
184 | &sg, 1, DMA_FROM_DEVICE, 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"); |
187 | return -ENOMEM; | 187 | return -ENOMEM; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3986520b4677..b5ecf6d23214 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -907,6 +907,10 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order) | |||
907 | if (err < 0) | 907 | if (err < 0) |
908 | printk(KERN_ERR "asoc: failed to remove %s\n", platform->name); | 908 | printk(KERN_ERR "asoc: failed to remove %s\n", platform->name); |
909 | } | 909 | } |
910 | |||
911 | /* Make sure all DAPM widgets are freed */ | ||
912 | snd_soc_dapm_free(&platform->dapm); | ||
913 | |||
910 | platform->probed = 0; | 914 | platform->probed = 0; |
911 | list_del(&platform->card_list); | 915 | list_del(&platform->card_list); |
912 | module_put(platform->dev->driver->owner); | 916 | module_put(platform->dev->driver->owner); |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 3ad1f59b8028..1f55ded4047f 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -1426,7 +1426,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) | |||
1426 | dapm->target_bias_level = SND_SOC_BIAS_ON; | 1426 | dapm->target_bias_level = SND_SOC_BIAS_ON; |
1427 | break; | 1427 | break; |
1428 | case SND_SOC_DAPM_STREAM_STOP: | 1428 | case SND_SOC_DAPM_STREAM_STOP: |
1429 | if (dapm->codec->active) | 1429 | if (dapm->codec && dapm->codec->active) |
1430 | dapm->target_bias_level = SND_SOC_BIAS_ON; | 1430 | dapm->target_bias_level = SND_SOC_BIAS_ON; |
1431 | else | 1431 | else |
1432 | dapm->target_bias_level = SND_SOC_BIAS_STANDBY; | 1432 | dapm->target_bias_level = SND_SOC_BIAS_STANDBY; |
diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index 93931def0dce..21554611557c 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c | |||
@@ -134,7 +134,7 @@ txx9aclc_dma_submit(struct txx9aclc_dmadata *dmadata, dma_addr_t buf_dma_addr) | |||
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 = chan->device->device_prep_slave_sg(chan, &sg, 1, |
136 | dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? | 136 | dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
137 | DMA_TO_DEVICE : DMA_FROM_DEVICE, | 137 | DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, |
138 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 138 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
139 | if (!desc) { | 139 | if (!desc) { |
140 | dev_err(&chan->dev->device, "cannot prepare slave dma\n"); | 140 | dev_err(&chan->dev->device, "cannot prepare slave dma\n"); |
diff --git a/sound/sound_core.c b/sound/sound_core.c index 6ce277860fd7..c6e81fb928e9 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c | |||
@@ -29,7 +29,7 @@ MODULE_DESCRIPTION("Core sound module"); | |||
29 | MODULE_AUTHOR("Alan Cox"); | 29 | MODULE_AUTHOR("Alan Cox"); |
30 | MODULE_LICENSE("GPL"); | 30 | MODULE_LICENSE("GPL"); |
31 | 31 | ||
32 | static char *sound_devnode(struct device *dev, mode_t *mode) | 32 | static char *sound_devnode(struct device *dev, umode_t *mode) |
33 | { | 33 | { |
34 | if (MAJOR(dev->devt) == SOUND_MAJOR) | 34 | if (MAJOR(dev->devt) == SOUND_MAJOR) |
35 | return NULL; | 35 | return NULL; |
diff --git a/sound/usb/6fire/chip.c b/sound/usb/6fire/chip.c index a43f1952169a..8af92e3e9c18 100644 --- a/sound/usb/6fire/chip.c +++ b/sound/usb/6fire/chip.c | |||
@@ -211,22 +211,11 @@ static struct usb_device_id device_table[] = { | |||
211 | 211 | ||
212 | MODULE_DEVICE_TABLE(usb, device_table); | 212 | MODULE_DEVICE_TABLE(usb, device_table); |
213 | 213 | ||
214 | static struct usb_driver driver = { | 214 | static struct usb_driver usb_driver = { |
215 | .name = "snd-usb-6fire", | 215 | .name = "snd-usb-6fire", |
216 | .probe = usb6fire_chip_probe, | 216 | .probe = usb6fire_chip_probe, |
217 | .disconnect = usb6fire_chip_disconnect, | 217 | .disconnect = usb6fire_chip_disconnect, |
218 | .id_table = device_table, | 218 | .id_table = device_table, |
219 | }; | 219 | }; |
220 | 220 | ||
221 | static int __init usb6fire_chip_init(void) | 221 | module_usb_driver(usb_driver); |
222 | { | ||
223 | return usb_register(&driver); | ||
224 | } | ||
225 | |||
226 | static void __exit usb6fire_chip_cleanup(void) | ||
227 | { | ||
228 | usb_deregister(&driver); | ||
229 | } | ||
230 | |||
231 | module_init(usb6fire_chip_init); | ||
232 | module_exit(usb6fire_chip_cleanup); | ||
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c index 7cf67e44d85b..64aed432ae22 100644 --- a/sound/usb/caiaq/device.c +++ b/sound/usb/caiaq/device.c | |||
@@ -538,16 +538,5 @@ static struct usb_driver snd_usb_driver = { | |||
538 | .id_table = snd_usb_id_table, | 538 | .id_table = snd_usb_id_table, |
539 | }; | 539 | }; |
540 | 540 | ||
541 | static int __init snd_module_init(void) | 541 | module_usb_driver(snd_usb_driver); |
542 | { | ||
543 | return usb_register(&snd_usb_driver); | ||
544 | } | ||
545 | |||
546 | static void __exit snd_module_exit(void) | ||
547 | { | ||
548 | usb_deregister(&snd_usb_driver); | ||
549 | } | ||
550 | |||
551 | module_init(snd_module_init) | ||
552 | module_exit(snd_module_exit) | ||
553 | 542 | ||
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index e42805862ce5..8b81cb54026f 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c | |||
@@ -1387,16 +1387,4 @@ static struct usb_driver ua101_driver = { | |||
1387 | #endif | 1387 | #endif |
1388 | }; | 1388 | }; |
1389 | 1389 | ||
1390 | static int __init alsa_card_ua101_init(void) | 1390 | module_usb_driver(ua101_driver); |
1391 | { | ||
1392 | return usb_register(&ua101_driver); | ||
1393 | } | ||
1394 | |||
1395 | static void __exit alsa_card_ua101_exit(void) | ||
1396 | { | ||
1397 | usb_deregister(&ua101_driver); | ||
1398 | mutex_destroy(&devices_mutex); | ||
1399 | } | ||
1400 | |||
1401 | module_init(alsa_card_ua101_init); | ||
1402 | module_exit(alsa_card_ua101_exit); | ||
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index 86f76a9aefae..c4fd3b1d9592 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -772,16 +772,4 @@ static struct usb_driver snd_us122l_usb_driver = { | |||
772 | .supports_autosuspend = 1 | 772 | .supports_autosuspend = 1 |
773 | }; | 773 | }; |
774 | 774 | ||
775 | 775 | module_usb_driver(snd_us122l_usb_driver); | |
776 | static int __init snd_us122l_module_init(void) | ||
777 | { | ||
778 | return usb_register(&snd_us122l_usb_driver); | ||
779 | } | ||
780 | |||
781 | static void __exit snd_us122l_module_exit(void) | ||
782 | { | ||
783 | usb_deregister(&snd_us122l_usb_driver); | ||
784 | } | ||
785 | |||
786 | module_init(snd_us122l_module_init) | ||
787 | module_exit(snd_us122l_module_exit) | ||
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index 1d694586d637..9af7c1f17413 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -459,15 +459,4 @@ static void usX2Y_usb_disconnect(struct usb_device *device, void* ptr) | |||
459 | } | 459 | } |
460 | } | 460 | } |
461 | 461 | ||
462 | static int __init snd_usX2Y_module_init(void) | 462 | module_usb_driver(snd_usX2Y_usb_driver); |
463 | { | ||
464 | return usb_register(&snd_usX2Y_usb_driver); | ||
465 | } | ||
466 | |||
467 | static void __exit snd_usX2Y_module_exit(void) | ||
468 | { | ||
469 | usb_deregister(&snd_usX2Y_usb_driver); | ||
470 | } | ||
471 | |||
472 | module_init(snd_usX2Y_module_init) | ||
473 | module_exit(snd_usX2Y_module_exit) | ||