aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/ux500/mop500_ab8500.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/ux500/mop500_ab8500.c')
-rw-r--r--sound/soc/ux500/mop500_ab8500.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/sound/soc/ux500/mop500_ab8500.c b/sound/soc/ux500/mop500_ab8500.c
index 77655084bbde..e5e73a2bd9fe 100644
--- a/sound/soc/ux500/mop500_ab8500.c
+++ b/sound/soc/ux500/mop500_ab8500.c
@@ -5,8 +5,6 @@
* Author: Ola Lilja <ola.o.lilja@stericsson.com>,
* Kristoffer Karlsson <kristoffer.karlsson@stericsson.com>
* for ST-Ericsson.
- *
- * License terms:
*/
#include <linux/module.h>
@@ -190,7 +188,7 @@ static struct snd_kcontrol_new mop500_ab8500_ctrls[] = {
static int mop500_ab8500_startup(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
/* Set audio-clock source */
return mop500_ab8500_set_mclk(rtd->card->dev,
@@ -199,7 +197,7 @@ static int mop500_ab8500_startup(struct snd_pcm_substream *substream)
static void mop500_ab8500_shutdown(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct device *dev = rtd->card->dev;
dev_dbg(dev, "%s: Enter\n", __func__);
@@ -214,9 +212,9 @@ static void mop500_ab8500_shutdown(struct snd_pcm_substream *substream)
static int mop500_ab8500_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
struct device *dev = rtd->card->dev;
unsigned int fmt;
int channels, ret = 0, driver_mode, slots;
@@ -338,8 +336,8 @@ static int mop500_ab8500_hw_params(struct snd_pcm_substream *substream,
static int mop500_ab8500_hw_free(struct snd_pcm_substream *substream)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
mutex_lock(&mop500_ab8500_params_lock);
__clear_bit(cpu_dai->id, &mop500_ab8500_usage);
@@ -348,7 +346,7 @@ static int mop500_ab8500_hw_free(struct snd_pcm_substream *substream)
return 0;
}
-struct snd_soc_ops mop500_ab8500_ops[] = {
+const struct snd_soc_ops mop500_ab8500_ops[] = {
{
.hw_params = mop500_ab8500_hw_params,
.hw_free = mop500_ab8500_hw_free,
@@ -433,12 +431,9 @@ void mop500_ab8500_remove(struct snd_soc_card *card)
{
struct mop500_ab8500_drvdata *drvdata = snd_soc_card_get_drvdata(card);
- if (drvdata->clk_ptr_sysclk != NULL)
- clk_put(drvdata->clk_ptr_sysclk);
- if (drvdata->clk_ptr_ulpclk != NULL)
- clk_put(drvdata->clk_ptr_ulpclk);
- if (drvdata->clk_ptr_intclk != NULL)
- clk_put(drvdata->clk_ptr_intclk);
+ clk_put(drvdata->clk_ptr_sysclk);
+ clk_put(drvdata->clk_ptr_ulpclk);
+ clk_put(drvdata->clk_ptr_intclk);
snd_soc_card_set_drvdata(card, drvdata);
}