summaryrefslogtreecommitdiffstats
path: root/firmware/drivers/wm8731l.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/wm8731l.c')
-rw-r--r--firmware/drivers/wm8731l.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/drivers/wm8731l.c b/firmware/drivers/wm8731l.c
index 4f0f249149..62b1b6a81e 100644
--- a/firmware/drivers/wm8731l.c
+++ b/firmware/drivers/wm8731l.c
@@ -43,6 +43,9 @@
#define IPOD_PCM_LEVEL 0x65 /* -6dB */
+/* use zero crossing to reduce clicks during volume changes */
+#define VOLUME_ZC_WAIT (1<<7)
+
/* convert tenth of dB volume (-730..60) to master volume register value */
int tenthdb2master(int db)
{
@@ -159,8 +162,8 @@ int audiohw_set_master_vol(int vol_l, int vol_r)
/* 0110000 == -73dB */
/* 0101111 == mute (0x2f) */
- wmcodec_write(LOUTVOL, vol_l);
- wmcodec_write(ROUTVOL, vol_r);
+ wmcodec_write(LOUTVOL, VOLUME_ZC_WAIT | vol_l);
+ wmcodec_write(ROUTVOL, VOLUME_ZC_WAIT | vol_r);
return 0;
}