aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-03-23 10:00:47 -0400
committerMark Brown <broonie@linaro.org>2014-03-23 10:00:47 -0400
commitf928badf5e58195af2ae3a457da35190d10ace48 (patch)
treeb3cf42e3aa815464a4b2da0508c6b12f246768b0 /sound
parent9780b68435eea68906bcf8f34c5522b5b087f4be (diff)
parentab64246cf8c31f70a390dcabd134097c3aec45ab (diff)
Merge remote-tracking branch 'asoc/topic/codecs' into asoc-next
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/isabelle.c3
-rw-r--r--sound/soc/codecs/mc13783.c6
-rw-r--r--sound/soc/codecs/rt5640.c3
-rw-r--r--sound/soc/codecs/sta529.c3
-rw-r--r--sound/soc/codecs/tlv320aic31xx.c39
-rw-r--r--sound/soc/codecs/uda134x.c3
-rw-r--r--sound/soc/codecs/uda1380.c3
-rw-r--r--sound/soc/codecs/wm8580.c3
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,
918 struct snd_pcm_hw_params *params, 918 struct snd_pcm_hw_params *params,
919 struct snd_soc_dai *dai) 919 struct snd_soc_dai *dai)
920{ 920{
921 struct snd_soc_pcm_runtime *rtd = substream->private_data; 921 struct snd_soc_codec *codec = dai->codec;
922 struct snd_soc_codec *codec = rtd->codec;
923 u16 aif = 0; 922 u16 aif = 0;
924 unsigned int fs_val = 0; 923 unsigned int fs_val = 0;
925 924
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,
106 struct snd_pcm_hw_params *params, 106 struct snd_pcm_hw_params *params,
107 struct snd_soc_dai *dai) 107 struct snd_soc_dai *dai)
108{ 108{
109 struct snd_soc_pcm_runtime *rtd = substream->private_data; 109 struct snd_soc_codec *codec = dai->codec;
110 struct snd_soc_codec *codec = rtd->codec;
111 unsigned int rate = params_rate(params); 110 unsigned int rate = params_rate(params);
112 int i; 111 int i;
113 112
@@ -126,8 +125,7 @@ static int mc13783_pcm_hw_params_codec(struct snd_pcm_substream *substream,
126 struct snd_pcm_hw_params *params, 125 struct snd_pcm_hw_params *params,
127 struct snd_soc_dai *dai) 126 struct snd_soc_dai *dai)
128{ 127{
129 struct snd_soc_pcm_runtime *rtd = substream->private_data; 128 struct snd_soc_codec *codec = dai->codec;
130 struct snd_soc_codec *codec = rtd->codec;
131 unsigned int rate = params_rate(params); 129 unsigned int rate = params_rate(params);
132 unsigned int val; 130 unsigned int val;
133 131
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)
1594static int rt5640_hw_params(struct snd_pcm_substream *substream, 1594static int rt5640_hw_params(struct snd_pcm_substream *substream,
1595 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) 1595 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
1596{ 1596{
1597 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1597 struct snd_soc_codec *codec = dai->codec;
1598 struct snd_soc_codec *codec = rtd->codec;
1599 struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); 1598 struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
1600 unsigned int val_len = 0, val_clk, mask_clk; 1599 unsigned int val_len = 0, val_clk, mask_clk;
1601 int dai_sel, pre_div, bclk_ms, frame_size; 1600 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,
193 struct snd_pcm_hw_params *params, 193 struct snd_pcm_hw_params *params,
194 struct snd_soc_dai *dai) 194 struct snd_soc_dai *dai)
195{ 195{
196 struct snd_soc_pcm_runtime *rtd = substream->private_data; 196 struct snd_soc_codec *codec = dai->codec;
197 struct snd_soc_codec *codec = rtd->codec;
198 int pdata, play_freq_val, record_freq_val; 197 int pdata, play_freq_val, record_freq_val;
199 int bclk_to_fs_ratio; 198 int bclk_to_fs_ratio;
200 199
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[] = {
129 }, 129 },
130}; 130};
131 131
132struct regmap_config aic31xx_i2c_regmap = { 132static const struct regmap_config aic31xx_i2c_regmap = {
133 .reg_bits = 8, 133 .reg_bits = 8,
134 .val_bits = 8, 134 .val_bits = 8,
135 .writeable_reg = aic31xx_writeable, 135 .writeable_reg = aic31xx_writeable,
@@ -321,9 +321,9 @@ static const struct snd_kcontrol_new ldac_in_control =
321static const struct snd_kcontrol_new rdac_in_control = 321static const struct snd_kcontrol_new rdac_in_control =
322 SOC_DAPM_ENUM("DAC Right Input", rdac_in_enum); 322 SOC_DAPM_ENUM("DAC Right Input", rdac_in_enum);
323 323
324int aic31xx_wait_bits(struct aic31xx_priv *aic31xx, unsigned int reg, 324static int aic31xx_wait_bits(struct aic31xx_priv *aic31xx, unsigned int reg,
325 unsigned int mask, unsigned int wbits, int sleep, 325 unsigned int mask, unsigned int wbits, int sleep,
326 int count) 326 int count)
327{ 327{
328 unsigned int bits; 328 unsigned int bits;
329 int counter = count; 329 int counter = count;
@@ -753,10 +753,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
753 753
754static int aic31xx_hw_params(struct snd_pcm_substream *substream, 754static int aic31xx_hw_params(struct snd_pcm_substream *substream,
755 struct snd_pcm_hw_params *params, 755 struct snd_pcm_hw_params *params,
756 struct snd_soc_dai *tmp) 756 struct snd_soc_dai *dai)
757{ 757{
758 struct snd_soc_pcm_runtime *rtd = substream->private_data; 758 struct snd_soc_codec *codec = dai->codec;
759 struct snd_soc_codec *codec = rtd->codec;
760 u8 data = 0; 759 u8 data = 0;
761 760
762 dev_dbg(codec->dev, "## %s: format %d width %d rate %d\n", 761 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)
943 942
944static void aic31xx_clk_off(struct snd_soc_codec *codec) 943static void aic31xx_clk_off(struct snd_soc_codec *codec)
945{ 944{
946 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
947 u8 mask = AIC31XX_PM_MASK; 945 u8 mask = AIC31XX_PM_MASK;
948 u8 off = 0; 946 u8 off = 0;
949 947
@@ -1021,7 +1019,8 @@ static int aic31xx_set_bias_level(struct snd_soc_codec *codec,
1021 } 1019 }
1022 break; 1020 break;
1023 case SND_SOC_BIAS_OFF: 1021 case SND_SOC_BIAS_OFF:
1024 aic31xx_power_off(codec); 1022 if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY)
1023 aic31xx_power_off(codec);
1025 break; 1024 break;
1026 } 1025 }
1027 codec->dapm.bias_level = level; 1026 codec->dapm.bias_level = level;
@@ -1050,18 +1049,9 @@ static int aic31xx_codec_probe(struct snd_soc_codec *codec)
1050 dev_dbg(aic31xx->dev, "## %s\n", __func__); 1049 dev_dbg(aic31xx->dev, "## %s\n", __func__);
1051 1050
1052 aic31xx = snd_soc_codec_get_drvdata(codec); 1051 aic31xx = snd_soc_codec_get_drvdata(codec);
1053 codec->control_data = aic31xx->regmap;
1054 1052
1055 aic31xx->codec = codec; 1053 aic31xx->codec = codec;
1056 1054
1057 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
1058
1059 if (ret != 0) {
1060 dev_err(codec->dev, "snd_soc_codec_set_cache_io failed %d\n",
1061 ret);
1062 return ret;
1063 }
1064
1065 for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) { 1055 for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) {
1066 aic31xx->disable_nb[i].nb.notifier_call = 1056 aic31xx->disable_nb[i].nb.notifier_call =
1067 aic31xx_regulator_event; 1057 aic31xx_regulator_event;
@@ -1187,7 +1177,7 @@ static void aic31xx_pdata_from_of(struct aic31xx_priv *aic31xx)
1187} 1177}
1188#endif /* CONFIG_OF */ 1178#endif /* CONFIG_OF */
1189 1179
1190void aic31xx_device_init(struct aic31xx_priv *aic31xx) 1180static void aic31xx_device_init(struct aic31xx_priv *aic31xx)
1191{ 1181{
1192 int ret, i; 1182 int ret, i;
1193 1183
@@ -1238,7 +1228,6 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c,
1238 return -ENOMEM; 1228 return -ENOMEM;
1239 1229
1240 aic31xx->regmap = devm_regmap_init_i2c(i2c, regmap_config); 1230 aic31xx->regmap = devm_regmap_init_i2c(i2c, regmap_config);
1241
1242 if (IS_ERR(aic31xx->regmap)) { 1231 if (IS_ERR(aic31xx->regmap)) {
1243 ret = PTR_ERR(aic31xx->regmap); 1232 ret = PTR_ERR(aic31xx->regmap);
1244 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", 1233 dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
@@ -1251,18 +1240,14 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c,
1251 1240
1252 aic31xx_device_init(aic31xx); 1241 aic31xx_device_init(aic31xx);
1253 1242
1254 ret = snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx, 1243 return snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx,
1255 aic31xx_dai_driver, 1244 aic31xx_dai_driver,
1256 ARRAY_SIZE(aic31xx_dai_driver)); 1245 ARRAY_SIZE(aic31xx_dai_driver));
1257
1258 return ret;
1259} 1246}
1260 1247
1261static int aic31xx_i2c_remove(struct i2c_client *i2c) 1248static int aic31xx_i2c_remove(struct i2c_client *i2c)
1262{ 1249{
1263 struct aic31xx_priv *aic31xx = dev_get_drvdata(&i2c->dev); 1250 snd_soc_unregister_codec(&i2c->dev);
1264
1265 kfree(aic31xx);
1266 return 0; 1251 return 0;
1267} 1252}
1268 1253
@@ -1284,7 +1269,7 @@ static struct i2c_driver aic31xx_i2c_driver = {
1284 .of_match_table = of_match_ptr(tlv320aic31xx_of_match), 1269 .of_match_table = of_match_ptr(tlv320aic31xx_of_match),
1285 }, 1270 },
1286 .probe = aic31xx_i2c_probe, 1271 .probe = aic31xx_i2c_probe,
1287 .remove = (aic31xx_i2c_remove), 1272 .remove = aic31xx_i2c_remove,
1288 .id_table = aic31xx_i2c_id, 1273 .id_table = aic31xx_i2c_id,
1289}; 1274};
1290 1275
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,
203 struct snd_pcm_hw_params *params, 203 struct snd_pcm_hw_params *params,
204 struct snd_soc_dai *dai) 204 struct snd_soc_dai *dai)
205{ 205{
206 struct snd_soc_pcm_runtime *rtd = substream->private_data; 206 struct snd_soc_codec *codec = dai->codec;
207 struct snd_soc_codec *codec = rtd->codec;
208 struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); 207 struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec);
209 u8 hw_params; 208 u8 hw_params;
210 209
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,
566static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream, 566static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream,
567 struct snd_soc_dai *dai) 567 struct snd_soc_dai *dai)
568{ 568{
569 struct snd_soc_pcm_runtime *rtd = substream->private_data; 569 struct snd_soc_codec *codec = dai->codec;
570 struct snd_soc_codec *codec = rtd->codec;
571 u16 clk = uda1380_read_reg_cache(codec, UDA1380_CLK); 570 u16 clk = uda1380_read_reg_cache(codec, UDA1380_CLK);
572 571
573 /* shut down WSPLL power if running from this clock */ 572 /* 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,
504 struct snd_pcm_hw_params *params, 504 struct snd_pcm_hw_params *params,
505 struct snd_soc_dai *dai) 505 struct snd_soc_dai *dai)
506{ 506{
507 struct snd_soc_pcm_runtime *rtd = substream->private_data; 507 struct snd_soc_codec *codec = dai->codec;
508 struct snd_soc_codec *codec = rtd->codec;
509 struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); 508 struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec);
510 u16 paifa = 0; 509 u16 paifa = 0;
511 u16 paifb = 0; 510 u16 paifb = 0;