| OLD | NEW |
| 1 /* sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c | 1 /* sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c |
| 2 * | 2 * |
| 3 * Copyright 2009 Simtec Electronics | 3 * Copyright 2009 Simtec Electronics |
| 4 * | 4 * |
| 5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #include <linux/module.h> | 10 #include <sound/soc.h> |
| 11 #include <linux/clk.h> | |
| 12 #include <linux/platform_device.h> | |
| 13 | 11 |
| 14 #include <sound/core.h> | |
| 15 #include <sound/pcm.h> | |
| 16 #include <sound/soc.h> | |
| 17 #include <sound/soc-dapm.h> | |
| 18 | |
| 19 #include <plat/audio-simtec.h> | |
| 20 | |
| 21 #include "s3c-dma.h" | |
| 22 #include "s3c24xx-i2s.h" | |
| 23 #include "s3c24xx_simtec.h" | 12 #include "s3c24xx_simtec.h" |
| 24 | 13 |
| 25 #include "../codecs/tlv320aic23.h" | |
| 26 | |
| 27 /* supported machines: | 14 /* supported machines: |
| 28 * | 15 * |
| 29 * Machine Connections AMP | 16 * Machine Connections AMP |
| 30 * ------- ----------- --- | 17 * ------- ----------- --- |
| 31 * BAST MIC, HPOUT, LOUT, LIN TPA2001D1 (HPOUTL,R) (gain hardwired) | 18 * BAST MIC, HPOUT, LOUT, LIN TPA2001D1 (HPOUTL,R) (gain hardwired) |
| 32 * VR1000 HPOUT, LIN None | 19 * VR1000 HPOUT, LIN None |
| 33 * VR2000 LIN, LOUT, MIC, HP LM4871 (HPOUTL,R) | 20 * VR2000 LIN, LOUT, MIC, HP LM4871 (HPOUTL,R) |
| 34 * DePicture LIN, LOUT, MIC, HP LM4871 (HPOUTL,R) | 21 * DePicture LIN, LOUT, MIC, HP LM4871 (HPOUTL,R) |
| 35 * Anubis LIN, LOUT, MIC, HP TPA2001D1 (HPOUTL,R) | 22 * Anubis LIN, LOUT, MIC, HP TPA2001D1 (HPOUTL,R) |
| 36 */ | 23 */ |
| (...skipping 21 matching lines...) Expand all Loading... |
| 58 /** | 45 /** |
| 59 * simtec_tlv320aic23_init - initialise and add controls | 46 * simtec_tlv320aic23_init - initialise and add controls |
| 60 * @codec; The codec instance to attach to. | 47 * @codec; The codec instance to attach to. |
| 61 * | 48 * |
| 62 * Attach our controls and configure the necessary codec | 49 * Attach our controls and configure the necessary codec |
| 63 * mappings for our sound card instance. | 50 * mappings for our sound card instance. |
| 64 */ | 51 */ |
| 65 static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) | 52 static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd) |
| 66 { | 53 { |
| 67 struct snd_soc_codec *codec = rtd->codec; | 54 struct snd_soc_codec *codec = rtd->codec; |
| 55 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 68 | 56 |
| 69 » snd_soc_dapm_new_controls(codec, dapm_widgets, | 57 » snd_soc_dapm_new_controls(dapm, dapm_widgets, |
| 70 ARRAY_SIZE(dapm_widgets)); | 58 ARRAY_SIZE(dapm_widgets)); |
| 71 | 59 |
| 72 » snd_soc_dapm_add_routes(codec, base_map, ARRAY_SIZE(base_map)); | 60 » snd_soc_dapm_add_routes(dapm, base_map, ARRAY_SIZE(base_map)); |
| 73 | 61 |
| 74 » snd_soc_dapm_enable_pin(codec, "Headphone Jack"); | 62 » snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); |
| 75 » snd_soc_dapm_enable_pin(codec, "Line In"); | 63 » snd_soc_dapm_enable_pin(dapm, "Line In"); |
| 76 » snd_soc_dapm_enable_pin(codec, "Line Out"); | 64 » snd_soc_dapm_enable_pin(dapm, "Line Out"); |
| 77 » snd_soc_dapm_enable_pin(codec, "Mic Jack"); | 65 » snd_soc_dapm_enable_pin(dapm, "Mic Jack"); |
| 78 | 66 |
| 79 simtec_audio_init(rtd); | 67 simtec_audio_init(rtd); |
| 80 » snd_soc_dapm_sync(codec); | 68 » snd_soc_dapm_sync(dapm); |
| 81 | 69 |
| 82 return 0; | 70 return 0; |
| 83 } | 71 } |
| 84 | 72 |
| 85 static struct snd_soc_dai_link simtec_dai_aic23 = { | 73 static struct snd_soc_dai_link simtec_dai_aic23 = { |
| 86 .name = "tlv320aic23", | 74 .name = "tlv320aic23", |
| 87 .stream_name = "TLV320AIC23", | 75 .stream_name = "TLV320AIC23", |
| 88 » .codec_name» = "tlv320aic3x-codec.0-0x1a", | 76 » .codec_name» = "tlv320aic3x-codec.0-001a", |
| 89 » .cpu_dai_name» = "s3c24xx-i2s", | 77 » .cpu_dai_name» = "s3c24xx-iis", |
| 90 .codec_dai_name = "tlv320aic3x-hifi", | 78 .codec_dai_name = "tlv320aic3x-hifi", |
| 91 » .platform_name» = "s3c24xx-pcm-audio", | 79 » .platform_name» = "samsung-audio", |
| 92 .init = simtec_tlv320aic23_init, | 80 .init = simtec_tlv320aic23_init, |
| 93 }; | 81 }; |
| 94 | 82 |
| 95 /* simtec audio machine driver */ | 83 /* simtec audio machine driver */ |
| 96 static struct snd_soc_card snd_soc_machine_simtec_aic23 = { | 84 static struct snd_soc_card snd_soc_machine_simtec_aic23 = { |
| 97 .name = "Simtec", | 85 .name = "Simtec", |
| 98 .dai_link = &simtec_dai_aic23, | 86 .dai_link = &simtec_dai_aic23, |
| 99 .num_links = 1, | 87 .num_links = 1, |
| 100 }; | 88 }; |
| 101 | 89 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 125 { | 113 { |
| 126 platform_driver_unregister(&simtec_audio_tlv320aic23_platdrv); | 114 platform_driver_unregister(&simtec_audio_tlv320aic23_platdrv); |
| 127 } | 115 } |
| 128 | 116 |
| 129 module_init(simtec_tlv320aic23_modinit); | 117 module_init(simtec_tlv320aic23_modinit); |
| 130 module_exit(simtec_tlv320aic23_modexit); | 118 module_exit(simtec_tlv320aic23_modexit); |
| 131 | 119 |
| 132 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | 120 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); |
| 133 MODULE_DESCRIPTION("ALSA SoC Simtec Audio support"); | 121 MODULE_DESCRIPTION("ALSA SoC Simtec Audio support"); |
| 134 MODULE_LICENSE("GPL"); | 122 MODULE_LICENSE("GPL"); |
| OLD | NEW |