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

Side by Side Diff: sound/soc/samsung/jive_wm8750.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/samsung/i2s.c ('k') | sound/soc/samsung/lm4857.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* sound/soc/s3c24xx/jive_wm8750.c 1 /* sound/soc/samsung/jive_wm8750.c
2 * 2 *
3 * Copyright 2007,2008 Simtec Electronics 3 * Copyright 2007,2008 Simtec Electronics
4 * 4 *
5 * Based on sound/soc/pxa/spitz.c 5 * Based on sound/soc/pxa/spitz.c
6 * Copyright 2005 Wolfson Microelectronics PLC. 6 * Copyright 2005 Wolfson Microelectronics PLC.
7 * Copyright 2005 Openedhand Ltd. 7 * Copyright 2005 Openedhand Ltd.
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14 #include <linux/module.h>
15 #include <linux/moduleparam.h>
16 #include <linux/timer.h>
17 #include <linux/interrupt.h>
18 #include <linux/platform_device.h>
19 #include <linux/clk.h>
20
21 #include <sound/core.h>
22 #include <sound/pcm.h>
23 #include <sound/soc.h> 14 #include <sound/soc.h>
24 #include <sound/soc-dapm.h>
25 15
26 #include <asm/mach-types.h> 16 #include <asm/mach-types.h>
27 17
28 #include "s3c-dma.h"
29 #include "s3c2412-i2s.h" 18 #include "s3c2412-i2s.h"
30
31 #include "../codecs/wm8750.h" 19 #include "../codecs/wm8750.h"
32 20
33 static const struct snd_soc_dapm_route audio_map[] = { 21 static const struct snd_soc_dapm_route audio_map[] = {
34 { "Headphone Jack", NULL, "LOUT1" }, 22 { "Headphone Jack", NULL, "LOUT1" },
35 { "Headphone Jack", NULL, "ROUT1" }, 23 { "Headphone Jack", NULL, "ROUT1" },
36 { "Internal Speaker", NULL, "LOUT2" }, 24 { "Internal Speaker", NULL, "LOUT2" },
37 { "Internal Speaker", NULL, "ROUT2" }, 25 { "Internal Speaker", NULL, "ROUT2" },
38 { "LINPUT1", NULL, "Line Input" }, 26 { "LINPUT1", NULL, "Line Input" },
39 { "RINPUT1", NULL, "Line Input" }, 27 { "RINPUT1", NULL, "Line Input" },
40 }; 28 };
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return 0; 92 return 0;
105 } 93 }
106 94
107 static struct snd_soc_ops jive_ops = { 95 static struct snd_soc_ops jive_ops = {
108 .hw_params = jive_hw_params, 96 .hw_params = jive_hw_params,
109 }; 97 };
110 98
111 static int jive_wm8750_init(struct snd_soc_pcm_runtime *rtd) 99 static int jive_wm8750_init(struct snd_soc_pcm_runtime *rtd)
112 { 100 {
113 struct snd_soc_codec *codec = rtd->codec; 101 struct snd_soc_codec *codec = rtd->codec;
102 struct snd_soc_dapm_context *dapm = &codec->dapm;
114 int err; 103 int err;
115 104
116 /* These endpoints are not being used. */ 105 /* These endpoints are not being used. */
117 » snd_soc_dapm_nc_pin(codec, "LINPUT2"); 106 » snd_soc_dapm_nc_pin(dapm, "LINPUT2");
118 » snd_soc_dapm_nc_pin(codec, "RINPUT2"); 107 » snd_soc_dapm_nc_pin(dapm, "RINPUT2");
119 » snd_soc_dapm_nc_pin(codec, "LINPUT3"); 108 » snd_soc_dapm_nc_pin(dapm, "LINPUT3");
120 » snd_soc_dapm_nc_pin(codec, "RINPUT3"); 109 » snd_soc_dapm_nc_pin(dapm, "RINPUT3");
121 » snd_soc_dapm_nc_pin(codec, "OUT3"); 110 » snd_soc_dapm_nc_pin(dapm, "OUT3");
122 » snd_soc_dapm_nc_pin(codec, "MONO"); 111 » snd_soc_dapm_nc_pin(dapm, "MONO");
123 112
124 /* Add jive specific widgets */ 113 /* Add jive specific widgets */
125 » err = snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets, 114 » err = snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets,
126 ARRAY_SIZE(wm8750_dapm_widgets)); 115 ARRAY_SIZE(wm8750_dapm_widgets));
127 if (err) { 116 if (err) {
128 printk(KERN_ERR "%s: failed to add widgets (%d)\n", 117 printk(KERN_ERR "%s: failed to add widgets (%d)\n",
129 __func__, err); 118 __func__, err);
130 return err; 119 return err;
131 } 120 }
132 121
133 » snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 122 » snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
134 » snd_soc_dapm_sync(codec); 123 » snd_soc_dapm_sync(dapm);
135 124
136 return 0; 125 return 0;
137 } 126 }
138 127
139 static struct snd_soc_dai_link jive_dai = { 128 static struct snd_soc_dai_link jive_dai = {
140 .name = "wm8750", 129 .name = "wm8750",
141 .stream_name = "WM8750", 130 .stream_name = "WM8750",
142 .cpu_dai_name = "s3c2412-i2s", 131 .cpu_dai_name = "s3c2412-i2s",
143 .codec_dai_name = "wm8750-hifi", 132 .codec_dai_name = "wm8750-hifi",
144 » .platform_name» = "s3c24xx-pcm-audio", 133 » .platform_name» = "samsung-audio",
145 .codec_name = "wm8750-codec.0-0x1a", 134 .codec_name = "wm8750-codec.0-0x1a",
146 .init = jive_wm8750_init, 135 .init = jive_wm8750_init,
147 .ops = &jive_ops, 136 .ops = &jive_ops,
148 }; 137 };
149 138
150 /* jive audio machine driver */ 139 /* jive audio machine driver */
151 static struct snd_soc_card snd_soc_machine_jive = { 140 static struct snd_soc_card snd_soc_machine_jive = {
152 .name = "Jive", 141 .name = "Jive",
153 .dai_link = &jive_dai, 142 .dai_link = &jive_dai,
154 .num_links = 1, 143 .num_links = 1,
(...skipping 27 matching lines...) Expand all
182 { 171 {
183 platform_device_unregister(jive_snd_device); 172 platform_device_unregister(jive_snd_device);
184 } 173 }
185 174
186 module_init(jive_init); 175 module_init(jive_init);
187 module_exit(jive_exit); 176 module_exit(jive_exit);
188 177
189 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 178 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
190 MODULE_DESCRIPTION("ALSA SoC Jive Audio support"); 179 MODULE_DESCRIPTION("ALSA SoC Jive Audio support");
191 MODULE_LICENSE("GPL"); 180 MODULE_LICENSE("GPL");
OLDNEW
« no previous file with comments | « sound/soc/samsung/i2s.c ('k') | sound/soc/samsung/lm4857.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698