diff options
Diffstat (limited to 'sound/soc/codecs/wm8990.c')
-rw-r--r-- | sound/soc/codecs/wm8990.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index 3ecce5168e94..dd995ef448b4 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c | |||
@@ -82,7 +82,7 @@ static const u16 wm8990_reg[] = { | |||
82 | 0x0003, /* R35 - ClassD1 */ | 82 | 0x0003, /* R35 - ClassD1 */ |
83 | 0x0000, /* R36 */ | 83 | 0x0000, /* R36 */ |
84 | 0x0100, /* R37 - ClassD3 */ | 84 | 0x0100, /* R37 - ClassD3 */ |
85 | 0x0000, /* R38 */ | 85 | 0x0079, /* R38 - ClassD4 */ |
86 | 0x0000, /* R39 - Input Mixer1 */ | 86 | 0x0000, /* R39 - Input Mixer1 */ |
87 | 0x0000, /* R40 - Input Mixer2 */ | 87 | 0x0000, /* R40 - Input Mixer2 */ |
88 | 0x0000, /* R41 - Input Mixer3 */ | 88 | 0x0000, /* R41 - Input Mixer3 */ |
@@ -311,11 +311,15 @@ SOC_SINGLE("Speaker Mode Switch", WM8990_CLASSD1, | |||
311 | WM8990_CDMODE_BIT, 1, 0), | 311 | WM8990_CDMODE_BIT, 1, 0), |
312 | 312 | ||
313 | SOC_SINGLE("Speaker Output Attenuation Volume", WM8990_SPEAKER_VOLUME, | 313 | SOC_SINGLE("Speaker Output Attenuation Volume", WM8990_SPEAKER_VOLUME, |
314 | WM8990_SPKVOL_SHIFT, WM8990_SPKVOL_MASK, 0), | 314 | WM8990_SPKATTN_SHIFT, WM8990_SPKATTN_MASK, 0), |
315 | SOC_SINGLE("Speaker DC Boost Volume", WM8990_CLASSD3, | 315 | SOC_SINGLE("Speaker DC Boost Volume", WM8990_CLASSD3, |
316 | WM8990_DCGAIN_SHIFT, WM8990_DCGAIN_MASK, 0), | 316 | WM8990_DCGAIN_SHIFT, WM8990_DCGAIN_MASK, 0), |
317 | SOC_SINGLE("Speaker AC Boost Volume", WM8990_CLASSD3, | 317 | SOC_SINGLE("Speaker AC Boost Volume", WM8990_CLASSD3, |
318 | WM8990_ACGAIN_SHIFT, WM8990_ACGAIN_MASK, 0), | 318 | WM8990_ACGAIN_SHIFT, WM8990_ACGAIN_MASK, 0), |
319 | SOC_SINGLE_TLV("Speaker Volume", WM8990_CLASSD4, | ||
320 | WM8990_SPKVOL_SHIFT, WM8990_SPKVOL_MASK, 0, out_pga_tlv), | ||
321 | SOC_SINGLE("Speaker ZC Switch", WM8990_CLASSD4, | ||
322 | WM8990_SPKZC_SHIFT, WM8990_SPKZC_MASK, 0), | ||
319 | 323 | ||
320 | SOC_WM899X_OUTPGA_SINGLE_R_TLV("Left DAC Digital Volume", | 324 | SOC_WM899X_OUTPGA_SINGLE_R_TLV("Left DAC Digital Volume", |
321 | WM8990_LEFT_DAC_DIGITAL_VOLUME, | 325 | WM8990_LEFT_DAC_DIGITAL_VOLUME, |
@@ -920,7 +924,7 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
920 | {"SPKMIX", "SPKMIX Left Mixer PGA Switch", "LOPGA"}, | 924 | {"SPKMIX", "SPKMIX Left Mixer PGA Switch", "LOPGA"}, |
921 | {"SPKMIX", "SPKMIX Right Mixer PGA Switch", "ROPGA"}, | 925 | {"SPKMIX", "SPKMIX Right Mixer PGA Switch", "ROPGA"}, |
922 | {"SPKMIX", "SPKMIX Right DAC Switch", "Right DAC"}, | 926 | {"SPKMIX", "SPKMIX Right DAC Switch", "Right DAC"}, |
923 | {"SPKMIX", "SPKMIX Left DAC Switch", "Right DAC"}, | 927 | {"SPKMIX", "SPKMIX Left DAC Switch", "Left DAC"}, |
924 | 928 | ||
925 | /* LONMIX */ | 929 | /* LONMIX */ |
926 | {"LONMIX", "LONMIX Left Mixer PGA Switch", "LOPGA"}, | 930 | {"LONMIX", "LONMIX Left Mixer PGA Switch", "LOPGA"}, |
@@ -1496,10 +1500,9 @@ static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1496 | client_template.addr = addr; | 1500 | client_template.addr = addr; |
1497 | 1501 | ||
1498 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 1502 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
1499 | if (i2c == NULL) { | 1503 | if (i2c == NULL) |
1500 | kfree(codec); | ||
1501 | return -ENOMEM; | 1504 | return -ENOMEM; |
1502 | } | 1505 | |
1503 | i2c_set_clientdata(i2c, codec); | 1506 | i2c_set_clientdata(i2c, codec); |
1504 | codec->control_data = i2c; | 1507 | codec->control_data = i2c; |
1505 | 1508 | ||
@@ -1517,7 +1520,6 @@ static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1517 | return ret; | 1520 | return ret; |
1518 | 1521 | ||
1519 | err: | 1522 | err: |
1520 | kfree(codec); | ||
1521 | kfree(i2c); | 1523 | kfree(i2c); |
1522 | return ret; | 1524 | return ret; |
1523 | } | 1525 | } |
@@ -1591,6 +1593,11 @@ static int wm8990_probe(struct platform_device *pdev) | |||
1591 | #else | 1593 | #else |
1592 | /* Add other interfaces here */ | 1594 | /* Add other interfaces here */ |
1593 | #endif | 1595 | #endif |
1596 | |||
1597 | if (ret != 0) { | ||
1598 | kfree(codec->private_data); | ||
1599 | kfree(codec); | ||
1600 | } | ||
1594 | return ret; | 1601 | return ret; |
1595 | } | 1602 | } |
1596 | 1603 | ||