summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2011-03-14 09:58:19 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2011-03-14 09:58:19 +0000
commita8dc45f51191221c4f584d02d208244d2273f499 (patch)
treeefce7fe55e97efb118f2f8c13d7b90982960103c /firmware/export
parent8aed244bd8b05e7cc0a61846b3cb82e936f18494 (diff)
slightly modified FS#11531 by me: WM8750/51 driver rework
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29584 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/wm8751.h38
1 files changed, 31 insertions, 7 deletions
diff --git a/firmware/export/wm8751.h b/firmware/export/wm8751.h
index a7c28a9855..3bbf744463 100644
--- a/firmware/export/wm8751.h
+++ b/firmware/export/wm8751.h
@@ -25,13 +25,15 @@
#define VOLUME_MIN -730
#define VOLUME_MAX 60
-/* turn off 3D Enchance feature of WM8750 for now
#if defined(HAVE_WM8750)
-#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | DEPTH_3D_CAP)
+#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \
+ BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \
+ DEPTH_3D_CAP)
#else
-*/
-#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP)
-/* #endif */
+
+#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \
+ BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP)
+#endif
extern int tenthdb2master(int db);
@@ -60,12 +62,13 @@ void audiohw_set_recsrc(int source, bool recording);
#endif
#define LOUT1 0x02
-#define LOUT1_LOUT1VOL_MASK (0x07f << 0)
+#define LOUT1_LOUT1VOL_MASK 0x07f
#define LOUT1_LOUT1VOL(x) ((x) & 0x7f)
#define LOUT1_LO1ZC (1 << 7)
#define LOUT1_LO1VU (1 << 8)
#define ROUT1 0x03
+#define ROUT1_ROUT1VOL_MASK 0x17f
#define ROUT1_ROUT1VOL(x) ((x) & 0x7f)
#define ROUT1_RO1ZC (1 << 7)
#define ROUT1_RO1VU (1 << 8)
@@ -110,11 +113,13 @@ void audiohw_set_recsrc(int source, bool recording);
#define RIGHTGAIN_RDVU (1 << 8)
#define BASSCTRL 0x0c
+#define BASSCTRL_BASS_MASK 0x0f
#define BASSCTRL_BASS(x) ((x) & 0xf)
#define BASSCTRL_BC (1 << 6)
#define BASSCTRL_BB (1 << 7)
#define TREBCTRL 0x0d
+#define TREBCTRL_TREB_MASK 0x0f
#define TREBCTRL_TREB(x) ((x) & 0xf)
#define TREBCTRL_TC (1 << 6)
@@ -125,6 +130,7 @@ void audiohw_set_recsrc(int source, bool recording);
#define ENHANCE_3D 0x10
#define ENHANCE_3D_3DEN (1 << 0)
#define ENHANCE_3D_DEPTH(x) (((x) & 0xf) << 1)
+#define ENHANCE_3D_DEPTH_MASK (0x0f << 1)
#define ENHANCE_3D_3DLC (1 << 5)
#define ENHANCE_3D_3DUC (1 << 6)
#define ENHANCE_3D_MODE3D_PLAYBACK (1 << 7)
@@ -137,6 +143,7 @@ void audiohw_set_recsrc(int source, bool recording);
#define ALC1_ALCSEL_RIGHT (1 << 7)
#define ALC1_ALCSEL_LEFT (2 << 7)
#define ALC1_ALCSEL_STEREO (3 << 7)
+#define ALC1_ALCSEL_MASK (3 << 7)
#define ALC2 0x12
#define ALC2_HLD(x) ((x) & 0x0f)
@@ -152,6 +159,14 @@ void audiohw_set_recsrc(int source, bool recording);
#define NGAT_NGG_MUTEADC (1 << 1)
#define NGAT_NGG(x) (((x) & 0x3) << 1)
#define NGAT_NGTH(x) (((x) & 0x1f) << 3)
+
+#define LADCVOL 0x15
+#define LADCVOL_LADCVOL(x) ((x) & 0xff)
+#define LADCVOL_LAVU (1 << 8)
+
+#define RADCVOL 0x16
+#define RADCVOL_RADCVOL(x) ((x) & 0xff)
+#define RADCVOL_RAVU (1 << 8)
#endif
#define ADDITIONAL1 0x17
@@ -167,6 +182,7 @@ void audiohw_set_recsrc(int source, bool recording);
#define ADDITIONAL1_VSEL_DEFAULT2 (2 << 6)
#define ADDITIONAL1_VSEL_DEFAULT (3 << 6)
#define ADDITIONAL1_VSEL(x) ((x) & (0x3 << 6))
+#define ADDITIONAL1_VSEL_MASK (3 << 6)
#define ADDITIONAL1_TSDEN (1 << 8)
#define ADDITIONAL2 0x18
@@ -196,6 +212,7 @@ void audiohw_set_recsrc(int source, bool recording);
#define PWRMGMT1_VMIDSEL_500K (2 << 7)
#define PWRMGMT1_VMIDSEL_5K (3 << 7)
#define PWRMGMT1_VMIDSEL(x) ((x) & (0x3 << 7))
+#define PWRMGMT1_VMIDSEL_MASK ((1<<8)|(1<<7))
#define PWRMGMT2 0x1a
#define PWRMGMT2_OUT3 (1 << 1)
@@ -232,7 +249,8 @@ void audiohw_set_recsrc(int source, bool recording);
#define ADCL_LINSEL_LINPUT1 (0 << 6)
#define ADCL_LINSEL_LINPUT2 (1 << 6)
#define ADCL_LINSEL_LINPUT3 (2 << 6)
-#define ADCL_LINSEL_DIFF (3 << 6)
+#define ADCL_LINSEL_DIFF (3 << 6)
+#define ADCL_LINSEL_MASK (3 << 6)
#define ADCR 0x21
#define ADCR_RMICBOOST_DISABLED (0 << 4)
@@ -244,6 +262,7 @@ void audiohw_set_recsrc(int source, bool recording);
#define ADCR_RINSEL_RINPUT2 (1 << 6)
#define ADCR_RINSEL_RINPUT3 (2 << 6)
#define ADCR_RINSEL_DIFF (3 << 6)
+#define ADCR_RINSEL_MASK (3 << 6)
#endif
#define LEFTMIX1 0x22
@@ -256,6 +275,7 @@ void audiohw_set_recsrc(int source, bool recording);
#endif
#define LEFTMIX1_LI2LO_DEFAULT (5 << 4)
#define LEFTMIX1_LI2LOVOL(x) ((x) & (0x7 << 4))
+#define LEFTMIX1_LI2LOVOL_MASK (0x7 << 4)
#define LEFTMIX1_LI2LO (1 << 7)
#define LEFTMIX1_LD2LO (1 << 8)
@@ -297,6 +317,7 @@ void audiohw_set_recsrc(int source, bool recording);
#endif
#define RIGHTMIX2_RI2RO_DEFAULT (5 << 4)
#define RIGHTMIX2_RI2ROVOL(x) ((x) & (0x7 << 4))
+#define RIGHTMIX2_RI2ROVOL_MASK (0x7 << 4)
#define RIGHTMIX2_RI2RO (1 << 7)
#define RIGHTMIX2_RD2RO (1 << 8)
@@ -312,11 +333,13 @@ void audiohw_set_recsrc(int source, bool recording);
#define MONOMIX2_RD2MO (1 << 8)
#define LOUT2 0x28
+#define LOUT2_LOUT2VOL_MASK 0x7f
#define LOUT2_LOUT2VOL(x) ((x) & 0x7f)
#define LOUT2_LO2ZC (1 << 7)
#define LOUT2_LO2VU (1 << 8)
#define ROUT2 0x29
+#define ROUT2_ROUT2VOL_MASK 0x17f
#define ROUT2_ROUT2VOL(x) ((x) & 0x7f)
#define ROUT2_RO2ZC (1 << 7)
#define ROUT2_RO2VU (1 << 8)
@@ -324,4 +347,5 @@ void audiohw_set_recsrc(int source, bool recording);
#define MONOOUT 0x2a
#define MONOOUT_MOZC (1 << 7)
+#define WM_NUM_REGS 0x2b
#endif /* _WM8751_H */