Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: sound/soc/pxa/saarb.c

Issue 6577007: CHROMIUM: ASoC: Import entire upstream ASoC tree (Closed)
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sound/soc/pxa/raumfeld.c ('k') | sound/soc/pxa/spitz.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * saarb.c -- SoC audio for saarb 2 * saarb.c -- SoC audio for saarb
3 * 3 *
4 * Copyright (C) 2010 Marvell International Ltd. 4 * Copyright (C) 2010 Marvell International Ltd.
5 * Haojian Zhuang <haojian.zhuang@marvell.com> 5 * Haojian Zhuang <haojian.zhuang@marvell.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12 #include <linux/module.h> 12 #include <linux/module.h>
13 #include <linux/moduleparam.h> 13 #include <linux/moduleparam.h>
14 #include <linux/device.h> 14 #include <linux/device.h>
15 #include <linux/clk.h> 15 #include <linux/clk.h>
16 #include <linux/i2c.h> 16 #include <linux/i2c.h>
17 #include <sound/core.h> 17 #include <sound/core.h>
18 #include <sound/pcm.h> 18 #include <sound/pcm.h>
19 #include <sound/pcm_params.h> 19 #include <sound/pcm_params.h>
20 #include <sound/soc.h> 20 #include <sound/soc.h>
21 #include <sound/soc-dapm.h>
22 #include <sound/jack.h> 21 #include <sound/jack.h>
23 22
24 #include <asm/mach-types.h> 23 #include <asm/mach-types.h>
25 24
26 #include "../codecs/88pm860x-codec.h" 25 #include "../codecs/88pm860x-codec.h"
27 #include "pxa-ssp.h" 26 #include "pxa-ssp.h"
28 27
29 static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd); 28 static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd);
30 29
31 static struct platform_device *saarb_snd_device; 30 static struct platform_device *saarb_snd_device;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 125
127 static struct snd_soc_card snd_soc_card_saarb = { 126 static struct snd_soc_card snd_soc_card_saarb = {
128 .name = "Saarb", 127 .name = "Saarb",
129 .dai_link = saarb_dai, 128 .dai_link = saarb_dai,
130 .num_links = ARRAY_SIZE(saarb_dai), 129 .num_links = ARRAY_SIZE(saarb_dai),
131 }; 130 };
132 131
133 static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd) 132 static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd)
134 { 133 {
135 struct snd_soc_codec *codec = rtd->codec; 134 struct snd_soc_codec *codec = rtd->codec;
135 struct snd_soc_dapm_context *dapm = &codec->dapm;
136 int ret; 136 int ret;
137 137
138 » snd_soc_dapm_new_controls(codec, saarb_dapm_widgets, 138 » snd_soc_dapm_new_controls(dapm, saarb_dapm_widgets,
139 ARRAY_SIZE(saarb_dapm_widgets)); 139 ARRAY_SIZE(saarb_dapm_widgets));
140 » snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 140 » snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
141 141
142 /* connected pins */ 142 /* connected pins */
143 » snd_soc_dapm_enable_pin(codec, "Ext Speaker"); 143 » snd_soc_dapm_enable_pin(dapm, "Ext Speaker");
144 » snd_soc_dapm_enable_pin(codec, "Ext Mic 1"); 144 » snd_soc_dapm_enable_pin(dapm, "Ext Mic 1");
145 » snd_soc_dapm_enable_pin(codec, "Ext Mic 3"); 145 » snd_soc_dapm_enable_pin(dapm, "Ext Mic 3");
146 » snd_soc_dapm_disable_pin(codec, "Headset Mic 2"); 146 » snd_soc_dapm_disable_pin(dapm, "Headset Mic 2");
147 » snd_soc_dapm_disable_pin(codec, "Headset Stereophone"); 147 » snd_soc_dapm_disable_pin(dapm, "Headset Stereophone");
148 148
149 » ret = snd_soc_dapm_sync(codec); 149 » ret = snd_soc_dapm_sync(dapm);
150 if (ret) 150 if (ret)
151 return ret; 151 return ret;
152 152
153 /* Headset jack detection */ 153 /* Headset jack detection */
154 snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE 154 snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE
155 | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2, 155 | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2,
156 &hs_jack); 156 &hs_jack);
157 snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins), 157 snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
158 hs_jack_pins); 158 hs_jack_pins);
159 snd_soc_jack_new(codec, "Microphone Jack", SND_JACK_MICROPHONE, 159 snd_soc_jack_new(codec, "Microphone Jack", SND_JACK_MICROPHONE,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 { 191 {
192 platform_device_unregister(saarb_snd_device); 192 platform_device_unregister(saarb_snd_device);
193 } 193 }
194 194
195 module_init(saarb_init); 195 module_init(saarb_init);
196 module_exit(saarb_exit); 196 module_exit(saarb_exit);
197 197
198 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); 198 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
199 MODULE_DESCRIPTION("ALSA SoC 88PM860x Saarb"); 199 MODULE_DESCRIPTION("ALSA SoC 88PM860x Saarb");
200 MODULE_LICENSE("GPL"); 200 MODULE_LICENSE("GPL");
OLDNEW
« no previous file with comments | « sound/soc/pxa/raumfeld.c ('k') | sound/soc/pxa/spitz.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698