diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/Kconfig | 4 | ||||
-rw-r--r-- | sound/mips/au1x00.c | 1 | ||||
-rw-r--r-- | sound/pci/ca0106/ca0106_main.c | 5 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 9 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 30 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 5 | ||||
-rw-r--r-- | sound/pci/oxygen/hifier.c | 4 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 4 | ||||
-rw-r--r-- | sound/pci/oxygen/oxygen_mixer.c | 5 | ||||
-rw-r--r-- | sound/soc/at91/eti_b1_wm8731.c | 1 | ||||
-rw-r--r-- | sound/soc/codecs/ak4535.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/uda1380.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/wm8510.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/wm8731.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/wm8750.c | 10 | ||||
-rw-r--r-- | sound/soc/codecs/wm8753.c | 12 | ||||
-rw-r--r-- | sound/soc/codecs/wm8990.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/wm9712.c | 1 | ||||
-rw-r--r-- | sound/soc/omap/n810.c | 18 | ||||
-rw-r--r-- | sound/soc/pxa/pxa2xx-i2s.c | 40 |
21 files changed, 159 insertions, 52 deletions
diff --git a/sound/Kconfig b/sound/Kconfig index a37bee094eba..8ebf512ced6c 100644 --- a/sound/Kconfig +++ b/sound/Kconfig | |||
@@ -91,6 +91,9 @@ endif # SOUND_PRIME | |||
91 | 91 | ||
92 | endif # !M68K | 92 | endif # !M68K |
93 | 93 | ||
94 | endif # SOUND | ||
95 | |||
96 | # AC97_BUS is used from both sound and ucb1400 | ||
94 | config AC97_BUS | 97 | config AC97_BUS |
95 | tristate | 98 | tristate |
96 | help | 99 | help |
@@ -99,4 +102,3 @@ config AC97_BUS | |||
99 | sound although they're sharing the AC97 bus. Concerned drivers | 102 | sound although they're sharing the AC97 bus. Concerned drivers |
100 | should "select" this. | 103 | should "select" this. |
101 | 104 | ||
102 | endif # SOUND | ||
diff --git a/sound/mips/au1x00.c b/sound/mips/au1x00.c index ee0741f9eb53..fbef38a9604a 100644 --- a/sound/mips/au1x00.c +++ b/sound/mips/au1x00.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <linux/interrupt.h> | 38 | #include <linux/interrupt.h> |
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | #include <linux/version.h> | ||
42 | #include <sound/core.h> | 41 | #include <sound/core.h> |
43 | #include <sound/initval.h> | 42 | #include <sound/initval.h> |
44 | #include <sound/pcm.h> | 43 | #include <sound/pcm.h> |
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 2f8b28add276..6abe8a3bd365 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -249,11 +249,12 @@ static struct snd_ca0106_details ca0106_chip_details[] = { | |||
249 | .name = "MSI K8N Diamond MB [SB0438]", | 249 | .name = "MSI K8N Diamond MB [SB0438]", |
250 | .gpio_type = 2, | 250 | .gpio_type = 2, |
251 | .i2c_adc = 1 } , | 251 | .i2c_adc = 1 } , |
252 | /* Another MSI K8N Diamond MB, which has apprently a different SSID */ | 252 | /* MSI K8N Diamond PLUS MB */ |
253 | { .serial = 0x10091102, | 253 | { .serial = 0x10091102, |
254 | .name = "MSI K8N Diamond MB", | 254 | .name = "MSI K8N Diamond MB", |
255 | .gpio_type = 2, | 255 | .gpio_type = 2, |
256 | .i2c_adc = 1 } , | 256 | .i2c_adc = 1, |
257 | .spi_dac = 2 }, | ||
257 | /* Shuttle XPC SD31P which has an onboard Creative Labs | 258 | /* Shuttle XPC SD31P which has an onboard Creative Labs |
258 | * Sound Blaster Live! 24-bit EAX | 259 | * Sound Blaster Live! 24-bit EAX |
259 | * high-definition 7.1 audio processor". | 260 | * high-definition 7.1 audio processor". |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index a73d6ca0a906..1c53e337ecb2 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -278,6 +278,9 @@ enum { | |||
278 | /* Defines for Nvidia HDA support */ | 278 | /* Defines for Nvidia HDA support */ |
279 | #define NVIDIA_HDA_TRANSREG_ADDR 0x4e | 279 | #define NVIDIA_HDA_TRANSREG_ADDR 0x4e |
280 | #define NVIDIA_HDA_ENABLE_COHBITS 0x0f | 280 | #define NVIDIA_HDA_ENABLE_COHBITS 0x0f |
281 | #define NVIDIA_HDA_ISTRM_COH 0x4d | ||
282 | #define NVIDIA_HDA_OSTRM_COH 0x4c | ||
283 | #define NVIDIA_HDA_ENABLE_COHBIT 0x01 | ||
281 | 284 | ||
282 | /* Defines for Intel SCH HDA snoop control */ | 285 | /* Defines for Intel SCH HDA snoop control */ |
283 | #define INTEL_SCH_HDA_DEVC 0x78 | 286 | #define INTEL_SCH_HDA_DEVC 0x78 |
@@ -900,6 +903,12 @@ static void azx_init_pci(struct azx *chip) | |||
900 | update_pci_byte(chip->pci, | 903 | update_pci_byte(chip->pci, |
901 | NVIDIA_HDA_TRANSREG_ADDR, | 904 | NVIDIA_HDA_TRANSREG_ADDR, |
902 | 0x0f, NVIDIA_HDA_ENABLE_COHBITS); | 905 | 0x0f, NVIDIA_HDA_ENABLE_COHBITS); |
906 | update_pci_byte(chip->pci, | ||
907 | NVIDIA_HDA_ISTRM_COH, | ||
908 | 0x01, NVIDIA_HDA_ENABLE_COHBIT); | ||
909 | update_pci_byte(chip->pci, | ||
910 | NVIDIA_HDA_OSTRM_COH, | ||
911 | 0x01, NVIDIA_HDA_ENABLE_COHBIT); | ||
903 | break; | 912 | break; |
904 | case AZX_DRIVER_SCH: | 913 | case AZX_DRIVER_SCH: |
905 | pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop); | 914 | pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b80e725432f0..66025161bd69 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -952,7 +952,7 @@ do_sku: | |||
952 | tmp | 0x2010); | 952 | tmp | 0x2010); |
953 | break; | 953 | break; |
954 | case 0x10ec0888: | 954 | case 0x10ec0888: |
955 | alc888_coef_init(codec); | 955 | /*alc888_coef_init(codec);*/ /* called in alc_init() */ |
956 | break; | 956 | break; |
957 | case 0x10ec0267: | 957 | case 0x10ec0267: |
958 | case 0x10ec0268: | 958 | case 0x10ec0268: |
@@ -2439,6 +2439,8 @@ static int alc_init(struct hda_codec *codec) | |||
2439 | unsigned int i; | 2439 | unsigned int i; |
2440 | 2440 | ||
2441 | alc_fix_pll(codec); | 2441 | alc_fix_pll(codec); |
2442 | if (codec->vendor_id == 0x10ec0888) | ||
2443 | alc888_coef_init(codec); | ||
2442 | 2444 | ||
2443 | for (i = 0; i < spec->num_init_verbs; i++) | 2445 | for (i = 0; i < spec->num_init_verbs; i++) |
2444 | snd_hda_sequence_write(codec, spec->init_verbs[i]); | 2446 | snd_hda_sequence_write(codec, spec->init_verbs[i]); |
@@ -6195,7 +6197,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = { | |||
6195 | SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG), | 6197 | SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG), |
6196 | SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), | 6198 | SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), |
6197 | SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), | 6199 | SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), |
6198 | SND_PCI_QUIRK(0x106b, 0x00a0, "Apple iMac 24''", ALC885_IMAC24), | ||
6199 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG), | 6200 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG), |
6200 | SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */ | 6201 | SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */ |
6201 | SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), | 6202 | SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), |
@@ -8426,8 +8427,6 @@ static int patch_alc883(struct hda_codec *codec) | |||
8426 | codec->patch_ops = alc_patch_ops; | 8427 | codec->patch_ops = alc_patch_ops; |
8427 | if (board_config == ALC883_AUTO) | 8428 | if (board_config == ALC883_AUTO) |
8428 | spec->init_hook = alc883_auto_init; | 8429 | spec->init_hook = alc883_auto_init; |
8429 | else if (codec->vendor_id == 0x10ec0888) | ||
8430 | spec->init_hook = alc888_coef_init; | ||
8431 | 8430 | ||
8432 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 8431 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
8433 | if (!spec->loopback.amplist) | 8432 | if (!spec->loopback.amplist) |
@@ -14067,6 +14066,13 @@ static struct hda_verb alc662_auto_init_verbs[] = { | |||
14067 | { } | 14066 | { } |
14068 | }; | 14067 | }; |
14069 | 14068 | ||
14069 | /* additional verbs for ALC663 */ | ||
14070 | static struct hda_verb alc663_auto_init_verbs[] = { | ||
14071 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
14072 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
14073 | { } | ||
14074 | }; | ||
14075 | |||
14070 | static struct hda_verb alc663_m51va_init_verbs[] = { | 14076 | static struct hda_verb alc663_m51va_init_verbs[] = { |
14071 | {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | 14077 | {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, |
14072 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 14078 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
@@ -14595,6 +14601,14 @@ static int alc662_auto_create_extra_out(struct alc_spec *spec, hda_nid_t pin, | |||
14595 | if (!pin) | 14601 | if (!pin) |
14596 | return 0; | 14602 | return 0; |
14597 | 14603 | ||
14604 | if (pin == 0x17) { | ||
14605 | /* ALC663 has a mono output pin on 0x17 */ | ||
14606 | sprintf(name, "%s Playback Switch", pfx); | ||
14607 | err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, | ||
14608 | HDA_COMPOSE_AMP_VAL(pin, 2, 0, HDA_OUTPUT)); | ||
14609 | return err; | ||
14610 | } | ||
14611 | |||
14598 | if (alc880_is_fixed_pin(pin)) { | 14612 | if (alc880_is_fixed_pin(pin)) { |
14599 | nid = alc880_idx_to_dac(alc880_fixed_pin_idx(pin)); | 14613 | nid = alc880_idx_to_dac(alc880_fixed_pin_idx(pin)); |
14600 | /* printk("DAC nid=%x\n",nid); */ | 14614 | /* printk("DAC nid=%x\n",nid); */ |
@@ -14765,6 +14779,14 @@ static int alc662_parse_auto_config(struct hda_codec *codec) | |||
14765 | spec->input_mux = &spec->private_imux; | 14779 | spec->input_mux = &spec->private_imux; |
14766 | 14780 | ||
14767 | spec->init_verbs[spec->num_init_verbs++] = alc662_auto_init_verbs; | 14781 | spec->init_verbs[spec->num_init_verbs++] = alc662_auto_init_verbs; |
14782 | if (codec->vendor_id == 0x10ec0663) | ||
14783 | spec->init_verbs[spec->num_init_verbs++] = | ||
14784 | alc663_auto_init_verbs; | ||
14785 | |||
14786 | err = alc_auto_add_mic_boost(codec); | ||
14787 | if (err < 0) | ||
14788 | return err; | ||
14789 | |||
14768 | spec->mixers[spec->num_mixers] = alc662_capture_mixer; | 14790 | spec->mixers[spec->num_mixers] = alc662_capture_mixer; |
14769 | spec->num_mixers++; | 14791 | spec->num_mixers++; |
14770 | return 1; | 14792 | return 1; |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 7fdafcb0015d..ad994fcab725 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -560,8 +560,9 @@ static struct hda_verb dell_eq_core_init[] = { | |||
560 | }; | 560 | }; |
561 | 561 | ||
562 | static struct hda_verb dell_m6_core_init[] = { | 562 | static struct hda_verb dell_m6_core_init[] = { |
563 | /* set master volume and direct control */ | 563 | /* set master volume to max value without distortion |
564 | { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, | 564 | * and direct control */ |
565 | { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec}, | ||
565 | /* setup audio connections */ | 566 | /* setup audio connections */ |
566 | { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, | 567 | { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, |
567 | { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, | 568 | { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, |
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c index 7442460583dd..dad393ae040a 100644 --- a/sound/pci/oxygen/hifier.c +++ b/sound/pci/oxygen/hifier.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/delay.h> | ||
20 | #include <linux/pci.h> | 21 | #include <linux/pci.h> |
21 | #include <sound/control.h> | 22 | #include <sound/control.h> |
22 | #include <sound/core.h> | 23 | #include <sound/core.h> |
@@ -107,6 +108,9 @@ static void set_ak4396_params(struct oxygen *chip, | |||
107 | else | 108 | else |
108 | value |= AK4396_DFS_QUAD; | 109 | value |= AK4396_DFS_QUAD; |
109 | data->ak4396_ctl2 = value; | 110 | data->ak4396_ctl2 = value; |
111 | |||
112 | msleep(1); /* wait for the new MCLK to become stable */ | ||
113 | |||
110 | ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB); | 114 | ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB); |
111 | ak4396_write(chip, AK4396_CONTROL_2, value); | 115 | ak4396_write(chip, AK4396_CONTROL_2, value); |
112 | ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN); | 116 | ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN); |
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index 7c8ae31eb468..c5829d30ef86 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c | |||
@@ -28,6 +28,7 @@ | |||
28 | * GPIO 1 -> DFS1 of AK5385 | 28 | * GPIO 1 -> DFS1 of AK5385 |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <linux/delay.h> | ||
31 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
32 | #include <linux/pci.h> | 33 | #include <linux/pci.h> |
33 | #include <sound/ac97_codec.h> | 34 | #include <sound/ac97_codec.h> |
@@ -213,6 +214,9 @@ static void set_ak4396_params(struct oxygen *chip, | |||
213 | else | 214 | else |
214 | value |= AK4396_DFS_QUAD; | 215 | value |= AK4396_DFS_QUAD; |
215 | data->ak4396_ctl2 = value; | 216 | data->ak4396_ctl2 = value; |
217 | |||
218 | msleep(1); /* wait for the new MCLK to become stable */ | ||
219 | |||
216 | for (i = 0; i < 4; ++i) { | 220 | for (i = 0; i < 4; ++i) { |
217 | ak4396_write(chip, i, | 221 | ak4396_write(chip, i, |
218 | AK4396_CONTROL_1, AK4396_DIF_24_MSB); | 222 | AK4396_CONTROL_1, AK4396_DIF_24_MSB); |
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 6facac5aed90..05eb8994c141 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -512,9 +512,12 @@ static int ac97_switch_get(struct snd_kcontrol *ctl, | |||
512 | 512 | ||
513 | static void mute_ac97_ctl(struct oxygen *chip, unsigned int control) | 513 | static void mute_ac97_ctl(struct oxygen *chip, unsigned int control) |
514 | { | 514 | { |
515 | unsigned int priv_idx = chip->controls[control]->private_value & 0xff; | 515 | unsigned int priv_idx; |
516 | u16 value; | 516 | u16 value; |
517 | 517 | ||
518 | if (!chip->controls[control]) | ||
519 | return; | ||
520 | priv_idx = chip->controls[control]->private_value & 0xff; | ||
518 | value = oxygen_read_ac97(chip, 0, priv_idx); | 521 | value = oxygen_read_ac97(chip, 0, priv_idx); |
519 | if (!(value & 0x8000)) { | 522 | if (!(value & 0x8000)) { |
520 | oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000); | 523 | oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000); |
diff --git a/sound/soc/at91/eti_b1_wm8731.c b/sound/soc/at91/eti_b1_wm8731.c index b081e83766b7..b81d6b2cfa1d 100644 --- a/sound/soc/at91/eti_b1_wm8731.c +++ b/sound/soc/at91/eti_b1_wm8731.c | |||
@@ -22,7 +22,6 @@ | |||
22 | 22 | ||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/moduleparam.h> | 24 | #include <linux/moduleparam.h> |
25 | #include <linux/version.h> | ||
26 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
27 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
28 | #include <linux/timer.h> | 27 | #include <linux/timer.h> |
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index b26003c4f3e8..7da9f467b7b8 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c | |||
@@ -562,10 +562,9 @@ static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
562 | client_template.addr = addr; | 562 | client_template.addr = addr; |
563 | 563 | ||
564 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 564 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
565 | if (i2c == NULL) { | 565 | if (i2c == NULL) |
566 | kfree(codec); | ||
567 | return -ENOMEM; | 566 | return -ENOMEM; |
568 | } | 567 | |
569 | i2c_set_clientdata(i2c, codec); | 568 | i2c_set_clientdata(i2c, codec); |
570 | codec->control_data = i2c; | 569 | codec->control_data = i2c; |
571 | 570 | ||
@@ -583,7 +582,6 @@ static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
583 | return ret; | 582 | return ret; |
584 | 583 | ||
585 | err: | 584 | err: |
586 | kfree(codec); | ||
587 | kfree(i2c); | 585 | kfree(i2c); |
588 | return ret; | 586 | return ret; |
589 | } | 587 | } |
@@ -660,6 +658,11 @@ static int ak4535_probe(struct platform_device *pdev) | |||
660 | #else | 658 | #else |
661 | /* Add other interfaces here */ | 659 | /* Add other interfaces here */ |
662 | #endif | 660 | #endif |
661 | |||
662 | if (ret != 0) { | ||
663 | kfree(codec->private_data); | ||
664 | kfree(codec); | ||
665 | } | ||
663 | return ret; | 666 | return ret; |
664 | } | 667 | } |
665 | 668 | ||
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index b1dce5f459db..5f9abb199435 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -1199,10 +1199,9 @@ static int aic3x_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1199 | client_template.addr = addr; | 1199 | client_template.addr = addr; |
1200 | 1200 | ||
1201 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 1201 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
1202 | if (i2c == NULL) { | 1202 | if (i2c == NULL) |
1203 | kfree(codec); | ||
1204 | return -ENOMEM; | 1203 | return -ENOMEM; |
1205 | } | 1204 | |
1206 | i2c_set_clientdata(i2c, codec); | 1205 | i2c_set_clientdata(i2c, codec); |
1207 | codec->control_data = i2c; | 1206 | codec->control_data = i2c; |
1208 | 1207 | ||
@@ -1221,7 +1220,6 @@ static int aic3x_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1221 | return ret; | 1220 | return ret; |
1222 | 1221 | ||
1223 | err: | 1222 | err: |
1224 | kfree(codec); | ||
1225 | kfree(i2c); | 1223 | kfree(i2c); |
1226 | return ret; | 1224 | return ret; |
1227 | } | 1225 | } |
@@ -1302,6 +1300,11 @@ static int aic3x_probe(struct platform_device *pdev) | |||
1302 | #else | 1300 | #else |
1303 | /* Add other interfaces here */ | 1301 | /* Add other interfaces here */ |
1304 | #endif | 1302 | #endif |
1303 | |||
1304 | if (ret != 0) { | ||
1305 | kfree(codec->private_data); | ||
1306 | kfree(codec); | ||
1307 | } | ||
1305 | return ret; | 1308 | return ret; |
1306 | } | 1309 | } |
1307 | 1310 | ||
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index a52d6d9e007a..807318fbdc8f 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -729,10 +729,9 @@ static int uda1380_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
729 | client_template.addr = addr; | 729 | client_template.addr = addr; |
730 | 730 | ||
731 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 731 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
732 | if (i2c == NULL) { | 732 | if (i2c == NULL) |
733 | kfree(codec); | ||
734 | return -ENOMEM; | 733 | return -ENOMEM; |
735 | } | 734 | |
736 | i2c_set_clientdata(i2c, codec); | 735 | i2c_set_clientdata(i2c, codec); |
737 | codec->control_data = i2c; | 736 | codec->control_data = i2c; |
738 | 737 | ||
@@ -750,7 +749,6 @@ static int uda1380_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
750 | return ret; | 749 | return ret; |
751 | 750 | ||
752 | err: | 751 | err: |
753 | kfree(codec); | ||
754 | kfree(i2c); | 752 | kfree(i2c); |
755 | return ret; | 753 | return ret; |
756 | } | 754 | } |
@@ -817,6 +815,9 @@ static int uda1380_probe(struct platform_device *pdev) | |||
817 | #else | 815 | #else |
818 | /* Add other interfaces here */ | 816 | /* Add other interfaces here */ |
819 | #endif | 817 | #endif |
818 | |||
819 | if (ret != 0) | ||
820 | kfree(codec); | ||
820 | return ret; | 821 | return ret; |
821 | } | 822 | } |
822 | 823 | ||
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 67325fd95447..3d998e6a997e 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c | |||
@@ -693,10 +693,9 @@ static int wm8510_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
693 | client_template.addr = addr; | 693 | client_template.addr = addr; |
694 | 694 | ||
695 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 695 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
696 | if (i2c == NULL) { | 696 | if (i2c == NULL) |
697 | kfree(codec); | ||
698 | return -ENOMEM; | 697 | return -ENOMEM; |
699 | } | 698 | |
700 | i2c_set_clientdata(i2c, codec); | 699 | i2c_set_clientdata(i2c, codec); |
701 | codec->control_data = i2c; | 700 | codec->control_data = i2c; |
702 | 701 | ||
@@ -714,7 +713,6 @@ static int wm8510_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
714 | return ret; | 713 | return ret; |
715 | 714 | ||
716 | err: | 715 | err: |
717 | kfree(codec); | ||
718 | kfree(i2c); | 716 | kfree(i2c); |
719 | return ret; | 717 | return ret; |
720 | } | 718 | } |
@@ -782,6 +780,9 @@ static int wm8510_probe(struct platform_device *pdev) | |||
782 | #else | 780 | #else |
783 | /* Add other interfaces here */ | 781 | /* Add other interfaces here */ |
784 | #endif | 782 | #endif |
783 | |||
784 | if (ret != 0) | ||
785 | kfree(codec); | ||
785 | return ret; | 786 | return ret; |
786 | } | 787 | } |
787 | 788 | ||
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 369d39c3f745..9402fcaf04fa 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -596,10 +596,9 @@ static int wm8731_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
596 | client_template.addr = addr; | 596 | client_template.addr = addr; |
597 | 597 | ||
598 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 598 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
599 | if (i2c == NULL) { | 599 | if (i2c == NULL) |
600 | kfree(codec); | ||
601 | return -ENOMEM; | 600 | return -ENOMEM; |
602 | } | 601 | |
603 | i2c_set_clientdata(i2c, codec); | 602 | i2c_set_clientdata(i2c, codec); |
604 | codec->control_data = i2c; | 603 | codec->control_data = i2c; |
605 | 604 | ||
@@ -617,7 +616,6 @@ static int wm8731_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
617 | return ret; | 616 | return ret; |
618 | 617 | ||
619 | err: | 618 | err: |
620 | kfree(codec); | ||
621 | kfree(i2c); | 619 | kfree(i2c); |
622 | return ret; | 620 | return ret; |
623 | } | 621 | } |
@@ -693,6 +691,11 @@ static int wm8731_probe(struct platform_device *pdev) | |||
693 | #else | 691 | #else |
694 | /* Add other interfaces here */ | 692 | /* Add other interfaces here */ |
695 | #endif | 693 | #endif |
694 | |||
695 | if (ret != 0) { | ||
696 | kfree(codec->private_data); | ||
697 | kfree(codec); | ||
698 | } | ||
696 | return ret; | 699 | return ret; |
697 | } | 700 | } |
698 | 701 | ||
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c index c6a8edf302ad..dd1f55404b29 100644 --- a/sound/soc/codecs/wm8750.c +++ b/sound/soc/codecs/wm8750.c | |||
@@ -869,10 +869,9 @@ static int wm8750_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
869 | client_template.addr = addr; | 869 | client_template.addr = addr; |
870 | 870 | ||
871 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 871 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
872 | if (i2c == NULL) { | 872 | if (i2c == NULL) |
873 | kfree(codec); | ||
874 | return -ENOMEM; | 873 | return -ENOMEM; |
875 | } | 874 | |
876 | i2c_set_clientdata(i2c, codec); | 875 | i2c_set_clientdata(i2c, codec); |
877 | codec->control_data = i2c; | 876 | codec->control_data = i2c; |
878 | 877 | ||
@@ -890,7 +889,6 @@ static int wm8750_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
890 | return ret; | 889 | return ret; |
891 | 890 | ||
892 | err: | 891 | err: |
893 | kfree(codec); | ||
894 | kfree(i2c); | 892 | kfree(i2c); |
895 | return ret; | 893 | return ret; |
896 | } | 894 | } |
@@ -966,6 +964,10 @@ static int wm8750_probe(struct platform_device *pdev) | |||
966 | /* Add other interfaces here */ | 964 | /* Add other interfaces here */ |
967 | #endif | 965 | #endif |
968 | 966 | ||
967 | if (ret != 0) { | ||
968 | kfree(codec->private_data); | ||
969 | kfree(codec); | ||
970 | } | ||
969 | return ret; | 971 | return ret; |
970 | } | 972 | } |
971 | 973 | ||
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 8604809f0c36..5761164fe16d 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -34,7 +34,6 @@ | |||
34 | 34 | ||
35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
36 | #include <linux/moduleparam.h> | 36 | #include <linux/moduleparam.h> |
37 | #include <linux/version.h> | ||
38 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
39 | #include <linux/init.h> | 38 | #include <linux/init.h> |
40 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
@@ -1661,10 +1660,9 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1661 | client_template.addr = addr; | 1660 | client_template.addr = addr; |
1662 | 1661 | ||
1663 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 1662 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
1664 | if (!i2c) { | 1663 | if (!i2c) |
1665 | kfree(codec); | ||
1666 | return -ENOMEM; | 1664 | return -ENOMEM; |
1667 | } | 1665 | |
1668 | i2c_set_clientdata(i2c, codec); | 1666 | i2c_set_clientdata(i2c, codec); |
1669 | codec->control_data = i2c; | 1667 | codec->control_data = i2c; |
1670 | 1668 | ||
@@ -1683,7 +1681,6 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1683 | return ret; | 1681 | return ret; |
1684 | 1682 | ||
1685 | err: | 1683 | err: |
1686 | kfree(codec); | ||
1687 | kfree(i2c); | 1684 | kfree(i2c); |
1688 | return ret; | 1685 | return ret; |
1689 | } | 1686 | } |
@@ -1760,6 +1757,11 @@ static int wm8753_probe(struct platform_device *pdev) | |||
1760 | #else | 1757 | #else |
1761 | /* Add other interfaces here */ | 1758 | /* Add other interfaces here */ |
1762 | #endif | 1759 | #endif |
1760 | |||
1761 | if (ret != 0) { | ||
1762 | kfree(codec->private_data); | ||
1763 | kfree(codec); | ||
1764 | } | ||
1763 | return ret; | 1765 | return ret; |
1764 | } | 1766 | } |
1765 | 1767 | ||
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index e44153fa38de..dd995ef448b4 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c | |||
@@ -1500,10 +1500,9 @@ static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1500 | client_template.addr = addr; | 1500 | client_template.addr = addr; |
1501 | 1501 | ||
1502 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 1502 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
1503 | if (i2c == NULL) { | 1503 | if (i2c == NULL) |
1504 | kfree(codec); | ||
1505 | return -ENOMEM; | 1504 | return -ENOMEM; |
1506 | } | 1505 | |
1507 | i2c_set_clientdata(i2c, codec); | 1506 | i2c_set_clientdata(i2c, codec); |
1508 | codec->control_data = i2c; | 1507 | codec->control_data = i2c; |
1509 | 1508 | ||
@@ -1521,7 +1520,6 @@ static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1521 | return ret; | 1520 | return ret; |
1522 | 1521 | ||
1523 | err: | 1522 | err: |
1524 | kfree(codec); | ||
1525 | kfree(i2c); | 1523 | kfree(i2c); |
1526 | return ret; | 1524 | return ret; |
1527 | } | 1525 | } |
@@ -1595,6 +1593,11 @@ static int wm8990_probe(struct platform_device *pdev) | |||
1595 | #else | 1593 | #else |
1596 | /* Add other interfaces here */ | 1594 | /* Add other interfaces here */ |
1597 | #endif | 1595 | #endif |
1596 | |||
1597 | if (ret != 0) { | ||
1598 | kfree(codec->private_data); | ||
1599 | kfree(codec); | ||
1600 | } | ||
1598 | return ret; | 1601 | return ret; |
1599 | } | 1602 | } |
1600 | 1603 | ||
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 1fb7f9a7aecd..2f1c91b1d556 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/version.h> | ||
17 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
18 | #include <linux/device.h> | 17 | #include <linux/device.h> |
19 | #include <sound/core.h> | 18 | #include <sound/core.h> |
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index 7694621ec40b..87d0ed01f65a 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c | |||
@@ -329,12 +329,14 @@ static int __init n810_soc_init(void) | |||
329 | sys_clkout2_src = clk_get(dev, "sys_clkout2_src"); | 329 | sys_clkout2_src = clk_get(dev, "sys_clkout2_src"); |
330 | if (IS_ERR(sys_clkout2_src)) { | 330 | if (IS_ERR(sys_clkout2_src)) { |
331 | dev_err(dev, "Could not get sys_clkout2_src clock\n"); | 331 | dev_err(dev, "Could not get sys_clkout2_src clock\n"); |
332 | return -ENODEV; | 332 | err = PTR_ERR(sys_clkout2_src); |
333 | goto err2; | ||
333 | } | 334 | } |
334 | sys_clkout2 = clk_get(dev, "sys_clkout2"); | 335 | sys_clkout2 = clk_get(dev, "sys_clkout2"); |
335 | if (IS_ERR(sys_clkout2)) { | 336 | if (IS_ERR(sys_clkout2)) { |
336 | dev_err(dev, "Could not get sys_clkout2\n"); | 337 | dev_err(dev, "Could not get sys_clkout2\n"); |
337 | goto err1; | 338 | err = PTR_ERR(sys_clkout2); |
339 | goto err3; | ||
338 | } | 340 | } |
339 | /* | 341 | /* |
340 | * Configure 12 MHz output on SYS_CLKOUT2. Therefore we must use | 342 | * Configure 12 MHz output on SYS_CLKOUT2. Therefore we must use |
@@ -343,7 +345,8 @@ static int __init n810_soc_init(void) | |||
343 | func96m_clk = clk_get(dev, "func_96m_ck"); | 345 | func96m_clk = clk_get(dev, "func_96m_ck"); |
344 | if (IS_ERR(func96m_clk)) { | 346 | if (IS_ERR(func96m_clk)) { |
345 | dev_err(dev, "Could not get func 96M clock\n"); | 347 | dev_err(dev, "Could not get func 96M clock\n"); |
346 | goto err2; | 348 | err = PTR_ERR(func96m_clk); |
349 | goto err4; | ||
347 | } | 350 | } |
348 | clk_set_parent(sys_clkout2_src, func96m_clk); | 351 | clk_set_parent(sys_clkout2_src, func96m_clk); |
349 | clk_set_rate(sys_clkout2, 12000000); | 352 | clk_set_rate(sys_clkout2, 12000000); |
@@ -356,20 +359,25 @@ static int __init n810_soc_init(void) | |||
356 | gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0); | 359 | gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0); |
357 | 360 | ||
358 | return 0; | 361 | return 0; |
359 | err2: | 362 | err4: |
360 | clk_put(sys_clkout2); | 363 | clk_put(sys_clkout2); |
364 | err3: | ||
365 | clk_put(sys_clkout2_src); | ||
366 | err2: | ||
361 | platform_device_del(n810_snd_device); | 367 | platform_device_del(n810_snd_device); |
362 | err1: | 368 | err1: |
363 | platform_device_put(n810_snd_device); | 369 | platform_device_put(n810_snd_device); |
364 | 370 | ||
365 | return err; | 371 | return err; |
366 | |||
367 | } | 372 | } |
368 | 373 | ||
369 | static void __exit n810_soc_exit(void) | 374 | static void __exit n810_soc_exit(void) |
370 | { | 375 | { |
371 | gpio_free(N810_SPEAKER_AMP_GPIO); | 376 | gpio_free(N810_SPEAKER_AMP_GPIO); |
372 | gpio_free(N810_HEADSET_AMP_GPIO); | 377 | gpio_free(N810_HEADSET_AMP_GPIO); |
378 | clk_put(sys_clkout2_src); | ||
379 | clk_put(sys_clkout2); | ||
380 | clk_put(func96m_clk); | ||
373 | 381 | ||
374 | platform_device_unregister(n810_snd_device); | 382 | platform_device_unregister(n810_snd_device); |
375 | } | 383 | } |
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 8548818eea08..c796b1882776 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/platform_device.h> | ||
19 | #include <sound/core.h> | 20 | #include <sound/core.h> |
20 | #include <sound/pcm.h> | 21 | #include <sound/pcm.h> |
21 | #include <sound/initval.h> | 22 | #include <sound/initval.h> |
@@ -81,7 +82,6 @@ static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream) | |||
81 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 82 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
82 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 83 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; |
83 | 84 | ||
84 | clk_i2s = clk_get(NULL, "I2SCLK"); | ||
85 | if (IS_ERR(clk_i2s)) | 85 | if (IS_ERR(clk_i2s)) |
86 | return PTR_ERR(clk_i2s); | 86 | return PTR_ERR(clk_i2s); |
87 | 87 | ||
@@ -152,6 +152,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, | |||
152 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx); | 152 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx); |
153 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm); | 153 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm); |
154 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk); | 154 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk); |
155 | BUG_ON(IS_ERR(clk_i2s)); | ||
155 | clk_enable(clk_i2s); | 156 | clk_enable(clk_i2s); |
156 | pxa_i2s_wait(); | 157 | pxa_i2s_wait(); |
157 | 158 | ||
@@ -317,6 +318,43 @@ struct snd_soc_dai pxa_i2s_dai = { | |||
317 | 318 | ||
318 | EXPORT_SYMBOL_GPL(pxa_i2s_dai); | 319 | EXPORT_SYMBOL_GPL(pxa_i2s_dai); |
319 | 320 | ||
321 | static int pxa2xx_i2s_probe(struct platform_device *dev) | ||
322 | { | ||
323 | clk_i2s = clk_get(&dev->dev, "I2SCLK"); | ||
324 | return IS_ERR(clk_i2s) ? PTR_ERR(clk_i2s) : 0; | ||
325 | } | ||
326 | |||
327 | static int __devexit pxa2xx_i2s_remove(struct platform_device *dev) | ||
328 | { | ||
329 | clk_put(clk_i2s); | ||
330 | clk_i2s = ERR_PTR(-ENOENT); | ||
331 | return 0; | ||
332 | } | ||
333 | |||
334 | static struct platform_driver pxa2xx_i2s_driver = { | ||
335 | .probe = pxa2xx_i2s_probe, | ||
336 | .remove = __devexit_p(pxa2xx_i2s_remove), | ||
337 | |||
338 | .driver = { | ||
339 | .name = "pxa2xx-i2s", | ||
340 | .owner = THIS_MODULE, | ||
341 | }, | ||
342 | }; | ||
343 | |||
344 | static int __init pxa2xx_i2s_init(void) | ||
345 | { | ||
346 | clk_i2s = ERR_PTR(-ENOENT); | ||
347 | return platform_driver_register(&pxa2xx_i2s_driver); | ||
348 | } | ||
349 | |||
350 | static void __exit pxa2xx_i2s_exit(void) | ||
351 | { | ||
352 | platform_driver_unregister(&pxa2xx_i2s_driver); | ||
353 | } | ||
354 | |||
355 | module_init(pxa2xx_i2s_init); | ||
356 | module_exit(pxa2xx_i2s_exit); | ||
357 | |||
320 | /* Module information */ | 358 | /* Module information */ |
321 | MODULE_AUTHOR("Liam Girdwood, liam.girdwood@wolfsonmicro.com, www.wolfsonmicro.com"); | 359 | MODULE_AUTHOR("Liam Girdwood, liam.girdwood@wolfsonmicro.com, www.wolfsonmicro.com"); |
322 | MODULE_DESCRIPTION("pxa2xx I2S SoC Interface"); | 360 | MODULE_DESCRIPTION("pxa2xx I2S SoC Interface"); |