Commit bd85a06c authored by Stephen Warren's avatar Stephen Warren Committed by Mark Brown

ASoC: tegra trimslice: assume CONFIG_OF, and other cleanup

Tegra only supports, and always enables, device tree. Remove all runtime
checks for DT support from the driver.

Also, some minor changes so that the probe() body more closely resembles
other drivers, for easier comparison.
Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f726536f
...@@ -97,9 +97,6 @@ static const struct snd_soc_dapm_route trimslice_audio_map[] = { ...@@ -97,9 +97,6 @@ static const struct snd_soc_dapm_route trimslice_audio_map[] = {
static struct snd_soc_dai_link trimslice_tlv320aic23_dai = { static struct snd_soc_dai_link trimslice_tlv320aic23_dai = {
.name = "TLV320AIC23", .name = "TLV320AIC23",
.stream_name = "AIC23", .stream_name = "AIC23",
.codec_name = "tlv320aic23-codec.2-001a",
.platform_name = "tegra20-i2s.0",
.cpu_dai_name = "tegra20-i2s.0",
.codec_dai_name = "tlv320aic23-hifi", .codec_dai_name = "tlv320aic23-hifi",
.ops = &trimslice_asoc_ops, .ops = &trimslice_asoc_ops,
.dai_fmt = SND_SOC_DAIFMT_I2S | .dai_fmt = SND_SOC_DAIFMT_I2S |
...@@ -122,6 +119,7 @@ static struct snd_soc_card snd_soc_trimslice = { ...@@ -122,6 +119,7 @@ static struct snd_soc_card snd_soc_trimslice = {
static int tegra_snd_trimslice_probe(struct platform_device *pdev) static int tegra_snd_trimslice_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node;
struct snd_soc_card *card = &snd_soc_trimslice; struct snd_soc_card *card = &snd_soc_trimslice;
struct tegra_trimslice *trimslice; struct tegra_trimslice *trimslice;
int ret; int ret;
...@@ -130,14 +128,15 @@ static int tegra_snd_trimslice_probe(struct platform_device *pdev) ...@@ -130,14 +128,15 @@ static int tegra_snd_trimslice_probe(struct platform_device *pdev)
GFP_KERNEL); GFP_KERNEL);
if (!trimslice) { if (!trimslice) {
dev_err(&pdev->dev, "Can't allocate tegra_trimslice\n"); dev_err(&pdev->dev, "Can't allocate tegra_trimslice\n");
ret = -ENOMEM; return -ENOMEM;
goto err;
} }
if (pdev->dev.of_node) { card->dev = &pdev->dev;
trimslice_tlv320aic23_dai.codec_name = NULL; platform_set_drvdata(pdev, card);
trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle( snd_soc_card_set_drvdata(card, trimslice);
pdev->dev.of_node, "nvidia,audio-codec", 0);
trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle(np,
"nvidia,audio-codec", 0);
if (!trimslice_tlv320aic23_dai.codec_of_node) { if (!trimslice_tlv320aic23_dai.codec_of_node) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Property 'nvidia,audio-codec' missing or invalid\n"); "Property 'nvidia,audio-codec' missing or invalid\n");
...@@ -145,9 +144,8 @@ static int tegra_snd_trimslice_probe(struct platform_device *pdev) ...@@ -145,9 +144,8 @@ static int tegra_snd_trimslice_probe(struct platform_device *pdev)
goto err; goto err;
} }
trimslice_tlv320aic23_dai.cpu_dai_name = NULL; trimslice_tlv320aic23_dai.cpu_of_node = of_parse_phandle(np,
trimslice_tlv320aic23_dai.cpu_of_node = of_parse_phandle( "nvidia,i2s-controller", 0);
pdev->dev.of_node, "nvidia,i2s-controller", 0);
if (!trimslice_tlv320aic23_dai.cpu_of_node) { if (!trimslice_tlv320aic23_dai.cpu_of_node) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Property 'nvidia,i2s-controller' missing or invalid\n"); "Property 'nvidia,i2s-controller' missing or invalid\n");
...@@ -155,19 +153,13 @@ static int tegra_snd_trimslice_probe(struct platform_device *pdev) ...@@ -155,19 +153,13 @@ static int tegra_snd_trimslice_probe(struct platform_device *pdev)
goto err; goto err;
} }
trimslice_tlv320aic23_dai.platform_name = NULL;
trimslice_tlv320aic23_dai.platform_of_node = trimslice_tlv320aic23_dai.platform_of_node =
trimslice_tlv320aic23_dai.cpu_of_node; trimslice_tlv320aic23_dai.cpu_of_node;
}
ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev); ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev);
if (ret) if (ret)
goto err; goto err;
card->dev = &pdev->dev;
platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, trimslice);
ret = snd_soc_register_card(card); ret = snd_soc_register_card(card);
if (ret) { if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment