19 #include <linux/module.h>
20 #include <linux/i2c.h>
30 #define GPIO_SPDIF_RESET (38)
31 #define GPIO_MCLK_RESET (111)
32 #define GPIO_CODEC_RESET (120)
39 #define MAX9485_MCLK_FREQ_112896 0x22
40 #define MAX9485_MCLK_FREQ_122880 0x23
41 #define MAX9485_MCLK_FREQ_225792 0x32
42 #define MAX9485_MCLK_FREQ_245760 0x33
44 static void set_max9485_clk(
char clk)
49 static void raumfeld_enable_audio(
bool en)
149 .startup = raumfeld_cs4270_startup,
150 .shutdown = raumfeld_cs4270_shutdown,
151 .hw_params = raumfeld_cs4270_hw_params,
156 raumfeld_enable_audio(
false);
162 raumfeld_enable_audio(
true);
174 int fmt, ret = 0, clk = 0;
225 .hw_params = raumfeld_ak4104_hw_params,
228 #define DAI_LINK_CS4270 \
231 .stream_name = "CS4270", \
232 .cpu_dai_name = "pxa-ssp-dai.0", \
233 .platform_name = "pxa-pcm-audio", \
234 .codec_dai_name = "cs4270-hifi", \
235 .codec_name = "cs4270.0-0048", \
236 .ops = &raumfeld_cs4270_ops, \
239 #define DAI_LINK_AK4104 \
242 .stream_name = "Playback", \
243 .cpu_dai_name = "pxa-ssp-dai.1", \
244 .codec_dai_name = "ak4104-hifi", \
245 .platform_name = "pxa-pcm-audio", \
246 .ops = &raumfeld_ak4104_ops, \
247 .codec_name = "spi0.0", \
261 static struct snd_soc_card snd_soc_raumfeld_connector = {
262 .name =
"Raumfeld Connector",
264 .dai_link = snd_soc_raumfeld_connector_dai,
265 .num_links =
ARRAY_SIZE(snd_soc_raumfeld_connector_dai),
266 .suspend_post = raumfeld_analog_suspend,
267 .resume_pre = raumfeld_analog_resume,
271 .name =
"Raumfeld Speaker",
273 .dai_link = snd_soc_raumfeld_speaker_dai,
274 .num_links =
ARRAY_SIZE(snd_soc_raumfeld_speaker_dai),
275 .suspend_post = raumfeld_analog_suspend,
276 .resume_pre = raumfeld_analog_resume,
281 static int __init raumfeld_audio_init(
void)
285 if (!machine_is_raumfeld_speaker() &&
286 !machine_is_raumfeld_connector())
290 &max9486_hwmon_info);
299 if (!raumfeld_audio_device)
302 if (machine_is_raumfeld_speaker())
303 platform_set_drvdata(raumfeld_audio_device,
304 &snd_soc_raumfeld_speaker);
306 if (machine_is_raumfeld_connector())
307 platform_set_drvdata(raumfeld_audio_device,
308 &snd_soc_raumfeld_connector);
316 raumfeld_enable_audio(
true);
320 static void __exit raumfeld_audio_exit(
void)
322 raumfeld_enable_audio(
false);