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

Side by Side Diff: sound/soc/atmel/snd-soc-afeb9260.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/atmel/sam9g20_wm8731.c ('k') | sound/soc/au1x/db1200.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 * afeb9260.c -- SoC audio for AFEB9260 2 * afeb9260.c -- SoC audio for AFEB9260
3 * 3 *
4 * Copyright (C) 2009 Sergey Lapin <slapin@ossfans.org> 4 * Copyright (C) 2009 Sergey Lapin <slapin@ossfans.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or 6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation. 8 * version 2 as published by the Free Software Foundation.
9 * 9 *
10 * This program is distributed in the hope that it will be useful, but 10 * This program is distributed in the hope that it will be useful, but
(...skipping 12 matching lines...) Expand all
23 #include <linux/moduleparam.h> 23 #include <linux/moduleparam.h>
24 #include <linux/kernel.h> 24 #include <linux/kernel.h>
25 #include <linux/clk.h> 25 #include <linux/clk.h>
26 #include <linux/platform_device.h> 26 #include <linux/platform_device.h>
27 27
28 #include <linux/atmel-ssc.h> 28 #include <linux/atmel-ssc.h>
29 #include <sound/core.h> 29 #include <sound/core.h>
30 #include <sound/pcm.h> 30 #include <sound/pcm.h>
31 #include <sound/pcm_params.h> 31 #include <sound/pcm_params.h>
32 #include <sound/soc.h> 32 #include <sound/soc.h>
33 #include <sound/soc-dapm.h>
34 33
35 #include <asm/mach-types.h> 34 #include <asm/mach-types.h>
36 #include <mach/hardware.h> 35 #include <mach/hardware.h>
37 #include <linux/gpio.h> 36 #include <linux/gpio.h>
38 37
39 #include "../codecs/tlv320aic23.h" 38 #include "../codecs/tlv320aic23.h"
40 #include "atmel-pcm.h" 39 #include "atmel-pcm.h"
41 #include "atmel_ssc_dai.h" 40 #include "atmel_ssc_dai.h"
42 41
43 #define CODEC_CLOCK 12000000 42 #define CODEC_CLOCK 12000000
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 97
99 {"LLINEIN", NULL, "Line In"}, 98 {"LLINEIN", NULL, "Line In"},
100 {"RLINEIN", NULL, "Line In"}, 99 {"RLINEIN", NULL, "Line In"},
101 100
102 {"MICIN", NULL, "Mic Jack"}, 101 {"MICIN", NULL, "Mic Jack"},
103 }; 102 };
104 103
105 static int afeb9260_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) 104 static int afeb9260_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
106 { 105 {
107 struct snd_soc_codec *codec = rtd->codec; 106 struct snd_soc_codec *codec = rtd->codec;
107 struct snd_soc_dapm_context *dapm = &codec->dapm;
108 108
109 /* Add afeb9260 specific widgets */ 109 /* Add afeb9260 specific widgets */
110 » snd_soc_dapm_new_controls(codec, tlv320aic23_dapm_widgets, 110 » snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
111 ARRAY_SIZE(tlv320aic23_dapm_widgets)); 111 ARRAY_SIZE(tlv320aic23_dapm_widgets));
112 112
113 /* Set up afeb9260 specific audio path audio_map */ 113 /* Set up afeb9260 specific audio path audio_map */
114 » snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 114 » snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
115 115
116 » snd_soc_dapm_enable_pin(codec, "Headphone Jack"); 116 » snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
117 » snd_soc_dapm_enable_pin(codec, "Line In"); 117 » snd_soc_dapm_enable_pin(dapm, "Line In");
118 » snd_soc_dapm_enable_pin(codec, "Mic Jack"); 118 » snd_soc_dapm_enable_pin(dapm, "Mic Jack");
119 119
120 » snd_soc_dapm_sync(codec); 120 » snd_soc_dapm_sync(dapm);
121 121
122 return 0; 122 return 0;
123 } 123 }
124 124
125 /* Digital audio interface glue - connects codec <--> CPU */ 125 /* Digital audio interface glue - connects codec <--> CPU */
126 static struct snd_soc_dai_link afeb9260_dai = { 126 static struct snd_soc_dai_link afeb9260_dai = {
127 .name = "TLV320AIC23", 127 .name = "TLV320AIC23",
128 .stream_name = "AIC23", 128 .stream_name = "AIC23",
129 .cpu_dai_name = "atmel-ssc-dai.0", 129 .cpu_dai_name = "atmel-ssc-dai.0",
130 .codec_dai_name = "tlv320aic23-hifi", 130 .codec_dai_name = "tlv320aic23-hifi",
131 .platform_name = "atmel_pcm-audio", 131 .platform_name = "atmel_pcm-audio",
132 » .codec_name = "tlv320aic23-codec.0-0x1a", 132 » .codec_name = "tlv320aic23-codec.0-001a",
133 .init = afeb9260_tlv320aic23_init, 133 .init = afeb9260_tlv320aic23_init,
134 .ops = &afeb9260_ops, 134 .ops = &afeb9260_ops,
135 }; 135 };
136 136
137 /* Audio machine driver */ 137 /* Audio machine driver */
138 static struct snd_soc_card snd_soc_machine_afeb9260 = { 138 static struct snd_soc_card snd_soc_machine_afeb9260 = {
139 .name = "AFEB9260", 139 .name = "AFEB9260",
140 .dai_link = &afeb9260_dai, 140 .dai_link = &afeb9260_dai,
141 .num_links = 1, 141 .num_links = 1,
142 }; 142 };
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 platform_device_unregister(afeb9260_snd_device); 176 platform_device_unregister(afeb9260_snd_device);
177 } 177 }
178 178
179 module_init(afeb9260_soc_init); 179 module_init(afeb9260_soc_init);
180 module_exit(afeb9260_soc_exit); 180 module_exit(afeb9260_soc_exit);
181 181
182 MODULE_AUTHOR("Sergey Lapin <slapin@ossfans.org>"); 182 MODULE_AUTHOR("Sergey Lapin <slapin@ossfans.org>");
183 MODULE_DESCRIPTION("ALSA SoC for AFEB9260"); 183 MODULE_DESCRIPTION("ALSA SoC for AFEB9260");
184 MODULE_LICENSE("GPL"); 184 MODULE_LICENSE("GPL");
185 185
OLDNEW
« no previous file with comments | « sound/soc/atmel/sam9g20_wm8731.c ('k') | sound/soc/au1x/db1200.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698