diff options
Diffstat (limited to 'sound/soc/tegra/trimslice.c')
-rw-r--r-- | sound/soc/tegra/trimslice.c | 56 |
1 files changed, 24 insertions, 32 deletions
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c index 7fcf6c2297db..05c68aab5cf0 100644 --- a/sound/soc/tegra/trimslice.c +++ b/sound/soc/tegra/trimslice.c | |||
@@ -97,9 +97,6 @@ static const struct snd_soc_dapm_route trimslice_audio_map[] = { | |||
97 | static struct snd_soc_dai_link trimslice_tlv320aic23_dai = { | 97 | static struct snd_soc_dai_link trimslice_tlv320aic23_dai = { |
98 | .name = "TLV320AIC23", | 98 | .name = "TLV320AIC23", |
99 | .stream_name = "AIC23", | 99 | .stream_name = "AIC23", |
100 | .codec_name = "tlv320aic23-codec.2-001a", | ||
101 | .platform_name = "tegra20-i2s.0", | ||
102 | .cpu_dai_name = "tegra20-i2s.0", | ||
103 | .codec_dai_name = "tlv320aic23-hifi", | 100 | .codec_dai_name = "tlv320aic23-hifi", |
104 | .ops = &trimslice_asoc_ops, | 101 | .ops = &trimslice_asoc_ops, |
105 | .dai_fmt = SND_SOC_DAIFMT_I2S | | 102 | .dai_fmt = SND_SOC_DAIFMT_I2S | |
@@ -122,6 +119,7 @@ static struct snd_soc_card snd_soc_trimslice = { | |||
122 | 119 | ||
123 | static int tegra_snd_trimslice_probe(struct platform_device *pdev) | 120 | static int tegra_snd_trimslice_probe(struct platform_device *pdev) |
124 | { | 121 | { |
122 | struct device_node *np = pdev->dev.of_node; | ||
125 | struct snd_soc_card *card = &snd_soc_trimslice; | 123 | struct snd_soc_card *card = &snd_soc_trimslice; |
126 | struct tegra_trimslice *trimslice; | 124 | struct tegra_trimslice *trimslice; |
127 | int ret; | 125 | int ret; |
@@ -130,44 +128,38 @@ static int tegra_snd_trimslice_probe(struct platform_device *pdev) | |||
130 | GFP_KERNEL); | 128 | GFP_KERNEL); |
131 | if (!trimslice) { | 129 | if (!trimslice) { |
132 | dev_err(&pdev->dev, "Can't allocate tegra_trimslice\n"); | 130 | dev_err(&pdev->dev, "Can't allocate tegra_trimslice\n"); |
133 | ret = -ENOMEM; | 131 | return -ENOMEM; |
132 | } | ||
133 | |||
134 | card->dev = &pdev->dev; | ||
135 | platform_set_drvdata(pdev, card); | ||
136 | snd_soc_card_set_drvdata(card, trimslice); | ||
137 | |||
138 | trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle(np, | ||
139 | "nvidia,audio-codec", 0); | ||
140 | if (!trimslice_tlv320aic23_dai.codec_of_node) { | ||
141 | dev_err(&pdev->dev, | ||
142 | "Property 'nvidia,audio-codec' missing or invalid\n"); | ||
143 | ret = -EINVAL; | ||
134 | goto err; | 144 | goto err; |
135 | } | 145 | } |
136 | 146 | ||
137 | if (pdev->dev.of_node) { | 147 | trimslice_tlv320aic23_dai.cpu_of_node = of_parse_phandle(np, |
138 | trimslice_tlv320aic23_dai.codec_name = NULL; | 148 | "nvidia,i2s-controller", 0); |
139 | trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle( | 149 | if (!trimslice_tlv320aic23_dai.cpu_of_node) { |
140 | pdev->dev.of_node, "nvidia,audio-codec", 0); | 150 | dev_err(&pdev->dev, |
141 | if (!trimslice_tlv320aic23_dai.codec_of_node) { | 151 | "Property 'nvidia,i2s-controller' missing or invalid\n"); |
142 | dev_err(&pdev->dev, | 152 | ret = -EINVAL; |
143 | "Property 'nvidia,audio-codec' missing or invalid\n"); | 153 | goto err; |
144 | ret = -EINVAL; | ||
145 | goto err; | ||
146 | } | ||
147 | |||
148 | trimslice_tlv320aic23_dai.cpu_dai_name = NULL; | ||
149 | trimslice_tlv320aic23_dai.cpu_of_node = of_parse_phandle( | ||
150 | pdev->dev.of_node, "nvidia,i2s-controller", 0); | ||
151 | if (!trimslice_tlv320aic23_dai.cpu_of_node) { | ||
152 | dev_err(&pdev->dev, | ||
153 | "Property 'nvidia,i2s-controller' missing or invalid\n"); | ||
154 | ret = -EINVAL; | ||
155 | goto err; | ||
156 | } | ||
157 | |||
158 | trimslice_tlv320aic23_dai.platform_name = NULL; | ||
159 | trimslice_tlv320aic23_dai.platform_of_node = | ||
160 | trimslice_tlv320aic23_dai.cpu_of_node; | ||
161 | } | 154 | } |
162 | 155 | ||
156 | trimslice_tlv320aic23_dai.platform_of_node = | ||
157 | trimslice_tlv320aic23_dai.cpu_of_node; | ||
158 | |||
163 | ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev); | 159 | ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev); |
164 | if (ret) | 160 | if (ret) |
165 | goto err; | 161 | goto err; |
166 | 162 | ||
167 | card->dev = &pdev->dev; | ||
168 | platform_set_drvdata(pdev, card); | ||
169 | snd_soc_card_set_drvdata(card, trimslice); | ||
170 | |||
171 | ret = snd_soc_register_card(card); | 163 | ret = snd_soc_register_card(card); |
172 | if (ret) { | 164 | if (ret) { |
173 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", | 165 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", |