treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / sound / soc / samsung / s3c24xx_simtec_tlv320aic23.c
blobc03d52990267b94629021f345e6a55dbce7ca96c
1 // SPDX-License-Identifier: GPL-2.0
2 //
3 // Copyright 2009 Simtec Electronics
5 #include <linux/module.h>
6 #include <sound/soc.h>
8 #include "s3c24xx_simtec.h"
10 /* supported machines:
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)
21 static 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),
28 static const struct snd_soc_dapm_route base_map[] = {
29 { "Headphone Jack", NULL, "LHPOUT"},
30 { "Headphone Jack", NULL, "RHPOUT"},
32 { "Line Out", NULL, "LOUT" },
33 { "Line Out", NULL, "ROUT" },
35 { "LLINEIN", NULL, "Line In"},
36 { "RLINEIN", NULL, "Line In"},
38 { "MICIN", NULL, "Mic Jack"},
41 /**
42 * simtec_tlv320aic23_init - initialise and add controls
43 * @codec; The codec instance to attach to.
45 * Attach our controls and configure the necessary codec
46 * mappings for our sound card instance.
48 static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
50 simtec_audio_init(rtd);
52 return 0;
55 SND_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")));
61 static struct snd_soc_dai_link simtec_dai_aic23 = {
62 .name = "tlv320aic23",
63 .stream_name = "TLV320AIC23",
64 .init = simtec_tlv320aic23_init,
65 SND_SOC_DAILINK_REG(tlv320aic23),
68 /* simtec audio machine driver */
69 static struct snd_soc_card snd_soc_machine_simtec_aic23 = {
70 .name = "Simtec",
71 .owner = THIS_MODULE,
72 .dai_link = &simtec_dai_aic23,
73 .num_links = 1,
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),
81 static int simtec_audio_tlv320aic23_probe(struct platform_device *pd)
83 return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic23);
86 static struct platform_driver simtec_audio_tlv320aic23_driver = {
87 .driver = {
88 .name = "s3c24xx-simtec-tlv320aic23",
89 .pm = simtec_audio_pm,
91 .probe = simtec_audio_tlv320aic23_probe,
92 .remove = simtec_audio_remove,
95 module_platform_driver(simtec_audio_tlv320aic23_driver);
97 MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23");
98 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
99 MODULE_DESCRIPTION("ALSA SoC Simtec Audio support");
100 MODULE_LICENSE("GPL");