Fixed line out volume for 4G, Nano and 5G Ipods. Partial patch #4814 by
Ralf Herz.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9181 a1c6a512-1295-4272-9138-f99709370657
diff --git a/firmware/drivers/wm8758.c b/firmware/drivers/wm8758.c
index 3867748..e997110 100644
--- a/firmware/drivers/wm8758.c
+++ b/firmware/drivers/wm8758.c
@@ -148,6 +148,11 @@
wm8758_write(LOUT1VOL, vol_l);
wm8758_write(ROUT1VOL, 0x100 | vol_r);
+ return 0;
+}
+
+int wmcodec_set_lineout_vol(int vol_l, int vol_r)
+{
/* OUT2 */
wm8758_write(LOUT2VOL, vol_l);
wm8758_write(ROUT2VOL, 0x100 | vol_r);
diff --git a/firmware/drivers/wm8975.c b/firmware/drivers/wm8975.c
index 51c12f1..64a123b 100644
--- a/firmware/drivers/wm8975.c
+++ b/firmware/drivers/wm8975.c
@@ -176,6 +176,11 @@
wm8975_write(LOUT1VOL, vol_l);
wm8975_write(ROUT1VOL, 0x100 | vol_r);
+ return 0;
+}
+
+int wmcodec_set_lineout_vol(int vol_l, int vol_r)
+{
/* OUT2 */
wm8975_write(LOUT2VOL, vol_l);
wm8975_write(ROUT2VOL, 0x100 | vol_r);
diff --git a/firmware/export/wm8758.h b/firmware/export/wm8758.h
index adc17f8..13eccb9 100644
--- a/firmware/export/wm8758.h
+++ b/firmware/export/wm8758.h
@@ -24,6 +24,7 @@
extern int wmcodec_init(void);
extern void wmcodec_enable_output(bool enable);
extern int wmcodec_set_master_vol(int vol_l, int vol_r);
+extern int wmcodec_set_lineout_vol(int vol_l, int vol_r);
extern int wmcodec_set_mixer_vol(int channel1, int channel2);
extern void wmcodec_set_bass(int value);
extern void wmcodec_set_treble(int value);
diff --git a/firmware/export/wm8975.h b/firmware/export/wm8975.h
index 4d575c3..a676939 100644
--- a/firmware/export/wm8975.h
+++ b/firmware/export/wm8975.h
@@ -24,6 +24,7 @@
extern int wmcodec_init(void);
extern void wmcodec_enable_output(bool enable);
extern int wmcodec_set_master_vol(int vol_l, int vol_r);
+extern int wmcodec_set_lineout_vol(int vol_l, int vol_r);
extern int wmcodec_set_mixer_vol(int channel1, int channel2);
extern void wmcodec_set_bass(int value);
extern void wmcodec_set_treble(int value);
diff --git a/firmware/sound.c b/firmware/sound.c
index a3eb6da..88412c4 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -453,6 +453,10 @@
uda1380_set_master_vol(tenthdb2master(l), tenthdb2master(r));
#elif defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_WM8731)
wmcodec_set_master_vol(tenthdb2master(l), tenthdb2master(r));
+#if defined(HAVE_WM8975) || defined(HAVE_WM8758)
+ wmcodec_set_lineout_vol(tenthdb2master(0), tenthdb2master(0));
+#endif
+
#endif
}
#endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */