aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs42l51.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-28 17:25:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-28 17:25:01 -0400
commit68d99b2c8efcb6ed3807a55569300c53b5f88be5 (patch)
treef189c8f2132d3668a2f0e503f5c3f8695b26a1c8 /sound/soc/codecs/cs42l51.c
parent0e59e7e7feb5a12938fbf9135147eeda3238c6c4 (diff)
parent8128c9f21509f9a8b6da94ac432d845dda458406 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (549 commits) ALSA: hda - Fix ADC input-amp handling for Cx20549 codec ALSA: hda - Keep EAPD turned on for old Conexant chips ALSA: hda/realtek - Fix missing volume controls with ALC260 ASoC: wm8940: Properly set codec->dapm.bias_level ALSA: hda - Fix pin-config for ASUS W90V ALSA: hda - Fix surround/CLFE headphone and speaker pins order ALSA: hda - Fix typo ALSA: Update the sound git tree URL ALSA: HDA: Add new revision for ALC662 ASoC: max98095: Convert codec->hw_write to snd_soc_write ASoC: keep pointer to resource so it can be freed ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2 ASoC: da7210: Add support for line out and DAC ASoC: da7210: Add support for DAPM ALSA: hda/realtek - Fix DAC assignments of multiple speakers ASoC: Use SGTL5000_LINREG_VDDD_MASK instead of hardcoded mask value ASoC: Set sgtl5000->ldo in ldo_regulator_register ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture ASoC: wm8994: Use SND_SOC_DAPM_AIF_OUT for AIF3 Capture ...
Diffstat (limited to 'sound/soc/codecs/cs42l51.c')
-rw-r--r--sound/soc/codecs/cs42l51.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c
index 8fb7070108dd..8c3c8205d19e 100644
--- a/sound/soc/codecs/cs42l51.c
+++ b/sound/soc/codecs/cs42l51.c
@@ -42,7 +42,6 @@ enum master_slave_mode {
42 42
43struct cs42l51_private { 43struct cs42l51_private {
44 enum snd_soc_control_type control_type; 44 enum snd_soc_control_type control_type;
45 void *control_data;
46 unsigned int mclk; 45 unsigned int mclk;
47 unsigned int audio_mode; /* The mode (I2S or left-justified) */ 46 unsigned int audio_mode; /* The mode (I2S or left-justified) */
48 enum master_slave_mode func; 47 enum master_slave_mode func;
@@ -57,7 +56,7 @@ struct cs42l51_private {
57static int cs42l51_fill_cache(struct snd_soc_codec *codec) 56static int cs42l51_fill_cache(struct snd_soc_codec *codec)
58{ 57{
59 u8 *cache = codec->reg_cache + 1; 58 u8 *cache = codec->reg_cache + 1;
60 struct i2c_client *i2c_client = codec->control_data; 59 struct i2c_client *i2c_client = to_i2c_client(codec->dev);
61 s32 length; 60 s32 length;
62 61
63 length = i2c_smbus_read_i2c_block_data(i2c_client, 62 length = i2c_smbus_read_i2c_block_data(i2c_client,
@@ -289,7 +288,6 @@ static int cs42l51_set_dai_fmt(struct snd_soc_dai *codec_dai,
289{ 288{
290 struct snd_soc_codec *codec = codec_dai->codec; 289 struct snd_soc_codec *codec = codec_dai->codec;
291 struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec); 290 struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec);
292 int ret = 0;
293 291
294 switch (format & SND_SOC_DAIFMT_FORMAT_MASK) { 292 switch (format & SND_SOC_DAIFMT_FORMAT_MASK) {
295 case SND_SOC_DAIFMT_I2S: 293 case SND_SOC_DAIFMT_I2S:
@@ -299,7 +297,7 @@ static int cs42l51_set_dai_fmt(struct snd_soc_dai *codec_dai,
299 break; 297 break;
300 default: 298 default:
301 dev_err(codec->dev, "invalid DAI format\n"); 299 dev_err(codec->dev, "invalid DAI format\n");
302 ret = -EINVAL; 300 return -EINVAL;
303 } 301 }
304 302
305 switch (format & SND_SOC_DAIFMT_MASTER_MASK) { 303 switch (format & SND_SOC_DAIFMT_MASTER_MASK) {
@@ -310,11 +308,11 @@ static int cs42l51_set_dai_fmt(struct snd_soc_dai *codec_dai,
310 cs42l51->func = MODE_SLAVE_AUTO; 308 cs42l51->func = MODE_SLAVE_AUTO;
311 break; 309 break;
312 default: 310 default:
313 ret = -EINVAL; 311 dev_err(codec->dev, "Unknown master/slave configuration\n");
314 break; 312 return -EINVAL;
315 } 313 }
316 314
317 return ret; 315 return 0;
318} 316}
319 317
320struct cs42l51_ratios { 318struct cs42l51_ratios {
@@ -520,8 +518,6 @@ static int cs42l51_probe(struct snd_soc_codec *codec)
520 struct snd_soc_dapm_context *dapm = &codec->dapm; 518 struct snd_soc_dapm_context *dapm = &codec->dapm;
521 int ret, reg; 519 int ret, reg;
522 520
523 codec->control_data = cs42l51->control_data;
524
525 ret = cs42l51_fill_cache(codec); 521 ret = cs42l51_fill_cache(codec);
526 if (ret < 0) { 522 if (ret < 0) {
527 dev_err(codec->dev, "failed to fill register cache\n"); 523 dev_err(codec->dev, "failed to fill register cache\n");
@@ -593,7 +589,6 @@ static int cs42l51_i2c_probe(struct i2c_client *i2c_client,
593 } 589 }
594 590
595 i2c_set_clientdata(i2c_client, cs42l51); 591 i2c_set_clientdata(i2c_client, cs42l51);
596 cs42l51->control_data = i2c_client;
597 cs42l51->control_type = SND_SOC_I2C; 592 cs42l51->control_type = SND_SOC_I2C;
598 593
599 ret = snd_soc_register_codec(&i2c_client->dev, 594 ret = snd_soc_register_codec(&i2c_client->dev,