summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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