Skip to content

Commit 8bc3c2c

Browse files
committed
ASoC: Tune performance of WM8958 revision A
Update some of the default configuration for the device to improve the performance. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
1 parent dd31b31 commit 8bc3c2c

2 files changed

Lines changed: 36 additions & 9 deletions

File tree

‎include/linux/mfd/wm8994/registers.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#define WM8994_LDO_1 0x3B
6565
#define WM8994_LDO_2 0x3C
6666
#define WM8994_CHARGE_PUMP_1 0x4C
67+
#define WM8958_CHARGE_PUMP_2 0x4D
6768
#define WM8994_CLASS_W_1 0x51
6869
#define WM8994_DC_SERVO_1 0x54
6970
#define WM8994_DC_SERVO_2 0x55
@@ -1925,6 +1926,14 @@
19251926
#define WM8994_CP_ENA_SHIFT 15 /* CP_ENA */
19261927
#define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */
19271928

1929+
/*
1930+
* R77 (0x4D) - Charge Pump (2)
1931+
*/
1932+
#define WM8958_CP_DISCH 0x8000 /* CP_DISCH */
1933+
#define WM8958_CP_DISCH_MASK 0x8000 /* CP_DISCH */
1934+
#define WM8958_CP_DISCH_SHIFT 15 /* CP_DISCH */
1935+
#define WM8958_CP_DISCH_WIDTH 1 /* CP_DISCH */
1936+
19281937
/*
19291938
* R81 (0x51) - Class W (1)
19301939
*/

‎sound/soc/codecs/wm8994.c‎

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,15 +1858,33 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
18581858
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
18591859
pm_runtime_get_sync(codec->dev);
18601860

1861-
/* Tweak DC servo and DSP configuration for
1862-
* improved performance. */
1863-
if (control->type == WM8994 && wm8994->revision < 4) {
1864-
/* Tweak DC servo and DSP configuration for
1865-
* improved performance. */
1866-
snd_soc_write(codec, 0x102, 0x3);
1867-
snd_soc_write(codec, 0x56, 0x3);
1868-
snd_soc_write(codec, 0x817, 0);
1869-
snd_soc_write(codec, 0x102, 0);
1861+
switch (control->type) {
1862+
case WM8994:
1863+
if (wm8994->revision < 4) {
1864+
/* Tweak DC servo and DSP
1865+
* configuration for improved
1866+
* performance. */
1867+
snd_soc_write(codec, 0x102, 0x3);
1868+
snd_soc_write(codec, 0x56, 0x3);
1869+
snd_soc_write(codec, 0x817, 0);
1870+
snd_soc_write(codec, 0x102, 0);
1871+
}
1872+
break;
1873+
1874+
case WM8958:
1875+
if (wm8994->revision == 0) {
1876+
/* Optimise performance for rev A */
1877+
snd_soc_write(codec, 0x102, 0x3);
1878+
snd_soc_write(codec, 0xcb, 0x81);
1879+
snd_soc_write(codec, 0x817, 0);
1880+
snd_soc_write(codec, 0x102, 0);
1881+
1882+
snd_soc_update_bits(codec,
1883+
WM8958_CHARGE_PUMP_2,
1884+
WM8958_CP_DISCH,
1885+
WM8958_CP_DISCH);
1886+
}
1887+
break;
18701888
}
18711889

18721890
/* Discharge LINEOUT1 & 2 */

0 commit comments

Comments
 (0)