diff options
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/pxa/corgi.c | 34 | ||||
-rw-r--r-- | sound/soc/pxa/pxa2xx-ac97.c | 10 | ||||
-rw-r--r-- | sound/soc/pxa/pxa2xx-i2s.c | 43 | ||||
-rw-r--r-- | sound/soc/pxa/spitz.c | 46 |
4 files changed, 77 insertions, 56 deletions
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index dd7fa0b329c7..2718eaf7895f 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-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index a80ae074b090..a7a3a9c5c6ff 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c | |||
@@ -49,7 +49,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = { | |||
49 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = { | 49 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = { |
50 | .name = "AC97 PCM Stereo out", | 50 | .name = "AC97 PCM Stereo out", |
51 | .dev_addr = __PREG(PCDR), | 51 | .dev_addr = __PREG(PCDR), |
52 | .drcmr = &DRCMRTXPCDR, | 52 | .drcmr = &DRCMR(12), |
53 | .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | | 53 | .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | |
54 | DCMD_BURST32 | DCMD_WIDTH4, | 54 | DCMD_BURST32 | DCMD_WIDTH4, |
55 | }; | 55 | }; |
@@ -57,7 +57,7 @@ static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = { | |||
57 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_in = { | 57 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_in = { |
58 | .name = "AC97 PCM Stereo in", | 58 | .name = "AC97 PCM Stereo in", |
59 | .dev_addr = __PREG(PCDR), | 59 | .dev_addr = __PREG(PCDR), |
60 | .drcmr = &DRCMRRXPCDR, | 60 | .drcmr = &DRCMR(11), |
61 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | | 61 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | |
62 | DCMD_BURST32 | DCMD_WIDTH4, | 62 | DCMD_BURST32 | DCMD_WIDTH4, |
63 | }; | 63 | }; |
@@ -65,7 +65,7 @@ static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_in = { | |||
65 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_aux_mono_out = { | 65 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_aux_mono_out = { |
66 | .name = "AC97 Aux PCM (Slot 5) Mono out", | 66 | .name = "AC97 Aux PCM (Slot 5) Mono out", |
67 | .dev_addr = __PREG(MODR), | 67 | .dev_addr = __PREG(MODR), |
68 | .drcmr = &DRCMRTXMODR, | 68 | .drcmr = &DRCMR(10), |
69 | .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | | 69 | .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | |
70 | DCMD_BURST16 | DCMD_WIDTH2, | 70 | DCMD_BURST16 | DCMD_WIDTH2, |
71 | }; | 71 | }; |
@@ -73,7 +73,7 @@ static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_aux_mono_out = { | |||
73 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_aux_mono_in = { | 73 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_aux_mono_in = { |
74 | .name = "AC97 Aux PCM (Slot 5) Mono in", | 74 | .name = "AC97 Aux PCM (Slot 5) Mono in", |
75 | .dev_addr = __PREG(MODR), | 75 | .dev_addr = __PREG(MODR), |
76 | .drcmr = &DRCMRRXMODR, | 76 | .drcmr = &DRCMR(9), |
77 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | | 77 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | |
78 | DCMD_BURST16 | DCMD_WIDTH2, | 78 | DCMD_BURST16 | DCMD_WIDTH2, |
79 | }; | 79 | }; |
@@ -81,7 +81,7 @@ static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_aux_mono_in = { | |||
81 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_mic_mono_in = { | 81 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_mic_mono_in = { |
82 | .name = "AC97 Mic PCM (Slot 6) Mono in", | 82 | .name = "AC97 Mic PCM (Slot 6) Mono in", |
83 | .dev_addr = __PREG(MCDR), | 83 | .dev_addr = __PREG(MCDR), |
84 | .drcmr = &DRCMRRXMCDR, | 84 | .drcmr = &DRCMR(8), |
85 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | | 85 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | |
86 | DCMD_BURST16 | DCMD_WIDTH2, | 86 | DCMD_BURST16 | DCMD_WIDTH2, |
87 | }; | 87 | }; |
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 64057b1d220d..e758034db5c3 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c | |||
@@ -39,6 +39,45 @@ struct pxa2xx_gpio { | |||
39 | u32 frm; | 39 | u32 frm; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | /* | ||
43 | * I2S Controller Register and Bit Definitions | ||
44 | */ | ||
45 | #define SACR0 __REG(0x40400000) /* Global Control Register */ | ||
46 | #define SACR1 __REG(0x40400004) /* Serial Audio I 2 S/MSB-Justified Control Register */ | ||
47 | #define SASR0 __REG(0x4040000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */ | ||
48 | #define SAIMR __REG(0x40400014) /* Serial Audio Interrupt Mask Register */ | ||
49 | #define SAICR __REG(0x40400018) /* Serial Audio Interrupt Clear Register */ | ||
50 | #define SADIV __REG(0x40400060) /* Audio Clock Divider Register. */ | ||
51 | #define SADR __REG(0x40400080) /* Serial Audio Data Register (TX and RX FIFO access Register). */ | ||
52 | |||
53 | #define SACR0_RFTH(x) ((x) << 12) /* Rx FIFO Interrupt or DMA Trigger Threshold */ | ||
54 | #define SACR0_TFTH(x) ((x) << 8) /* Tx FIFO Interrupt or DMA Trigger Threshold */ | ||
55 | #define SACR0_STRF (1 << 5) /* FIFO Select for EFWR Special Function */ | ||
56 | #define SACR0_EFWR (1 << 4) /* Enable EFWR Function */ | ||
57 | #define SACR0_RST (1 << 3) /* FIFO, i2s Register Reset */ | ||
58 | #define SACR0_BCKD (1 << 2) /* Bit Clock Direction */ | ||
59 | #define SACR0_ENB (1 << 0) /* Enable I2S Link */ | ||
60 | #define SACR1_ENLBF (1 << 5) /* Enable Loopback */ | ||
61 | #define SACR1_DRPL (1 << 4) /* Disable Replaying Function */ | ||
62 | #define SACR1_DREC (1 << 3) /* Disable Recording Function */ | ||
63 | #define SACR1_AMSL (1 << 0) /* Specify Alternate Mode */ | ||
64 | |||
65 | #define SASR0_I2SOFF (1 << 7) /* Controller Status */ | ||
66 | #define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */ | ||
67 | #define SASR0_TUR (1 << 5) /* Tx FIFO Underrun */ | ||
68 | #define SASR0_RFS (1 << 4) /* Rx FIFO Service Request */ | ||
69 | #define SASR0_TFS (1 << 3) /* Tx FIFO Service Request */ | ||
70 | #define SASR0_BSY (1 << 2) /* I2S Busy */ | ||
71 | #define SASR0_RNE (1 << 1) /* Rx FIFO Not Empty */ | ||
72 | #define SASR0_TNF (1 << 0) /* Tx FIFO Not Empty */ | ||
73 | |||
74 | #define SAICR_ROR (1 << 6) /* Clear Rx FIFO Overrun Interrupt */ | ||
75 | #define SAICR_TUR (1 << 5) /* Clear Tx FIFO Underrun Interrupt */ | ||
76 | |||
77 | #define SAIMR_ROR (1 << 6) /* Enable Rx FIFO Overrun Condition Interrupt */ | ||
78 | #define SAIMR_TUR (1 << 5) /* Enable Tx FIFO Underrun Condition Interrupt */ | ||
79 | #define SAIMR_RFS (1 << 4) /* Enable Rx FIFO Service Interrupt */ | ||
80 | #define SAIMR_TFS (1 << 3) /* Enable Tx FIFO Service Interrupt */ | ||
42 | 81 | ||
43 | struct pxa_i2s_port { | 82 | struct pxa_i2s_port { |
44 | u32 sadiv; | 83 | u32 sadiv; |
@@ -54,7 +93,7 @@ static struct clk *clk_i2s; | |||
54 | static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = { | 93 | static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = { |
55 | .name = "I2S PCM Stereo out", | 94 | .name = "I2S PCM Stereo out", |
56 | .dev_addr = __PREG(SADR), | 95 | .dev_addr = __PREG(SADR), |
57 | .drcmr = &DRCMRTXSADR, | 96 | .drcmr = &DRCMR(3), |
58 | .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | | 97 | .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | |
59 | DCMD_BURST32 | DCMD_WIDTH4, | 98 | DCMD_BURST32 | DCMD_WIDTH4, |
60 | }; | 99 | }; |
@@ -62,7 +101,7 @@ static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = { | |||
62 | static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_in = { | 101 | static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_in = { |
63 | .name = "I2S PCM Stereo in", | 102 | .name = "I2S PCM Stereo in", |
64 | .dev_addr = __PREG(SADR), | 103 | .dev_addr = __PREG(SADR), |
65 | .drcmr = &DRCMRRXSADR, | 104 | .drcmr = &DRCMR(2), |
66 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | | 105 | .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | |
67 | DCMD_BURST32 | DCMD_WIDTH4, | 106 | DCMD_BURST32 | DCMD_WIDTH4, |
68 | }; | 107 | }; |
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index 8f89188e541e..d307b6757e95 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 | ||