diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-01-13 02:37:24 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-01-13 02:37:24 -0500 |
commit | 6db9a0f326d3144d790d9479309df480a8f562e4 (patch) | |
tree | 650a8950c35c087278ecee1b8d123f75f601ebc8 /sound/soc/pxa/spitz.c | |
parent | c400c9e23feb5bb3fbe8a8d4581ecce3b19a2f38 (diff) | |
parent | 18b022eb117e7f70c191267551ff865f278a9258 (diff) |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'sound/soc/pxa/spitz.c')
-rw-r--r-- | sound/soc/pxa/spitz.c | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index 0b30d7de24ec..c2acb69b957a 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <sound/core.h> | 23 | #include <sound/core.h> |
24 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
25 | #include <sound/soc.h> | 25 | #include <sound/soc.h> |
26 | #include <sound/soc-dapm.h> | ||
27 | 26 | ||
28 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
29 | #include <mach/spitz.h> | 28 | #include <mach/spitz.h> |
@@ -46,61 +45,63 @@ static int spitz_spk_func; | |||
46 | 45 | ||
47 | static void spitz_ext_control(struct snd_soc_codec *codec) | 46 | static void spitz_ext_control(struct snd_soc_codec *codec) |
48 | { | 47 | { |
48 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
49 | |||
49 | if (spitz_spk_func == SPITZ_SPK_ON) | 50 | if (spitz_spk_func == SPITZ_SPK_ON) |
50 | snd_soc_dapm_enable_pin(codec, "Ext Spk"); | 51 | snd_soc_dapm_enable_pin(dapm, "Ext Spk"); |
51 | else | 52 | else |
52 | snd_soc_dapm_disable_pin(codec, "Ext Spk"); | 53 | snd_soc_dapm_disable_pin(dapm, "Ext Spk"); |
53 | 54 | ||
54 | /* set up jack connection */ | 55 | /* set up jack connection */ |
55 | switch (spitz_jack_func) { | 56 | switch (spitz_jack_func) { |
56 | case SPITZ_HP: | 57 | case SPITZ_HP: |
57 | /* enable and unmute hp jack, disable mic bias */ | 58 | /* enable and unmute hp jack, disable mic bias */ |
58 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 59 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
59 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 60 | snd_soc_dapm_disable_pin(dapm, "Mic Jack"); |
60 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 61 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
61 | snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 62 | snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
62 | gpio_set_value(SPITZ_GPIO_MUTE_L, 1); | 63 | gpio_set_value(SPITZ_GPIO_MUTE_L, 1); |
63 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); | 64 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); |
64 | break; | 65 | break; |
65 | case SPITZ_MIC: | 66 | case SPITZ_MIC: |
66 | /* enable mic jack and bias, mute hp */ | 67 | /* enable mic jack and bias, mute hp */ |
67 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 68 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
68 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 69 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
69 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 70 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
70 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 71 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
71 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); | 72 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
72 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); | 73 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
73 | break; | 74 | break; |
74 | case SPITZ_LINE: | 75 | case SPITZ_LINE: |
75 | /* enable line jack, disable mic bias and mute hp */ | 76 | /* enable line jack, disable mic bias and mute hp */ |
76 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 77 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
77 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 78 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
78 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 79 | snd_soc_dapm_disable_pin(dapm, "Mic Jack"); |
79 | snd_soc_dapm_enable_pin(codec, "Line Jack"); | 80 | snd_soc_dapm_enable_pin(dapm, "Line Jack"); |
80 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); | 81 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
81 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); | 82 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
82 | break; | 83 | break; |
83 | case SPITZ_HEADSET: | 84 | case SPITZ_HEADSET: |
84 | /* enable and unmute headset jack enable mic bias, mute L hp */ | 85 | /* enable and unmute headset jack enable mic bias, mute L hp */ |
85 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 86 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
86 | snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 87 | snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
87 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 88 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
88 | snd_soc_dapm_enable_pin(codec, "Headset Jack"); | 89 | snd_soc_dapm_enable_pin(dapm, "Headset Jack"); |
89 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); | 90 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
90 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); | 91 | gpio_set_value(SPITZ_GPIO_MUTE_R, 1); |
91 | break; | 92 | break; |
92 | case SPITZ_HP_OFF: | 93 | case SPITZ_HP_OFF: |
93 | 94 | ||
94 | /* jack removed, everything off */ | 95 | /* jack removed, everything off */ |
95 | snd_soc_dapm_disable_pin(codec, "Headphone Jack"); | 96 | snd_soc_dapm_disable_pin(dapm, "Headphone Jack"); |
96 | snd_soc_dapm_disable_pin(codec, "Headset Jack"); | 97 | snd_soc_dapm_disable_pin(dapm, "Headset Jack"); |
97 | snd_soc_dapm_disable_pin(codec, "Mic Jack"); | 98 | snd_soc_dapm_disable_pin(dapm, "Mic Jack"); |
98 | snd_soc_dapm_disable_pin(codec, "Line Jack"); | 99 | snd_soc_dapm_disable_pin(dapm, "Line Jack"); |
99 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); | 100 | gpio_set_value(SPITZ_GPIO_MUTE_L, 0); |
100 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); | 101 | gpio_set_value(SPITZ_GPIO_MUTE_R, 0); |
101 | break; | 102 | break; |
102 | } | 103 | } |
103 | snd_soc_dapm_sync(codec); | 104 | snd_soc_dapm_sync(dapm); |
104 | } | 105 | } |
105 | 106 | ||
106 | static int spitz_startup(struct snd_pcm_substream *substream) | 107 | static int spitz_startup(struct snd_pcm_substream *substream) |
@@ -281,16 +282,17 @@ static const struct snd_kcontrol_new wm8750_spitz_controls[] = { | |||
281 | static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) | 282 | static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) |
282 | { | 283 | { |
283 | struct snd_soc_codec *codec = rtd->codec; | 284 | struct snd_soc_codec *codec = rtd->codec; |
285 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
284 | int err; | 286 | int err; |
285 | 287 | ||
286 | /* NC codec pins */ | 288 | /* NC codec pins */ |
287 | snd_soc_dapm_nc_pin(codec, "RINPUT1"); | 289 | snd_soc_dapm_nc_pin(dapm, "RINPUT1"); |
288 | snd_soc_dapm_nc_pin(codec, "LINPUT2"); | 290 | snd_soc_dapm_nc_pin(dapm, "LINPUT2"); |
289 | snd_soc_dapm_nc_pin(codec, "RINPUT2"); | 291 | snd_soc_dapm_nc_pin(dapm, "RINPUT2"); |
290 | snd_soc_dapm_nc_pin(codec, "LINPUT3"); | 292 | snd_soc_dapm_nc_pin(dapm, "LINPUT3"); |
291 | snd_soc_dapm_nc_pin(codec, "RINPUT3"); | 293 | snd_soc_dapm_nc_pin(dapm, "RINPUT3"); |
292 | snd_soc_dapm_nc_pin(codec, "OUT3"); | 294 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
293 | snd_soc_dapm_nc_pin(codec, "MONO1"); | 295 | snd_soc_dapm_nc_pin(dapm, "MONO1"); |
294 | 296 | ||
295 | /* Add spitz specific controls */ | 297 | /* Add spitz specific controls */ |
296 | err = snd_soc_add_controls(codec, wm8750_spitz_controls, | 298 | err = snd_soc_add_controls(codec, wm8750_spitz_controls, |
@@ -299,13 +301,13 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) | |||
299 | return err; | 301 | return err; |
300 | 302 | ||
301 | /* Add spitz specific widgets */ | 303 | /* Add spitz specific widgets */ |
302 | snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets, | 304 | snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets, |
303 | ARRAY_SIZE(wm8750_dapm_widgets)); | 305 | ARRAY_SIZE(wm8750_dapm_widgets)); |
304 | 306 | ||
305 | /* Set up spitz specific audio paths */ | 307 | /* Set up spitz specific audio paths */ |
306 | snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 308 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
307 | 309 | ||
308 | snd_soc_dapm_sync(codec); | 310 | snd_soc_dapm_sync(dapm); |
309 | return 0; | 311 | return 0; |
310 | } | 312 | } |
311 | 313 | ||