Jassi Brar | ff6e64d | 2010-01-27 14:59:19 +0900 | [diff] [blame] | 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 | |
| 24 | /* |
Mark Brown | 583b2be | 2010-01-27 20:54:13 +0000 | [diff] [blame^] | 25 | * Default CFG switch settings to use this driver: |
| 26 | * |
| 27 | * SMDK6410: Set CFG1 1-3 On, CFG2 1-4 Off |
| 28 | */ |
| 29 | |
| 30 | /* |
Jassi Brar | ff6e64d | 2010-01-27 14:59:19 +0900 | [diff] [blame] | 31 | Playback (HeadPhone):- |
| 32 | Headphone Playback Switch - On |
| 33 | $ amixer cset numid=4 1 |
| 34 | |
| 35 | Right Headphone Out Mux - Headphone |
| 36 | $ amixer cset numid=92 2 |
| 37 | Left Headphone Out Mux - Headphone |
| 38 | $ amixer cset numid=93 2 |
| 39 | |
| 40 | Right HP Mixer PCM Playback Switch - On |
| 41 | $ amixer cset numid=75 1 |
| 42 | Left HP Mixer PCM Playback Switch - On |
| 43 | $ amixer cset numid=81 1 |
| 44 | |
| 45 | Capture (LineIn):- |
| 46 | Right Capture Source - Line |
| 47 | $ amixer cset numid=86 2 |
| 48 | Left Capture Source - Line |
| 49 | $ amixer cset numid=87 2 |
| 50 | */ |
| 51 | |
| 52 | static struct snd_soc_dai_link smdk_dai = { |
| 53 | .name = "AC97", |
| 54 | .stream_name = "AC97 PCM", |
| 55 | .cpu_dai = &s3c_ac97_dai[S3C_AC97_DAI_PCM], |
| 56 | .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI], |
| 57 | }; |
| 58 | |
| 59 | static struct snd_soc_card smdk = { |
| 60 | .name = "SMDK", |
| 61 | .platform = &s3c24xx_soc_platform, |
| 62 | .dai_link = &smdk_dai, |
| 63 | .num_links = 1, |
| 64 | }; |
| 65 | |
| 66 | static struct snd_soc_device smdk_snd_ac97_devdata = { |
| 67 | .card = &smdk, |
| 68 | .codec_dev = &soc_codec_dev_wm9713, |
| 69 | }; |
| 70 | |
| 71 | static struct platform_device *smdk_snd_ac97_device; |
| 72 | |
| 73 | static int __init smdk_init(void) |
| 74 | { |
| 75 | int ret; |
| 76 | |
| 77 | smdk_snd_ac97_device = platform_device_alloc("soc-audio", -1); |
| 78 | if (!smdk_snd_ac97_device) |
| 79 | return -ENOMEM; |
| 80 | |
| 81 | platform_set_drvdata(smdk_snd_ac97_device, |
| 82 | &smdk_snd_ac97_devdata); |
| 83 | smdk_snd_ac97_devdata.dev = &smdk_snd_ac97_device->dev; |
| 84 | |
| 85 | ret = platform_device_add(smdk_snd_ac97_device); |
| 86 | if (ret) |
| 87 | platform_device_put(smdk_snd_ac97_device); |
| 88 | |
| 89 | return ret; |
| 90 | } |
| 91 | |
| 92 | static void __exit smdk_exit(void) |
| 93 | { |
| 94 | platform_device_unregister(smdk_snd_ac97_device); |
| 95 | } |
| 96 | |
| 97 | module_init(smdk_init); |
| 98 | module_exit(smdk_exit); |
| 99 | |
| 100 | /* Module information */ |
| 101 | MODULE_AUTHOR("Jaswinder Singh Brar, jassi.brar@samsung.com"); |
| 102 | MODULE_DESCRIPTION("ALSA SoC SMDK+WM9713"); |
| 103 | MODULE_LICENSE("GPL"); |