aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-04-27 15:34:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-30 18:47:54 -0400
commit6264f668d51647be68bcfde8a56042bd646a7855 (patch)
treebcfbc30f0e61280126cfa0b7ec9088d5c17630b0 /sound/soc/tegra
parent3a96c77ef792478f5e372b71403698606973c479 (diff)
ASoC: tegra: add device tree support for TrimSlice
This binding doesn't include the nvidia,model or nvidia,audio-routing properties the other Tegra audio DT bindings have, because this binding is targetted at a single machine, rather than for any machine using the tlv320aic23 codec. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/tegra')
-rw-r--r--sound/soc/tegra/trimslice.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c
index 0fd115e69a8..4a8d5b672c9 100644
--- a/sound/soc/tegra/trimslice.c
+++ b/sound/soc/tegra/trimslice.c
@@ -27,6 +27,7 @@
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28 28
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/of.h>
30#include <linux/platform_device.h> 31#include <linux/platform_device.h>
31#include <linux/slab.h> 32#include <linux/slab.h>
32 33
@@ -149,6 +150,32 @@ static __devinit int tegra_snd_trimslice_probe(struct platform_device *pdev)
149 goto err; 150 goto err;
150 } 151 }
151 152
153 if (pdev->dev.of_node) {
154 trimslice_tlv320aic23_dai.codec_name = NULL;
155 trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle(
156 pdev->dev.of_node, "nvidia,audio-codec", 0);
157 if (!trimslice_tlv320aic23_dai.codec_of_node) {
158 dev_err(&pdev->dev,
159 "Property 'nvidia,audio-codec' missing or invalid\n");
160 ret = -EINVAL;
161 goto err;
162 }
163
164 trimslice_tlv320aic23_dai.cpu_dai_name = NULL;
165 trimslice_tlv320aic23_dai.cpu_dai_of_node = of_parse_phandle(
166 pdev->dev.of_node, "nvidia,i2s-controller", 0);
167 if (!trimslice_tlv320aic23_dai.cpu_dai_of_node) {
168 dev_err(&pdev->dev,
169 "Property 'nvidia,i2s-controller' missing or invalid\n");
170 ret = -EINVAL;
171 goto err;
172 }
173
174 trimslice_tlv320aic23_dai.platform_name = NULL;
175 trimslice_tlv320aic23_dai.platform_of_node =
176 trimslice_tlv320aic23_dai.cpu_dai_of_node;
177 }
178
152 ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev); 179 ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev);
153 if (ret) 180 if (ret)
154 goto err; 181 goto err;
@@ -184,10 +211,17 @@ static int __devexit tegra_snd_trimslice_remove(struct platform_device *pdev)
184 return 0; 211 return 0;
185} 212}
186 213
214static const struct of_device_id trimslice_of_match[] __devinitconst = {
215 { .compatible = "nvidia,tegra-audio-trimslice", },
216 {},
217};
218MODULE_DEVICE_TABLE(of, trimslice_of_match);
219
187static struct platform_driver tegra_snd_trimslice_driver = { 220static struct platform_driver tegra_snd_trimslice_driver = {
188 .driver = { 221 .driver = {
189 .name = DRV_NAME, 222 .name = DRV_NAME,
190 .owner = THIS_MODULE, 223 .owner = THIS_MODULE,
224 .of_match_table = trimslice_of_match,
191 }, 225 },
192 .probe = tegra_snd_trimslice_probe, 226 .probe = tegra_snd_trimslice_probe,
193 .remove = __devexit_p(tegra_snd_trimslice_remove), 227 .remove = __devexit_p(tegra_snd_trimslice_remove),