treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / sound / soc / samsung / s3c24xx_simtec_hermes.c
blobed0d1b8fa2d45ccb8486cd4fa442167485eae8e3
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 static const struct snd_soc_dapm_widget dapm_widgets[] = {
11 SND_SOC_DAPM_LINE("GSM Out", NULL),
12 SND_SOC_DAPM_LINE("GSM In", NULL),
13 SND_SOC_DAPM_LINE("Line In", NULL),
14 SND_SOC_DAPM_LINE("Line Out", NULL),
15 SND_SOC_DAPM_LINE("ZV", NULL),
16 SND_SOC_DAPM_MIC("Mic Jack", NULL),
17 SND_SOC_DAPM_HP("Headphone Jack", NULL),
20 static const struct snd_soc_dapm_route base_map[] = {
21 /* Headphone connected to HP{L,R}OUT and HP{L,R}COM */
23 { "Headphone Jack", NULL, "HPLOUT" },
24 { "Headphone Jack", NULL, "HPLCOM" },
25 { "Headphone Jack", NULL, "HPROUT" },
26 { "Headphone Jack", NULL, "HPRCOM" },
28 /* ZV connected to Line1 */
30 { "LINE1L", NULL, "ZV" },
31 { "LINE1R", NULL, "ZV" },
33 /* Line In connected to Line2 */
35 { "LINE2L", NULL, "Line In" },
36 { "LINE2R", NULL, "Line In" },
38 /* Microphone connected to MIC3R and MIC_BIAS */
40 { "MIC3L", NULL, "Mic Jack" },
42 /* GSM connected to MONO_LOUT and MIC3L (in) */
44 { "GSM Out", NULL, "MONO_LOUT" },
45 { "MIC3L", NULL, "GSM In" },
47 /* Speaker is connected to LINEOUT{LN,LP,RN,RP}, however we are
48 * not using the DAPM to power it up and down as there it makes
49 * a click when powering up. */
52 /**
53 * simtec_hermes_init - initialise and add controls
54 * @codec; The codec instance to attach to.
56 * Attach our controls and configure the necessary codec
57 * mappings for our sound card instance.
59 static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd)
61 simtec_audio_init(rtd);
63 return 0;
66 SND_SOC_DAILINK_DEFS(tlv320aic33,
67 DAILINK_COMP_ARRAY(COMP_CPU("s3c24xx-iis")),
68 DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.0-001a",
69 "tlv320aic3x-hifi")),
70 DAILINK_COMP_ARRAY(COMP_PLATFORM("s3c24xx-iis")));
72 static struct snd_soc_dai_link simtec_dai_aic33 = {
73 .name = "tlv320aic33",
74 .stream_name = "TLV320AIC33",
75 .init = simtec_hermes_init,
76 SND_SOC_DAILINK_REG(tlv320aic33),
79 /* simtec audio machine driver */
80 static struct snd_soc_card snd_soc_machine_simtec_aic33 = {
81 .name = "Simtec-Hermes",
82 .owner = THIS_MODULE,
83 .dai_link = &simtec_dai_aic33,
84 .num_links = 1,
86 .dapm_widgets = dapm_widgets,
87 .num_dapm_widgets = ARRAY_SIZE(dapm_widgets),
88 .dapm_routes = base_map,
89 .num_dapm_routes = ARRAY_SIZE(base_map),
92 static int simtec_audio_hermes_probe(struct platform_device *pd)
94 dev_info(&pd->dev, "probing....\n");
95 return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic33);
98 static struct platform_driver simtec_audio_hermes_platdrv = {
99 .driver = {
100 .name = "s3c24xx-simtec-hermes-snd",
101 .pm = simtec_audio_pm,
103 .probe = simtec_audio_hermes_probe,
104 .remove = simtec_audio_remove,
107 module_platform_driver(simtec_audio_hermes_platdrv);
109 MODULE_ALIAS("platform:s3c24xx-simtec-hermes-snd");
110 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
111 MODULE_DESCRIPTION("ALSA SoC Simtec Audio support");
112 MODULE_LICENSE("GPL");