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

Side by Side Diff: sound/soc/codecs/wm2000.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/wl1273.c ('k') | sound/soc/codecs/wm8350.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 * wm2000.c -- WM2000 ALSA Soc Audio driver 2 * wm2000.c -- WM2000 ALSA Soc Audio driver
3 * 3 *
4 * Copyright 2008-2010 Wolfson Microelectronics PLC. 4 * Copyright 2008-2010 Wolfson Microelectronics PLC.
5 * 5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
(...skipping 18 matching lines...) Expand all
29 #include <linux/delay.h> 29 #include <linux/delay.h>
30 #include <linux/pm.h> 30 #include <linux/pm.h>
31 #include <linux/i2c.h> 31 #include <linux/i2c.h>
32 #include <linux/platform_device.h> 32 #include <linux/platform_device.h>
33 #include <linux/debugfs.h> 33 #include <linux/debugfs.h>
34 #include <linux/slab.h> 34 #include <linux/slab.h>
35 #include <sound/core.h> 35 #include <sound/core.h>
36 #include <sound/pcm.h> 36 #include <sound/pcm.h>
37 #include <sound/pcm_params.h> 37 #include <sound/pcm_params.h>
38 #include <sound/soc.h> 38 #include <sound/soc.h>
39 #include <sound/soc-dapm.h>
40 #include <sound/initval.h> 39 #include <sound/initval.h>
41 #include <sound/tlv.h> 40 #include <sound/tlv.h>
42 41
43 #include <sound/wm2000.h> 42 #include <sound/wm2000.h>
44 43
45 #include "wm2000.h" 44 #include "wm2000.h"
46 45
47 enum wm2000_anc_mode { 46 enum wm2000_anc_mode {
48 ANC_ACTIVE = 0, 47 ANC_ACTIVE = 0,
49 ANC_BYPASS = 1, 48 ANC_BYPASS = 1,
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 static const struct snd_soc_dapm_route audio_map[] = { 697 static const struct snd_soc_dapm_route audio_map[] = {
699 { "WM2000 SPKN", NULL, "ANC Engine" }, 698 { "WM2000 SPKN", NULL, "ANC Engine" },
700 { "WM2000 SPKP", NULL, "ANC Engine" }, 699 { "WM2000 SPKP", NULL, "ANC Engine" },
701 { "ANC Engine", NULL, "WM2000 LINN" }, 700 { "ANC Engine", NULL, "WM2000 LINN" },
702 { "ANC Engine", NULL, "WM2000 LINP" }, 701 { "ANC Engine", NULL, "WM2000 LINP" },
703 }; 702 };
704 703
705 /* Called from the machine driver */ 704 /* Called from the machine driver */
706 int wm2000_add_controls(struct snd_soc_codec *codec) 705 int wm2000_add_controls(struct snd_soc_codec *codec)
707 { 706 {
707 struct snd_soc_dapm_context *dapm = &codec->dapm;
708 int ret; 708 int ret;
709 709
710 if (!wm2000_i2c) { 710 if (!wm2000_i2c) {
711 pr_err("WM2000 not yet probed\n"); 711 pr_err("WM2000 not yet probed\n");
712 return -ENODEV; 712 return -ENODEV;
713 } 713 }
714 714
715 » ret = snd_soc_dapm_new_controls(codec, wm2000_dapm_widgets, 715 » ret = snd_soc_dapm_new_controls(dapm, wm2000_dapm_widgets,
716 ARRAY_SIZE(wm2000_dapm_widgets)); 716 ARRAY_SIZE(wm2000_dapm_widgets));
717 if (ret < 0) 717 if (ret < 0)
718 return ret; 718 return ret;
719 719
720 » ret = snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 720 » ret = snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
721 if (ret < 0) 721 if (ret < 0)
722 return ret; 722 return ret;
723 723
724 return snd_soc_add_controls(codec, wm2000_controls, 724 return snd_soc_add_controls(codec, wm2000_controls,
725 ARRAY_SIZE(wm2000_controls)); 725 ARRAY_SIZE(wm2000_controls));
726 } 726 }
727 EXPORT_SYMBOL_GPL(wm2000_add_controls); 727 EXPORT_SYMBOL_GPL(wm2000_add_controls);
728 728
729 static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, 729 static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
730 const struct i2c_device_id *i2c_id) 730 const struct i2c_device_id *i2c_id)
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 881
882 static void __exit wm2000_exit(void) 882 static void __exit wm2000_exit(void)
883 { 883 {
884 i2c_del_driver(&wm2000_i2c_driver); 884 i2c_del_driver(&wm2000_i2c_driver);
885 } 885 }
886 module_exit(wm2000_exit); 886 module_exit(wm2000_exit);
887 887
888 MODULE_DESCRIPTION("ASoC WM2000 driver"); 888 MODULE_DESCRIPTION("ASoC WM2000 driver");
889 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfonmicro.com>"); 889 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfonmicro.com>");
890 MODULE_LICENSE("GPL"); 890 MODULE_LICENSE("GPL");
OLDNEW
« no previous file with comments | « sound/soc/codecs/wl1273.c ('k') | sound/soc/codecs/wm8350.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698