Jassi Brar | 5033f43 | 2010-11-22 15:37:25 +0900 | [diff] [blame] | 1 | /* sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 2 | * |
| 3 | * Copyright 2009 Simtec Electronics |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation. |
| 8 | */ |
| 9 | |
Paul Gortmaker | da155d5 | 2011-07-15 12:38:28 -0400 | [diff] [blame] | 10 | #include <linux/module.h> |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 11 | #include <sound/soc.h> |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 12 | |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 13 | #include "s3c24xx_simtec.h" |
| 14 | |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 15 | /* supported machines: |
| 16 | * |
| 17 | * Machine Connections AMP |
| 18 | * ------- ----------- --- |
| 19 | * BAST MIC, HPOUT, LOUT, LIN TPA2001D1 (HPOUTL,R) (gain hardwired) |
| 20 | * VR1000 HPOUT, LIN None |
| 21 | * VR2000 LIN, LOUT, MIC, HP LM4871 (HPOUTL,R) |
| 22 | * DePicture LIN, LOUT, MIC, HP LM4871 (HPOUTL,R) |
| 23 | * Anubis LIN, LOUT, MIC, HP TPA2001D1 (HPOUTL,R) |
| 24 | */ |
| 25 | |
| 26 | static const struct snd_soc_dapm_widget dapm_widgets[] = { |
| 27 | SND_SOC_DAPM_HP("Headphone Jack", NULL), |
| 28 | SND_SOC_DAPM_LINE("Line In", NULL), |
| 29 | SND_SOC_DAPM_LINE("Line Out", NULL), |
| 30 | SND_SOC_DAPM_MIC("Mic Jack", NULL), |
| 31 | }; |
| 32 | |
| 33 | static const struct snd_soc_dapm_route base_map[] = { |
| 34 | { "Headphone Jack", NULL, "LHPOUT"}, |
| 35 | { "Headphone Jack", NULL, "RHPOUT"}, |
| 36 | |
| 37 | { "Line Out", NULL, "LOUT" }, |
| 38 | { "Line Out", NULL, "ROUT" }, |
| 39 | |
| 40 | { "LLINEIN", NULL, "Line In"}, |
| 41 | { "RLINEIN", NULL, "Line In"}, |
| 42 | |
| 43 | { "MICIN", NULL, "Mic Jack"}, |
| 44 | }; |
| 45 | |
| 46 | /** |
| 47 | * simtec_tlv320aic23_init - initialise and add controls |
| 48 | * @codec; The codec instance to attach to. |
| 49 | * |
| 50 | * Attach our controls and configure the necessary codec |
| 51 | * mappings for our sound card instance. |
| 52 | */ |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 53 | static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 54 | { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 55 | simtec_audio_init(rtd); |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 56 | |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | static struct snd_soc_dai_link simtec_dai_aic23 = { |
| 61 | .name = "tlv320aic23", |
| 62 | .stream_name = "TLV320AIC23", |
Lars-Peter Clausen | 81d7da5 | 2011-01-24 22:09:22 +0100 | [diff] [blame] | 63 | .codec_name = "tlv320aic3x-codec.0-001a", |
Lars-Peter Clausen | 518aa59 | 2011-01-24 22:12:42 +0100 | [diff] [blame] | 64 | .cpu_dai_name = "s3c24xx-iis", |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 65 | .codec_dai_name = "tlv320aic3x-hifi", |
Padmavathi Venna | a08485d8 | 2012-12-07 13:59:21 +0530 | [diff] [blame] | 66 | .platform_name = "s3c24xx-iis", |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 67 | .init = simtec_tlv320aic23_init, |
| 68 | }; |
| 69 | |
| 70 | /* simtec audio machine driver */ |
| 71 | static struct snd_soc_card snd_soc_machine_simtec_aic23 = { |
| 72 | .name = "Simtec", |
Axel Lin | 095d79d | 2011-12-22 10:53:15 +0800 | [diff] [blame] | 73 | .owner = THIS_MODULE, |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 74 | .dai_link = &simtec_dai_aic23, |
| 75 | .num_links = 1, |
Mark Brown | 4f5448a | 2011-10-08 12:19:12 +0100 | [diff] [blame] | 76 | |
| 77 | .dapm_widgets = dapm_widgets, |
| 78 | .num_dapm_widgets = ARRAY_SIZE(dapm_widgets), |
| 79 | .dapm_routes = base_map, |
| 80 | .num_dapm_routes = ARRAY_SIZE(base_map), |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 81 | }; |
| 82 | |
Bill Pemberton | fdca21a | 2012-12-07 09:26:15 -0500 | [diff] [blame] | 83 | static int simtec_audio_tlv320aic23_probe(struct platform_device *pd) |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 84 | { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 85 | return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic23); |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 86 | } |
| 87 | |
Axel Lin | c1496b4 | 2011-12-07 18:04:10 +0800 | [diff] [blame] | 88 | static struct platform_driver simtec_audio_tlv320aic23_driver = { |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 89 | .driver = { |
| 90 | .owner = THIS_MODULE, |
| 91 | .name = "s3c24xx-simtec-tlv320aic23", |
| 92 | .pm = simtec_audio_pm, |
| 93 | }, |
| 94 | .probe = simtec_audio_tlv320aic23_probe, |
Bill Pemberton | fdca21a | 2012-12-07 09:26:15 -0500 | [diff] [blame] | 95 | .remove = simtec_audio_remove, |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 96 | }; |
| 97 | |
Axel Lin | c1496b4 | 2011-12-07 18:04:10 +0800 | [diff] [blame] | 98 | module_platform_driver(simtec_audio_tlv320aic23_driver); |
Mark Brown | e00c3f5 | 2011-11-23 15:20:13 +0000 | [diff] [blame] | 99 | |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 100 | MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23"); |
Ben Dooks | 14412ac | 2009-08-20 22:50:40 +0100 | [diff] [blame] | 101 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); |
| 102 | MODULE_DESCRIPTION("ALSA SoC Simtec Audio support"); |
| 103 | MODULE_LICENSE("GPL"); |