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):- |
Jassi Brar | 9e9d04c0 | 2010-01-29 10:57:07 +0900 | [diff] [blame^] | 32 | $ amixer sset 'Headphone' unmute |
| 33 | $ amixer sset 'Right Headphone Out Mux' 'Headphone' |
| 34 | $ amixer sset 'Left Headphone Out Mux' 'Headphone' |
| 35 | $ amixer sset 'Right HP Mixer PCM' unmute |
| 36 | $ amixer sset 'Left HP Mixer PCM' unmute |
Jassi Brar | ff6e64d | 2010-01-27 14:59:19 +0900 | [diff] [blame] | 37 | |
| 38 | Capture (LineIn):- |
Jassi Brar | 9e9d04c0 | 2010-01-29 10:57:07 +0900 | [diff] [blame^] | 39 | $ amixer sset 'Right Capture Source' 'Line' |
| 40 | $ amixer sset 'Left Capture Source' 'Line' |
Jassi Brar | ff6e64d | 2010-01-27 14:59:19 +0900 | [diff] [blame] | 41 | */ |
| 42 | |
| 43 | static struct snd_soc_dai_link smdk_dai = { |
| 44 | .name = "AC97", |
| 45 | .stream_name = "AC97 PCM", |
| 46 | .cpu_dai = &s3c_ac97_dai[S3C_AC97_DAI_PCM], |
| 47 | .codec_dai = &wm9713_dai[WM9713_DAI_AC97_HIFI], |
| 48 | }; |
| 49 | |
| 50 | static struct snd_soc_card smdk = { |
| 51 | .name = "SMDK", |
| 52 | .platform = &s3c24xx_soc_platform, |
| 53 | .dai_link = &smdk_dai, |
| 54 | .num_links = 1, |
| 55 | }; |
| 56 | |
| 57 | static struct snd_soc_device smdk_snd_ac97_devdata = { |
| 58 | .card = &smdk, |
| 59 | .codec_dev = &soc_codec_dev_wm9713, |
| 60 | }; |
| 61 | |
| 62 | static struct platform_device *smdk_snd_ac97_device; |
| 63 | |
| 64 | static int __init smdk_init(void) |
| 65 | { |
| 66 | int ret; |
| 67 | |
| 68 | smdk_snd_ac97_device = platform_device_alloc("soc-audio", -1); |
| 69 | if (!smdk_snd_ac97_device) |
| 70 | return -ENOMEM; |
| 71 | |
| 72 | platform_set_drvdata(smdk_snd_ac97_device, |
| 73 | &smdk_snd_ac97_devdata); |
| 74 | smdk_snd_ac97_devdata.dev = &smdk_snd_ac97_device->dev; |
| 75 | |
| 76 | ret = platform_device_add(smdk_snd_ac97_device); |
| 77 | if (ret) |
| 78 | platform_device_put(smdk_snd_ac97_device); |
| 79 | |
| 80 | return ret; |
| 81 | } |
| 82 | |
| 83 | static void __exit smdk_exit(void) |
| 84 | { |
| 85 | platform_device_unregister(smdk_snd_ac97_device); |
| 86 | } |
| 87 | |
| 88 | module_init(smdk_init); |
| 89 | module_exit(smdk_exit); |
| 90 | |
| 91 | /* Module information */ |
| 92 | MODULE_AUTHOR("Jaswinder Singh Brar, jassi.brar@samsung.com"); |
| 93 | MODULE_DESCRIPTION("ALSA SoC SMDK+WM9713"); |
| 94 | MODULE_LICENSE("GPL"); |