diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-10-07 14:08:56 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-10-07 14:08:56 -0400 |
commit | 5a89770daad83df74d77a8d34a1ffaedae565ce9 (patch) | |
tree | 0d8ef70293a6ef969ba8b7718e59608337643d40 /sound | |
parent | c46c948260f41af18b277c1eb1895d788d3605dc (diff) | |
parent | af7c951d76708c61b862463d579d76be757130bf (diff) |
Merge branches 'pxa-core' and 'pxa-machines' into pxa-all
Conflicts:
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
Diffstat (limited to 'sound')
-rw-r--r-- | sound/Kconfig | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 24 | ||||
-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/omap/n810.c | 18 | ||||
-rw-r--r-- | sound/soc/pxa/corgi.c | 34 | ||||
-rw-r--r-- | sound/soc/pxa/pxa2xx-i2s.c | 40 | ||||
-rw-r--r-- | sound/soc/pxa/spitz.c | 46 |
10 files changed, 124 insertions, 60 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/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 909f1c101c95..66025161bd69 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -6197,7 +6197,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = { | |||
6197 | SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG), | 6197 | SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG), |
6198 | SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), | 6198 | SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG), |
6199 | SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), | 6199 | SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG), |
6200 | SND_PCI_QUIRK(0x106b, 0x00a0, "Apple iMac 24''", ALC885_IMAC24), | ||
6201 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG), | 6200 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG), |
6202 | 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 */ |
6203 | SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), | 6202 | SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG), |
@@ -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/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/corgi.c b/sound/soc/pxa/corgi.c index 0a53f72077fd..fa69faa886ef 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c | |||
@@ -18,13 +18,13 @@ | |||
18 | #include <linux/timer.h> | 18 | #include <linux/timer.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/gpio.h> | ||
21 | #include <sound/core.h> | 22 | #include <sound/core.h> |
22 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
23 | #include <sound/soc.h> | 24 | #include <sound/soc.h> |
24 | #include <sound/soc-dapm.h> | 25 | #include <sound/soc-dapm.h> |
25 | 26 | ||
26 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
27 | #include <asm/hardware/scoop.h> | ||
28 | #include <mach/pxa-regs.h> | 28 | #include <mach/pxa-regs.h> |
29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
30 | #include <mach/corgi.h> | 30 | #include <mach/corgi.h> |
@@ -54,8 +54,8 @@ static void corgi_ext_control(struct snd_soc_codec *codec) | |||
54 | switch (corgi_jack_func) { | 54 | switch (corgi_jack_func) { |
55 | case CORGI_HP: | 55 | case CORGI_HP: |
56 | /* set = unmute headphone */ | 56 | /* set = unmute headphone */ |
57 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 57 | gpio_set_value(CORGI_GPIO_MUTE_L, 1); |
58 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 58 | gpio_set_value(CORGI_GPIO_MUTE_R, 1); |
59 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 59 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); |
60 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 60 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
61 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 61 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); |
@@ -63,24 +63,24 @@ static void corgi_ext_control(struct snd_soc_codec *codec) | |||
63 | break; | 63 | break; |
64 | case CORGI_MIC: | 64 | case CORGI_MIC: |
65 | /* reset = mute headphone */ | 65 | /* reset = mute headphone */ |
66 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 66 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); |
67 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 67 | gpio_set_value(CORGI_GPIO_MUTE_R, 0); |
68 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 68 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); |
69 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 69 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
70 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 70 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); |
71 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 71 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
72 | break; | 72 | break; |
73 | case CORGI_LINE: | 73 | case CORGI_LINE: |
74 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 74 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); |
75 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 75 | gpio_set_value(CORGI_GPIO_MUTE_R, 0); |
76 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 76 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); |
77 | snd_soc_dapm_enable_pin(codec, "Line Jack"); | 77 | snd_soc_dapm_enable_pin(codec, "Line Jack"); |
78 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 78 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); |
79 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 79 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
80 | break; | 80 | break; |
81 | case CORGI_HEADSET: | 81 | case CORGI_HEADSET: |
82 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 82 | gpio_set_value(CORGI_GPIO_MUTE_L, 0); |
83 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 83 | gpio_set_value(CORGI_GPIO_MUTE_R, 1); |
84 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 84 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); |
85 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 85 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
86 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 86 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); |
@@ -114,8 +114,8 @@ static int corgi_shutdown(struct snd_pcm_substream *substream) | |||
114 | struct snd_soc_codec *codec = rtd->socdev->codec; | 114 | struct snd_soc_codec *codec = rtd->socdev->codec; |
115 | 115 | ||
116 | /* set = unmute headphone */ | 116 | /* set = unmute headphone */ |
117 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_L); | 117 | gpio_set_value(CORGI_GPIO_MUTE_L, 1); |
118 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MUTE_R); | 118 | gpio_set_value(CORGI_GPIO_MUTE_R, 1); |
119 | return 0; | 119 | return 0; |
120 | } | 120 | } |
121 | 121 | ||
@@ -218,22 +218,14 @@ static int corgi_set_spk(struct snd_kcontrol *kcontrol, | |||
218 | static int corgi_amp_event(struct snd_soc_dapm_widget *w, | 218 | static int corgi_amp_event(struct snd_soc_dapm_widget *w, |
219 | struct snd_kcontrol *k, int event) | 219 | struct snd_kcontrol *k, int event) |
220 | { | 220 | { |
221 | if (SND_SOC_DAPM_EVENT_ON(event)) | 221 | gpio_set_value(CORGI_GPIO_APM_ON, SND_SOC_DAPM_EVENT_ON(event)); |
222 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_APM_ON); | ||
223 | else | ||
224 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_APM_ON); | ||
225 | |||
226 | return 0; | 222 | return 0; |
227 | } | 223 | } |
228 | 224 | ||
229 | static int corgi_mic_event(struct snd_soc_dapm_widget *w, | 225 | static int corgi_mic_event(struct snd_soc_dapm_widget *w, |
230 | struct snd_kcontrol *k, int event) | 226 | struct snd_kcontrol *k, int event) |
231 | { | 227 | { |
232 | if (SND_SOC_DAPM_EVENT_ON(event)) | 228 | gpio_set_value(CORGI_GPIO_MIC_BIAS, SND_SOC_DAPM_EVENT_ON(event)); |
233 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MIC_BIAS); | ||
234 | else | ||
235 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_MIC_BIAS); | ||
236 | |||
237 | return 0; | 229 | return 0; |
238 | } | 230 | } |
239 | 231 | ||
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"); |
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index 37cb768fc933..b89a3edd2183 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c | |||
@@ -19,16 +19,15 @@ | |||
19 | #include <linux/timer.h> | 19 | #include <linux/timer.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/gpio.h> | ||
22 | #include <sound/core.h> | 23 | #include <sound/core.h> |
23 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
24 | #include <sound/soc.h> | 25 | #include <sound/soc.h> |
25 | #include <sound/soc-dapm.h> | 26 | #include <sound/soc-dapm.h> |
26 | 27 | ||
27 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
28 | #include <asm/hardware/scoop.h> | ||
29 | #include <mach/pxa-regs.h> | 29 | #include <mach/pxa-regs.h> |
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | #include <mach/akita.h> | ||
32 | #include <mach/spitz.h> | 31 | #include <mach/spitz.h> |
33 | #include "../codecs/wm8750.h" | 32 | #include "../codecs/wm8750.h" |
34 | #include "pxa2xx-pcm.h" | 33 | #include "pxa2xx-pcm.h" |
@@ -63,8 +62,8 @@ static void spitz_ext_control(struct snd_soc_codec *codec) | |||
63 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 62 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); |
64 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 63 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
65 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 64 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); |
66 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 65 | gpio_set_value(SPITZ_GPIO_MUTE_L, 1); |
67 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 66 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); |
68 | break; | 67 | break; |
69 | case SPITZ_MIC: | 68 | case SPITZ_MIC: |
70 | /* enable mic jack and bias, mute hp */ | 69 | /* enable mic jack and bias, mute hp */ |
@@ -72,8 +71,8 @@ static void spitz_ext_control(struct snd_soc_codec *codec) | |||
72 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 71 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
73 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 72 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
74 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 73 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); |
75 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 74 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
76 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 75 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
77 | break; | 76 | break; |
78 | case SPITZ_LINE: | 77 | case SPITZ_LINE: |
79 | /* enable line jack, disable mic bias and mute hp */ | 78 | /* enable line jack, disable mic bias and mute hp */ |
@@ -81,8 +80,8 @@ static void spitz_ext_control(struct snd_soc_codec *codec) | |||
81 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 80 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
82 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 81 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); |
83 | snd_soc_dapm_enable_pin(codec, "Line Jack"); | 82 | snd_soc_dapm_enable_pin(codec, "Line Jack"); |
84 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 83 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
85 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 84 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
86 | break; | 85 | break; |
87 | case SPITZ_HEADSET: | 86 | case SPITZ_HEADSET: |
88 | /* enable and unmute headset jack enable mic bias, mute L hp */ | 87 | /* enable and unmute headset jack enable mic bias, mute L hp */ |
@@ -90,8 +89,8 @@ static void spitz_ext_control(struct snd_soc_codec *codec) | |||
90 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 89 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); |
91 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 90 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
92 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); | 91 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); |
93 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 92 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
94 | set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 93 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); |
95 | break; | 94 | break; |
96 | case SPITZ_HP_OFF: | 95 | case SPITZ_HP_OFF: |
97 | 96 | ||
@@ -100,8 +99,8 @@ static void spitz_ext_control(struct snd_soc_codec *codec) | |||
100 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 99 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); |
101 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 100 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); |
102 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 101 | snd_soc_dapm_disable_pin(codec, "Line Jack"); |
103 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_L); | 102 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
104 | reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_MUTE_R); | 103 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
105 | break; | 104 | break; |
106 | } | 105 | } |
107 | snd_soc_dapm_sync(codec); | 106 | snd_soc_dapm_sync(codec); |
@@ -215,23 +214,14 @@ static int spitz_set_spk(struct snd_kcontrol *kcontrol, | |||
215 | static int spitz_mic_bias(struct snd_soc_dapm_widget *w, | 214 | static int spitz_mic_bias(struct snd_soc_dapm_widget *w, |
216 | struct snd_kcontrol *k, int event) | 215 | struct snd_kcontrol *k, int event) |
217 | { | 216 | { |
218 | if (machine_is_borzoi() || machine_is_spitz()) { | 217 | if (machine_is_borzoi() || machine_is_spitz()) |
219 | if (SND_SOC_DAPM_EVENT_ON(event)) | 218 | gpio_set_value(SPITZ_GPIO_MIC_BIAS, |
220 | set_scoop_gpio(&spitzscoop2_device.dev, | 219 | SND_SOC_DAPM_EVENT_ON(event)); |
221 | SPITZ_SCP2_MIC_BIAS); | 220 | |
222 | else | 221 | if (machine_is_akita()) |
223 | reset_scoop_gpio(&spitzscoop2_device.dev, | 222 | gpio_set_value(AKITA_GPIO_MIC_BIAS, |
224 | SPITZ_SCP2_MIC_BIAS); | 223 | SND_SOC_DAPM_EVENT_ON(event)); |
225 | } | ||
226 | 224 | ||
227 | if (machine_is_akita()) { | ||
228 | if (SND_SOC_DAPM_EVENT_ON(event)) | ||
229 | akita_set_ioexp(&akitaioexp_device.dev, | ||
230 | AKITA_IOEXP_MIC_BIAS); | ||
231 | else | ||
232 | akita_reset_ioexp(&akitaioexp_device.dev, | ||
233 | AKITA_IOEXP_MIC_BIAS); | ||
234 | } | ||
235 | return 0; | 225 | return 0; |
236 | } | 226 | } |
237 | 227 | ||