Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 2 | /* |
| 3 | * ASoC driver for TI DAVINCI EVM platform |
| 4 | * |
Vladimir Barinov | d6b5203 | 2008-09-29 23:14:11 +0400 | [diff] [blame] | 5 | * Author: Vladimir Barinov, <vbarinov@embeddedalley.com> |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 6 | * Copyright: (C) 2007 MontaVista Software, Inc., <source@mvista.com> |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <linux/module.h> |
| 10 | #include <linux/moduleparam.h> |
| 11 | #include <linux/timer.h> |
| 12 | #include <linux/interrupt.h> |
| 13 | #include <linux/platform_device.h> |
Ben Dooks | aa6b904 | 2009-08-20 22:50:42 +0100 | [diff] [blame] | 14 | #include <linux/i2c.h> |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 15 | #include <linux/of_platform.h> |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 16 | #include <linux/clk.h> |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 17 | #include <sound/core.h> |
| 18 | #include <sound/pcm.h> |
| 19 | #include <sound/soc.h> |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 20 | |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 21 | #include <asm/dma.h> |
David Brownell | f492ec9 | 2009-05-14 13:01:59 -0700 | [diff] [blame] | 22 | #include <asm/mach-types.h> |
| 23 | |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 24 | struct snd_soc_card_drvdata_davinci { |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 25 | struct clk *mclk; |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 26 | unsigned sysclk; |
| 27 | }; |
| 28 | |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 29 | static int evm_startup(struct snd_pcm_substream *substream) |
| 30 | { |
| 31 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
Lars-Peter Clausen | 2896b8b | 2014-05-19 11:41:47 +0200 | [diff] [blame] | 32 | struct snd_soc_card *soc_card = rtd->card; |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 33 | struct snd_soc_card_drvdata_davinci *drvdata = |
| 34 | snd_soc_card_get_drvdata(soc_card); |
| 35 | |
| 36 | if (drvdata->mclk) |
| 37 | return clk_prepare_enable(drvdata->mclk); |
| 38 | |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | static void evm_shutdown(struct snd_pcm_substream *substream) |
| 43 | { |
| 44 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
Lars-Peter Clausen | 2896b8b | 2014-05-19 11:41:47 +0200 | [diff] [blame] | 45 | struct snd_soc_card *soc_card = rtd->card; |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 46 | struct snd_soc_card_drvdata_davinci *drvdata = |
| 47 | snd_soc_card_get_drvdata(soc_card); |
| 48 | |
| 49 | if (drvdata->mclk) |
| 50 | clk_disable_unprepare(drvdata->mclk); |
| 51 | } |
| 52 | |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 53 | static int evm_hw_params(struct snd_pcm_substream *substream, |
| 54 | struct snd_pcm_hw_params *params) |
| 55 | { |
| 56 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
Kuninori Morimoto | 2842b87 | 2020-03-23 14:21:14 +0900 | [diff] [blame^] | 57 | struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
| 58 | struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
Lars-Peter Clausen | 2896b8b | 2014-05-19 11:41:47 +0200 | [diff] [blame] | 59 | struct snd_soc_card *soc_card = rtd->card; |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 60 | int ret = 0; |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 61 | unsigned sysclk = ((struct snd_soc_card_drvdata_davinci *) |
| 62 | snd_soc_card_get_drvdata(soc_card))->sysclk; |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 63 | |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 64 | /* set the codec system clock */ |
David Brownell | 05d5e99 | 2009-01-04 02:50:10 -0800 | [diff] [blame] | 65 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, sysclk, SND_SOC_CLOCK_OUT); |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 66 | if (ret < 0) |
| 67 | return ret; |
| 68 | |
Daniel Mack | 5b66aa2 | 2012-10-04 15:08:41 +0200 | [diff] [blame] | 69 | /* set the CPU system clock */ |
| 70 | ret = snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_OUT); |
Peter Ujfalusi | 69f3405 | 2019-08-30 13:38:41 +0300 | [diff] [blame] | 71 | if (ret < 0 && ret != -ENOTSUPP) |
Daniel Mack | 5b66aa2 | 2012-10-04 15:08:41 +0200 | [diff] [blame] | 72 | return ret; |
| 73 | |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | static struct snd_soc_ops evm_ops = { |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 78 | .startup = evm_startup, |
| 79 | .shutdown = evm_shutdown, |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 80 | .hw_params = evm_hw_params, |
| 81 | }; |
| 82 | |
| 83 | /* davinci-evm machine dapm widgets */ |
| 84 | static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = { |
| 85 | SND_SOC_DAPM_HP("Headphone Jack", NULL), |
| 86 | SND_SOC_DAPM_LINE("Line Out", NULL), |
| 87 | SND_SOC_DAPM_MIC("Mic Jack", NULL), |
| 88 | SND_SOC_DAPM_LINE("Line In", NULL), |
| 89 | }; |
| 90 | |
| 91 | /* davinci-evm machine audio_mapnections to the codec pins */ |
Mark Brown | acf497f | 2008-05-13 14:58:30 +0200 | [diff] [blame] | 92 | static const struct snd_soc_dapm_route audio_map[] = { |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 93 | /* Headphone connected to HPLOUT, HPROUT */ |
| 94 | {"Headphone Jack", NULL, "HPLOUT"}, |
| 95 | {"Headphone Jack", NULL, "HPROUT"}, |
| 96 | |
| 97 | /* Line Out connected to LLOUT, RLOUT */ |
| 98 | {"Line Out", NULL, "LLOUT"}, |
| 99 | {"Line Out", NULL, "RLOUT"}, |
| 100 | |
| 101 | /* Mic connected to (MIC3L | MIC3R) */ |
Hebbar Gururaja | e2e8bfd | 2013-01-31 18:23:04 +0530 | [diff] [blame] | 102 | {"MIC3L", NULL, "Mic Bias"}, |
| 103 | {"MIC3R", NULL, "Mic Bias"}, |
| 104 | {"Mic Bias", NULL, "Mic Jack"}, |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 105 | |
| 106 | /* Line In connected to (LINE1L | LINE2L), (LINE1R | LINE2R) */ |
| 107 | {"LINE1L", NULL, "Line In"}, |
| 108 | {"LINE2L", NULL, "Line In"}, |
| 109 | {"LINE1R", NULL, "Line In"}, |
| 110 | {"LINE2R", NULL, "Line In"}, |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 111 | }; |
| 112 | |
| 113 | /* Logic for a aic3x as connected on a davinci-evm */ |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 114 | static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd) |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 115 | { |
Lars-Peter Clausen | d343a66 | 2014-03-12 15:27:35 +0100 | [diff] [blame] | 116 | struct snd_soc_card *card = rtd->card; |
Lars-Peter Clausen | 2896b8b | 2014-05-19 11:41:47 +0200 | [diff] [blame] | 117 | struct device_node *np = card->dev->of_node; |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 118 | int ret; |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 119 | |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 120 | /* Add davinci-evm specific widgets */ |
Lars-Peter Clausen | d343a66 | 2014-03-12 15:27:35 +0100 | [diff] [blame] | 121 | snd_soc_dapm_new_controls(&card->dapm, aic3x_dapm_widgets, |
Mark Brown | acf497f | 2008-05-13 14:58:30 +0200 | [diff] [blame] | 122 | ARRAY_SIZE(aic3x_dapm_widgets)); |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 123 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 124 | if (np) { |
Lars-Peter Clausen | d343a66 | 2014-03-12 15:27:35 +0100 | [diff] [blame] | 125 | ret = snd_soc_of_parse_audio_routing(card, "ti,audio-routing"); |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 126 | if (ret) |
| 127 | return ret; |
| 128 | } else { |
| 129 | /* Set up davinci-evm specific audio path audio_map */ |
Lars-Peter Clausen | d343a66 | 2014-03-12 15:27:35 +0100 | [diff] [blame] | 130 | snd_soc_dapm_add_routes(&card->dapm, audio_map, |
| 131 | ARRAY_SIZE(audio_map)); |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 132 | } |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 133 | |
| 134 | /* not connected */ |
Lars-Peter Clausen | b213b44 | 2015-04-11 13:11:28 +0200 | [diff] [blame] | 135 | snd_soc_dapm_nc_pin(&card->dapm, "MONO_LOUT"); |
| 136 | snd_soc_dapm_nc_pin(&card->dapm, "HPLCOM"); |
| 137 | snd_soc_dapm_nc_pin(&card->dapm, "HPRCOM"); |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 138 | |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 139 | return 0; |
| 140 | } |
| 141 | |
| 142 | /* davinci-evm digital audio interface glue - connects codec <--> CPU */ |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 143 | SND_SOC_DAILINK_DEFS(dm6446, |
| 144 | DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcbsp")), |
| 145 | DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-001b", |
| 146 | "tlv320aic3x-hifi")), |
| 147 | DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcbsp"))); |
| 148 | |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 149 | static struct snd_soc_dai_link dm6446_evm_dai = { |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 150 | .name = "TLV320AIC3X", |
| 151 | .stream_name = "AIC3X", |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 152 | .init = evm_aic3x_init, |
| 153 | .ops = &evm_ops, |
Peter Ujfalusi | d38970e | 2013-11-14 11:35:21 +0200 | [diff] [blame] | 154 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM | |
| 155 | SND_SOC_DAIFMT_IB_NF, |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 156 | SND_SOC_DAILINK_REG(dm6446), |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 157 | }; |
| 158 | |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 159 | SND_SOC_DAILINK_DEFS(dm355, |
| 160 | DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcbsp.1")), |
| 161 | DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-001b", |
| 162 | "tlv320aic3x-hifi")), |
| 163 | DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcbsp.1"))); |
| 164 | |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 165 | static struct snd_soc_dai_link dm355_evm_dai = { |
| 166 | .name = "TLV320AIC3X", |
| 167 | .stream_name = "AIC3X", |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 168 | .init = evm_aic3x_init, |
| 169 | .ops = &evm_ops, |
Peter Ujfalusi | d38970e | 2013-11-14 11:35:21 +0200 | [diff] [blame] | 170 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM | |
| 171 | SND_SOC_DAIFMT_IB_NF, |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 172 | SND_SOC_DAILINK_REG(dm355), |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 173 | }; |
| 174 | |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 175 | #ifdef CONFIG_SND_SOC_DM365_AIC3X_CODEC |
| 176 | SND_SOC_DAILINK_DEFS(dm365, |
| 177 | DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcbsp")), |
| 178 | DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-0018", |
| 179 | "tlv320aic3x-hifi")), |
| 180 | DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcbsp"))); |
| 181 | #elif defined(CONFIG_SND_SOC_DM365_VOICE_CODEC) |
| 182 | SND_SOC_DAILINK_DEFS(dm365, |
| 183 | DAILINK_COMP_ARRAY(COMP_CPU("davinci-vcif")), |
| 184 | DAILINK_COMP_ARRAY(COMP_CODEC("cq93vc-codec", "cq93vc-hifi")), |
| 185 | DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-vcif"))); |
| 186 | #endif |
| 187 | |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 188 | static struct snd_soc_dai_link dm365_evm_dai = { |
Peter Ujfalusi | f2055e1 | 2018-12-17 14:21:34 +0200 | [diff] [blame] | 189 | #ifdef CONFIG_SND_SOC_DM365_AIC3X_CODEC |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 190 | .name = "TLV320AIC3X", |
| 191 | .stream_name = "AIC3X", |
Peter Ujfalusi | d38970e | 2013-11-14 11:35:21 +0200 | [diff] [blame] | 192 | .init = evm_aic3x_init, |
| 193 | .ops = &evm_ops, |
| 194 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM | |
| 195 | SND_SOC_DAIFMT_IB_NF, |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 196 | SND_SOC_DAILINK_REG(dm365), |
Peter Ujfalusi | f2055e1 | 2018-12-17 14:21:34 +0200 | [diff] [blame] | 197 | #elif defined(CONFIG_SND_SOC_DM365_VOICE_CODEC) |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 198 | .name = "Voice Codec - CQ93VC", |
| 199 | .stream_name = "CQ93", |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 200 | SND_SOC_DAILINK_REG(dm365), |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 201 | #endif |
| 202 | }; |
| 203 | |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 204 | SND_SOC_DAILINK_DEFS(dm6467_aic3x, |
| 205 | DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcasp.0")), |
| 206 | DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.0-001a", |
| 207 | "tlv320aic3x-hifi")), |
| 208 | DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcasp.0"))); |
| 209 | |
| 210 | SND_SOC_DAILINK_DEFS(dm6467_spdif, |
| 211 | DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcasp.1")), |
| 212 | DAILINK_COMP_ARRAY(COMP_CODEC("spdif_dit", "dit-hifi")), |
| 213 | DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcasp.1"))); |
| 214 | |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 215 | static struct snd_soc_dai_link dm6467_evm_dai[] = { |
| 216 | { |
| 217 | .name = "TLV320AIC3X", |
| 218 | .stream_name = "AIC3X", |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 219 | .init = evm_aic3x_init, |
| 220 | .ops = &evm_ops, |
Peter Ujfalusi | d38970e | 2013-11-14 11:35:21 +0200 | [diff] [blame] | 221 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM | |
| 222 | SND_SOC_DAIFMT_IB_NF, |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 223 | SND_SOC_DAILINK_REG(dm6467_aic3x), |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 224 | }, |
| 225 | { |
| 226 | .name = "McASP", |
| 227 | .stream_name = "spdif", |
Peter Ujfalusi | d38970e | 2013-11-14 11:35:21 +0200 | [diff] [blame] | 228 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM | |
| 229 | SND_SOC_DAIFMT_IB_NF, |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 230 | SND_SOC_DAILINK_REG(dm6467_spdif), |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 231 | }, |
| 232 | }; |
Vaibhav Bedia | f9eb9dd | 2011-02-03 16:42:25 +0530 | [diff] [blame] | 233 | |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 234 | SND_SOC_DAILINK_DEFS(da830, |
| 235 | DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcasp.1")), |
| 236 | DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-0018", |
| 237 | "tlv320aic3x-hifi")), |
| 238 | DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcasp.1"))); |
| 239 | |
Vaibhav Bedia | f9eb9dd | 2011-02-03 16:42:25 +0530 | [diff] [blame] | 240 | static struct snd_soc_dai_link da830_evm_dai = { |
| 241 | .name = "TLV320AIC3X", |
| 242 | .stream_name = "AIC3X", |
Vaibhav Bedia | f9eb9dd | 2011-02-03 16:42:25 +0530 | [diff] [blame] | 243 | .init = evm_aic3x_init, |
| 244 | .ops = &evm_ops, |
Peter Ujfalusi | d38970e | 2013-11-14 11:35:21 +0200 | [diff] [blame] | 245 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM | |
| 246 | SND_SOC_DAIFMT_IB_NF, |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 247 | SND_SOC_DAILINK_REG(da830), |
Vaibhav Bedia | f9eb9dd | 2011-02-03 16:42:25 +0530 | [diff] [blame] | 248 | }; |
| 249 | |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 250 | SND_SOC_DAILINK_DEFS(da850, |
| 251 | DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcasp.0")), |
| 252 | DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-0018", |
| 253 | "tlv320aic3x-hifi")), |
| 254 | DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcasp.0"))); |
| 255 | |
Vaibhav Bedia | f9eb9dd | 2011-02-03 16:42:25 +0530 | [diff] [blame] | 256 | static struct snd_soc_dai_link da850_evm_dai = { |
Chaithrika U S | 7ae5945 | 2009-08-07 10:07:51 -0400 | [diff] [blame] | 257 | .name = "TLV320AIC3X", |
| 258 | .stream_name = "AIC3X", |
Chaithrika U S | 7ae5945 | 2009-08-07 10:07:51 -0400 | [diff] [blame] | 259 | .init = evm_aic3x_init, |
| 260 | .ops = &evm_ops, |
Peter Ujfalusi | d38970e | 2013-11-14 11:35:21 +0200 | [diff] [blame] | 261 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM | |
| 262 | SND_SOC_DAIFMT_IB_NF, |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 263 | SND_SOC_DAILINK_REG(da850), |
Chaithrika U S | 7ae5945 | 2009-08-07 10:07:51 -0400 | [diff] [blame] | 264 | }; |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 265 | |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 266 | /* davinci dm6446 evm audio machine driver */ |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 267 | /* |
| 268 | * ASP0 in DM6446 EVM is clocked by U55, as configured by |
| 269 | * board-dm644x-evm.c using GPIOs from U18. There are six |
| 270 | * options; here we "know" we use a 48 KHz sample rate. |
| 271 | */ |
| 272 | static struct snd_soc_card_drvdata_davinci dm6446_snd_soc_card_drvdata = { |
| 273 | .sysclk = 12288000, |
| 274 | }; |
| 275 | |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 276 | static struct snd_soc_card dm6446_snd_soc_card_evm = { |
| 277 | .name = "DaVinci DM6446 EVM", |
Axel Lin | 36a16d1 | 2011-12-22 21:19:42 +0800 | [diff] [blame] | 278 | .owner = THIS_MODULE, |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 279 | .dai_link = &dm6446_evm_dai, |
| 280 | .num_links = 1, |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 281 | .drvdata = &dm6446_snd_soc_card_drvdata, |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 282 | }; |
| 283 | |
| 284 | /* davinci dm355 evm audio machine driver */ |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 285 | /* ASP1 on DM355 EVM is clocked by an external oscillator */ |
| 286 | static struct snd_soc_card_drvdata_davinci dm355_snd_soc_card_drvdata = { |
| 287 | .sysclk = 27000000, |
| 288 | }; |
| 289 | |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 290 | static struct snd_soc_card dm355_snd_soc_card_evm = { |
| 291 | .name = "DaVinci DM355 EVM", |
Axel Lin | 36a16d1 | 2011-12-22 21:19:42 +0800 | [diff] [blame] | 292 | .owner = THIS_MODULE, |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 293 | .dai_link = &dm355_evm_dai, |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 294 | .num_links = 1, |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 295 | .drvdata = &dm355_snd_soc_card_drvdata, |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 296 | }; |
| 297 | |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 298 | /* davinci dm365 evm audio machine driver */ |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 299 | static struct snd_soc_card_drvdata_davinci dm365_snd_soc_card_drvdata = { |
| 300 | .sysclk = 27000000, |
| 301 | }; |
| 302 | |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 303 | static struct snd_soc_card dm365_snd_soc_card_evm = { |
| 304 | .name = "DaVinci DM365 EVM", |
Axel Lin | 36a16d1 | 2011-12-22 21:19:42 +0800 | [diff] [blame] | 305 | .owner = THIS_MODULE, |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 306 | .dai_link = &dm365_evm_dai, |
| 307 | .num_links = 1, |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 308 | .drvdata = &dm365_snd_soc_card_drvdata, |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 309 | }; |
| 310 | |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 311 | /* davinci dm6467 evm audio machine driver */ |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 312 | static struct snd_soc_card_drvdata_davinci dm6467_snd_soc_card_drvdata = { |
| 313 | .sysclk = 27000000, |
| 314 | }; |
| 315 | |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 316 | static struct snd_soc_card dm6467_snd_soc_card_evm = { |
| 317 | .name = "DaVinci DM6467 EVM", |
Axel Lin | 36a16d1 | 2011-12-22 21:19:42 +0800 | [diff] [blame] | 318 | .owner = THIS_MODULE, |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 319 | .dai_link = dm6467_evm_dai, |
| 320 | .num_links = ARRAY_SIZE(dm6467_evm_dai), |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 321 | .drvdata = &dm6467_snd_soc_card_drvdata, |
| 322 | }; |
| 323 | |
| 324 | static struct snd_soc_card_drvdata_davinci da830_snd_soc_card_drvdata = { |
| 325 | .sysclk = 24576000, |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 326 | }; |
| 327 | |
Chaithrika U S | 7ae5945 | 2009-08-07 10:07:51 -0400 | [diff] [blame] | 328 | static struct snd_soc_card da830_snd_soc_card = { |
Chaithrika U S | 30230f4 | 2009-08-11 16:59:21 -0400 | [diff] [blame] | 329 | .name = "DA830/OMAP-L137 EVM", |
Axel Lin | 36a16d1 | 2011-12-22 21:19:42 +0800 | [diff] [blame] | 330 | .owner = THIS_MODULE, |
Vaibhav Bedia | f9eb9dd | 2011-02-03 16:42:25 +0530 | [diff] [blame] | 331 | .dai_link = &da830_evm_dai, |
Chaithrika U S | 30230f4 | 2009-08-11 16:59:21 -0400 | [diff] [blame] | 332 | .num_links = 1, |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 333 | .drvdata = &da830_snd_soc_card_drvdata, |
| 334 | }; |
| 335 | |
| 336 | static struct snd_soc_card_drvdata_davinci da850_snd_soc_card_drvdata = { |
| 337 | .sysclk = 24576000, |
Chaithrika U S | 30230f4 | 2009-08-11 16:59:21 -0400 | [diff] [blame] | 338 | }; |
| 339 | |
| 340 | static struct snd_soc_card da850_snd_soc_card = { |
| 341 | .name = "DA850/OMAP-L138 EVM", |
Axel Lin | 36a16d1 | 2011-12-22 21:19:42 +0800 | [diff] [blame] | 342 | .owner = THIS_MODULE, |
Vaibhav Bedia | f9eb9dd | 2011-02-03 16:42:25 +0530 | [diff] [blame] | 343 | .dai_link = &da850_evm_dai, |
Chaithrika U S | 7ae5945 | 2009-08-07 10:07:51 -0400 | [diff] [blame] | 344 | .num_links = 1, |
Jyri Sarha | bcf2556 | 2013-09-17 12:26:00 +0300 | [diff] [blame] | 345 | .drvdata = &da850_snd_soc_card_drvdata, |
Chaithrika U S | 7ae5945 | 2009-08-07 10:07:51 -0400 | [diff] [blame] | 346 | }; |
| 347 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 348 | #if defined(CONFIG_OF) |
| 349 | |
| 350 | /* |
| 351 | * The struct is used as place holder. It will be completely |
| 352 | * filled with data from dt node. |
| 353 | */ |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 354 | SND_SOC_DAILINK_DEFS(evm, |
| 355 | DAILINK_COMP_ARRAY(COMP_EMPTY()), |
Kuninori Morimoto | 44e5781 | 2019-06-28 10:49:18 +0900 | [diff] [blame] | 356 | DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "tlv320aic3x-hifi")), |
| 357 | DAILINK_COMP_ARRAY(COMP_EMPTY())); |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 358 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 359 | static struct snd_soc_dai_link evm_dai_tlv320aic3x = { |
| 360 | .name = "TLV320AIC3X", |
| 361 | .stream_name = "AIC3X", |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 362 | .ops = &evm_ops, |
| 363 | .init = evm_aic3x_init, |
Peter Ujfalusi | d38970e | 2013-11-14 11:35:21 +0200 | [diff] [blame] | 364 | .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM | |
| 365 | SND_SOC_DAIFMT_IB_NF, |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 366 | SND_SOC_DAILINK_REG(evm), |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 367 | }; |
| 368 | |
| 369 | static const struct of_device_id davinci_evm_dt_ids[] = { |
| 370 | { |
| 371 | .compatible = "ti,da830-evm-audio", |
| 372 | .data = (void *) &evm_dai_tlv320aic3x, |
| 373 | }, |
| 374 | { /* sentinel */ } |
| 375 | }; |
| 376 | MODULE_DEVICE_TABLE(of, davinci_evm_dt_ids); |
| 377 | |
| 378 | /* davinci evm audio machine driver */ |
| 379 | static struct snd_soc_card evm_soc_card = { |
| 380 | .owner = THIS_MODULE, |
| 381 | .num_links = 1, |
| 382 | }; |
| 383 | |
| 384 | static int davinci_evm_probe(struct platform_device *pdev) |
| 385 | { |
| 386 | struct device_node *np = pdev->dev.of_node; |
Shailendra Verma | 3f81d9a | 2017-01-27 16:40:57 +0530 | [diff] [blame] | 387 | const struct of_device_id *match; |
| 388 | struct snd_soc_dai_link *dai; |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 389 | struct snd_soc_card_drvdata_davinci *drvdata = NULL; |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 390 | struct clk *mclk; |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 391 | int ret = 0; |
| 392 | |
Shailendra Verma | 3f81d9a | 2017-01-27 16:40:57 +0530 | [diff] [blame] | 393 | match = of_match_device(of_match_ptr(davinci_evm_dt_ids), &pdev->dev); |
| 394 | if (!match) { |
| 395 | dev_err(&pdev->dev, "Error: No device match found\n"); |
| 396 | return -ENODEV; |
| 397 | } |
| 398 | |
| 399 | dai = (struct snd_soc_dai_link *) match->data; |
| 400 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 401 | evm_soc_card.dai_link = dai; |
| 402 | |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 403 | dai->codecs->of_node = of_parse_phandle(np, "ti,audio-codec", 0); |
| 404 | if (!dai->codecs->of_node) |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 405 | return -EINVAL; |
| 406 | |
Kuninori Morimoto | de3582fe | 2019-06-06 13:12:57 +0900 | [diff] [blame] | 407 | dai->cpus->of_node = of_parse_phandle(np, "ti,mcasp-controller", 0); |
| 408 | if (!dai->cpus->of_node) |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 409 | return -EINVAL; |
| 410 | |
Kuninori Morimoto | 44e5781 | 2019-06-28 10:49:18 +0900 | [diff] [blame] | 411 | dai->platforms->of_node = dai->cpus->of_node; |
| 412 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 413 | evm_soc_card.dev = &pdev->dev; |
| 414 | ret = snd_soc_of_parse_card_name(&evm_soc_card, "ti,model"); |
| 415 | if (ret) |
| 416 | return ret; |
| 417 | |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 418 | mclk = devm_clk_get(&pdev->dev, "mclk"); |
| 419 | if (PTR_ERR(mclk) == -EPROBE_DEFER) { |
| 420 | return -EPROBE_DEFER; |
| 421 | } else if (IS_ERR(mclk)) { |
| 422 | dev_dbg(&pdev->dev, "mclk not found.\n"); |
| 423 | mclk = NULL; |
| 424 | } |
| 425 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 426 | drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); |
| 427 | if (!drvdata) |
| 428 | return -ENOMEM; |
| 429 | |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 430 | drvdata->mclk = mclk; |
| 431 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 432 | ret = of_property_read_u32(np, "ti,codec-clock-rate", &drvdata->sysclk); |
Jyri Sarha | 5ad8865 | 2014-01-27 17:37:51 +0200 | [diff] [blame] | 433 | |
| 434 | if (ret < 0) { |
| 435 | if (!drvdata->mclk) { |
| 436 | dev_err(&pdev->dev, |
| 437 | "No clock or clock rate defined.\n"); |
| 438 | return -EINVAL; |
| 439 | } |
| 440 | drvdata->sysclk = clk_get_rate(drvdata->mclk); |
| 441 | } else if (drvdata->mclk) { |
| 442 | unsigned int requestd_rate = drvdata->sysclk; |
| 443 | clk_set_rate(drvdata->mclk, drvdata->sysclk); |
| 444 | drvdata->sysclk = clk_get_rate(drvdata->mclk); |
| 445 | if (drvdata->sysclk != requestd_rate) |
| 446 | dev_warn(&pdev->dev, |
| 447 | "Could not get requested rate %u using %u.\n", |
| 448 | requestd_rate, drvdata->sysclk); |
| 449 | } |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 450 | |
| 451 | snd_soc_card_set_drvdata(&evm_soc_card, drvdata); |
| 452 | ret = devm_snd_soc_register_card(&pdev->dev, &evm_soc_card); |
| 453 | |
| 454 | if (ret) |
| 455 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); |
| 456 | |
| 457 | return ret; |
| 458 | } |
| 459 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 460 | static struct platform_driver davinci_evm_driver = { |
| 461 | .probe = davinci_evm_probe, |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 462 | .driver = { |
| 463 | .name = "davinci_evm", |
Peter Ujfalusi | fb6d208 | 2014-01-30 15:21:31 +0200 | [diff] [blame] | 464 | .pm = &snd_soc_pm_ops, |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 465 | .of_match_table = of_match_ptr(davinci_evm_dt_ids), |
| 466 | }, |
| 467 | }; |
| 468 | #endif |
| 469 | |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 470 | static struct platform_device *evm_snd_device; |
| 471 | |
| 472 | static int __init evm_init(void) |
| 473 | { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 474 | struct snd_soc_card *evm_snd_dev_data; |
David Brownell | f492ec9 | 2009-05-14 13:01:59 -0700 | [diff] [blame] | 475 | int index; |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 476 | int ret; |
| 477 | |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 478 | /* |
| 479 | * If dtb is there, the devices will be created dynamically. |
| 480 | * Only register platfrom driver structure. |
| 481 | */ |
| 482 | #if defined(CONFIG_OF) |
| 483 | if (of_have_populated_dt()) |
| 484 | return platform_driver_register(&davinci_evm_driver); |
| 485 | #endif |
| 486 | |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 487 | if (machine_is_davinci_evm()) { |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 488 | evm_snd_dev_data = &dm6446_snd_soc_card_evm; |
David Brownell | f492ec9 | 2009-05-14 13:01:59 -0700 | [diff] [blame] | 489 | index = 0; |
| 490 | } else if (machine_is_davinci_dm355_evm()) { |
Chris Paulson-Ellis | bedad0c | 2010-11-16 12:27:09 +0000 | [diff] [blame] | 491 | evm_snd_dev_data = &dm355_snd_soc_card_evm; |
David Brownell | f492ec9 | 2009-05-14 13:01:59 -0700 | [diff] [blame] | 492 | index = 1; |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 493 | } else if (machine_is_davinci_dm365_evm()) { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 494 | evm_snd_dev_data = &dm365_snd_soc_card_evm; |
Miguel Aguilar | aa9b88e | 2010-03-11 09:33:40 -0600 | [diff] [blame] | 495 | index = 0; |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 496 | } else if (machine_is_davinci_dm6467_evm()) { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 497 | evm_snd_dev_data = &dm6467_snd_soc_card_evm; |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 498 | index = 0; |
Chaithrika U S | 7ae5945 | 2009-08-07 10:07:51 -0400 | [diff] [blame] | 499 | } else if (machine_is_davinci_da830_evm()) { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 500 | evm_snd_dev_data = &da830_snd_soc_card; |
Chaithrika U S | 7ae5945 | 2009-08-07 10:07:51 -0400 | [diff] [blame] | 501 | index = 1; |
Chaithrika U S | 30230f4 | 2009-08-11 16:59:21 -0400 | [diff] [blame] | 502 | } else if (machine_is_davinci_da850_evm()) { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 503 | evm_snd_dev_data = &da850_snd_soc_card; |
Chaithrika U S | 30230f4 | 2009-08-11 16:59:21 -0400 | [diff] [blame] | 504 | index = 0; |
David Brownell | f492ec9 | 2009-05-14 13:01:59 -0700 | [diff] [blame] | 505 | } else |
| 506 | return -EINVAL; |
| 507 | |
| 508 | evm_snd_device = platform_device_alloc("soc-audio", index); |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 509 | if (!evm_snd_device) |
| 510 | return -ENOMEM; |
| 511 | |
Chaithrika U S | 04f80f5 | 2009-06-05 06:28:49 -0400 | [diff] [blame] | 512 | platform_set_drvdata(evm_snd_device, evm_snd_dev_data); |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 513 | ret = platform_device_add(evm_snd_device); |
| 514 | if (ret) |
| 515 | platform_device_put(evm_snd_device); |
| 516 | |
| 517 | return ret; |
| 518 | } |
| 519 | |
| 520 | static void __exit evm_exit(void) |
| 521 | { |
Hebbar, Gururaja | ee2f615 | 2013-10-23 15:30:14 +0300 | [diff] [blame] | 522 | #if defined(CONFIG_OF) |
| 523 | if (of_have_populated_dt()) { |
| 524 | platform_driver_unregister(&davinci_evm_driver); |
| 525 | return; |
| 526 | } |
| 527 | #endif |
| 528 | |
Vladimir Barinov | 310355c | 2008-02-18 11:40:22 +0100 | [diff] [blame] | 529 | platform_device_unregister(evm_snd_device); |
| 530 | } |
| 531 | |
| 532 | module_init(evm_init); |
| 533 | module_exit(evm_exit); |
| 534 | |
| 535 | MODULE_AUTHOR("Vladimir Barinov"); |
| 536 | MODULE_DESCRIPTION("TI DAVINCI EVM ASoC driver"); |
| 537 | MODULE_LICENSE("GPL"); |