summaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra/tegra_wm9712.c
diff options
context:
space:
mode:
authorLucas Stach2014-03-18 21:30:49 +0100
committerMark Brown2014-03-25 19:54:50 +0100
commit1ca2e8474df3626f8d64d23420f8bd16bcef2448 (patch)
tree310ea6df13d36aa0f9422efe6be45d3113239e92 /sound/soc/tegra/tegra_wm9712.c
parentLinus 3.14-rc1 (diff)
downloadkernel-qcow2-linux-1ca2e8474df3626f8d64d23420f8bd16bcef2448.tar.gz
kernel-qcow2-linux-1ca2e8474df3626f8d64d23420f8bd16bcef2448.tar.xz
kernel-qcow2-linux-1ca2e8474df3626f8d64d23420f8bd16bcef2448.zip
ASoC: tegra: move AC97 clock handling to the machine driver
On Tegra the convention is to have a single machine driver that's controlling the whole audio subsystem. Move the clock handling to the machine driver, to be in line with the other Tegra drivers and give the machine driver full control over the single Tegra audio PLL. Signed-off-by: Lucas Stach <dev@lynxeye.de> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/tegra/tegra_wm9712.c')
-rw-r--r--sound/soc/tegra/tegra_wm9712.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sound/soc/tegra/tegra_wm9712.c b/sound/soc/tegra/tegra_wm9712.c
index 45b57892b6a5..25a7f8211ecf 100644
--- a/sound/soc/tegra/tegra_wm9712.c
+++ b/sound/soc/tegra/tegra_wm9712.c
@@ -29,10 +29,13 @@
#include <sound/pcm_params.h>
#include <sound/soc.h>
+#include "tegra_asoc_utils.h"
+
#define DRV_NAME "tegra-snd-wm9712"
struct tegra_wm9712 {
struct platform_device *codec;
+ struct tegra_asoc_utils_data util_data;
};
static const struct snd_soc_dapm_widget tegra_wm9712_dapm_widgets[] = {
@@ -118,15 +121,25 @@ static int tegra_wm9712_driver_probe(struct platform_device *pdev)
tegra_wm9712_dai.platform_of_node = tegra_wm9712_dai.cpu_of_node;
+ ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev);
+ if (ret)
+ goto codec_unregister;
+
+ ret = tegra_asoc_utils_set_ac97_rate(&machine->util_data);
+ if (ret)
+ goto asoc_utils_fini;
+
ret = snd_soc_register_card(card);
if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
ret);
- goto codec_unregister;
+ goto asoc_utils_fini;
}
return 0;
+asoc_utils_fini:
+ tegra_asoc_utils_fini(&machine->util_data);
codec_unregister:
platform_device_del(machine->codec);
codec_put:
@@ -141,6 +154,8 @@ static int tegra_wm9712_driver_remove(struct platform_device *pdev)
snd_soc_unregister_card(card);
+ tegra_asoc_utils_fini(&machine->util_data);
+
platform_device_unregister(machine->codec);
return 0;