summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2008-09-29 21:41:38 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2008-09-29 21:41:38 +0000
commitf60c1ae0506a4407859a2e1ed97d59503c59bb1e (patch)
tree7740529effcfe3eb7d8e6a0c09115ad9239a30a8 /firmware
parentb297eb9d9d1010e15937a120c4068d661966d5f8 (diff)
downloadrockbox-f60c1ae0506a4407859a2e1ed97d59503c59bb1e.tar.gz
rockbox-f60c1ae0506a4407859a2e1ed97d59503c59bb1e.zip
More samplerates for playback for ipod 1g/2g, and fix the ipod mini 1g/2g which also use WM8721.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18669 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/audio/wm8721.c28
-rw-r--r--firmware/export/config-ipod1g2g.h12
2 files changed, 35 insertions, 5 deletions
diff --git a/firmware/drivers/audio/wm8721.c b/firmware/drivers/audio/wm8721.c
index 141224a65b..1740a48d18 100644
--- a/firmware/drivers/audio/wm8721.c
+++ b/firmware/drivers/audio/wm8721.c
@@ -104,7 +104,7 @@ void audiohw_enable_output(bool enable)
/* DACSEL=1 */
wmcodec_write(0x4, 0x10);
-
+
/* set power register to POWEROFF=0 on OUTPD=0, DACPD=0 */
wmcodec_write(PDCTRL, 0x67);
@@ -123,7 +123,7 @@ void audiohw_enable_output(bool enable)
/* 5. Set DACMU = 0 to soft-un-mute the audio DACs. */
wmcodec_write(DAPCTRL, 0x0);
-
+
audiohw_mute(0);
} else {
audiohw_mute(1);
@@ -168,7 +168,29 @@ void audiohw_set_nsorder(int order)
void audiohw_set_sample_rate(int sampling_control)
{
+ int rate = 0;
+ switch(sampling_control)
+ {
+ case SAMPR_96:
+ rate = WM8721_USB24_96000HZ;
+ break;
+ case SAMPR_88:
+ rate = WM8721_USB24_88200HZ;
+ break;
+ case SAMPR_48:
+ rate = WM8721_USB24_48000HZ;
+ break;
+ case SAMPR_44:
+ rate = WM8721_USB24_44100HZ;
+ break;
+ case SAMPR_32:
+ rate = WM8721_USB24_32000HZ;
+ break;
+ case SAMPR_8:
+ rate = WM8721_USB24_8000HZ;
+ break;
+ }
codec_set_active(0x0);
- wmcodec_write(SAMPCTRL, sampling_control);
+ wmcodec_write(SAMPCTRL, rate);
codec_set_active(0x1);
}
diff --git a/firmware/export/config-ipod1g2g.h b/firmware/export/config-ipod1g2g.h
index cbb5267331..2d3dff1edc 100644
--- a/firmware/export/config-ipod1g2g.h
+++ b/firmware/export/config-ipod1g2g.h
@@ -13,8 +13,16 @@
/* define this if you use an ATA controller */
#define HAVE_ATA
-/* define this if you have recording possibility */
-/*#define HAVE_RECORDING*/
+/* define this if you have recording possibility
+#define HAVE_RECORDING */
+
+/* define the bitmask of hardware sample rates */
+#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
+ SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
+
+/* define the bitmask of recording sample rates
+#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
+ SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP