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

Side by Side Diff: sound/soc/codecs/wm9705.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/codecs/wm9090.c ('k') | sound/soc/codecs/wm9712.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 * wm9705.c -- ALSA Soc WM9705 codec support 2 * wm9705.c -- ALSA Soc WM9705 codec support
3 * 3 *
4 * Copyright 2008 Ian Molton <spyro@f2s.com> 4 * Copyright 2008 Ian Molton <spyro@f2s.com>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the 7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; Version 2 of the License only. 8 * Free Software Foundation; Version 2 of the License only.
9 * 9 *
10 */ 10 */
11 11
12 #include <linux/init.h> 12 #include <linux/init.h>
13 #include <linux/slab.h> 13 #include <linux/slab.h>
14 #include <linux/module.h> 14 #include <linux/module.h>
15 #include <linux/kernel.h> 15 #include <linux/kernel.h>
16 #include <linux/device.h> 16 #include <linux/device.h>
17 #include <sound/core.h> 17 #include <sound/core.h>
18 #include <sound/pcm.h> 18 #include <sound/pcm.h>
19 #include <sound/ac97_codec.h> 19 #include <sound/ac97_codec.h>
20 #include <sound/initval.h> 20 #include <sound/initval.h>
21 #include <sound/soc.h> 21 #include <sound/soc.h>
22 #include <sound/soc-dapm.h>
23 22
24 #include "wm9705.h" 23 #include "wm9705.h"
25 24
26 /* 25 /*
27 * WM9705 register cache 26 * WM9705 register cache
28 */ 27 */
29 static const u16 wm9705_reg[] = { 28 static const u16 wm9705_reg[] = {
30 0x6150, 0x8000, 0x8000, 0x8000, /* 0x0 */ 29 0x6150, 0x8000, 0x8000, 0x8000, /* 0x0 */
31 0x0000, 0x8000, 0x8008, 0x8008, /* 0x8 */ 30 0x0000, 0x8000, 0x8008, 0x8008, /* 0x8 */
32 0x8808, 0x8808, 0x8808, 0x8808, /* 0x10 */ 31 0x8808, 0x8808, 0x8808, 0x8808, /* 0x10 */
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 {"ADC PGA", NULL, "Left Capture Source"}, 195 {"ADC PGA", NULL, "Left Capture Source"},
197 {"ADC PGA", NULL, "Right Capture Source"}, 196 {"ADC PGA", NULL, "Right Capture Source"},
198 197
199 /* ADC's */ 198 /* ADC's */
200 {"Left ADC", NULL, "ADC PGA"}, 199 {"Left ADC", NULL, "ADC PGA"},
201 {"Right ADC", NULL, "ADC PGA"}, 200 {"Right ADC", NULL, "ADC PGA"},
202 }; 201 };
203 202
204 static int wm9705_add_widgets(struct snd_soc_codec *codec) 203 static int wm9705_add_widgets(struct snd_soc_codec *codec)
205 { 204 {
206 » snd_soc_dapm_new_controls(codec, wm9705_dapm_widgets, 205 » struct snd_soc_dapm_context *dapm = &codec->dapm;
206
207 » snd_soc_dapm_new_controls(dapm, wm9705_dapm_widgets,
207 ARRAY_SIZE(wm9705_dapm_widgets)); 208 ARRAY_SIZE(wm9705_dapm_widgets));
208 » snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 209 » snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
209 210
210 return 0; 211 return 0;
211 } 212 }
212 213
213 /* We use a register cache to enhance read performance. */ 214 /* We use a register cache to enhance read performance. */
214 static unsigned int ac97_read(struct snd_soc_codec *codec, unsigned int reg) 215 static unsigned int ac97_read(struct snd_soc_codec *codec, unsigned int reg)
215 { 216 {
216 u16 *cache = codec->reg_cache; 217 u16 *cache = codec->reg_cache;
217 218
218 switch (reg) { 219 switch (reg) {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 422
422 static void __exit wm9705_exit(void) 423 static void __exit wm9705_exit(void)
423 { 424 {
424 platform_driver_unregister(&wm9705_codec_driver); 425 platform_driver_unregister(&wm9705_codec_driver);
425 } 426 }
426 module_exit(wm9705_exit); 427 module_exit(wm9705_exit);
427 428
428 MODULE_DESCRIPTION("ASoC WM9705 driver"); 429 MODULE_DESCRIPTION("ASoC WM9705 driver");
429 MODULE_AUTHOR("Ian Molton"); 430 MODULE_AUTHOR("Ian Molton");
430 MODULE_LICENSE("GPL v2"); 431 MODULE_LICENSE("GPL v2");
OLDNEW
« no previous file with comments | « sound/soc/codecs/wm9090.c ('k') | sound/soc/codecs/wm9712.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698