diff options
author | Mark Brown <broonie@linaro.org> | 2014-03-23 15:00:47 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-23 15:00:47 +0100 |
commit | f928badf5e58195af2ae3a457da35190d10ace48 (patch) | |
tree | b3cf42e3aa815464a4b2da0508c6b12f246768b0 | |
parent | Merge remote-tracking branch 'asoc/topic/core' into asoc-next (diff) | |
parent | ASoC: codecs: Replace instances of rtd->codec with dai->codec (diff) | |
download | linux-f928badf5e58195af2ae3a457da35190d10ace48.tar.xz linux-f928badf5e58195af2ae3a457da35190d10ace48.zip |
Merge remote-tracking branch 'asoc/topic/codecs' into asoc-next
-rw-r--r-- | sound/soc/codecs/isabelle.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/mc13783.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/rt5640.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/sta529.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic31xx.c | 39 | ||||
-rw-r--r-- | sound/soc/codecs/uda134x.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/uda1380.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/wm8580.c | 3 |
8 files changed, 20 insertions, 43 deletions
diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c index 3e264a78017a..3a89ce66d51d 100644 --- a/sound/soc/codecs/isabelle.c +++ b/sound/soc/codecs/isabelle.c @@ -918,8 +918,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; diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c index 37d737e567a1..2c59b1fb69dc 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c @@ -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; diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 13ccee43cfc5..0061ae6b6716 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -1594,8 +1594,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; diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index a3c61d308bb0..a40c4b0196a3 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c @@ -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; diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index e60e37b43a1b..fa158cfe9b32 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -129,7 +129,7 @@ static const struct regmap_range_cfg aic31xx_ranges[] = { }, }; -struct regmap_config aic31xx_i2c_regmap = { +static const struct regmap_config aic31xx_i2c_regmap = { .reg_bits = 8, .val_bits = 8, .writeable_reg = aic31xx_writeable, @@ -321,9 +321,9 @@ static const struct snd_kcontrol_new ldac_in_control = static const struct snd_kcontrol_new rdac_in_control = SOC_DAPM_ENUM("DAC Right Input", rdac_in_enum); -int aic31xx_wait_bits(struct aic31xx_priv *aic31xx, unsigned int reg, - unsigned int mask, unsigned int wbits, int sleep, - int count) +static int aic31xx_wait_bits(struct aic31xx_priv *aic31xx, unsigned int reg, + unsigned int mask, unsigned int wbits, int sleep, + int count) { unsigned int bits; int counter = count; @@ -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", @@ -943,7 +942,6 @@ static void aic31xx_clk_on(struct snd_soc_codec *codec) static void aic31xx_clk_off(struct snd_soc_codec *codec) { - struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); u8 mask = AIC31XX_PM_MASK; u8 off = 0; @@ -1021,7 +1019,8 @@ static int aic31xx_set_bias_level(struct snd_soc_codec *codec, } break; case SND_SOC_BIAS_OFF: - aic31xx_power_off(codec); + if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) + aic31xx_power_off(codec); break; } codec->dapm.bias_level = level; @@ -1050,18 +1049,9 @@ static int aic31xx_codec_probe(struct snd_soc_codec *codec) dev_dbg(aic31xx->dev, "## %s\n", __func__); aic31xx = snd_soc_codec_get_drvdata(codec); - codec->control_data = aic31xx->regmap; aic31xx->codec = codec; - ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP); - - if (ret != 0) { - dev_err(codec->dev, "snd_soc_codec_set_cache_io failed %d\n", - ret); - return ret; - } - for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) { aic31xx->disable_nb[i].nb.notifier_call = aic31xx_regulator_event; @@ -1187,7 +1177,7 @@ static void aic31xx_pdata_from_of(struct aic31xx_priv *aic31xx) } #endif /* CONFIG_OF */ -void aic31xx_device_init(struct aic31xx_priv *aic31xx) +static void aic31xx_device_init(struct aic31xx_priv *aic31xx) { int ret, i; @@ -1238,7 +1228,6 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, return -ENOMEM; aic31xx->regmap = devm_regmap_init_i2c(i2c, regmap_config); - if (IS_ERR(aic31xx->regmap)) { ret = PTR_ERR(aic31xx->regmap); dev_err(&i2c->dev, "Failed to allocate register map: %d\n", @@ -1251,18 +1240,14 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, aic31xx_device_init(aic31xx); - ret = snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx, + return snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx, aic31xx_dai_driver, ARRAY_SIZE(aic31xx_dai_driver)); - - return ret; } static int aic31xx_i2c_remove(struct i2c_client *i2c) { - struct aic31xx_priv *aic31xx = dev_get_drvdata(&i2c->dev); - - kfree(aic31xx); + snd_soc_unregister_codec(&i2c->dev); return 0; } @@ -1284,7 +1269,7 @@ static struct i2c_driver aic31xx_i2c_driver = { .of_match_table = of_match_ptr(tlv320aic31xx_of_match), }, .probe = aic31xx_i2c_probe, - .remove = (aic31xx_i2c_remove), + .remove = aic31xx_i2c_remove, .id_table = aic31xx_i2c_id, }; diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index c94d4c1e3dac..edf27acc1d77 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -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; diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 4dadaa8ad46c..e62e70781ec2 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c @@ -566,8 +566,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 */ diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 7558c838193d..af7ed8b5d4e1 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -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; |