Commit | Line | Data |
---|---|---|
ff6e64da JB |
1 | /* |
2 | * smdk_wm9713.c -- SoC audio for SMDK | |
3 | * | |
4 | * Copyright 2010 Samsung Electronics Co. Ltd. | |
5 | * Author: Jaswinder Singh Brar <jassi.brar@samsung.com> | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU General Public License as | |
9 | * published by the Free Software Foundation; either version 2 of the | |
10 | * License, or (at your option) any later version. | |
11 | * | |
12 | */ | |
13 | ||
14 | #include <linux/module.h> | |
15 | #include <linux/device.h> | |
16 | #include <sound/soc.h> | |
17 | ||
18 | #include "../codecs/wm9713.h" | |
19 | #include "s3c-dma.h" | |
20 | #include "s3c-ac97.h" | |
21 | ||
22 | static struct snd_soc_card smdk; | |
23 | ||
583b2be6 MB |
24 | /* |
25 | * Default CFG switch settings to use this driver: | |
26 | * | |
27 | * SMDK6410: Set CFG1 1-3 On, CFG2 1-4 Off | |
3dedece4 | 28 | * SMDKC100: Set CFG6 1-3 On, CFG7 1 On |
583b2be6 MB |
29 | */ |
30 | ||
ff6e64da JB |
31 | /* |
32 | Playback (HeadPhone):- | |
9e9d04c0 JB |
33 | $ amixer sset 'Headphone' unmute |
34 | $ amixer sset 'Right Headphone Out Mux' 'Headphone' | |
35 | $ amixer sset 'Left Headphone Out Mux' 'Headphone' | |
36 | $ amixer sset 'Right HP Mixer PCM' unmute | |
37 | $ amixer sset 'Left HP Mixer PCM' unmute | |
ff6e64da JB |
38 | |
39 | Capture (LineIn):- | |
9e9d04c0 JB |
40 | $ amixer sset 'Right Capture Source' 'Line' |
41 | $ amixer sset 'Left Capture Source' 'Line' | |
ff6e64da JB |
42 | */ |
43 | ||
44 | static struct snd_soc_dai_link smdk_dai = { | |
45 | .name = "AC97", | |
46 | .stream_name = "AC97 PCM", | |
47 | .cpu_dai = &s3c_ac97_dai[S3C_AC97_DAI_PCM], | |
48 | .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI], | |
49 | }; | |
50 | ||
51 | static struct snd_soc_card smdk = { | |
52 | .name = "SMDK", | |
53 | .platform = &s3c24xx_soc_platform, | |
54 | .dai_link = &smdk_dai, | |
55 | .num_links = 1, | |
56 | }; | |
57 | ||
58 | static struct snd_soc_device smdk_snd_ac97_devdata = { | |
59 | .card = &smdk, | |
60 | .codec_dev = &soc_codec_dev_wm9713, | |
61 | }; | |
62 | ||
63 | static struct platform_device *smdk_snd_ac97_device; | |
64 | ||
65 | static int __init smdk_init(void) | |
66 | { | |
67 | int ret; | |
68 | ||
69 | smdk_snd_ac97_device = platform_device_alloc("soc-audio", -1); | |
70 | if (!smdk_snd_ac97_device) | |
71 | return -ENOMEM; | |
72 | ||
73 | platform_set_drvdata(smdk_snd_ac97_device, | |
74 | &smdk_snd_ac97_devdata); | |
75 | smdk_snd_ac97_devdata.dev = &smdk_snd_ac97_device->dev; | |
76 | ||
77 | ret = platform_device_add(smdk_snd_ac97_device); | |
78 | if (ret) | |
79 | platform_device_put(smdk_snd_ac97_device); | |
80 | ||
81 | return ret; | |
82 | } | |
83 | ||
84 | static void __exit smdk_exit(void) | |
85 | { | |
86 | platform_device_unregister(smdk_snd_ac97_device); | |
87 | } | |
88 | ||
89 | module_init(smdk_init); | |
90 | module_exit(smdk_exit); | |
91 | ||
92 | /* Module information */ | |
93 | MODULE_AUTHOR("Jaswinder Singh Brar, jassi.brar@samsung.com"); | |
94 | MODULE_DESCRIPTION("ALSA SoC SMDK+WM9713"); | |
95 | MODULE_LICENSE("GPL"); |