]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
UBUNTU: Ubuntu-5.11.0-22.23
[mirror_ubuntu-hirsute-kernel.git] / sound / soc / samsung / s3c24xx_simtec_tlv320aic23.c
CommitLineData
ac64529d
SN
1// SPDX-License-Identifier: GPL-2.0
2//
3// Copyright 2009 Simtec Electronics
14412acd 4
da155d5b 5#include <linux/module.h>
14412acd 6#include <sound/soc.h>
14412acd 7
14412acd
BD
8#include "s3c24xx_simtec.h"
9
14412acd
BD
10/* supported machines:
11 *
12 * Machine Connections AMP
13 * ------- ----------- ---
14 * BAST MIC, HPOUT, LOUT, LIN TPA2001D1 (HPOUTL,R) (gain hardwired)
15 * VR1000 HPOUT, LIN None
16 * VR2000 LIN, LOUT, MIC, HP LM4871 (HPOUTL,R)
17 * DePicture LIN, LOUT, MIC, HP LM4871 (HPOUTL,R)
18 * Anubis LIN, LOUT, MIC, HP TPA2001D1 (HPOUTL,R)
19 */
20
21static const struct snd_soc_dapm_widget dapm_widgets[] = {
22 SND_SOC_DAPM_HP("Headphone Jack", NULL),
23 SND_SOC_DAPM_LINE("Line In", NULL),
24 SND_SOC_DAPM_LINE("Line Out", NULL),
25 SND_SOC_DAPM_MIC("Mic Jack", NULL),
26};
27
28static const struct snd_soc_dapm_route base_map[] = {
29 { "Headphone Jack", NULL, "LHPOUT"},
30 { "Headphone Jack", NULL, "RHPOUT"},
31
32 { "Line Out", NULL, "LOUT" },
33 { "Line Out", NULL, "ROUT" },
34
35 { "LLINEIN", NULL, "Line In"},
36 { "RLINEIN", NULL, "Line In"},
37
38 { "MICIN", NULL, "Mic Jack"},
39};
40
41/**
42 * simtec_tlv320aic23_init - initialise and add controls
43 * @codec; The codec instance to attach to.
44 *
45 * Attach our controls and configure the necessary codec
46 * mappings for our sound card instance.
47*/
f0fba2ad 48static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
14412acd 49{
f0fba2ad 50 simtec_audio_init(rtd);
14412acd
BD
51
52 return 0;
53}
54
fba1384c
KM
55SND_SOC_DAILINK_DEFS(tlv320aic23,
56 DAILINK_COMP_ARRAY(COMP_CPU("s3c24xx-iis")),
57 DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.0-001a",
58 "tlv320aic3x-hifi")),
59 DAILINK_COMP_ARRAY(COMP_PLATFORM("s3c24xx-iis")));
60
14412acd
BD
61static struct snd_soc_dai_link simtec_dai_aic23 = {
62 .name = "tlv320aic23",
63 .stream_name = "TLV320AIC23",
14412acd 64 .init = simtec_tlv320aic23_init,
fba1384c 65 SND_SOC_DAILINK_REG(tlv320aic23),
14412acd
BD
66};
67
68/* simtec audio machine driver */
69static struct snd_soc_card snd_soc_machine_simtec_aic23 = {
70 .name = "Simtec",
095d79dc 71 .owner = THIS_MODULE,
14412acd
BD
72 .dai_link = &simtec_dai_aic23,
73 .num_links = 1,
4f5448ae
MB
74
75 .dapm_widgets = dapm_widgets,
76 .num_dapm_widgets = ARRAY_SIZE(dapm_widgets),
77 .dapm_routes = base_map,
78 .num_dapm_routes = ARRAY_SIZE(base_map),
14412acd
BD
79};
80
fdca21ad 81static int simtec_audio_tlv320aic23_probe(struct platform_device *pd)
14412acd 82{
f0fba2ad 83 return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic23);
14412acd
BD
84}
85
c1496b4a 86static struct platform_driver simtec_audio_tlv320aic23_driver = {
14412acd 87 .driver = {
14412acd
BD
88 .name = "s3c24xx-simtec-tlv320aic23",
89 .pm = simtec_audio_pm,
90 },
91 .probe = simtec_audio_tlv320aic23_probe,
fdca21ad 92 .remove = simtec_audio_remove,
14412acd
BD
93};
94
c1496b4a 95module_platform_driver(simtec_audio_tlv320aic23_driver);
14412acd 96
e00c3f55 97MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23");
14412acd
BD
98MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
99MODULE_DESCRIPTION("ALSA SoC Simtec Audio support");
100MODULE_LICENSE("GPL");