diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-12-13 03:29:52 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-12-13 03:29:52 -0500 |
commit | 354d14b3f53cc749c5d26d4ba7280d1e931d6bc4 (patch) | |
tree | 59b597e44902d8db8bde7deac1e7e707327c6fe6 /sound | |
parent | 5144c534d16529bc469396211131e8935589f833 (diff) | |
parent | 5b84ba26a9672e615897234fa5efd3eea2d6b295 (diff) |
Merge branch 'topic/workq-update' into topic/misc
Diffstat (limited to 'sound')
73 files changed, 496 insertions, 367 deletions
diff --git a/sound/aoa/core/gpio-feature.c b/sound/aoa/core/gpio-feature.c index de8e03afa97b..faa317490545 100644 --- a/sound/aoa/core/gpio-feature.c +++ b/sound/aoa/core/gpio-feature.c | |||
@@ -287,10 +287,9 @@ static void ftr_gpio_exit(struct gpio_runtime *rt) | |||
287 | free_irq(linein_detect_irq, &rt->line_in_notify); | 287 | free_irq(linein_detect_irq, &rt->line_in_notify); |
288 | if (rt->line_out_notify.gpio_private) | 288 | if (rt->line_out_notify.gpio_private) |
289 | free_irq(lineout_detect_irq, &rt->line_out_notify); | 289 | free_irq(lineout_detect_irq, &rt->line_out_notify); |
290 | cancel_delayed_work(&rt->headphone_notify.work); | 290 | cancel_delayed_work_sync(&rt->headphone_notify.work); |
291 | cancel_delayed_work(&rt->line_in_notify.work); | 291 | cancel_delayed_work_sync(&rt->line_in_notify.work); |
292 | cancel_delayed_work(&rt->line_out_notify.work); | 292 | cancel_delayed_work_sync(&rt->line_out_notify.work); |
293 | flush_scheduled_work(); | ||
294 | mutex_destroy(&rt->headphone_notify.mutex); | 293 | mutex_destroy(&rt->headphone_notify.mutex); |
295 | mutex_destroy(&rt->line_in_notify.mutex); | 294 | mutex_destroy(&rt->line_in_notify.mutex); |
296 | mutex_destroy(&rt->line_out_notify.mutex); | 295 | mutex_destroy(&rt->line_out_notify.mutex); |
diff --git a/sound/aoa/core/gpio-pmf.c b/sound/aoa/core/gpio-pmf.c index 7e267c9379bc..c8d8a1a6f964 100644 --- a/sound/aoa/core/gpio-pmf.c +++ b/sound/aoa/core/gpio-pmf.c | |||
@@ -107,10 +107,9 @@ static void pmf_gpio_exit(struct gpio_runtime *rt) | |||
107 | 107 | ||
108 | /* make sure no work is pending before freeing | 108 | /* make sure no work is pending before freeing |
109 | * all things */ | 109 | * all things */ |
110 | cancel_delayed_work(&rt->headphone_notify.work); | 110 | cancel_delayed_work_sync(&rt->headphone_notify.work); |
111 | cancel_delayed_work(&rt->line_in_notify.work); | 111 | cancel_delayed_work_sync(&rt->line_in_notify.work); |
112 | cancel_delayed_work(&rt->line_out_notify.work); | 112 | cancel_delayed_work_sync(&rt->line_out_notify.work); |
113 | flush_scheduled_work(); | ||
114 | 113 | ||
115 | mutex_destroy(&rt->headphone_notify.mutex); | 114 | mutex_destroy(&rt->headphone_notify.mutex); |
116 | mutex_destroy(&rt->line_in_notify.mutex); | 115 | mutex_destroy(&rt->line_in_notify.mutex); |
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index 4e47baada66f..6e2409181895 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c | |||
@@ -422,7 +422,7 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev) | |||
422 | sample_clk = clk_get(&pdev->dev, "sample_clk"); | 422 | sample_clk = clk_get(&pdev->dev, "sample_clk"); |
423 | if (IS_ERR(sample_clk)) { | 423 | if (IS_ERR(sample_clk)) { |
424 | dev_dbg(&pdev->dev, "no sample clock\n"); | 424 | dev_dbg(&pdev->dev, "no sample clock\n"); |
425 | retval = PTR_ERR(pclk); | 425 | retval = PTR_ERR(sample_clk); |
426 | goto out_put_pclk; | 426 | goto out_put_pclk; |
427 | } | 427 | } |
428 | clk_enable(pclk); | 428 | clk_enable(pclk); |
diff --git a/sound/core/info.c b/sound/core/info.c index b70564ed8b37..7077f601da5a 100644 --- a/sound/core/info.c +++ b/sound/core/info.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/time.h> | 23 | #include <linux/time.h> |
24 | #include <linux/mm.h> | 24 | #include <linux/mm.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/smp_lock.h> | ||
27 | #include <linux/string.h> | 26 | #include <linux/string.h> |
28 | #include <sound/core.h> | 27 | #include <sound/core.h> |
29 | #include <sound/minors.h> | 28 | #include <sound/minors.h> |
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 5c8c7dff8ede..b753ec661fcf 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -1510,16 +1510,19 @@ static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __use | |||
1510 | static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file) | 1510 | static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file) |
1511 | { | 1511 | { |
1512 | struct snd_pcm_substream *substream; | 1512 | struct snd_pcm_substream *substream; |
1513 | struct snd_pcm_runtime *runtime; | ||
1514 | int i; | ||
1513 | 1515 | ||
1514 | substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; | 1516 | for (i = 0; i < 2; i++) { |
1515 | if (substream != NULL) { | 1517 | substream = pcm_oss_file->streams[i]; |
1516 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); | 1518 | if (!substream) |
1517 | substream->runtime->oss.prepare = 1; | 1519 | continue; |
1518 | } | 1520 | runtime = substream->runtime; |
1519 | substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; | ||
1520 | if (substream != NULL) { | ||
1521 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); | 1521 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); |
1522 | substream->runtime->oss.prepare = 1; | 1522 | runtime->oss.prepare = 1; |
1523 | runtime->oss.buffer_used = 0; | ||
1524 | runtime->oss.prev_hw_ptr_period = 0; | ||
1525 | runtime->oss.period_ptr = 0; | ||
1523 | } | 1526 | } |
1524 | return 0; | 1527 | return 0; |
1525 | } | 1528 | } |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index f91a439f675c..0db714e87a80 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
23 | #include <linux/file.h> | 23 | #include <linux/file.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/smp_lock.h> | ||
26 | #include <linux/time.h> | 25 | #include <linux/time.h> |
27 | #include <linux/pm_qos_params.h> | 26 | #include <linux/pm_qos_params.h> |
28 | #include <linux/uio.h> | 27 | #include <linux/uio.h> |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 345caea2d749..1c7a3efe1778 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -21,7 +21,6 @@ | |||
21 | 21 | ||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/smp_lock.h> | ||
25 | #include <linux/time.h> | 24 | #include <linux/time.h> |
26 | #include <linux/device.h> | 25 | #include <linux/device.h> |
27 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c index 971a84a4fa77..c424d329f806 100644 --- a/sound/i2c/other/ak4113.c +++ b/sound/i2c/other/ak4113.c | |||
@@ -57,8 +57,7 @@ static void snd_ak4113_free(struct ak4113 *chip) | |||
57 | { | 57 | { |
58 | chip->init = 1; /* don't schedule new work */ | 58 | chip->init = 1; /* don't schedule new work */ |
59 | mb(); | 59 | mb(); |
60 | cancel_delayed_work(&chip->work); | 60 | cancel_delayed_work_sync(&chip->work); |
61 | flush_scheduled_work(); | ||
62 | kfree(chip); | 61 | kfree(chip); |
63 | } | 62 | } |
64 | 63 | ||
@@ -141,7 +140,7 @@ void snd_ak4113_reinit(struct ak4113 *chip) | |||
141 | { | 140 | { |
142 | chip->init = 1; | 141 | chip->init = 1; |
143 | mb(); | 142 | mb(); |
144 | flush_scheduled_work(); | 143 | flush_delayed_work_sync(&chip->work); |
145 | ak4113_init_regs(chip); | 144 | ak4113_init_regs(chip); |
146 | /* bring up statistics / event queing */ | 145 | /* bring up statistics / event queing */ |
147 | chip->init = 0; | 146 | chip->init = 0; |
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c index 0341451f814c..d9fb537b0b94 100644 --- a/sound/i2c/other/ak4114.c +++ b/sound/i2c/other/ak4114.c | |||
@@ -67,8 +67,7 @@ static void snd_ak4114_free(struct ak4114 *chip) | |||
67 | { | 67 | { |
68 | chip->init = 1; /* don't schedule new work */ | 68 | chip->init = 1; /* don't schedule new work */ |
69 | mb(); | 69 | mb(); |
70 | cancel_delayed_work(&chip->work); | 70 | cancel_delayed_work_sync(&chip->work); |
71 | flush_scheduled_work(); | ||
72 | kfree(chip); | 71 | kfree(chip); |
73 | } | 72 | } |
74 | 73 | ||
@@ -154,7 +153,7 @@ void snd_ak4114_reinit(struct ak4114 *chip) | |||
154 | { | 153 | { |
155 | chip->init = 1; | 154 | chip->init = 1; |
156 | mb(); | 155 | mb(); |
157 | flush_scheduled_work(); | 156 | flush_delayed_work_sync(&chip->work); |
158 | ak4114_init_regs(chip); | 157 | ak4114_init_regs(chip); |
159 | /* bring up statistics / event queing */ | 158 | /* bring up statistics / event queing */ |
160 | chip->init = 0; | 159 | chip->init = 0; |
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index a7630e9edf8a..0fc614ce16c1 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -1014,8 +1014,7 @@ static int snd_ac97_free(struct snd_ac97 *ac97) | |||
1014 | { | 1014 | { |
1015 | if (ac97) { | 1015 | if (ac97) { |
1016 | #ifdef CONFIG_SND_AC97_POWER_SAVE | 1016 | #ifdef CONFIG_SND_AC97_POWER_SAVE |
1017 | cancel_delayed_work(&ac97->power_work); | 1017 | cancel_delayed_work_sync(&ac97->power_work); |
1018 | flush_scheduled_work(); | ||
1019 | #endif | 1018 | #endif |
1020 | snd_ac97_proc_done(ac97); | 1019 | snd_ac97_proc_done(ac97); |
1021 | if (ac97->bus) | 1020 | if (ac97->bus) |
@@ -2456,8 +2455,7 @@ void snd_ac97_suspend(struct snd_ac97 *ac97) | |||
2456 | if (ac97->build_ops->suspend) | 2455 | if (ac97->build_ops->suspend) |
2457 | ac97->build_ops->suspend(ac97); | 2456 | ac97->build_ops->suspend(ac97); |
2458 | #ifdef CONFIG_SND_AC97_POWER_SAVE | 2457 | #ifdef CONFIG_SND_AC97_POWER_SAVE |
2459 | cancel_delayed_work(&ac97->power_work); | 2458 | cancel_delayed_work_sync(&ac97->power_work); |
2460 | flush_scheduled_work(); | ||
2461 | #endif | 2459 | #endif |
2462 | snd_ac97_powerdown(ac97); | 2460 | snd_ac97_powerdown(ac97); |
2463 | } | 2461 | } |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 3cfb31e77b16..846d1ead47fd 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -3111,6 +3111,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
3111 | SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD), | 3111 | SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD), |
3112 | SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD), | 3112 | SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD), |
3113 | SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD), | 3113 | SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD), |
3114 | SND_PCI_QUIRK(0x17aa, 0x21c8, "Thinkpad Edge 11", CXT5066_IDEAPAD), | ||
3114 | SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), | 3115 | SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), |
3115 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G series", CXT5066_IDEAPAD), | 3116 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G series", CXT5066_IDEAPAD), |
3116 | SND_PCI_QUIRK(0x17aa, 0x390a, "Lenovo S10-3t", CXT5066_IDEAPAD), | 3117 | SND_PCI_QUIRK(0x17aa, 0x390a, "Lenovo S10-3t", CXT5066_IDEAPAD), |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b7e234898fd8..f17159d7dbe9 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1614,6 +1614,7 @@ do_sku: | |||
1614 | spec->init_amp = ALC_INIT_GPIO3; | 1614 | spec->init_amp = ALC_INIT_GPIO3; |
1615 | break; | 1615 | break; |
1616 | case 5: | 1616 | case 5: |
1617 | default: | ||
1617 | spec->init_amp = ALC_INIT_DEFAULT; | 1618 | spec->init_amp = ALC_INIT_DEFAULT; |
1618 | break; | 1619 | break; |
1619 | } | 1620 | } |
@@ -2014,6 +2015,36 @@ static struct hda_verb alc888_acer_aspire_6530g_verbs[] = { | |||
2014 | }; | 2015 | }; |
2015 | 2016 | ||
2016 | /* | 2017 | /* |
2018 | *ALC888 Acer Aspire 7730G model | ||
2019 | */ | ||
2020 | |||
2021 | static struct hda_verb alc888_acer_aspire_7730G_verbs[] = { | ||
2022 | /* Bias voltage on for external mic port */ | ||
2023 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80}, | ||
2024 | /* Front Mic: set to PIN_IN (empty by default) */ | ||
2025 | {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
2026 | /* Unselect Front Mic by default in input mixer 3 */ | ||
2027 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)}, | ||
2028 | /* Enable unsolicited event for HP jack */ | ||
2029 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
2030 | /* Enable speaker output */ | ||
2031 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
2032 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2033 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2}, | ||
2034 | /* Enable headphone output */ | ||
2035 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP}, | ||
2036 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2037 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
2038 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2}, | ||
2039 | /*Enable internal subwoofer */ | ||
2040 | {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
2041 | {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
2042 | {0x17, AC_VERB_SET_CONNECT_SEL, 0x02}, | ||
2043 | {0x17, AC_VERB_SET_EAPD_BTLENABLE, 2}, | ||
2044 | { } | ||
2045 | }; | ||
2046 | |||
2047 | /* | ||
2017 | * ALC889 Acer Aspire 8930G model | 2048 | * ALC889 Acer Aspire 8930G model |
2018 | */ | 2049 | */ |
2019 | 2050 | ||
@@ -2200,6 +2231,16 @@ static void alc888_acer_aspire_6530g_setup(struct hda_codec *codec) | |||
2200 | spec->autocfg.speaker_pins[2] = 0x17; | 2231 | spec->autocfg.speaker_pins[2] = 0x17; |
2201 | } | 2232 | } |
2202 | 2233 | ||
2234 | static void alc888_acer_aspire_7730g_setup(struct hda_codec *codec) | ||
2235 | { | ||
2236 | struct alc_spec *spec = codec->spec; | ||
2237 | |||
2238 | spec->autocfg.hp_pins[0] = 0x15; | ||
2239 | spec->autocfg.speaker_pins[0] = 0x14; | ||
2240 | spec->autocfg.speaker_pins[1] = 0x16; | ||
2241 | spec->autocfg.speaker_pins[2] = 0x17; | ||
2242 | } | ||
2243 | |||
2203 | static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec) | 2244 | static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec) |
2204 | { | 2245 | { |
2205 | struct alc_spec *spec = codec->spec; | 2246 | struct alc_spec *spec = codec->spec; |
@@ -9524,13 +9565,6 @@ static struct hda_verb alc883_acer_eapd_verbs[] = { | |||
9524 | { } | 9565 | { } |
9525 | }; | 9566 | }; |
9526 | 9567 | ||
9527 | static struct hda_verb alc888_acer_aspire_7730G_verbs[] = { | ||
9528 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
9529 | {0x17, AC_VERB_SET_CONNECT_SEL, 0x02}, | ||
9530 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
9531 | { } /* end */ | ||
9532 | }; | ||
9533 | |||
9534 | static void alc888_6st_dell_setup(struct hda_codec *codec) | 9568 | static void alc888_6st_dell_setup(struct hda_codec *codec) |
9535 | { | 9569 | { |
9536 | struct alc_spec *spec = codec->spec; | 9570 | struct alc_spec *spec = codec->spec; |
@@ -9831,7 +9865,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = { | |||
9831 | SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763), | 9865 | SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763), |
9832 | SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), | 9866 | SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), |
9833 | SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), | 9867 | SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), |
9834 | SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), | ||
9835 | SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG), | 9868 | SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG), |
9836 | SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), | 9869 | SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), |
9837 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), | 9870 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), |
@@ -10328,7 +10361,7 @@ static struct alc_config_preset alc882_presets[] = { | |||
10328 | .const_channel_count = 6, | 10361 | .const_channel_count = 6, |
10329 | .input_mux = &alc883_capture_source, | 10362 | .input_mux = &alc883_capture_source, |
10330 | .unsol_event = alc_automute_amp_unsol_event, | 10363 | .unsol_event = alc_automute_amp_unsol_event, |
10331 | .setup = alc888_acer_aspire_6530g_setup, | 10364 | .setup = alc888_acer_aspire_7730g_setup, |
10332 | .init_hook = alc_automute_amp, | 10365 | .init_hook = alc_automute_amp, |
10333 | }, | 10366 | }, |
10334 | [ALC883_MEDION] = { | 10367 | [ALC883_MEDION] = { |
@@ -14629,7 +14662,10 @@ static int alc275_setup_dual_adc(struct hda_codec *codec) | |||
14629 | /* different alc269-variants */ | 14662 | /* different alc269-variants */ |
14630 | enum { | 14663 | enum { |
14631 | ALC269_TYPE_NORMAL, | 14664 | ALC269_TYPE_NORMAL, |
14665 | ALC269_TYPE_ALC258, | ||
14632 | ALC269_TYPE_ALC259, | 14666 | ALC269_TYPE_ALC259, |
14667 | ALC269_TYPE_ALC269VB, | ||
14668 | ALC269_TYPE_ALC270, | ||
14633 | ALC269_TYPE_ALC271X, | 14669 | ALC269_TYPE_ALC271X, |
14634 | }; | 14670 | }; |
14635 | 14671 | ||
@@ -15029,7 +15065,7 @@ static int alc269_fill_coef(struct hda_codec *codec) | |||
15029 | static int patch_alc269(struct hda_codec *codec) | 15065 | static int patch_alc269(struct hda_codec *codec) |
15030 | { | 15066 | { |
15031 | struct alc_spec *spec; | 15067 | struct alc_spec *spec; |
15032 | int board_config; | 15068 | int board_config, coef; |
15033 | int err; | 15069 | int err; |
15034 | 15070 | ||
15035 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); | 15071 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
@@ -15040,14 +15076,23 @@ static int patch_alc269(struct hda_codec *codec) | |||
15040 | 15076 | ||
15041 | alc_auto_parse_customize_define(codec); | 15077 | alc_auto_parse_customize_define(codec); |
15042 | 15078 | ||
15043 | if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){ | 15079 | coef = alc_read_coef_idx(codec, 0); |
15080 | if ((coef & 0x00f0) == 0x0010) { | ||
15044 | if (codec->bus->pci->subsystem_vendor == 0x1025 && | 15081 | if (codec->bus->pci->subsystem_vendor == 0x1025 && |
15045 | spec->cdefine.platform_type == 1) { | 15082 | spec->cdefine.platform_type == 1) { |
15046 | alc_codec_rename(codec, "ALC271X"); | 15083 | alc_codec_rename(codec, "ALC271X"); |
15047 | spec->codec_variant = ALC269_TYPE_ALC271X; | 15084 | spec->codec_variant = ALC269_TYPE_ALC271X; |
15048 | } else { | 15085 | } else if ((coef & 0xf000) == 0x1000) { |
15086 | spec->codec_variant = ALC269_TYPE_ALC270; | ||
15087 | } else if ((coef & 0xf000) == 0x2000) { | ||
15049 | alc_codec_rename(codec, "ALC259"); | 15088 | alc_codec_rename(codec, "ALC259"); |
15050 | spec->codec_variant = ALC269_TYPE_ALC259; | 15089 | spec->codec_variant = ALC269_TYPE_ALC259; |
15090 | } else if ((coef & 0xf000) == 0x3000) { | ||
15091 | alc_codec_rename(codec, "ALC258"); | ||
15092 | spec->codec_variant = ALC269_TYPE_ALC258; | ||
15093 | } else { | ||
15094 | alc_codec_rename(codec, "ALC269VB"); | ||
15095 | spec->codec_variant = ALC269_TYPE_ALC269VB; | ||
15051 | } | 15096 | } |
15052 | } else | 15097 | } else |
15053 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 15098 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
@@ -15110,7 +15155,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
15110 | spec->stream_digital_capture = &alc269_pcm_digital_capture; | 15155 | spec->stream_digital_capture = &alc269_pcm_digital_capture; |
15111 | 15156 | ||
15112 | if (!spec->adc_nids) { /* wasn't filled automatically? use default */ | 15157 | if (!spec->adc_nids) { /* wasn't filled automatically? use default */ |
15113 | if (spec->codec_variant != ALC269_TYPE_NORMAL) { | 15158 | if (spec->codec_variant == ALC269_TYPE_NORMAL) { |
15114 | spec->adc_nids = alc269_adc_nids; | 15159 | spec->adc_nids = alc269_adc_nids; |
15115 | spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); | 15160 | spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); |
15116 | spec->capsrc_nids = alc269_capsrc_nids; | 15161 | spec->capsrc_nids = alc269_capsrc_nids; |
@@ -16904,7 +16949,7 @@ static struct alc_config_preset alc861vd_presets[] = { | |||
16904 | static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, | 16949 | static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, |
16905 | const struct auto_pin_cfg *cfg) | 16950 | const struct auto_pin_cfg *cfg) |
16906 | { | 16951 | { |
16907 | return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); | 16952 | return alc_auto_create_input_ctls(codec, cfg, 0x0b, 0x22, 0); |
16908 | } | 16953 | } |
16909 | 16954 | ||
16910 | 16955 | ||
@@ -18958,6 +19003,8 @@ static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid) | |||
18958 | return 0x02; | 19003 | return 0x02; |
18959 | else if (nid >= 0x0c && nid <= 0x0e) | 19004 | else if (nid >= 0x0c && nid <= 0x0e) |
18960 | return nid - 0x0c + 0x02; | 19005 | return nid - 0x0c + 0x02; |
19006 | else if (nid == 0x26) /* ALC887-VD has this DAC too */ | ||
19007 | return 0x25; | ||
18961 | else | 19008 | else |
18962 | return 0; | 19009 | return 0; |
18963 | } | 19010 | } |
@@ -18966,7 +19013,7 @@ static inline hda_nid_t alc662_mix_to_dac(hda_nid_t nid) | |||
18966 | static hda_nid_t alc662_dac_to_mix(struct hda_codec *codec, hda_nid_t pin, | 19013 | static hda_nid_t alc662_dac_to_mix(struct hda_codec *codec, hda_nid_t pin, |
18967 | hda_nid_t dac) | 19014 | hda_nid_t dac) |
18968 | { | 19015 | { |
18969 | hda_nid_t mix[4]; | 19016 | hda_nid_t mix[5]; |
18970 | int i, num; | 19017 | int i, num; |
18971 | 19018 | ||
18972 | num = snd_hda_get_connections(codec, pin, mix, ARRAY_SIZE(mix)); | 19019 | num = snd_hda_get_connections(codec, pin, mix, ARRAY_SIZE(mix)); |
@@ -19426,7 +19473,10 @@ static int patch_alc888(struct hda_codec *codec) | |||
19426 | { | 19473 | { |
19427 | if ((alc_read_coef_idx(codec, 0) & 0x00f0)==0x0030){ | 19474 | if ((alc_read_coef_idx(codec, 0) & 0x00f0)==0x0030){ |
19428 | kfree(codec->chip_name); | 19475 | kfree(codec->chip_name); |
19429 | codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL); | 19476 | if (codec->vendor_id == 0x10ec0887) |
19477 | codec->chip_name = kstrdup("ALC887-VD", GFP_KERNEL); | ||
19478 | else | ||
19479 | codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL); | ||
19430 | if (!codec->chip_name) { | 19480 | if (!codec->chip_name) { |
19431 | alc_free(codec); | 19481 | alc_free(codec); |
19432 | return -ENOMEM; | 19482 | return -ENOMEM; |
@@ -19916,7 +19966,7 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = { | |||
19916 | { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A", | 19966 | { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A", |
19917 | .patch = patch_alc882 }, | 19967 | .patch = patch_alc882 }, |
19918 | { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, | 19968 | { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 }, |
19919 | { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 }, | 19969 | { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc888 }, |
19920 | { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", | 19970 | { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", |
19921 | .patch = patch_alc882 }, | 19971 | .patch = patch_alc882 }, |
19922 | { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 }, | 19972 | { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 }, |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index cfd73afad882..efa4225f5fd6 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -1627,6 +1627,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { | |||
1627 | static struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = { | 1627 | static struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = { |
1628 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a1, | 1628 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a1, |
1629 | "Alienware M17x", STAC_ALIENWARE_M17X), | 1629 | "Alienware M17x", STAC_ALIENWARE_M17X), |
1630 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a, | ||
1631 | "Alienware M17x", STAC_ALIENWARE_M17X), | ||
1630 | {} /* terminator */ | 1632 | {} /* terminator */ |
1631 | }; | 1633 | }; |
1632 | 1634 | ||
@@ -3491,10 +3493,8 @@ static int stac92xx_auto_create_dmic_input_ctls(struct hda_codec *codec, | |||
3491 | return err; | 3493 | return err; |
3492 | } | 3494 | } |
3493 | 3495 | ||
3494 | if (snd_hda_get_bool_hint(codec, "separate_dmux") != 1) { | 3496 | if (snd_hda_get_bool_hint(codec, "separate_dmux") != 1) |
3495 | snd_hda_add_imux_item(imux, label, index, NULL); | 3497 | snd_hda_add_imux_item(imux, label, index, NULL); |
3496 | spec->num_analog_muxes++; | ||
3497 | } | ||
3498 | } | 3498 | } |
3499 | 3499 | ||
3500 | return 0; | 3500 | return 0; |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index d1c3f8defc48..7f4852a478a1 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -263,8 +263,7 @@ static void vt1708_stop_hp_work(struct via_spec *spec) | |||
263 | return; | 263 | return; |
264 | snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, | 264 | snd_hda_codec_write(spec->codec, 0x1, 0, 0xf81, |
265 | !spec->vt1708_jack_detectect); | 265 | !spec->vt1708_jack_detectect); |
266 | cancel_delayed_work(&spec->vt1708_hp_work); | 266 | cancel_delayed_work_sync(&spec->vt1708_hp_work); |
267 | flush_scheduled_work(); | ||
268 | } | 267 | } |
269 | 268 | ||
270 | 269 | ||
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c index 3078ed66ad61..c44c91e6fb18 100644 --- a/sound/pci/oxygen/oxygen_lib.c +++ b/sound/pci/oxygen/oxygen_lib.c | |||
@@ -565,7 +565,8 @@ static void oxygen_card_free(struct snd_card *card) | |||
565 | oxygen_shutdown(chip); | 565 | oxygen_shutdown(chip); |
566 | if (chip->irq >= 0) | 566 | if (chip->irq >= 0) |
567 | free_irq(chip->irq, chip); | 567 | free_irq(chip->irq, chip); |
568 | flush_scheduled_work(); | 568 | flush_work_sync(&chip->spdif_input_bits_work); |
569 | flush_work_sync(&chip->gpio_work); | ||
569 | chip->model.cleanup(chip); | 570 | chip->model.cleanup(chip); |
570 | kfree(chip->model_data); | 571 | kfree(chip->model_data); |
571 | mutex_destroy(&chip->mutex); | 572 | mutex_destroy(&chip->mutex); |
@@ -741,7 +742,8 @@ int oxygen_pci_suspend(struct pci_dev *pci, pm_message_t state) | |||
741 | spin_unlock_irq(&chip->reg_lock); | 742 | spin_unlock_irq(&chip->reg_lock); |
742 | 743 | ||
743 | synchronize_irq(chip->irq); | 744 | synchronize_irq(chip->irq); |
744 | flush_scheduled_work(); | 745 | flush_work_sync(&chip->spdif_input_bits_work); |
746 | flush_work_sync(&chip->gpio_work); | ||
745 | chip->interrupt_mask = saved_interrupt_mask; | 747 | chip->interrupt_mask = saved_interrupt_mask; |
746 | 748 | ||
747 | pci_disable_device(pci); | 749 | pci_disable_device(pci); |
diff --git a/sound/soc/atmel/Kconfig b/sound/soc/atmel/Kconfig index e720d5e6f04c..bee3c94f58b0 100644 --- a/sound/soc/atmel/Kconfig +++ b/sound/soc/atmel/Kconfig | |||
@@ -16,7 +16,8 @@ config SND_ATMEL_SOC_SSC | |||
16 | 16 | ||
17 | config SND_AT91_SOC_SAM9G20_WM8731 | 17 | config SND_AT91_SOC_SAM9G20_WM8731 |
18 | tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board" | 18 | tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board" |
19 | depends on ATMEL_SSC && ARCH_AT91SAM9G20 && SND_ATMEL_SOC | 19 | depends on ATMEL_SSC && ARCH_AT91SAM9G20 && SND_ATMEL_SOC && \ |
20 | AT91_PROGRAMMABLE_CLOCKS | ||
20 | select SND_ATMEL_SOC_SSC | 21 | select SND_ATMEL_SOC_SSC |
21 | select SND_SOC_WM8731 | 22 | select SND_SOC_WM8731 |
22 | help | 23 | help |
@@ -25,7 +26,7 @@ config SND_AT91_SOC_SAM9G20_WM8731 | |||
25 | 26 | ||
26 | config SND_AT32_SOC_PLAYPAQ | 27 | config SND_AT32_SOC_PLAYPAQ |
27 | tristate "SoC Audio support for PlayPaq with WM8510" | 28 | tristate "SoC Audio support for PlayPaq with WM8510" |
28 | depends on SND_ATMEL_SOC && BOARD_PLAYPAQ | 29 | depends on SND_ATMEL_SOC && BOARD_PLAYPAQ && AT91_PROGRAMMABLE_CLOCKS |
29 | select SND_ATMEL_SOC_SSC | 30 | select SND_ATMEL_SOC_SSC |
30 | select SND_SOC_WM8510 | 31 | select SND_SOC_WM8510 |
31 | help | 32 | help |
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index 293569dfd0ed..e521ada80542 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c | |||
@@ -222,9 +222,9 @@ static int __init at91sam9g20ek_init(void) | |||
222 | } | 222 | } |
223 | 223 | ||
224 | pllb = clk_get(NULL, "pllb"); | 224 | pllb = clk_get(NULL, "pllb"); |
225 | if (IS_ERR(mclk)) { | 225 | if (IS_ERR(pllb)) { |
226 | printk(KERN_ERR "ASoC: Failed to get PLLB\n"); | 226 | printk(KERN_ERR "ASoC: Failed to get PLLB\n"); |
227 | ret = PTR_ERR(mclk); | 227 | ret = PTR_ERR(pllb); |
228 | goto err_mclk; | 228 | goto err_mclk; |
229 | } | 229 | } |
230 | ret = clk_set_parent(mclk, pllb); | 230 | ret = clk_set_parent(mclk, pllb); |
@@ -240,6 +240,7 @@ static int __init at91sam9g20ek_init(void) | |||
240 | if (!at91sam9g20ek_snd_device) { | 240 | if (!at91sam9g20ek_snd_device) { |
241 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); | 241 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); |
242 | ret = -ENOMEM; | 242 | ret = -ENOMEM; |
243 | goto err_mclk; | ||
243 | } | 244 | } |
244 | 245 | ||
245 | platform_set_drvdata(at91sam9g20ek_snd_device, | 246 | platform_set_drvdata(at91sam9g20ek_snd_device, |
@@ -248,11 +249,13 @@ static int __init at91sam9g20ek_init(void) | |||
248 | ret = platform_device_add(at91sam9g20ek_snd_device); | 249 | ret = platform_device_add(at91sam9g20ek_snd_device); |
249 | if (ret) { | 250 | if (ret) { |
250 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); | 251 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); |
251 | platform_device_put(at91sam9g20ek_snd_device); | 252 | goto err_device_add; |
252 | } | 253 | } |
253 | 254 | ||
254 | return ret; | 255 | return ret; |
255 | 256 | ||
257 | err_device_add: | ||
258 | platform_device_put(at91sam9g20ek_snd_device); | ||
256 | err_mclk: | 259 | err_mclk: |
257 | clk_put(mclk); | 260 | clk_put(mclk); |
258 | mclk = NULL; | 261 | mclk = NULL; |
diff --git a/sound/soc/atmel/snd-soc-afeb9260.c b/sound/soc/atmel/snd-soc-afeb9260.c index e3d283561c19..86e0f8586dc3 100644 --- a/sound/soc/atmel/snd-soc-afeb9260.c +++ b/sound/soc/atmel/snd-soc-afeb9260.c | |||
@@ -167,7 +167,6 @@ static int __init afeb9260_soc_init(void) | |||
167 | 167 | ||
168 | return 0; | 168 | return 0; |
169 | err1: | 169 | err1: |
170 | platform_device_del(afeb9260_snd_device); | ||
171 | platform_device_put(afeb9260_snd_device); | 170 | platform_device_put(afeb9260_snd_device); |
172 | return err; | 171 | return err; |
173 | } | 172 | } |
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index bc22ee93a75d..d63e28773eb1 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -28,6 +28,11 @@ | |||
28 | #include <sound/max98088.h> | 28 | #include <sound/max98088.h> |
29 | #include "max98088.h" | 29 | #include "max98088.h" |
30 | 30 | ||
31 | enum max98088_type { | ||
32 | MAX98088, | ||
33 | MAX98089, | ||
34 | }; | ||
35 | |||
31 | struct max98088_cdata { | 36 | struct max98088_cdata { |
32 | unsigned int rate; | 37 | unsigned int rate; |
33 | unsigned int fmt; | 38 | unsigned int fmt; |
@@ -36,6 +41,7 @@ struct max98088_cdata { | |||
36 | 41 | ||
37 | struct max98088_priv { | 42 | struct max98088_priv { |
38 | u8 reg_cache[M98088_REG_CNT]; | 43 | u8 reg_cache[M98088_REG_CNT]; |
44 | enum max98088_type devtype; | ||
39 | void *control_data; | 45 | void *control_data; |
40 | struct max98088_pdata *pdata; | 46 | struct max98088_pdata *pdata; |
41 | unsigned int sysclk; | 47 | unsigned int sysclk; |
@@ -2013,7 +2019,10 @@ err_access: | |||
2013 | 2019 | ||
2014 | static int max98088_remove(struct snd_soc_codec *codec) | 2020 | static int max98088_remove(struct snd_soc_codec *codec) |
2015 | { | 2021 | { |
2022 | struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); | ||
2023 | |||
2016 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2024 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2025 | kfree(max98088->eq_texts); | ||
2017 | 2026 | ||
2018 | return 0; | 2027 | return 0; |
2019 | } | 2028 | } |
@@ -2040,6 +2049,8 @@ static int max98088_i2c_probe(struct i2c_client *i2c, | |||
2040 | if (max98088 == NULL) | 2049 | if (max98088 == NULL) |
2041 | return -ENOMEM; | 2050 | return -ENOMEM; |
2042 | 2051 | ||
2052 | max98088->devtype = id->driver_data; | ||
2053 | |||
2043 | i2c_set_clientdata(i2c, max98088); | 2054 | i2c_set_clientdata(i2c, max98088); |
2044 | max98088->control_data = i2c; | 2055 | max98088->control_data = i2c; |
2045 | max98088->pdata = i2c->dev.platform_data; | 2056 | max98088->pdata = i2c->dev.platform_data; |
@@ -2059,7 +2070,8 @@ static int __devexit max98088_i2c_remove(struct i2c_client *client) | |||
2059 | } | 2070 | } |
2060 | 2071 | ||
2061 | static const struct i2c_device_id max98088_i2c_id[] = { | 2072 | static const struct i2c_device_id max98088_i2c_id[] = { |
2062 | { "max98088", 0 }, | 2073 | { "max98088", MAX98088 }, |
2074 | { "max98089", MAX98089 }, | ||
2063 | { } | 2075 | { } |
2064 | }; | 2076 | }; |
2065 | MODULE_DEVICE_TABLE(i2c, max98088_i2c_id); | 2077 | MODULE_DEVICE_TABLE(i2c, max98088_i2c_id); |
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c index 00d67cc8e206..061f9e5a497b 100644 --- a/sound/soc/codecs/stac9766.c +++ b/sound/soc/codecs/stac9766.c | |||
@@ -383,6 +383,7 @@ static struct snd_soc_codec_driver soc_codec_dev_stac9766 = { | |||
383 | .reg_cache_size = sizeof(stac9766_reg), | 383 | .reg_cache_size = sizeof(stac9766_reg), |
384 | .reg_word_size = sizeof(u16), | 384 | .reg_word_size = sizeof(u16), |
385 | .reg_cache_step = 2, | 385 | .reg_cache_step = 2, |
386 | .reg_cache_default = stac9766_reg, | ||
386 | }; | 387 | }; |
387 | 388 | ||
388 | static __devinit int stac9766_probe(struct platform_device *pdev) | 389 | static __devinit int stac9766_probe(struct platform_device *pdev) |
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index fc687790188b..77b8f9ae29be 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -1176,7 +1176,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_gpio); | |||
1176 | int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio) | 1176 | int aic3x_get_gpio(struct snd_soc_codec *codec, int gpio) |
1177 | { | 1177 | { |
1178 | u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG; | 1178 | u8 reg = gpio ? AIC3X_GPIO2_REG : AIC3X_GPIO1_REG; |
1179 | u8 val, bit = gpio ? 2: 1; | 1179 | u8 val = 0, bit = gpio ? 2 : 1; |
1180 | 1180 | ||
1181 | aic3x_read(codec, reg, &val); | 1181 | aic3x_read(codec, reg, &val); |
1182 | return (val >> bit) & 1; | 1182 | return (val >> bit) & 1; |
@@ -1204,7 +1204,7 @@ EXPORT_SYMBOL_GPL(aic3x_set_headset_detection); | |||
1204 | 1204 | ||
1205 | int aic3x_headset_detected(struct snd_soc_codec *codec) | 1205 | int aic3x_headset_detected(struct snd_soc_codec *codec) |
1206 | { | 1206 | { |
1207 | u8 val; | 1207 | u8 val = 0; |
1208 | aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); | 1208 | aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); |
1209 | return (val >> 4) & 1; | 1209 | return (val >> 4) & 1; |
1210 | } | 1210 | } |
@@ -1212,7 +1212,7 @@ EXPORT_SYMBOL_GPL(aic3x_headset_detected); | |||
1212 | 1212 | ||
1213 | int aic3x_button_pressed(struct snd_soc_codec *codec) | 1213 | int aic3x_button_pressed(struct snd_soc_codec *codec) |
1214 | { | 1214 | { |
1215 | u8 val; | 1215 | u8 val = 0; |
1216 | aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); | 1216 | aic3x_read(codec, AIC3X_HEADSET_DETECT_CTRL_B, &val); |
1217 | return (val >> 5) & 1; | 1217 | return (val >> 5) & 1; |
1218 | } | 1218 | } |
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index ee4fb201de60..d2c243095673 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c | |||
@@ -78,8 +78,10 @@ static int tpa6130a2_i2c_write(int reg, u8 value) | |||
78 | 78 | ||
79 | if (data->power_state) { | 79 | if (data->power_state) { |
80 | val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value); | 80 | val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value); |
81 | if (val < 0) | 81 | if (val < 0) { |
82 | dev_err(&tpa6130a2_client->dev, "Write failed\n"); | 82 | dev_err(&tpa6130a2_client->dev, "Write failed\n"); |
83 | return val; | ||
84 | } | ||
83 | } | 85 | } |
84 | 86 | ||
85 | /* Either powered on or off, we save the context */ | 87 | /* Either powered on or off, we save the context */ |
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index 7540a509a6f5..464f0cfa4c7a 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c | |||
@@ -597,6 +597,7 @@ static struct snd_soc_codec_driver soc_codec_dev_uda134x = { | |||
597 | .resume = uda134x_soc_resume, | 597 | .resume = uda134x_soc_resume, |
598 | .reg_cache_size = sizeof(uda134x_reg), | 598 | .reg_cache_size = sizeof(uda134x_reg), |
599 | .reg_word_size = sizeof(u8), | 599 | .reg_word_size = sizeof(u8), |
600 | .reg_cache_default = uda134x_reg, | ||
600 | .reg_cache_step = 1, | 601 | .reg_cache_step = 1, |
601 | .read = uda134x_read_reg_cache, | 602 | .read = uda134x_read_reg_cache, |
602 | .write = uda134x_write, | 603 | .write = uda134x_write, |
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index f4f1fba38eb9..b3e9fac172e5 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -831,7 +831,7 @@ static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
831 | } | 831 | } |
832 | 832 | ||
833 | /* MCLK direction */ | 833 | /* MCLK direction */ |
834 | if (dir == WM8350_MCLK_DIR_OUT) | 834 | if (dir == SND_SOC_CLOCK_OUT) |
835 | wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_2, | 835 | wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_2, |
836 | WM8350_MCLK_DIR); | 836 | WM8350_MCLK_DIR); |
837 | else | 837 | else |
@@ -1586,6 +1586,13 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec) | |||
1586 | wm8350_set_bits(wm8350, WM8350_ROUT2_VOLUME, | 1586 | wm8350_set_bits(wm8350, WM8350_ROUT2_VOLUME, |
1587 | WM8350_OUT2_VU | WM8350_OUT2R_MUTE); | 1587 | WM8350_OUT2_VU | WM8350_OUT2R_MUTE); |
1588 | 1588 | ||
1589 | /* Make sure AIF tristating is disabled by default */ | ||
1590 | wm8350_clear_bits(wm8350, WM8350_AI_FORMATING, WM8350_AIF_TRI); | ||
1591 | |||
1592 | /* Make sure we've got a sane companding setup too */ | ||
1593 | wm8350_clear_bits(wm8350, WM8350_ADC_DAC_COMP, | ||
1594 | WM8350_DAC_COMP | WM8350_LOOPBACK); | ||
1595 | |||
1589 | /* Make sure jack detect is disabled to start off with */ | 1596 | /* Make sure jack detect is disabled to start off with */ |
1590 | wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, | 1597 | wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, |
1591 | WM8350_JDL_ENA | WM8350_JDR_ENA); | 1598 | WM8350_JDL_ENA | WM8350_JDR_ENA); |
@@ -1619,7 +1626,6 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) | |||
1619 | { | 1626 | { |
1620 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); | 1627 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); |
1621 | struct wm8350 *wm8350 = dev_get_platdata(codec->dev); | 1628 | struct wm8350 *wm8350 = dev_get_platdata(codec->dev); |
1622 | int ret; | ||
1623 | 1629 | ||
1624 | wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, | 1630 | wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, |
1625 | WM8350_JDL_ENA | WM8350_JDR_ENA); | 1631 | WM8350_JDL_ENA | WM8350_JDR_ENA); |
@@ -1634,15 +1640,9 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) | |||
1634 | priv->hpr.jack = NULL; | 1640 | priv->hpr.jack = NULL; |
1635 | priv->mic.jack = NULL; | 1641 | priv->mic.jack = NULL; |
1636 | 1642 | ||
1637 | /* cancel any work waiting to be queued. */ | ||
1638 | ret = cancel_delayed_work(&codec->delayed_work); | ||
1639 | |||
1640 | /* if there was any work waiting then we run it now and | 1643 | /* if there was any work waiting then we run it now and |
1641 | * wait for its completion */ | 1644 | * wait for its completion */ |
1642 | if (ret) { | 1645 | flush_delayed_work_sync(&codec->delayed_work); |
1643 | schedule_delayed_work(&codec->delayed_work, 0); | ||
1644 | flush_scheduled_work(); | ||
1645 | } | ||
1646 | 1646 | ||
1647 | wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1647 | wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1648 | 1648 | ||
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index 712ef7c76f90..9a433a5396cb 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c | |||
@@ -146,7 +146,6 @@ static int wm8523_startup(struct snd_pcm_substream *substream, | |||
146 | return -EINVAL; | 146 | return -EINVAL; |
147 | } | 147 | } |
148 | 148 | ||
149 | return 0; | ||
150 | snd_pcm_hw_constraint_list(substream->runtime, 0, | 149 | snd_pcm_hw_constraint_list(substream->runtime, 0, |
151 | SNDRV_PCM_HW_PARAM_RATE, | 150 | SNDRV_PCM_HW_PARAM_RATE, |
152 | &wm8523->rate_constraint); | 151 | &wm8523->rate_constraint); |
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 631385802eb4..e725c09a3e79 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -526,7 +526,7 @@ static int wm8731_probe(struct snd_soc_codec *codec) | |||
526 | snd_soc_update_bits(codec, WM8731_RINVOL, 0x100, 0); | 526 | snd_soc_update_bits(codec, WM8731_RINVOL, 0x100, 0); |
527 | 527 | ||
528 | /* Disable bypass path by default */ | 528 | /* Disable bypass path by default */ |
529 | snd_soc_update_bits(codec, WM8731_APANA, 0x4, 0); | 529 | snd_soc_update_bits(codec, WM8731_APANA, 0x8, 0); |
530 | 530 | ||
531 | snd_soc_add_controls(codec, wm8731_snd_controls, | 531 | snd_soc_add_controls(codec, wm8731_snd_controls, |
532 | ARRAY_SIZE(wm8731_snd_controls)); | 532 | ARRAY_SIZE(wm8731_snd_controls)); |
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 8f679a13f2bc..84a23675cba9 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1526,25 +1526,6 @@ static int wm8753_resume(struct snd_soc_codec *codec) | |||
1526 | return 0; | 1526 | return 0; |
1527 | } | 1527 | } |
1528 | 1528 | ||
1529 | /* | ||
1530 | * This function forces any delayed work to be queued and run. | ||
1531 | */ | ||
1532 | static int run_delayed_work(struct delayed_work *dwork) | ||
1533 | { | ||
1534 | int ret; | ||
1535 | |||
1536 | /* cancel any work waiting to be queued. */ | ||
1537 | ret = cancel_delayed_work(dwork); | ||
1538 | |||
1539 | /* if there was any work waiting then we run it now and | ||
1540 | * wait for it's completion */ | ||
1541 | if (ret) { | ||
1542 | schedule_delayed_work(dwork, 0); | ||
1543 | flush_scheduled_work(); | ||
1544 | } | ||
1545 | return ret; | ||
1546 | } | ||
1547 | |||
1548 | static int wm8753_probe(struct snd_soc_codec *codec) | 1529 | static int wm8753_probe(struct snd_soc_codec *codec) |
1549 | { | 1530 | { |
1550 | struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); | 1531 | struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); |
@@ -1604,7 +1585,7 @@ static int wm8753_probe(struct snd_soc_codec *codec) | |||
1604 | /* power down chip */ | 1585 | /* power down chip */ |
1605 | static int wm8753_remove(struct snd_soc_codec *codec) | 1586 | static int wm8753_remove(struct snd_soc_codec *codec) |
1606 | { | 1587 | { |
1607 | run_delayed_work(&codec->delayed_work); | 1588 | flush_delayed_work_sync(&codec->delayed_work); |
1608 | wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1589 | wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1609 | 1590 | ||
1610 | return 0; | 1591 | return 0; |
diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c index 04182c464e35..0132a27140ae 100644 --- a/sound/soc/codecs/wm8776.c +++ b/sound/soc/codecs/wm8776.c | |||
@@ -34,7 +34,6 @@ | |||
34 | /* codec private data */ | 34 | /* codec private data */ |
35 | struct wm8776_priv { | 35 | struct wm8776_priv { |
36 | enum snd_soc_control_type control_type; | 36 | enum snd_soc_control_type control_type; |
37 | u16 reg_cache[WM8776_CACHEREGNUM]; | ||
38 | int sysclk[2]; | 37 | int sysclk[2]; |
39 | }; | 38 | }; |
40 | 39 | ||
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 33be84e506ea..fca60a0b57b8 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c | |||
@@ -2498,6 +2498,8 @@ static int wm8904_remove(struct snd_soc_codec *codec) | |||
2498 | 2498 | ||
2499 | wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2499 | wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2500 | regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); | 2500 | regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); |
2501 | kfree(wm8904->retune_mobile_texts); | ||
2502 | kfree(wm8904->drc_texts); | ||
2501 | 2503 | ||
2502 | return 0; | 2504 | return 0; |
2503 | } | 2505 | } |
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 4f326f604104..8340485c9851 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c | |||
@@ -711,7 +711,7 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream, | |||
711 | if (fs <= 24000) | 711 | if (fs <= 24000) |
712 | reg |= WM8961_DACSLOPE; | 712 | reg |= WM8961_DACSLOPE; |
713 | else | 713 | else |
714 | reg &= WM8961_DACSLOPE; | 714 | reg &= ~WM8961_DACSLOPE; |
715 | snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); | 715 | snd_soc_write(codec, WM8961_ADC_DAC_CONTROL_2, reg); |
716 | 716 | ||
717 | return 0; | 717 | return 0; |
@@ -736,7 +736,7 @@ static int wm8961_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
736 | freq /= 2; | 736 | freq /= 2; |
737 | } else { | 737 | } else { |
738 | dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); | 738 | dev_dbg(codec->dev, "Using MCLK/1 for %dHz MCLK\n", freq); |
739 | reg &= WM8961_MCLKDIV; | 739 | reg &= ~WM8961_MCLKDIV; |
740 | } | 740 | } |
741 | 741 | ||
742 | snd_soc_write(codec, WM8961_CLOCKING1, reg); | 742 | snd_soc_write(codec, WM8961_CLOCKING1, reg); |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 894d0cd3aa9b..e8092745a207 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -3500,8 +3500,11 @@ static ssize_t wm8962_beep_set(struct device *dev, | |||
3500 | { | 3500 | { |
3501 | struct wm8962_priv *wm8962 = dev_get_drvdata(dev); | 3501 | struct wm8962_priv *wm8962 = dev_get_drvdata(dev); |
3502 | long int time; | 3502 | long int time; |
3503 | int ret; | ||
3503 | 3504 | ||
3504 | strict_strtol(buf, 10, &time); | 3505 | ret = strict_strtol(buf, 10, &time); |
3506 | if (ret != 0) | ||
3507 | return ret; | ||
3505 | 3508 | ||
3506 | input_event(wm8962->beep, EV_SND, SND_TONE, time); | 3509 | input_event(wm8962->beep, EV_SND, SND_TONE, time); |
3507 | 3510 | ||
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 0db59c3aa5d4..4d3e6f1ac584 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -3903,6 +3903,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
3903 | return -ENOMEM; | 3903 | return -ENOMEM; |
3904 | snd_soc_codec_set_drvdata(codec, wm8994); | 3904 | snd_soc_codec_set_drvdata(codec, wm8994); |
3905 | 3905 | ||
3906 | codec->reg_cache = &wm8994->reg_cache; | ||
3907 | |||
3906 | wm8994->pdata = dev_get_platdata(codec->dev->parent); | 3908 | wm8994->pdata = dev_get_platdata(codec->dev->parent); |
3907 | wm8994->codec = codec; | 3909 | wm8994->codec = codec; |
3908 | 3910 | ||
@@ -4059,6 +4061,8 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec) | |||
4059 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994); | 4061 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_DET, wm8994); |
4060 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994); | 4062 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_SHRT, wm8994); |
4061 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994); | 4063 | wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC1_DET, wm8994); |
4064 | kfree(wm8994->retune_mobile_texts); | ||
4065 | kfree(wm8994->drc_texts); | ||
4062 | kfree(wm8994); | 4066 | kfree(wm8994); |
4063 | 4067 | ||
4064 | return 0; | 4068 | return 0; |
@@ -4071,6 +4075,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8994 = { | |||
4071 | .resume = wm8994_resume, | 4075 | .resume = wm8994_resume, |
4072 | .read = wm8994_read, | 4076 | .read = wm8994_read, |
4073 | .write = wm8994_write, | 4077 | .write = wm8994_write, |
4078 | .readable_register = wm8994_readable, | ||
4079 | .volatile_register = wm8994_volatile, | ||
4074 | .set_bias_level = wm8994_set_bias_level, | 4080 | .set_bias_level = wm8994_set_bias_level, |
4075 | }; | 4081 | }; |
4076 | 4082 | ||
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 2b07b17a6b2d..bc9e6b0b3f6f 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c | |||
@@ -157,12 +157,23 @@ static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd) | |||
157 | } | 157 | } |
158 | 158 | ||
159 | /* davinci-evm digital audio interface glue - connects codec <--> CPU */ | 159 | /* davinci-evm digital audio interface glue - connects codec <--> CPU */ |
160 | static struct snd_soc_dai_link evm_dai = { | 160 | static struct snd_soc_dai_link dm6446_evm_dai = { |
161 | .name = "TLV320AIC3X", | 161 | .name = "TLV320AIC3X", |
162 | .stream_name = "AIC3X", | 162 | .stream_name = "AIC3X", |
163 | .cpu_dai_name = "davinci-mcasp.0", | 163 | .cpu_dai_name = "davinci-mcbsp", |
164 | .codec_dai_name = "tlv320aic3x-hifi", | 164 | .codec_dai_name = "tlv320aic3x-hifi", |
165 | .codec_name = "tlv320aic3x-codec.0-001a", | 165 | .codec_name = "tlv320aic3x-codec.1-001b", |
166 | .platform_name = "davinci-pcm-audio", | ||
167 | .init = evm_aic3x_init, | ||
168 | .ops = &evm_ops, | ||
169 | }; | ||
170 | |||
171 | static struct snd_soc_dai_link dm355_evm_dai = { | ||
172 | .name = "TLV320AIC3X", | ||
173 | .stream_name = "AIC3X", | ||
174 | .cpu_dai_name = "davinci-mcbsp.1", | ||
175 | .codec_dai_name = "tlv320aic3x-hifi", | ||
176 | .codec_name = "tlv320aic3x-codec.1-001b", | ||
166 | .platform_name = "davinci-pcm-audio", | 177 | .platform_name = "davinci-pcm-audio", |
167 | .init = evm_aic3x_init, | 178 | .init = evm_aic3x_init, |
168 | .ops = &evm_ops, | 179 | .ops = &evm_ops, |
@@ -172,10 +183,10 @@ static struct snd_soc_dai_link dm365_evm_dai = { | |||
172 | #ifdef CONFIG_SND_DM365_AIC3X_CODEC | 183 | #ifdef CONFIG_SND_DM365_AIC3X_CODEC |
173 | .name = "TLV320AIC3X", | 184 | .name = "TLV320AIC3X", |
174 | .stream_name = "AIC3X", | 185 | .stream_name = "AIC3X", |
175 | .cpu_dai_name = "davinci-i2s", | 186 | .cpu_dai_name = "davinci-mcbsp", |
176 | .codec_dai_name = "tlv320aic3x-hifi", | 187 | .codec_dai_name = "tlv320aic3x-hifi", |
177 | .init = evm_aic3x_init, | 188 | .init = evm_aic3x_init, |
178 | .codec_name = "tlv320aic3x-codec.0-001a", | 189 | .codec_name = "tlv320aic3x-codec.1-0018", |
179 | .ops = &evm_ops, | 190 | .ops = &evm_ops, |
180 | #elif defined(CONFIG_SND_DM365_VOICE_CODEC) | 191 | #elif defined(CONFIG_SND_DM365_VOICE_CODEC) |
181 | .name = "Voice Codec - CQ93VC", | 192 | .name = "Voice Codec - CQ93VC", |
@@ -219,10 +230,17 @@ static struct snd_soc_dai_link da8xx_evm_dai = { | |||
219 | .ops = &evm_ops, | 230 | .ops = &evm_ops, |
220 | }; | 231 | }; |
221 | 232 | ||
222 | /* davinci dm6446, dm355 evm audio machine driver */ | 233 | /* davinci dm6446 evm audio machine driver */ |
223 | static struct snd_soc_card snd_soc_card_evm = { | 234 | static struct snd_soc_card dm6446_snd_soc_card_evm = { |
224 | .name = "DaVinci EVM", | 235 | .name = "DaVinci DM6446 EVM", |
225 | .dai_link = &evm_dai, | 236 | .dai_link = &dm6446_evm_dai, |
237 | .num_links = 1, | ||
238 | }; | ||
239 | |||
240 | /* davinci dm355 evm audio machine driver */ | ||
241 | static struct snd_soc_card dm355_snd_soc_card_evm = { | ||
242 | .name = "DaVinci DM355 EVM", | ||
243 | .dai_link = &dm355_evm_dai, | ||
226 | .num_links = 1, | 244 | .num_links = 1, |
227 | }; | 245 | }; |
228 | 246 | ||
@@ -261,10 +279,10 @@ static int __init evm_init(void) | |||
261 | int ret; | 279 | int ret; |
262 | 280 | ||
263 | if (machine_is_davinci_evm()) { | 281 | if (machine_is_davinci_evm()) { |
264 | evm_snd_dev_data = &snd_soc_card_evm; | 282 | evm_snd_dev_data = &dm6446_snd_soc_card_evm; |
265 | index = 0; | 283 | index = 0; |
266 | } else if (machine_is_davinci_dm355_evm()) { | 284 | } else if (machine_is_davinci_dm355_evm()) { |
267 | evm_snd_dev_data = &snd_soc_card_evm; | 285 | evm_snd_dev_data = &dm355_snd_soc_card_evm; |
268 | index = 1; | 286 | index = 1; |
269 | } else if (machine_is_davinci_dm365_evm()) { | 287 | } else if (machine_is_davinci_dm365_evm()) { |
270 | evm_snd_dev_data = &dm365_snd_soc_card_evm; | 288 | evm_snd_dev_data = &dm365_snd_soc_card_evm; |
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index d46b545d41f4..9e0e565e6ed9 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c | |||
@@ -426,9 +426,6 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, | |||
426 | snd_pcm_format_t fmt; | 426 | snd_pcm_format_t fmt; |
427 | unsigned element_cnt = 1; | 427 | unsigned element_cnt = 1; |
428 | 428 | ||
429 | dai->capture_dma_data = dev->dma_params; | ||
430 | dai->playback_dma_data = dev->dma_params; | ||
431 | |||
432 | /* general line settings */ | 429 | /* general line settings */ |
433 | spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG); | 430 | spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG); |
434 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { | 431 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { |
@@ -601,6 +598,15 @@ static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd, | |||
601 | return ret; | 598 | return ret; |
602 | } | 599 | } |
603 | 600 | ||
601 | static int davinci_i2s_startup(struct snd_pcm_substream *substream, | ||
602 | struct snd_soc_dai *dai) | ||
603 | { | ||
604 | struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); | ||
605 | |||
606 | snd_soc_dai_set_dma_data(dai, substream, dev->dma_params); | ||
607 | return 0; | ||
608 | } | ||
609 | |||
604 | static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, | 610 | static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, |
605 | struct snd_soc_dai *dai) | 611 | struct snd_soc_dai *dai) |
606 | { | 612 | { |
@@ -612,6 +618,7 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, | |||
612 | #define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 | 618 | #define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 |
613 | 619 | ||
614 | static struct snd_soc_dai_ops davinci_i2s_dai_ops = { | 620 | static struct snd_soc_dai_ops davinci_i2s_dai_ops = { |
621 | .startup = davinci_i2s_startup, | ||
615 | .shutdown = davinci_i2s_shutdown, | 622 | .shutdown = davinci_i2s_shutdown, |
616 | .prepare = davinci_i2s_prepare, | 623 | .prepare = davinci_i2s_prepare, |
617 | .trigger = davinci_i2s_trigger, | 624 | .trigger = davinci_i2s_trigger, |
@@ -749,7 +756,7 @@ static struct platform_driver davinci_mcbsp_driver = { | |||
749 | .probe = davinci_i2s_probe, | 756 | .probe = davinci_i2s_probe, |
750 | .remove = davinci_i2s_remove, | 757 | .remove = davinci_i2s_remove, |
751 | .driver = { | 758 | .driver = { |
752 | .name = "davinci-i2s", | 759 | .name = "davinci-mcbsp", |
753 | .owner = THIS_MODULE, | 760 | .owner = THIS_MODULE, |
754 | }, | 761 | }, |
755 | }; | 762 | }; |
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 86918ee12419..fb55d2c5d704 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -715,9 +715,6 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, | |||
715 | int word_length; | 715 | int word_length; |
716 | u8 fifo_level; | 716 | u8 fifo_level; |
717 | 717 | ||
718 | cpu_dai->capture_dma_data = dev->dma_params; | ||
719 | cpu_dai->playback_dma_data = dev->dma_params; | ||
720 | |||
721 | davinci_hw_common_param(dev, substream->stream); | 718 | davinci_hw_common_param(dev, substream->stream); |
722 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 719 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
723 | fifo_level = dev->txnumevt; | 720 | fifo_level = dev->txnumevt; |
@@ -799,7 +796,17 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream, | |||
799 | return ret; | 796 | return ret; |
800 | } | 797 | } |
801 | 798 | ||
799 | static int davinci_mcasp_startup(struct snd_pcm_substream *substream, | ||
800 | struct snd_soc_dai *dai) | ||
801 | { | ||
802 | struct davinci_audio_dev *dev = snd_soc_dai_get_drvdata(dai); | ||
803 | |||
804 | snd_soc_dai_set_dma_data(dai, substream, dev->dma_params); | ||
805 | return 0; | ||
806 | } | ||
807 | |||
802 | static struct snd_soc_dai_ops davinci_mcasp_dai_ops = { | 808 | static struct snd_soc_dai_ops davinci_mcasp_dai_ops = { |
809 | .startup = davinci_mcasp_startup, | ||
803 | .trigger = davinci_mcasp_trigger, | 810 | .trigger = davinci_mcasp_trigger, |
804 | .hw_params = davinci_mcasp_hw_params, | 811 | .hw_params = davinci_mcasp_hw_params, |
805 | .set_fmt = davinci_mcasp_set_dai_fmt, | 812 | .set_fmt = davinci_mcasp_set_dai_fmt, |
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 009b6521a1bf..6c6666a1f942 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c | |||
@@ -84,7 +84,7 @@ static struct snd_soc_ops sffsdr_ops = { | |||
84 | static struct snd_soc_dai_link sffsdr_dai = { | 84 | static struct snd_soc_dai_link sffsdr_dai = { |
85 | .name = "PCM3008", /* Codec name */ | 85 | .name = "PCM3008", /* Codec name */ |
86 | .stream_name = "PCM3008 HiFi", | 86 | .stream_name = "PCM3008 HiFi", |
87 | .cpu_dai_name = "davinci-asp.0", | 87 | .cpu_dai_name = "davinci-mcbsp", |
88 | .codec_dai_name = "pcm3008-hifi", | 88 | .codec_dai_name = "pcm3008-hifi", |
89 | .codec_name = "pcm3008-codec", | 89 | .codec_name = "pcm3008-codec", |
90 | .platform_name = "davinci-pcm-audio", | 90 | .platform_name = "davinci-pcm-audio", |
diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c index ea232f6a2c21..9d2afccc3a2d 100644 --- a/sound/soc/davinci/davinci-vcif.c +++ b/sound/soc/davinci/davinci-vcif.c | |||
@@ -97,9 +97,6 @@ static int davinci_vcif_hw_params(struct snd_pcm_substream *substream, | |||
97 | &davinci_vcif_dev->dma_params[substream->stream]; | 97 | &davinci_vcif_dev->dma_params[substream->stream]; |
98 | u32 w; | 98 | u32 w; |
99 | 99 | ||
100 | dai->capture_dma_data = davinci_vcif_dev->dma_params; | ||
101 | dai->playback_dma_data = davinci_vcif_dev->dma_params; | ||
102 | |||
103 | /* Restart the codec before setup */ | 100 | /* Restart the codec before setup */ |
104 | davinci_vcif_stop(substream); | 101 | davinci_vcif_stop(substream); |
105 | davinci_vcif_start(substream); | 102 | davinci_vcif_start(substream); |
@@ -174,9 +171,19 @@ static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd, | |||
174 | return ret; | 171 | return ret; |
175 | } | 172 | } |
176 | 173 | ||
174 | static int davinci_vcif_startup(struct snd_pcm_substream *substream, | ||
175 | struct snd_soc_dai *dai) | ||
176 | { | ||
177 | struct davinci_vcif_dev *dev = snd_soc_dai_get_drvdata(dai); | ||
178 | |||
179 | snd_soc_dai_set_dma_data(dai, substream, dev->dma_params); | ||
180 | return 0; | ||
181 | } | ||
182 | |||
177 | #define DAVINCI_VCIF_RATES SNDRV_PCM_RATE_8000_48000 | 183 | #define DAVINCI_VCIF_RATES SNDRV_PCM_RATE_8000_48000 |
178 | 184 | ||
179 | static struct snd_soc_dai_ops davinci_vcif_dai_ops = { | 185 | static struct snd_soc_dai_ops davinci_vcif_dai_ops = { |
186 | .startup = davinci_vcif_startup, | ||
180 | .trigger = davinci_vcif_trigger, | 187 | .trigger = davinci_vcif_trigger, |
181 | .hw_params = davinci_vcif_hw_params, | 188 | .hw_params = davinci_vcif_hw_params, |
182 | }; | 189 | }; |
@@ -240,7 +247,10 @@ fail: | |||
240 | 247 | ||
241 | static int davinci_vcif_remove(struct platform_device *pdev) | 248 | static int davinci_vcif_remove(struct platform_device *pdev) |
242 | { | 249 | { |
250 | struct davinci_vcif_dev *davinci_vcif_dev = dev_get_drvdata(&pdev->dev); | ||
251 | |||
243 | snd_soc_unregister_dai(&pdev->dev); | 252 | snd_soc_unregister_dai(&pdev->dev); |
253 | kfree(davinci_vcif_dev); | ||
244 | 254 | ||
245 | return 0; | 255 | return 0; |
246 | } | 256 | } |
diff --git a/sound/soc/ep93xx/simone.c b/sound/soc/ep93xx/simone.c index 4b0d19913728..286817946c56 100644 --- a/sound/soc/ep93xx/simone.c +++ b/sound/soc/ep93xx/simone.c | |||
@@ -54,24 +54,26 @@ static int __init simone_init(void) | |||
54 | 54 | ||
55 | ret = platform_device_add(simone_snd_ac97_device); | 55 | ret = platform_device_add(simone_snd_ac97_device); |
56 | if (ret) | 56 | if (ret) |
57 | goto fail; | 57 | goto fail1; |
58 | 58 | ||
59 | simone_snd_device = platform_device_alloc("soc-audio", -1); | 59 | simone_snd_device = platform_device_alloc("soc-audio", -1); |
60 | if (!simone_snd_device) { | 60 | if (!simone_snd_device) { |
61 | ret = -ENOMEM; | 61 | ret = -ENOMEM; |
62 | goto fail; | 62 | goto fail2; |
63 | } | 63 | } |
64 | 64 | ||
65 | platform_set_drvdata(simone_snd_device, &snd_soc_simone); | 65 | platform_set_drvdata(simone_snd_device, &snd_soc_simone); |
66 | ret = platform_device_add(simone_snd_device); | 66 | ret = platform_device_add(simone_snd_device); |
67 | if (ret) { | 67 | if (ret) |
68 | platform_device_put(simone_snd_device); | 68 | goto fail3; |
69 | goto fail; | ||
70 | } | ||
71 | 69 | ||
72 | return ret; | 70 | return 0; |
73 | 71 | ||
74 | fail: | 72 | fail3: |
73 | platform_device_put(simone_snd_device); | ||
74 | fail2: | ||
75 | platform_device_del(simone_snd_ac97_device); | ||
76 | fail1: | ||
75 | platform_device_put(simone_snd_ac97_device); | 77 | platform_device_put(simone_snd_ac97_device); |
76 | return ret; | 78 | return ret; |
77 | } | 79 | } |
diff --git a/sound/soc/fsl/efika-audio-fabric.c b/sound/soc/fsl/efika-audio-fabric.c index 53251e6b5bd5..108b5d8bd0e9 100644 --- a/sound/soc/fsl/efika-audio-fabric.c +++ b/sound/soc/fsl/efika-audio-fabric.c | |||
@@ -76,6 +76,7 @@ static __init int efika_fabric_init(void) | |||
76 | rc = platform_device_add(pdev); | 76 | rc = platform_device_add(pdev); |
77 | if (rc) { | 77 | if (rc) { |
78 | pr_err("efika_fabric_init: platform_device_add() failed\n"); | 78 | pr_err("efika_fabric_init: platform_device_add() failed\n"); |
79 | platform_device_put(pdev); | ||
79 | return -ENODEV; | 80 | return -ENODEV; |
80 | } | 81 | } |
81 | return 0; | 82 | return 0; |
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index dce6b551cd78..f92dca07cd35 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/of_device.h> | 10 | #include <linux/of_device.h> |
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/of_device.h> | ||
13 | #include <linux/of_platform.h> | 12 | #include <linux/of_platform.h> |
14 | 13 | ||
15 | #include <sound/soc.h> | 14 | #include <sound/soc.h> |
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c index 74ffed41340f..9018fa5bf0db 100644 --- a/sound/soc/fsl/mpc5200_psc_i2s.c +++ b/sound/soc/fsl/mpc5200_psc_i2s.c | |||
@@ -160,7 +160,7 @@ static int __devinit psc_i2s_of_probe(struct platform_device *op, | |||
160 | rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); | 160 | rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai)); |
161 | if (rc != 0) { | 161 | if (rc != 0) { |
162 | pr_err("Failed to register DAI\n"); | 162 | pr_err("Failed to register DAI\n"); |
163 | return 0; | 163 | return rc; |
164 | } | 164 | } |
165 | 165 | ||
166 | psc_dma = dev_get_drvdata(&op->dev); | 166 | psc_dma = dev_get_drvdata(&op->dev); |
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 0d7dcf1e4863..7d7847a1e66b 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
@@ -498,6 +498,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
498 | dev_err(&pdev->dev, "platform device add failed\n"); | 498 | dev_err(&pdev->dev, "platform device add failed\n"); |
499 | goto error; | 499 | goto error; |
500 | } | 500 | } |
501 | dev_set_drvdata(&pdev->dev, sound_device); | ||
501 | 502 | ||
502 | of_node_put(codec_np); | 503 | of_node_put(codec_np); |
503 | 504 | ||
diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c index 63b9eaa1ebc2..026b756961e0 100644 --- a/sound/soc/fsl/p1022_ds.c +++ b/sound/soc/fsl/p1022_ds.c | |||
@@ -498,6 +498,7 @@ static int p1022_ds_probe(struct platform_device *pdev) | |||
498 | dev_err(&pdev->dev, "platform device add failed\n"); | 498 | dev_err(&pdev->dev, "platform device add failed\n"); |
499 | goto error; | 499 | goto error; |
500 | } | 500 | } |
501 | dev_set_drvdata(&pdev->dev, sound_device); | ||
501 | 502 | ||
502 | of_node_put(codec_np); | 503 | of_node_put(codec_np); |
503 | 504 | ||
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index 25f27ec1dd6e..ba4d85e317ed 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c | |||
@@ -76,6 +76,7 @@ static __init int pcm030_fabric_init(void) | |||
76 | rc = platform_device_add(pdev); | 76 | rc = platform_device_add(pdev); |
77 | if (rc) { | 77 | if (rc) { |
78 | pr_err("pcm030_fabric_init: platform_device_add() failed\n"); | 78 | pr_err("pcm030_fabric_init: platform_device_add() failed\n"); |
79 | platform_device_put(pdev); | ||
79 | return -ENODEV; | 80 | return -ENODEV; |
80 | } | 81 | } |
81 | return 0; | 82 | return 0; |
diff --git a/sound/soc/imx/eukrea-tlv320.c b/sound/soc/imx/eukrea-tlv320.c index b59675257ce5..dd4fffdbd177 100644 --- a/sound/soc/imx/eukrea-tlv320.c +++ b/sound/soc/imx/eukrea-tlv320.c | |||
@@ -34,8 +34,8 @@ static int eukrea_tlv320_hw_params(struct snd_pcm_substream *substream, | |||
34 | struct snd_pcm_hw_params *params) | 34 | struct snd_pcm_hw_params *params) |
35 | { | 35 | { |
36 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 36 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
37 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 37 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
38 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 38 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
39 | int ret; | 39 | int ret; |
40 | 40 | ||
41 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | 41 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | |
@@ -79,10 +79,10 @@ static struct snd_soc_ops eukrea_tlv320_snd_ops = { | |||
79 | static struct snd_soc_dai_link eukrea_tlv320_dai = { | 79 | static struct snd_soc_dai_link eukrea_tlv320_dai = { |
80 | .name = "tlv320aic23", | 80 | .name = "tlv320aic23", |
81 | .stream_name = "TLV320AIC23", | 81 | .stream_name = "TLV320AIC23", |
82 | .codec_dai = "tlv320aic23-hifi", | 82 | .codec_dai_name = "tlv320aic23-hifi", |
83 | .platform_name = "imx-pcm-audio.0", | 83 | .platform_name = "imx-pcm-audio.0", |
84 | .codec_name = "tlv320aic23-codec.0-001a", | 84 | .codec_name = "tlv320aic23-codec.0-001a", |
85 | .cpu_dai = "imx-ssi.0", | 85 | .cpu_dai_name = "imx-ssi.0", |
86 | .ops = &eukrea_tlv320_snd_ops, | 86 | .ops = &eukrea_tlv320_snd_ops, |
87 | }; | 87 | }; |
88 | 88 | ||
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index fd493ee1428e..671ef8dd524c 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
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 | 24 | ||
24 | #include <sound/core.h> | 25 | #include <sound/core.h> |
25 | #include <sound/initval.h> | 26 | #include <sound/initval.h> |
@@ -27,165 +28,146 @@ | |||
27 | #include <sound/pcm_params.h> | 28 | #include <sound/pcm_params.h> |
28 | #include <sound/soc.h> | 29 | #include <sound/soc.h> |
29 | 30 | ||
30 | #include <mach/dma-mx1-mx2.h> | 31 | #include <mach/dma.h> |
31 | 32 | ||
32 | #include "imx-ssi.h" | 33 | #include "imx-ssi.h" |
33 | 34 | ||
34 | struct imx_pcm_runtime_data { | 35 | struct imx_pcm_runtime_data { |
35 | int sg_count; | 36 | int period_bytes; |
36 | struct scatterlist *sg_list; | ||
37 | int period; | ||
38 | int periods; | 37 | int periods; |
39 | unsigned long dma_addr; | ||
40 | int dma; | 38 | int dma; |
41 | struct snd_pcm_substream *substream; | ||
42 | unsigned long offset; | 39 | unsigned long offset; |
43 | unsigned long size; | 40 | unsigned long size; |
44 | unsigned long period_cnt; | ||
45 | void *buf; | 41 | void *buf; |
46 | int period_time; | 42 | int period_time; |
43 | struct dma_async_tx_descriptor *desc; | ||
44 | struct dma_chan *dma_chan; | ||
45 | struct imx_dma_data dma_data; | ||
47 | }; | 46 | }; |
48 | 47 | ||
49 | /* Called by the DMA framework when a period has elapsed */ | 48 | static void audio_dma_irq(void *data) |
50 | static void imx_ssi_dma_progression(int channel, void *data, | ||
51 | struct scatterlist *sg) | ||
52 | { | 49 | { |
53 | struct snd_pcm_substream *substream = data; | 50 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)data; |
54 | struct snd_pcm_runtime *runtime = substream->runtime; | 51 | struct snd_pcm_runtime *runtime = substream->runtime; |
55 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; | 52 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; |
56 | 53 | ||
57 | if (!sg) | 54 | iprtd->offset += iprtd->period_bytes; |
58 | return; | 55 | iprtd->offset %= iprtd->period_bytes * iprtd->periods; |
59 | |||
60 | runtime = iprtd->substream->runtime; | ||
61 | 56 | ||
62 | iprtd->offset = sg->dma_address - runtime->dma_addr; | 57 | snd_pcm_period_elapsed(substream); |
63 | |||
64 | snd_pcm_period_elapsed(iprtd->substream); | ||
65 | } | 58 | } |
66 | 59 | ||
67 | static void imx_ssi_dma_callback(int channel, void *data) | 60 | static bool filter(struct dma_chan *chan, void *param) |
68 | { | 61 | { |
69 | pr_err("%s shouldn't be called\n", __func__); | 62 | struct imx_pcm_runtime_data *iprtd = param; |
70 | } | ||
71 | 63 | ||
72 | static void snd_imx_dma_err_callback(int channel, void *data, int err) | 64 | if (!imx_dma_is_general_purpose(chan)) |
73 | { | 65 | return false; |
74 | struct snd_pcm_substream *substream = data; | ||
75 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
76 | struct imx_pcm_dma_params *dma_params = | ||
77 | snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream); | ||
78 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
79 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; | ||
80 | int ret; | ||
81 | 66 | ||
82 | pr_err("DMA timeout on channel %d -%s%s%s%s\n", | 67 | chan->private = &iprtd->dma_data; |
83 | channel, | ||
84 | err & IMX_DMA_ERR_BURST ? " burst" : "", | ||
85 | err & IMX_DMA_ERR_REQUEST ? " request" : "", | ||
86 | err & IMX_DMA_ERR_TRANSFER ? " transfer" : "", | ||
87 | err & IMX_DMA_ERR_BUFFER ? " buffer" : ""); | ||
88 | 68 | ||
89 | imx_dma_disable(iprtd->dma); | 69 | return true; |
90 | ret = imx_dma_setup_sg(iprtd->dma, iprtd->sg_list, iprtd->sg_count, | ||
91 | IMX_DMA_LENGTH_LOOP, dma_params->dma_addr, | ||
92 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? | ||
93 | DMA_MODE_WRITE : DMA_MODE_READ); | ||
94 | if (!ret) | ||
95 | imx_dma_enable(iprtd->dma); | ||
96 | } | 70 | } |
97 | 71 | ||
98 | static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream) | 72 | static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, |
73 | struct snd_pcm_hw_params *params) | ||
99 | { | 74 | { |
100 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 75 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
101 | struct imx_pcm_dma_params *dma_params; | 76 | struct imx_pcm_dma_params *dma_params; |
102 | struct snd_pcm_runtime *runtime = substream->runtime; | 77 | struct snd_pcm_runtime *runtime = substream->runtime; |
103 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; | 78 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; |
79 | struct dma_slave_config slave_config; | ||
80 | dma_cap_mask_t mask; | ||
81 | enum dma_slave_buswidth buswidth; | ||
104 | int ret; | 82 | int ret; |
105 | 83 | ||
106 | dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | 84 | dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
107 | 85 | ||
108 | iprtd->dma = imx_dma_request_by_prio(DRV_NAME, DMA_PRIO_HIGH); | 86 | iprtd->dma_data.peripheral_type = IMX_DMATYPE_SSI; |
109 | if (iprtd->dma < 0) { | 87 | iprtd->dma_data.priority = DMA_PRIO_HIGH; |
110 | pr_err("Failed to claim the audio DMA\n"); | 88 | iprtd->dma_data.dma_request = dma_params->dma; |
111 | return -ENODEV; | ||
112 | } | ||
113 | 89 | ||
114 | ret = imx_dma_setup_handlers(iprtd->dma, | 90 | /* Try to grab a DMA channel */ |
115 | imx_ssi_dma_callback, | 91 | dma_cap_zero(mask); |
116 | snd_imx_dma_err_callback, substream); | 92 | dma_cap_set(DMA_SLAVE, mask); |
117 | if (ret) | 93 | iprtd->dma_chan = dma_request_channel(mask, filter, iprtd); |
118 | goto out; | 94 | if (!iprtd->dma_chan) |
95 | return -EINVAL; | ||
119 | 96 | ||
120 | ret = imx_dma_setup_progression_handler(iprtd->dma, | 97 | switch (params_format(params)) { |
121 | imx_ssi_dma_progression); | 98 | case SNDRV_PCM_FORMAT_S16_LE: |
122 | if (ret) { | 99 | buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES; |
123 | pr_err("Failed to setup the DMA handler\n"); | 100 | break; |
124 | goto out; | 101 | case SNDRV_PCM_FORMAT_S20_3LE: |
102 | case SNDRV_PCM_FORMAT_S24_LE: | ||
103 | buswidth = DMA_SLAVE_BUSWIDTH_4_BYTES; | ||
104 | break; | ||
105 | default: | ||
106 | return 0; | ||
125 | } | 107 | } |
126 | 108 | ||
127 | ret = imx_dma_config_channel(iprtd->dma, | 109 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
128 | IMX_DMA_MEMSIZE_16 | IMX_DMA_TYPE_FIFO, | 110 | slave_config.direction = DMA_TO_DEVICE; |
129 | IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR, | 111 | slave_config.dst_addr = dma_params->dma_addr; |
130 | dma_params->dma, 1); | 112 | slave_config.dst_addr_width = buswidth; |
131 | if (ret < 0) { | 113 | slave_config.dst_maxburst = dma_params->burstsize; |
132 | pr_err("Cannot configure DMA channel: %d\n", ret); | 114 | } else { |
133 | goto out; | 115 | slave_config.direction = DMA_FROM_DEVICE; |
116 | slave_config.src_addr = dma_params->dma_addr; | ||
117 | slave_config.src_addr_width = buswidth; | ||
118 | slave_config.src_maxburst = dma_params->burstsize; | ||
134 | } | 119 | } |
135 | 120 | ||
136 | imx_dma_config_burstlen(iprtd->dma, dma_params->burstsize * 2); | 121 | ret = dmaengine_slave_config(iprtd->dma_chan, &slave_config); |
122 | if (ret) | ||
123 | return ret; | ||
137 | 124 | ||
138 | return 0; | 125 | return 0; |
139 | out: | ||
140 | imx_dma_free(iprtd->dma); | ||
141 | return ret; | ||
142 | } | 126 | } |
143 | 127 | ||
144 | static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, | 128 | static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, |
145 | struct snd_pcm_hw_params *params) | 129 | struct snd_pcm_hw_params *params) |
146 | { | 130 | { |
131 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
147 | struct snd_pcm_runtime *runtime = substream->runtime; | 132 | struct snd_pcm_runtime *runtime = substream->runtime; |
148 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; | 133 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; |
149 | int i; | ||
150 | unsigned long dma_addr; | 134 | unsigned long dma_addr; |
135 | struct dma_chan *chan; | ||
136 | struct imx_pcm_dma_params *dma_params; | ||
137 | int ret; | ||
151 | 138 | ||
152 | imx_ssi_dma_alloc(substream); | 139 | dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
140 | ret = imx_ssi_dma_alloc(substream, params); | ||
141 | if (ret) | ||
142 | return ret; | ||
143 | chan = iprtd->dma_chan; | ||
153 | 144 | ||
154 | iprtd->size = params_buffer_bytes(params); | 145 | iprtd->size = params_buffer_bytes(params); |
155 | iprtd->periods = params_periods(params); | 146 | iprtd->periods = params_periods(params); |
156 | iprtd->period = params_period_bytes(params); | 147 | iprtd->period_bytes = params_period_bytes(params); |
157 | iprtd->offset = 0; | 148 | iprtd->offset = 0; |
158 | iprtd->period_time = HZ / (params_rate(params) / | 149 | iprtd->period_time = HZ / (params_rate(params) / |
159 | params_period_size(params)); | 150 | params_period_size(params)); |
160 | 151 | ||
161 | snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); | 152 | snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); |
162 | 153 | ||
163 | if (iprtd->sg_count != iprtd->periods) { | ||
164 | kfree(iprtd->sg_list); | ||
165 | |||
166 | iprtd->sg_list = kcalloc(iprtd->periods + 1, | ||
167 | sizeof(struct scatterlist), GFP_KERNEL); | ||
168 | if (!iprtd->sg_list) | ||
169 | return -ENOMEM; | ||
170 | iprtd->sg_count = iprtd->periods + 1; | ||
171 | } | ||
172 | |||
173 | sg_init_table(iprtd->sg_list, iprtd->sg_count); | ||
174 | dma_addr = runtime->dma_addr; | 154 | dma_addr = runtime->dma_addr; |
175 | 155 | ||
176 | for (i = 0; i < iprtd->periods; i++) { | 156 | iprtd->buf = (unsigned int *)substream->dma_buffer.area; |
177 | iprtd->sg_list[i].page_link = 0; | 157 | |
178 | iprtd->sg_list[i].offset = 0; | 158 | iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, |
179 | iprtd->sg_list[i].dma_address = dma_addr; | 159 | iprtd->period_bytes * iprtd->periods, |
180 | iprtd->sg_list[i].length = iprtd->period; | 160 | iprtd->period_bytes, |
181 | dma_addr += iprtd->period; | 161 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? |
162 | DMA_TO_DEVICE : DMA_FROM_DEVICE); | ||
163 | if (!iprtd->desc) { | ||
164 | dev_err(&chan->dev->device, "cannot prepare slave dma\n"); | ||
165 | return -EINVAL; | ||
182 | } | 166 | } |
183 | 167 | ||
184 | /* close the loop */ | 168 | iprtd->desc->callback = audio_dma_irq; |
185 | iprtd->sg_list[iprtd->sg_count - 1].offset = 0; | 169 | iprtd->desc->callback_param = substream; |
186 | iprtd->sg_list[iprtd->sg_count - 1].length = 0; | 170 | |
187 | iprtd->sg_list[iprtd->sg_count - 1].page_link = | ||
188 | ((unsigned long) iprtd->sg_list | 0x01) & ~0x02; | ||
189 | return 0; | 171 | return 0; |
190 | } | 172 | } |
191 | 173 | ||
@@ -194,41 +176,21 @@ static int snd_imx_pcm_hw_free(struct snd_pcm_substream *substream) | |||
194 | struct snd_pcm_runtime *runtime = substream->runtime; | 176 | struct snd_pcm_runtime *runtime = substream->runtime; |
195 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; | 177 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; |
196 | 178 | ||
197 | if (iprtd->dma >= 0) { | 179 | if (iprtd->dma_chan) { |
198 | imx_dma_free(iprtd->dma); | 180 | dma_release_channel(iprtd->dma_chan); |
199 | iprtd->dma = -EINVAL; | 181 | iprtd->dma_chan = NULL; |
200 | } | 182 | } |
201 | 183 | ||
202 | kfree(iprtd->sg_list); | ||
203 | iprtd->sg_list = NULL; | ||
204 | |||
205 | return 0; | 184 | return 0; |
206 | } | 185 | } |
207 | 186 | ||
208 | static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream) | 187 | static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream) |
209 | { | 188 | { |
210 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
211 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 189 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
212 | struct imx_pcm_dma_params *dma_params; | 190 | struct imx_pcm_dma_params *dma_params; |
213 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; | ||
214 | int err; | ||
215 | 191 | ||
216 | dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | 192 | dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
217 | 193 | ||
218 | iprtd->substream = substream; | ||
219 | iprtd->buf = (unsigned int *)substream->dma_buffer.area; | ||
220 | iprtd->period_cnt = 0; | ||
221 | |||
222 | pr_debug("%s: buf: %p period: %d periods: %d\n", | ||
223 | __func__, iprtd->buf, iprtd->period, iprtd->periods); | ||
224 | |||
225 | err = imx_dma_setup_sg(iprtd->dma, iprtd->sg_list, iprtd->sg_count, | ||
226 | IMX_DMA_LENGTH_LOOP, dma_params->dma_addr, | ||
227 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? | ||
228 | DMA_MODE_WRITE : DMA_MODE_READ); | ||
229 | if (err) | ||
230 | return err; | ||
231 | |||
232 | return 0; | 194 | return 0; |
233 | } | 195 | } |
234 | 196 | ||
@@ -241,14 +203,14 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
241 | case SNDRV_PCM_TRIGGER_START: | 203 | case SNDRV_PCM_TRIGGER_START: |
242 | case SNDRV_PCM_TRIGGER_RESUME: | 204 | case SNDRV_PCM_TRIGGER_RESUME: |
243 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 205 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
244 | imx_dma_enable(iprtd->dma); | 206 | dmaengine_submit(iprtd->desc); |
245 | 207 | ||
246 | break; | 208 | break; |
247 | 209 | ||
248 | case SNDRV_PCM_TRIGGER_STOP: | 210 | case SNDRV_PCM_TRIGGER_STOP: |
249 | case SNDRV_PCM_TRIGGER_SUSPEND: | 211 | case SNDRV_PCM_TRIGGER_SUSPEND: |
250 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 212 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
251 | imx_dma_disable(iprtd->dma); | 213 | dmaengine_terminate_all(iprtd->dma_chan); |
252 | 214 | ||
253 | break; | 215 | break; |
254 | default: | 216 | default: |
@@ -263,6 +225,9 @@ static snd_pcm_uframes_t snd_imx_pcm_pointer(struct snd_pcm_substream *substream | |||
263 | struct snd_pcm_runtime *runtime = substream->runtime; | 225 | struct snd_pcm_runtime *runtime = substream->runtime; |
264 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; | 226 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; |
265 | 227 | ||
228 | pr_debug("%s: %ld %ld\n", __func__, iprtd->offset, | ||
229 | bytes_to_frames(substream->runtime, iprtd->offset)); | ||
230 | |||
266 | return bytes_to_frames(substream->runtime, iprtd->offset); | 231 | return bytes_to_frames(substream->runtime, iprtd->offset); |
267 | } | 232 | } |
268 | 233 | ||
@@ -279,7 +244,7 @@ static struct snd_pcm_hardware snd_imx_hardware = { | |||
279 | .channels_max = 2, | 244 | .channels_max = 2, |
280 | .buffer_bytes_max = IMX_SSI_DMABUF_SIZE, | 245 | .buffer_bytes_max = IMX_SSI_DMABUF_SIZE, |
281 | .period_bytes_min = 128, | 246 | .period_bytes_min = 128, |
282 | .period_bytes_max = 16 * 1024, | 247 | .period_bytes_max = 65535, /* Limited by SDMA engine */ |
283 | .periods_min = 2, | 248 | .periods_min = 2, |
284 | .periods_max = 255, | 249 | .periods_max = 255, |
285 | .fifo_size = 0, | 250 | .fifo_size = 0, |
@@ -304,11 +269,23 @@ static int snd_imx_open(struct snd_pcm_substream *substream) | |||
304 | } | 269 | } |
305 | 270 | ||
306 | snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); | 271 | snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); |
272 | |||
273 | return 0; | ||
274 | } | ||
275 | |||
276 | static int snd_imx_close(struct snd_pcm_substream *substream) | ||
277 | { | ||
278 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
279 | struct imx_pcm_runtime_data *iprtd = runtime->private_data; | ||
280 | |||
281 | kfree(iprtd); | ||
282 | |||
307 | return 0; | 283 | return 0; |
308 | } | 284 | } |
309 | 285 | ||
310 | static struct snd_pcm_ops imx_pcm_ops = { | 286 | static struct snd_pcm_ops imx_pcm_ops = { |
311 | .open = snd_imx_open, | 287 | .open = snd_imx_open, |
288 | .close = snd_imx_close, | ||
312 | .ioctl = snd_pcm_lib_ioctl, | 289 | .ioctl = snd_pcm_lib_ioctl, |
313 | .hw_params = snd_imx_pcm_hw_params, | 290 | .hw_params = snd_imx_pcm_hw_params, |
314 | .hw_free = snd_imx_pcm_hw_free, | 291 | .hw_free = snd_imx_pcm_hw_free, |
@@ -340,7 +317,6 @@ static struct platform_driver imx_pcm_driver = { | |||
340 | .name = "imx-pcm-audio", | 317 | .name = "imx-pcm-audio", |
341 | .owner = THIS_MODULE, | 318 | .owner = THIS_MODULE, |
342 | }, | 319 | }, |
343 | |||
344 | .probe = imx_soc_platform_probe, | 320 | .probe = imx_soc_platform_probe, |
345 | .remove = __devexit_p(imx_soc_platform_remove), | 321 | .remove = __devexit_p(imx_soc_platform_remove), |
346 | }; | 322 | }; |
@@ -356,4 +332,3 @@ static void __exit snd_imx_pcm_exit(void) | |||
356 | platform_driver_unregister(&imx_pcm_driver); | 332 | platform_driver_unregister(&imx_pcm_driver); |
357 | } | 333 | } |
358 | module_exit(snd_imx_pcm_exit); | 334 | module_exit(snd_imx_pcm_exit); |
359 | |||
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index d4bd345b0a8d..390b6ffc2658 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c | |||
@@ -439,7 +439,22 @@ void imx_pcm_free(struct snd_pcm *pcm) | |||
439 | } | 439 | } |
440 | EXPORT_SYMBOL_GPL(imx_pcm_free); | 440 | EXPORT_SYMBOL_GPL(imx_pcm_free); |
441 | 441 | ||
442 | static int imx_ssi_dai_probe(struct snd_soc_dai *dai) | ||
443 | { | ||
444 | struct imx_ssi *ssi = dev_get_drvdata(dai->dev); | ||
445 | uint32_t val; | ||
446 | |||
447 | snd_soc_dai_set_drvdata(dai, ssi); | ||
448 | |||
449 | val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.burstsize) | | ||
450 | SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize); | ||
451 | writel(val, ssi->base + SSI_SFCSR); | ||
452 | |||
453 | return 0; | ||
454 | } | ||
455 | |||
442 | static struct snd_soc_dai_driver imx_ssi_dai = { | 456 | static struct snd_soc_dai_driver imx_ssi_dai = { |
457 | .probe = imx_ssi_dai_probe, | ||
443 | .playback = { | 458 | .playback = { |
444 | .channels_min = 2, | 459 | .channels_min = 2, |
445 | .channels_max = 2, | 460 | .channels_max = 2, |
@@ -455,20 +470,6 @@ static struct snd_soc_dai_driver imx_ssi_dai = { | |||
455 | .ops = &imx_ssi_pcm_dai_ops, | 470 | .ops = &imx_ssi_pcm_dai_ops, |
456 | }; | 471 | }; |
457 | 472 | ||
458 | static int imx_ssi_dai_probe(struct snd_soc_dai *dai) | ||
459 | { | ||
460 | struct imx_ssi *ssi = dev_get_drvdata(dai->dev); | ||
461 | uint32_t val; | ||
462 | |||
463 | snd_soc_dai_set_drvdata(dai, ssi); | ||
464 | |||
465 | val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.burstsize) | | ||
466 | SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize); | ||
467 | writel(val, ssi->base + SSI_SFCSR); | ||
468 | |||
469 | return 0; | ||
470 | } | ||
471 | |||
472 | static struct snd_soc_dai_driver imx_ac97_dai = { | 473 | static struct snd_soc_dai_driver imx_ac97_dai = { |
473 | .probe = imx_ssi_dai_probe, | 474 | .probe = imx_ssi_dai_probe, |
474 | .ac97_control = 1, | 475 | .ac97_control = 1, |
@@ -677,9 +678,25 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
677 | goto failed_register; | 678 | goto failed_register; |
678 | } | 679 | } |
679 | 680 | ||
680 | ssi->soc_platform_pdev = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); | 681 | ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); |
681 | if (!ssi->soc_platform_pdev) | 682 | if (!ssi->soc_platform_pdev_fiq) { |
683 | ret = -ENOMEM; | ||
684 | goto failed_pdev_fiq_alloc; | ||
685 | } | ||
686 | |||
687 | platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); | ||
688 | ret = platform_device_add(ssi->soc_platform_pdev_fiq); | ||
689 | if (ret) { | ||
690 | dev_err(&pdev->dev, "failed to add platform device\n"); | ||
691 | goto failed_pdev_fiq_add; | ||
692 | } | ||
693 | |||
694 | ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); | ||
695 | if (!ssi->soc_platform_pdev) { | ||
696 | ret = -ENOMEM; | ||
682 | goto failed_pdev_alloc; | 697 | goto failed_pdev_alloc; |
698 | } | ||
699 | |||
683 | platform_set_drvdata(ssi->soc_platform_pdev, ssi); | 700 | platform_set_drvdata(ssi->soc_platform_pdev, ssi); |
684 | ret = platform_device_add(ssi->soc_platform_pdev); | 701 | ret = platform_device_add(ssi->soc_platform_pdev); |
685 | if (ret) { | 702 | if (ret) { |
@@ -692,6 +709,10 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
692 | failed_pdev_add: | 709 | failed_pdev_add: |
693 | platform_device_put(ssi->soc_platform_pdev); | 710 | platform_device_put(ssi->soc_platform_pdev); |
694 | failed_pdev_alloc: | 711 | failed_pdev_alloc: |
712 | platform_device_del(ssi->soc_platform_pdev_fiq); | ||
713 | failed_pdev_fiq_add: | ||
714 | platform_device_put(ssi->soc_platform_pdev_fiq); | ||
715 | failed_pdev_fiq_alloc: | ||
695 | snd_soc_unregister_dai(&pdev->dev); | 716 | snd_soc_unregister_dai(&pdev->dev); |
696 | failed_register: | 717 | failed_register: |
697 | failed_ac97: | 718 | failed_ac97: |
@@ -712,8 +733,8 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev) | |||
712 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 733 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
713 | struct imx_ssi *ssi = platform_get_drvdata(pdev); | 734 | struct imx_ssi *ssi = platform_get_drvdata(pdev); |
714 | 735 | ||
715 | platform_device_del(ssi->soc_platform_pdev); | 736 | platform_device_unregister(ssi->soc_platform_pdev); |
716 | platform_device_put(ssi->soc_platform_pdev); | 737 | platform_device_unregister(ssi->soc_platform_pdev_fiq); |
717 | 738 | ||
718 | snd_soc_unregister_dai(&pdev->dev); | 739 | snd_soc_unregister_dai(&pdev->dev); |
719 | 740 | ||
diff --git a/sound/soc/imx/imx-ssi.h b/sound/soc/imx/imx-ssi.h index 53b780d9b2b0..a4406a134892 100644 --- a/sound/soc/imx/imx-ssi.h +++ b/sound/soc/imx/imx-ssi.h | |||
@@ -185,6 +185,9 @@ | |||
185 | 185 | ||
186 | #define DRV_NAME "imx-ssi" | 186 | #define DRV_NAME "imx-ssi" |
187 | 187 | ||
188 | #include <linux/dmaengine.h> | ||
189 | #include <mach/dma.h> | ||
190 | |||
188 | struct imx_pcm_dma_params { | 191 | struct imx_pcm_dma_params { |
189 | int dma; | 192 | int dma; |
190 | unsigned long dma_addr; | 193 | unsigned long dma_addr; |
@@ -212,6 +215,7 @@ struct imx_ssi { | |||
212 | int enabled; | 215 | int enabled; |
213 | 216 | ||
214 | struct platform_device *soc_platform_pdev; | 217 | struct platform_device *soc_platform_pdev; |
218 | struct platform_device *soc_platform_pdev_fiq; | ||
215 | }; | 219 | }; |
216 | 220 | ||
217 | struct snd_soc_platform *imx_ssi_fiq_init(struct platform_device *pdev, | 221 | struct snd_soc_platform *imx_ssi_fiq_init(struct platform_device *pdev, |
diff --git a/sound/soc/imx/phycore-ac97.c b/sound/soc/imx/phycore-ac97.c index 6a65dd705519..9eabc28667e6 100644 --- a/sound/soc/imx/phycore-ac97.c +++ b/sound/soc/imx/phycore-ac97.c | |||
@@ -20,9 +20,6 @@ | |||
20 | #include <sound/soc-dapm.h> | 20 | #include <sound/soc-dapm.h> |
21 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
22 | 22 | ||
23 | #include "../codecs/wm9712.h" | ||
24 | #include "imx-ssi.h" | ||
25 | |||
26 | static struct snd_soc_card imx_phycore; | 23 | static struct snd_soc_card imx_phycore; |
27 | 24 | ||
28 | static struct snd_soc_ops imx_phycore_hifi_ops = { | 25 | static struct snd_soc_ops imx_phycore_hifi_ops = { |
@@ -41,11 +38,12 @@ static struct snd_soc_dai_link imx_phycore_dai_ac97[] = { | |||
41 | }; | 38 | }; |
42 | 39 | ||
43 | static struct snd_soc_card imx_phycore = { | 40 | static struct snd_soc_card imx_phycore = { |
44 | .name = "PhyCORE-audio", | 41 | .name = "PhyCORE-ac97-audio", |
45 | .dai_link = imx_phycore_dai_ac97, | 42 | .dai_link = imx_phycore_dai_ac97, |
46 | .num_links = ARRAY_SIZE(imx_phycore_dai_ac97), | 43 | .num_links = ARRAY_SIZE(imx_phycore_dai_ac97), |
47 | }; | 44 | }; |
48 | 45 | ||
46 | static struct platform_device *imx_phycore_snd_ac97_device; | ||
49 | static struct platform_device *imx_phycore_snd_device; | 47 | static struct platform_device *imx_phycore_snd_device; |
50 | 48 | ||
51 | static int __init imx_phycore_init(void) | 49 | static int __init imx_phycore_init(void) |
@@ -56,29 +54,42 @@ static int __init imx_phycore_init(void) | |||
56 | /* return happy. We might run on a totally different machine */ | 54 | /* return happy. We might run on a totally different machine */ |
57 | return 0; | 55 | return 0; |
58 | 56 | ||
59 | imx_phycore_snd_device = platform_device_alloc("soc-audio", -1); | 57 | imx_phycore_snd_ac97_device = platform_device_alloc("soc-audio", -1); |
60 | if (!imx_phycore_snd_device) | 58 | if (!imx_phycore_snd_ac97_device) |
61 | return -ENOMEM; | 59 | return -ENOMEM; |
62 | 60 | ||
63 | platform_set_drvdata(imx_phycore_snd_device, &imx_phycore); | 61 | platform_set_drvdata(imx_phycore_snd_ac97_device, &imx_phycore); |
64 | ret = platform_device_add(imx_phycore_snd_device); | 62 | ret = platform_device_add(imx_phycore_snd_ac97_device); |
63 | if (ret) | ||
64 | goto fail1; | ||
65 | 65 | ||
66 | imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1); | 66 | imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1); |
67 | if (!imx_phycore_snd_device) | 67 | if (!imx_phycore_snd_device) { |
68 | return -ENOMEM; | 68 | ret = -ENOMEM; |
69 | goto fail2; | ||
70 | } | ||
69 | ret = platform_device_add(imx_phycore_snd_device); | 71 | ret = platform_device_add(imx_phycore_snd_device); |
70 | 72 | ||
71 | if (ret) { | 73 | if (ret) { |
72 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); | 74 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); |
73 | platform_device_put(imx_phycore_snd_device); | 75 | goto fail3; |
74 | } | 76 | } |
75 | 77 | ||
78 | return 0; | ||
79 | |||
80 | fail3: | ||
81 | platform_device_put(imx_phycore_snd_device); | ||
82 | fail2: | ||
83 | platform_device_del(imx_phycore_snd_ac97_device); | ||
84 | fail1: | ||
85 | platform_device_put(imx_phycore_snd_ac97_device); | ||
76 | return ret; | 86 | return ret; |
77 | } | 87 | } |
78 | 88 | ||
79 | static void __exit imx_phycore_exit(void) | 89 | static void __exit imx_phycore_exit(void) |
80 | { | 90 | { |
81 | platform_device_unregister(imx_phycore_snd_device); | 91 | platform_device_unregister(imx_phycore_snd_device); |
92 | platform_device_unregister(imx_phycore_snd_ac97_device); | ||
82 | } | 93 | } |
83 | 94 | ||
84 | late_initcall(imx_phycore_init); | 95 | late_initcall(imx_phycore_init); |
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index 293dc748797c..dac6732da969 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c | |||
@@ -49,7 +49,7 @@ static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97, | |||
49 | mutex_lock(&ac97_mutex); | 49 | mutex_lock(&ac97_mutex); |
50 | 50 | ||
51 | val = nuc900_checkready(); | 51 | val = nuc900_checkready(); |
52 | if (!!val) { | 52 | if (val) { |
53 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 53 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
54 | goto out; | 54 | goto out; |
55 | } | 55 | } |
@@ -102,7 +102,7 @@ static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
102 | mutex_lock(&ac97_mutex); | 102 | mutex_lock(&ac97_mutex); |
103 | 103 | ||
104 | tmp = nuc900_checkready(); | 104 | tmp = nuc900_checkready(); |
105 | if (!!tmp) | 105 | if (tmp) |
106 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 106 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
107 | 107 | ||
108 | /* clear the R_WB bit and write register index */ | 108 | /* clear the R_WB bit and write register index */ |
@@ -149,7 +149,7 @@ static void nuc900_ac97_warm_reset(struct snd_ac97 *ac97) | |||
149 | udelay(100); | 149 | udelay(100); |
150 | 150 | ||
151 | val = nuc900_checkready(); | 151 | val = nuc900_checkready(); |
152 | if (!!val) | 152 | if (val) |
153 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 153 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
154 | 154 | ||
155 | mutex_unlock(&ac97_mutex); | 155 | mutex_unlock(&ac97_mutex); |
@@ -263,8 +263,7 @@ static int nuc900_ac97_trigger(struct snd_pcm_substream *substream, | |||
263 | return ret; | 263 | return ret; |
264 | } | 264 | } |
265 | 265 | ||
266 | static int nuc900_ac97_probe(struct platform_device *pdev, | 266 | static int nuc900_ac97_probe(struct snd_soc_dai *dai) |
267 | struct snd_soc_dai *dai) | ||
268 | { | 267 | { |
269 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; | 268 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; |
270 | unsigned long val; | 269 | unsigned long val; |
@@ -284,12 +283,12 @@ static int nuc900_ac97_probe(struct platform_device *pdev, | |||
284 | return 0; | 283 | return 0; |
285 | } | 284 | } |
286 | 285 | ||
287 | static void nuc900_ac97_remove(struct platform_device *pdev, | 286 | static int nuc900_ac97_remove(struct snd_soc_dai *dai) |
288 | struct snd_soc_dai *dai) | ||
289 | { | 287 | { |
290 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; | 288 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; |
291 | 289 | ||
292 | clk_disable(nuc900_audio->clk); | 290 | clk_disable(nuc900_audio->clk); |
291 | return 0; | ||
293 | } | 292 | } |
294 | 293 | ||
295 | static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { | 294 | static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { |
@@ -313,7 +312,7 @@ static struct snd_soc_dai_driver nuc900_ac97_dai = { | |||
313 | .channels_max = 2, | 312 | .channels_max = 2, |
314 | }, | 313 | }, |
315 | .ops = &nuc900_ac97_dai_ops, | 314 | .ops = &nuc900_ac97_dai_ops, |
316 | } | 315 | }; |
317 | 316 | ||
318 | static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) | 317 | static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) |
319 | { | 318 | { |
@@ -384,7 +383,6 @@ out0: | |||
384 | 383 | ||
385 | static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) | 384 | static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) |
386 | { | 385 | { |
387 | |||
388 | snd_soc_unregister_dai(&pdev->dev); | 386 | snd_soc_unregister_dai(&pdev->dev); |
389 | 387 | ||
390 | clk_put(nuc900_ac97_data->clk); | 388 | clk_put(nuc900_ac97_data->clk); |
@@ -392,6 +390,7 @@ static int __devexit nuc900_ac97_drvremove(struct platform_device *pdev) | |||
392 | release_mem_region(nuc900_ac97_data->res->start, | 390 | release_mem_region(nuc900_ac97_data->res->start, |
393 | resource_size(nuc900_ac97_data->res)); | 391 | resource_size(nuc900_ac97_data->res)); |
394 | 392 | ||
393 | kfree(nuc900_ac97_data); | ||
395 | nuc900_ac97_data = NULL; | 394 | nuc900_ac97_data = NULL; |
396 | 395 | ||
397 | return 0; | 396 | return 0; |
diff --git a/sound/soc/nuc900/nuc900-audio.h b/sound/soc/nuc900/nuc900-audio.h index aeed8ead2b2b..59f7e8ed1a68 100644 --- a/sound/soc/nuc900/nuc900-audio.h +++ b/sound/soc/nuc900/nuc900-audio.h | |||
@@ -110,4 +110,6 @@ struct nuc900_audio { | |||
110 | 110 | ||
111 | }; | 111 | }; |
112 | 112 | ||
113 | extern struct nuc900_audio *nuc900_ac97_data; | ||
114 | |||
113 | #endif /*end _NUC900_AUDIO_H */ | 115 | #endif /*end _NUC900_AUDIO_H */ |
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index 195d1ac94771..8263f56dc665 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c | |||
@@ -50,12 +50,12 @@ static int nuc900_dma_hw_params(struct snd_pcm_substream *substream, | |||
50 | unsigned long flags; | 50 | unsigned long flags; |
51 | int ret = 0; | 51 | int ret = 0; |
52 | 52 | ||
53 | spin_lock_irqsave(&nuc900_audio->lock, flags); | ||
54 | |||
55 | ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); | 53 | ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); |
56 | if (ret < 0) | 54 | if (ret < 0) |
57 | return ret; | 55 | return ret; |
58 | 56 | ||
57 | spin_lock_irqsave(&nuc900_audio->lock, flags); | ||
58 | |||
59 | nuc900_audio->substream = substream; | 59 | nuc900_audio->substream = substream; |
60 | nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr; | 60 | nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr; |
61 | nuc900_audio->buffersize[substream->stream] = | 61 | nuc900_audio->buffersize[substream->stream] = |
@@ -169,6 +169,7 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) | |||
169 | struct snd_pcm_runtime *runtime = substream->runtime; | 169 | struct snd_pcm_runtime *runtime = substream->runtime; |
170 | struct nuc900_audio *nuc900_audio = runtime->private_data; | 170 | struct nuc900_audio *nuc900_audio = runtime->private_data; |
171 | unsigned long flags, val; | 171 | unsigned long flags, val; |
172 | int ret = 0; | ||
172 | 173 | ||
173 | spin_lock_irqsave(&nuc900_audio->lock, flags); | 174 | spin_lock_irqsave(&nuc900_audio->lock, flags); |
174 | 175 | ||
@@ -197,10 +198,10 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) | |||
197 | AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); | 198 | AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); |
198 | break; | 199 | break; |
199 | default: | 200 | default: |
200 | return -EINVAL; | 201 | ret = -EINVAL; |
201 | } | 202 | } |
202 | spin_unlock_irqrestore(&nuc900_audio->lock, flags); | 203 | spin_unlock_irqrestore(&nuc900_audio->lock, flags); |
203 | return 0; | 204 | return ret; |
204 | } | 205 | } |
205 | 206 | ||
206 | static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd) | 207 | static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd) |
@@ -332,7 +333,7 @@ static struct snd_soc_platform_driver nuc900_soc_platform = { | |||
332 | .ops = &nuc900_dma_ops, | 333 | .ops = &nuc900_dma_ops, |
333 | .pcm_new = nuc900_dma_new, | 334 | .pcm_new = nuc900_dma_new, |
334 | .pcm_free = nuc900_dma_free_dma_buffers, | 335 | .pcm_free = nuc900_dma_free_dma_buffers, |
335 | } | 336 | }; |
336 | 337 | ||
337 | static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) | 338 | static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) |
338 | { | 339 | { |
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index d542ea2ff6be..a088db6d5091 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig | |||
@@ -12,8 +12,8 @@ config SND_OMAP_SOC_MCPDM | |||
12 | config SND_OMAP_SOC_N810 | 12 | config SND_OMAP_SOC_N810 |
13 | tristate "SoC Audio support for Nokia N810" | 13 | tristate "SoC Audio support for Nokia N810" |
14 | depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C | 14 | depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C |
15 | depends on OMAP_MUX | ||
15 | select SND_OMAP_SOC_MCBSP | 16 | select SND_OMAP_SOC_MCBSP |
16 | select OMAP_MUX | ||
17 | select SND_SOC_TLV320AIC3X | 17 | select SND_SOC_TLV320AIC3X |
18 | help | 18 | help |
19 | Say Y if you want to add support for SoC audio on Nokia N810. | 19 | Say Y if you want to add support for SoC audio on Nokia N810. |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index d211c9fa5a91..7e84f24b9a88 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -644,15 +644,23 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
644 | 644 | ||
645 | 645 | ||
646 | case OMAP_MCBSP_CLKR_SRC_CLKR: | 646 | case OMAP_MCBSP_CLKR_SRC_CLKR: |
647 | if (cpu_class_is_omap1()) | ||
648 | break; | ||
647 | omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKR); | 649 | omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKR); |
648 | break; | 650 | break; |
649 | case OMAP_MCBSP_CLKR_SRC_CLKX: | 651 | case OMAP_MCBSP_CLKR_SRC_CLKX: |
652 | if (cpu_class_is_omap1()) | ||
653 | break; | ||
650 | omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKX); | 654 | omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKX); |
651 | break; | 655 | break; |
652 | case OMAP_MCBSP_FSR_SRC_FSR: | 656 | case OMAP_MCBSP_FSR_SRC_FSR: |
657 | if (cpu_class_is_omap1()) | ||
658 | break; | ||
653 | omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSR); | 659 | omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSR); |
654 | break; | 660 | break; |
655 | case OMAP_MCBSP_FSR_SRC_FSX: | 661 | case OMAP_MCBSP_FSR_SRC_FSX: |
662 | if (cpu_class_is_omap1()) | ||
663 | break; | ||
656 | omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSX); | 664 | omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSX); |
657 | break; | 665 | break; |
658 | default: | 666 | default: |
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c index dbd9d96b5f92..4ee33ce2cb98 100644 --- a/sound/soc/omap/omap3pandora.c +++ b/sound/soc/omap/omap3pandora.c | |||
@@ -306,6 +306,7 @@ static int __init omap3pandora_soc_init(void) | |||
306 | pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n", | 306 | pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n", |
307 | dev_name(&omap3pandora_snd_device->dev), | 307 | dev_name(&omap3pandora_snd_device->dev), |
308 | PTR_ERR(omap3pandora_dac_reg)); | 308 | PTR_ERR(omap3pandora_dac_reg)); |
309 | ret = PTR_ERR(omap3pandora_dac_reg); | ||
309 | goto fail3; | 310 | goto fail3; |
310 | } | 311 | } |
311 | 312 | ||
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c index f0e662556428..65ae00e976ef 100644 --- a/sound/soc/omap/osk5912.c +++ b/sound/soc/omap/osk5912.c | |||
@@ -177,7 +177,8 @@ static int __init osk_soc_init(void) | |||
177 | tlv320aic23_mclk = clk_get(dev, "mclk"); | 177 | tlv320aic23_mclk = clk_get(dev, "mclk"); |
178 | if (IS_ERR(tlv320aic23_mclk)) { | 178 | if (IS_ERR(tlv320aic23_mclk)) { |
179 | printk(KERN_ERR "Could not get mclk clock\n"); | 179 | printk(KERN_ERR "Could not get mclk clock\n"); |
180 | return -ENODEV; | 180 | err = PTR_ERR(tlv320aic23_mclk); |
181 | goto err2; | ||
181 | } | 182 | } |
182 | 183 | ||
183 | /* | 184 | /* |
@@ -188,7 +189,7 @@ static int __init osk_soc_init(void) | |||
188 | if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) { | 189 | if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) { |
189 | printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n"); | 190 | printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n"); |
190 | err = -ECANCELED; | 191 | err = -ECANCELED; |
191 | goto err1; | 192 | goto err3; |
192 | } | 193 | } |
193 | } | 194 | } |
194 | 195 | ||
@@ -196,9 +197,12 @@ static int __init osk_soc_init(void) | |||
196 | (uint) clk_get_rate(tlv320aic23_mclk), CODEC_CLOCK); | 197 | (uint) clk_get_rate(tlv320aic23_mclk), CODEC_CLOCK); |
197 | 198 | ||
198 | return 0; | 199 | return 0; |
199 | err1: | 200 | |
201 | err3: | ||
200 | clk_put(tlv320aic23_mclk); | 202 | clk_put(tlv320aic23_mclk); |
203 | err2: | ||
201 | platform_device_del(osk_snd_device); | 204 | platform_device_del(osk_snd_device); |
205 | err1: | ||
202 | platform_device_put(osk_snd_device); | 206 | platform_device_put(osk_snd_device); |
203 | 207 | ||
204 | return err; | 208 | return err; |
@@ -207,6 +211,7 @@ err1: | |||
207 | 211 | ||
208 | static void __exit osk_soc_exit(void) | 212 | static void __exit osk_soc_exit(void) |
209 | { | 213 | { |
214 | clk_put(tlv320aic23_mclk); | ||
210 | platform_device_unregister(osk_snd_device); | 215 | platform_device_unregister(osk_snd_device); |
211 | } | 216 | } |
212 | 217 | ||
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 37f191bbfdd9..580f48571303 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config SND_PXA2XX_SOC | 1 | config SND_PXA2XX_SOC |
2 | tristate "SoC Audio for the Intel PXA2xx chip" | 2 | tristate "SoC Audio for the Intel PXA2xx chip" |
3 | depends on ARCH_PXA | 3 | depends on ARCH_PXA |
4 | select SND_ARM | ||
4 | select SND_PXA2XX_LIB | 5 | select SND_PXA2XX_LIB |
5 | help | 6 | help |
6 | 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 |
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index 97e9423615c9..f451acd4935b 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c | |||
@@ -100,8 +100,13 @@ static int corgi_startup(struct snd_pcm_substream *substream) | |||
100 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 100 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
101 | struct snd_soc_codec *codec = rtd->codec; | 101 | struct snd_soc_codec *codec = rtd->codec; |
102 | 102 | ||
103 | mutex_lock(&codec->mutex); | ||
104 | |||
103 | /* check the jack status at stream startup */ | 105 | /* check the jack status at stream startup */ |
104 | corgi_ext_control(codec); | 106 | corgi_ext_control(codec); |
107 | |||
108 | mutex_unlock(&codec->mutex); | ||
109 | |||
105 | return 0; | 110 | return 0; |
106 | } | 111 | } |
107 | 112 | ||
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c index b8207ced4072..5ef0526924b9 100644 --- a/sound/soc/pxa/magician.c +++ b/sound/soc/pxa/magician.c | |||
@@ -72,9 +72,13 @@ static int magician_startup(struct snd_pcm_substream *substream) | |||
72 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 72 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
73 | struct snd_soc_codec *codec = rtd->codec; | 73 | struct snd_soc_codec *codec = rtd->codec; |
74 | 74 | ||
75 | mutex_lock(&codec->mutex); | ||
76 | |||
75 | /* check the jack status at stream startup */ | 77 | /* check the jack status at stream startup */ |
76 | magician_ext_control(codec); | 78 | magician_ext_control(codec); |
77 | 79 | ||
80 | mutex_unlock(&codec->mutex); | ||
81 | |||
78 | return 0; | 82 | return 0; |
79 | } | 83 | } |
80 | 84 | ||
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c index af84ee9c5e11..84edd0385a21 100644 --- a/sound/soc/pxa/poodle.c +++ b/sound/soc/pxa/poodle.c | |||
@@ -77,8 +77,13 @@ static int poodle_startup(struct snd_pcm_substream *substream) | |||
77 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 77 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
78 | struct snd_soc_codec *codec = rtd->codec; | 78 | struct snd_soc_codec *codec = rtd->codec; |
79 | 79 | ||
80 | mutex_lock(&codec->mutex); | ||
81 | |||
80 | /* check the jack status at stream startup */ | 82 | /* check the jack status at stream startup */ |
81 | poodle_ext_control(codec); | 83 | poodle_ext_control(codec); |
84 | |||
85 | mutex_unlock(&codec->mutex); | ||
86 | |||
82 | return 0; | 87 | return 0; |
83 | } | 88 | } |
84 | 89 | ||
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index f470f360f4dd..0b30d7de24ec 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c | |||
@@ -108,8 +108,13 @@ static int spitz_startup(struct snd_pcm_substream *substream) | |||
108 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 108 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
109 | struct snd_soc_codec *codec = rtd->codec; | 109 | struct snd_soc_codec *codec = rtd->codec; |
110 | 110 | ||
111 | mutex_lock(&codec->mutex); | ||
112 | |||
111 | /* check the jack status at stream startup */ | 113 | /* check the jack status at stream startup */ |
112 | spitz_ext_control(codec); | 114 | spitz_ext_control(codec); |
115 | |||
116 | mutex_unlock(&codec->mutex); | ||
117 | |||
113 | return 0; | 118 | return 0; |
114 | } | 119 | } |
115 | 120 | ||
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index 73d0edd8ded9..7b983f935454 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c | |||
@@ -81,8 +81,13 @@ static int tosa_startup(struct snd_pcm_substream *substream) | |||
81 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 81 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
82 | struct snd_soc_codec *codec = rtd->codec; | 82 | struct snd_soc_codec *codec = rtd->codec; |
83 | 83 | ||
84 | mutex_lock(&codec->mutex); | ||
85 | |||
84 | /* check the jack status at stream startup */ | 86 | /* check the jack status at stream startup */ |
85 | tosa_ext_control(codec); | 87 | tosa_ext_control(codec); |
88 | |||
89 | mutex_unlock(&codec->mutex); | ||
90 | |||
86 | return 0; | 91 | return 0; |
87 | } | 92 | } |
88 | 93 | ||
diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig index 8a6b53ccd203..d85bf8a0abb2 100644 --- a/sound/soc/s3c24xx/Kconfig +++ b/sound/soc/s3c24xx/Kconfig | |||
@@ -2,6 +2,7 @@ config SND_S3C24XX_SOC | |||
2 | tristate "SoC Audio for the Samsung S3CXXXX chips" | 2 | tristate "SoC Audio for the Samsung S3CXXXX chips" |
3 | depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 | 3 | depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 |
4 | select S3C64XX_DMA if ARCH_S3C64XX | 4 | select S3C64XX_DMA if ARCH_S3C64XX |
5 | select S3C2410_DMA if ARCH_S3C2410 | ||
5 | help | 6 | help |
6 | 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 |
7 | the S3C24XX AC97 or I2S interfaces. You will also need to | 8 | the S3C24XX AC97 or I2S interfaces. You will also need to |
diff --git a/sound/soc/s3c24xx/rx1950_uda1380.c b/sound/soc/s3c24xx/rx1950_uda1380.c index ffd5cf2fb0a9..468cc11fdf47 100644 --- a/sound/soc/s3c24xx/rx1950_uda1380.c +++ b/sound/soc/s3c24xx/rx1950_uda1380.c | |||
@@ -50,7 +50,6 @@ static unsigned int rates[] = { | |||
50 | 16000, | 50 | 16000, |
51 | 44100, | 51 | 44100, |
52 | 48000, | 52 | 48000, |
53 | 88200, | ||
54 | }; | 53 | }; |
55 | 54 | ||
56 | static struct snd_pcm_hw_constraint_list hw_rates = { | 55 | static struct snd_pcm_hw_constraint_list hw_rates = { |
@@ -130,7 +129,6 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
130 | }; | 129 | }; |
131 | 130 | ||
132 | static struct platform_device *s3c24xx_snd_device; | 131 | static struct platform_device *s3c24xx_snd_device; |
133 | static struct clk *xtal; | ||
134 | 132 | ||
135 | static int rx1950_startup(struct snd_pcm_substream *substream) | 133 | static int rx1950_startup(struct snd_pcm_substream *substream) |
136 | { | 134 | { |
@@ -179,10 +177,8 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream, | |||
179 | case 44100: | 177 | case 44100: |
180 | case 88200: | 178 | case 88200: |
181 | clk_source = S3C24XX_CLKSRC_MPLL; | 179 | clk_source = S3C24XX_CLKSRC_MPLL; |
182 | fs_mode = S3C2410_IISMOD_256FS; | 180 | fs_mode = S3C2410_IISMOD_384FS; |
183 | div = clk_get_rate(xtal) / (256 * rate); | 181 | div = 1; |
184 | if (clk_get_rate(xtal) % (256 * rate) > (128 * rate)) | ||
185 | div++; | ||
186 | break; | 182 | break; |
187 | default: | 183 | default: |
188 | printk(KERN_ERR "%s: rate %d is not supported\n", | 184 | printk(KERN_ERR "%s: rate %d is not supported\n", |
@@ -210,7 +206,7 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream, | |||
210 | 206 | ||
211 | /* set MCLK division for sample rate */ | 207 | /* set MCLK division for sample rate */ |
212 | ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, | 208 | ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, |
213 | S3C2410_IISMOD_384FS); | 209 | fs_mode); |
214 | if (ret < 0) | 210 | if (ret < 0) |
215 | return ret; | 211 | return ret; |
216 | 212 | ||
@@ -295,17 +291,8 @@ static int __init rx1950_init(void) | |||
295 | goto err_plat_add; | 291 | goto err_plat_add; |
296 | } | 292 | } |
297 | 293 | ||
298 | xtal = clk_get(&s3c24xx_snd_device->dev, "xtal"); | ||
299 | |||
300 | if (IS_ERR(xtal)) { | ||
301 | ret = PTR_ERR(xtal); | ||
302 | platform_device_unregister(s3c24xx_snd_device); | ||
303 | goto err_clk; | ||
304 | } | ||
305 | |||
306 | return 0; | 294 | return 0; |
307 | 295 | ||
308 | err_clk: | ||
309 | err_plat_add: | 296 | err_plat_add: |
310 | err_plat_alloc: | 297 | err_plat_alloc: |
311 | err_gpio_conf: | 298 | err_gpio_conf: |
@@ -320,7 +307,6 @@ static void __exit rx1950_exit(void) | |||
320 | platform_device_unregister(s3c24xx_snd_device); | 307 | platform_device_unregister(s3c24xx_snd_device); |
321 | snd_soc_jack_free_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios), | 308 | snd_soc_jack_free_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios), |
322 | hp_jack_gpios); | 309 | hp_jack_gpios); |
323 | clk_put(xtal); | ||
324 | gpio_free(S3C2410_GPA(1)); | 310 | gpio_free(S3C2410_GPA(1)); |
325 | } | 311 | } |
326 | 312 | ||
diff --git a/sound/soc/s3c24xx/smdk_spdif.c b/sound/soc/s3c24xx/smdk_spdif.c index f31d22ad7c88..c8bd90488a87 100644 --- a/sound/soc/s3c24xx/smdk_spdif.c +++ b/sound/soc/s3c24xx/smdk_spdif.c | |||
@@ -38,7 +38,7 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) | |||
38 | } | 38 | } |
39 | 39 | ||
40 | mout_epll = clk_get(NULL, "mout_epll"); | 40 | mout_epll = clk_get(NULL, "mout_epll"); |
41 | if (IS_ERR(fout_epll)) { | 41 | if (IS_ERR(mout_epll)) { |
42 | printk(KERN_WARNING "%s: Cannot find mout_epll.\n", | 42 | printk(KERN_WARNING "%s: Cannot find mout_epll.\n", |
43 | __func__); | 43 | __func__); |
44 | ret = -EINVAL; | 44 | ret = -EINVAL; |
@@ -54,7 +54,7 @@ static int set_audio_clock_heirachy(struct platform_device *pdev) | |||
54 | } | 54 | } |
55 | 55 | ||
56 | sclk_spdif = clk_get(NULL, "sclk_spdif"); | 56 | sclk_spdif = clk_get(NULL, "sclk_spdif"); |
57 | if (IS_ERR(fout_epll)) { | 57 | if (IS_ERR(sclk_spdif)) { |
58 | printk(KERN_WARNING "%s: Cannot find sclk_spdif.\n", | 58 | printk(KERN_WARNING "%s: Cannot find sclk_spdif.\n", |
59 | __func__); | 59 | __func__); |
60 | ret = -EINVAL; | 60 | ret = -EINVAL; |
diff --git a/sound/soc/s6000/s6000-i2s.c b/sound/soc/s6000/s6000-i2s.c index 8778faa174a6..3052f64b2403 100644 --- a/sound/soc/s6000/s6000-i2s.c +++ b/sound/soc/s6000/s6000-i2s.c | |||
@@ -434,7 +434,7 @@ static struct snd_soc_dai_driver s6000_i2s_dai = { | |||
434 | .rate_max = 1562500, | 434 | .rate_max = 1562500, |
435 | }, | 435 | }, |
436 | .ops = &s6000_i2s_dai_ops, | 436 | .ops = &s6000_i2s_dai_ops, |
437 | } | 437 | }; |
438 | 438 | ||
439 | static int __devinit s6000_i2s_probe(struct platform_device *pdev) | 439 | static int __devinit s6000_i2s_probe(struct platform_device *pdev) |
440 | { | 440 | { |
diff --git a/sound/soc/s6000/s6000-pcm.c b/sound/soc/s6000/s6000-pcm.c index 271fd222bf19..ab3ccaec72d2 100644 --- a/sound/soc/s6000/s6000-pcm.c +++ b/sound/soc/s6000/s6000-pcm.c | |||
@@ -473,7 +473,7 @@ static int s6000_pcm_new(struct snd_card *card, | |||
473 | } | 473 | } |
474 | 474 | ||
475 | res = request_irq(params->irq, s6000_pcm_irq, IRQF_SHARED, | 475 | res = request_irq(params->irq, s6000_pcm_irq, IRQF_SHARED, |
476 | s6000_soc_platform.name, pcm); | 476 | "s6000-audio", pcm); |
477 | if (res) { | 477 | if (res) { |
478 | printk(KERN_ERR "s6000-pcm couldn't get IRQ\n"); | 478 | printk(KERN_ERR "s6000-pcm couldn't get IRQ\n"); |
479 | return res; | 479 | return res; |
diff --git a/sound/soc/s6000/s6105-ipcam.c b/sound/soc/s6000/s6105-ipcam.c index 96c05e137538..c1244c5bc730 100644 --- a/sound/soc/s6000/s6105-ipcam.c +++ b/sound/soc/s6000/s6105-ipcam.c | |||
@@ -167,7 +167,7 @@ static int s6105_aic3x_init(struct snd_soc_pcm_runtime *rtd) | |||
167 | 167 | ||
168 | snd_soc_dapm_sync(codec); | 168 | snd_soc_dapm_sync(codec); |
169 | 169 | ||
170 | snd_ctl_add(codec->snd_card, snd_ctl_new1(&audio_out_mux, codec)); | 170 | snd_ctl_add(codec->card->snd_card, snd_ctl_new1(&audio_out_mux, codec)); |
171 | 171 | ||
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 507e709f2807..4c2404b1b862 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -132,6 +132,8 @@ struct fsi_priv { | |||
132 | struct fsi_stream playback; | 132 | struct fsi_stream playback; |
133 | struct fsi_stream capture; | 133 | struct fsi_stream capture; |
134 | 134 | ||
135 | long rate; | ||
136 | |||
135 | u32 mst_ctrl; | 137 | u32 mst_ctrl; |
136 | }; | 138 | }; |
137 | 139 | ||
@@ -854,10 +856,17 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream, | |||
854 | { | 856 | { |
855 | struct fsi_priv *fsi = fsi_get_priv(substream); | 857 | struct fsi_priv *fsi = fsi_get_priv(substream); |
856 | int is_play = fsi_is_play(substream); | 858 | int is_play = fsi_is_play(substream); |
859 | struct fsi_master *master = fsi_get_master(fsi); | ||
860 | int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); | ||
857 | 861 | ||
858 | fsi_irq_disable(fsi, is_play); | 862 | fsi_irq_disable(fsi, is_play); |
859 | fsi_clk_ctrl(fsi, 0); | 863 | fsi_clk_ctrl(fsi, 0); |
860 | 864 | ||
865 | set_rate = master->info->set_rate; | ||
866 | if (set_rate && fsi->rate) | ||
867 | set_rate(dai->dev, fsi_is_port_a(fsi), fsi->rate, 0); | ||
868 | fsi->rate = 0; | ||
869 | |||
861 | pm_runtime_put_sync(dai->dev); | 870 | pm_runtime_put_sync(dai->dev); |
862 | } | 871 | } |
863 | 872 | ||
@@ -891,20 +900,20 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream, | |||
891 | { | 900 | { |
892 | struct fsi_priv *fsi = fsi_get_priv(substream); | 901 | struct fsi_priv *fsi = fsi_get_priv(substream); |
893 | struct fsi_master *master = fsi_get_master(fsi); | 902 | struct fsi_master *master = fsi_get_master(fsi); |
894 | int (*set_rate)(int is_porta, int rate) = master->info->set_rate; | 903 | int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); |
895 | int fsi_ver = master->core->ver; | 904 | int fsi_ver = master->core->ver; |
896 | int is_play = fsi_is_play(substream); | 905 | long rate = params_rate(params); |
897 | int ret; | 906 | int ret; |
898 | 907 | ||
899 | /* if slave mode, set_rate is not needed */ | 908 | set_rate = master->info->set_rate; |
900 | if (!fsi_is_master_mode(fsi, is_play)) | 909 | if (!set_rate) |
901 | return 0; | 910 | return 0; |
902 | 911 | ||
903 | /* it is error if no set_rate */ | 912 | ret = set_rate(dai->dev, fsi_is_port_a(fsi), rate, 1); |
904 | if (!set_rate) | 913 | if (ret < 0) /* error */ |
905 | return -EIO; | 914 | return ret; |
906 | 915 | ||
907 | ret = set_rate(fsi_is_port_a(fsi), params_rate(params)); | 916 | fsi->rate = rate; |
908 | if (ret > 0) { | 917 | if (ret > 0) { |
909 | u32 data = 0; | 918 | u32 data = 0; |
910 | 919 | ||
diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c index 40bbdf1591dc..05192d97b377 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c | |||
@@ -387,7 +387,7 @@ static int __devinit sh4_soc_dai_probe(struct platform_device *pdev) | |||
387 | 387 | ||
388 | static int __devexit sh4_soc_dai_remove(struct platform_device *pdev) | 388 | static int __devexit sh4_soc_dai_remove(struct platform_device *pdev) |
389 | { | 389 | { |
390 | snd_soc_unregister_dai(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); | 390 | snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); |
391 | return 0; | 391 | return 0; |
392 | } | 392 | } |
393 | 393 | ||
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 614a8b30d87b..b54ea9a0a1db 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -67,25 +67,6 @@ static int pmdown_time = 5000; | |||
67 | module_param(pmdown_time, int, 0); | 67 | module_param(pmdown_time, int, 0); |
68 | MODULE_PARM_DESC(pmdown_time, "DAPM stream powerdown time (msecs)"); | 68 | MODULE_PARM_DESC(pmdown_time, "DAPM stream powerdown time (msecs)"); |
69 | 69 | ||
70 | /* | ||
71 | * This function forces any delayed work to be queued and run. | ||
72 | */ | ||
73 | static int run_delayed_work(struct delayed_work *dwork) | ||
74 | { | ||
75 | int ret; | ||
76 | |||
77 | /* cancel any work waiting to be queued. */ | ||
78 | ret = cancel_delayed_work(dwork); | ||
79 | |||
80 | /* if there was any work waiting then we run it now and | ||
81 | * wait for it's completion */ | ||
82 | if (ret) { | ||
83 | schedule_delayed_work(dwork, 0); | ||
84 | flush_scheduled_work(); | ||
85 | } | ||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | /* codec register dump */ | 70 | /* codec register dump */ |
90 | static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf) | 71 | static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf) |
91 | { | 72 | { |
@@ -1016,7 +997,7 @@ static int soc_suspend(struct device *dev) | |||
1016 | 997 | ||
1017 | /* close any waiting streams and save state */ | 998 | /* close any waiting streams and save state */ |
1018 | for (i = 0; i < card->num_rtd; i++) { | 999 | for (i = 0; i < card->num_rtd; i++) { |
1019 | run_delayed_work(&card->rtd[i].delayed_work); | 1000 | flush_delayed_work_sync(&card->rtd[i].delayed_work); |
1020 | card->rtd[i].codec->suspend_bias_level = card->rtd[i].codec->bias_level; | 1001 | card->rtd[i].codec->suspend_bias_level = card->rtd[i].codec->bias_level; |
1021 | } | 1002 | } |
1022 | 1003 | ||
@@ -1687,7 +1668,7 @@ static int soc_remove(struct platform_device *pdev) | |||
1687 | /* make sure any delayed work runs */ | 1668 | /* make sure any delayed work runs */ |
1688 | for (i = 0; i < card->num_rtd; i++) { | 1669 | for (i = 0; i < card->num_rtd; i++) { |
1689 | struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; | 1670 | struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; |
1690 | run_delayed_work(&rtd->delayed_work); | 1671 | flush_delayed_work_sync(&rtd->delayed_work); |
1691 | } | 1672 | } |
1692 | 1673 | ||
1693 | /* remove and free each DAI */ | 1674 | /* remove and free each DAI */ |
@@ -1718,7 +1699,7 @@ static int soc_poweroff(struct device *dev) | |||
1718 | * now, we're shutting down so no imminent restart. */ | 1699 | * now, we're shutting down so no imminent restart. */ |
1719 | for (i = 0; i < card->num_rtd; i++) { | 1700 | for (i = 0; i < card->num_rtd; i++) { |
1720 | struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; | 1701 | struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; |
1721 | run_delayed_work(&rtd->delayed_work); | 1702 | flush_delayed_work_sync(&rtd->delayed_work); |
1722 | } | 1703 | } |
1723 | 1704 | ||
1724 | snd_soc_dapm_shutdown(card); | 1705 | snd_soc_dapm_shutdown(card); |
@@ -3043,8 +3024,10 @@ int snd_soc_register_dais(struct device *dev, | |||
3043 | for (i = 0; i < count; i++) { | 3024 | for (i = 0; i < count; i++) { |
3044 | 3025 | ||
3045 | dai = kzalloc(sizeof(struct snd_soc_dai), GFP_KERNEL); | 3026 | dai = kzalloc(sizeof(struct snd_soc_dai), GFP_KERNEL); |
3046 | if (dai == NULL) | 3027 | if (dai == NULL) { |
3047 | return -ENOMEM; | 3028 | ret = -ENOMEM; |
3029 | goto err; | ||
3030 | } | ||
3048 | 3031 | ||
3049 | /* create DAI component name */ | 3032 | /* create DAI component name */ |
3050 | dai->name = fmt_multiple_name(dev, &dai_drv[i]); | 3033 | dai->name = fmt_multiple_name(dev, &dai_drv[i]); |
@@ -3263,9 +3246,6 @@ int snd_soc_register_codec(struct device *dev, | |||
3263 | return 0; | 3246 | return 0; |
3264 | 3247 | ||
3265 | error: | 3248 | error: |
3266 | for (i--; i >= 0; i--) | ||
3267 | snd_soc_unregister_dai(dev); | ||
3268 | |||
3269 | if (codec->reg_cache) | 3249 | if (codec->reg_cache) |
3270 | kfree(codec->reg_cache); | 3250 | kfree(codec->reg_cache); |
3271 | kfree(codec->name); | 3251 | kfree(codec->name); |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 7d85c6496afa..75ed6491222d 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -683,12 +683,12 @@ static int dapm_seq_compare(struct snd_soc_dapm_widget *a, | |||
683 | struct snd_soc_dapm_widget *b, | 683 | struct snd_soc_dapm_widget *b, |
684 | int sort[]) | 684 | int sort[]) |
685 | { | 685 | { |
686 | if (a->codec != b->codec) | ||
687 | return (unsigned long)a - (unsigned long)b; | ||
688 | if (sort[a->id] != sort[b->id]) | 686 | if (sort[a->id] != sort[b->id]) |
689 | return sort[a->id] - sort[b->id]; | 687 | return sort[a->id] - sort[b->id]; |
690 | if (a->reg != b->reg) | 688 | if (a->reg != b->reg) |
691 | return a->reg - b->reg; | 689 | return a->reg - b->reg; |
690 | if (a->codec != b->codec) | ||
691 | return (unsigned long)a->codec - (unsigned long)b->codec; | ||
692 | 692 | ||
693 | return 0; | 693 | return 0; |
694 | } | 694 | } |
diff --git a/sound/sound_core.c b/sound/sound_core.c index c03bbaefdbc3..5580aced8730 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c | |||
@@ -104,7 +104,6 @@ module_exit(cleanup_soundcore); | |||
104 | 104 | ||
105 | #include <linux/init.h> | 105 | #include <linux/init.h> |
106 | #include <linux/slab.h> | 106 | #include <linux/slab.h> |
107 | #include <linux/smp_lock.h> | ||
108 | #include <linux/types.h> | 107 | #include <linux/types.h> |
109 | #include <linux/kernel.h> | 108 | #include <linux/kernel.h> |
110 | #include <linux/sound.h> | 109 | #include <linux/sound.h> |