]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: codecs: Replace instances of rtd->codec with dai->codec
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 13 Mar 2014 20:24:54 +0000 (21:24 +0100)
committerMark Brown <broonie@linaro.org>
Tue, 18 Mar 2014 12:47:49 +0000 (12:47 +0000)
With CODEC to CODEC links rtd->codec does not necessarily point to the driver's
CODEC. CODEC drivers should always use dai->codec and never even look at the PCM
runtime.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/isabelle.c
sound/soc/codecs/mc13783.c
sound/soc/codecs/rt5640.c
sound/soc/codecs/sta529.c
sound/soc/codecs/tlv320aic31xx.c
sound/soc/codecs/uda134x.c
sound/soc/codecs/uda1380.c
sound/soc/codecs/wm8580.c

index 5839048ec4674e5d20cc5f06e206c2210977999e..7c8ba02a6d1b372ddc570ddaf0c6085f11fa25a5 100644 (file)
@@ -910,8 +910,7 @@ static int isabelle_hw_params(struct snd_pcm_substream *substream,
                              struct snd_pcm_hw_params *params,
                              struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        u16 aif = 0;
        unsigned int fs_val = 0;
 
index 582c2bbd42cb9eae83346b5fbcd4e497d6101493..bebba7fb8819f2547672a9a4d1d7555a613f5443 100644 (file)
@@ -106,8 +106,7 @@ static int mc13783_pcm_hw_params_dac(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params,
                                struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        unsigned int rate = params_rate(params);
        int i;
 
@@ -126,8 +125,7 @@ static int mc13783_pcm_hw_params_codec(struct snd_pcm_substream *substream,
                                struct snd_pcm_hw_params *params,
                                struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        unsigned int rate = params_rate(params);
        unsigned int val;
 
index a3fb411796364a683d554b6278ba9bda6b942326..7877a5e14c54b67d7e09cf044fa47179a3e7bcb4 100644 (file)
@@ -1601,8 +1601,7 @@ static int get_clk_info(int sclk, int rate)
 static int rt5640_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
        unsigned int val_len = 0, val_clk, mask_clk;
        int dai_sel, pre_div, bclk_ms, frame_size;
index 40c07be9b5814f170f73fa1b3670d3813101bb67..fa4b050fe6e6108f73bc09594f283c32d4ddb0e2 100644 (file)
@@ -193,8 +193,7 @@ static int sta529_hw_params(struct snd_pcm_substream *substream,
                struct snd_pcm_hw_params *params,
                struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        int pdata, play_freq_val, record_freq_val;
        int bclk_to_fs_ratio;
 
index e463ae7fe1f4dadce828c277a12bd4d630eabaae..fa158cfe9b32d396d09bdb266727c57203c7e62d 100644 (file)
@@ -753,10 +753,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
 
 static int aic31xx_hw_params(struct snd_pcm_substream *substream,
                             struct snd_pcm_hw_params *params,
-                            struct snd_soc_dai *tmp)
+                            struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        u8 data = 0;
 
        dev_dbg(codec->dev, "## %s: format %d width %d rate %d\n",
index c94d4c1e3dacc1d7a51f2c6708848d56af6ecf9e..edf27acc1d77da6ba457cef5e8a403867e753fb2 100644 (file)
@@ -203,8 +203,7 @@ static int uda134x_hw_params(struct snd_pcm_substream *substream,
        struct snd_pcm_hw_params *params,
        struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
        u8 hw_params;
 
index 726df6d43c2b69227adc503e38397f977db4f220..dc47f6f5cd838ec5350eaaee5e289345bccaaab5 100644 (file)
@@ -564,8 +564,7 @@ static int uda1380_pcm_hw_params(struct snd_pcm_substream *substream,
 static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream,
                                 struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        u16 clk = uda1380_read_reg_cache(codec, UDA1380_CLK);
 
        /* shut down WSPLL power if running from this clock */
index 318989acbbe5fbb97878856ccab46330422f6bdf..49c2869b681cc1dd633ceed7909418250f24010a 100644 (file)
@@ -504,8 +504,7 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream,
                                 struct snd_pcm_hw_params *params,
                                 struct snd_soc_dai *dai)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_codec *codec = dai->codec;
        struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec);
        u16 paifa = 0;
        u16 paifb = 0;