diff options
author | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2013-05-12 23:31:32 +0400 |
---|---|---|
committer | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2013-05-24 11:32:20 +0400 |
commit | 00b856365469b4ff82928597923094aa3236abb5 (patch) | |
tree | bf9600106f7f4de8687400c56dac62a2033d7308 | |
parent | 0519f7e5ab6d17f90257caffad85862187bffed6 (diff) | |
download | rockbox-00b856365469b4ff82928597923094aa3236abb5.tar.gz rockbox-00b856365469b4ff82928597923094aa3236abb5.zip |
df1704: Add filter roll-off selection.
Change-Id: I732ebd3446858b497105cf03fc81e934a749a57b
-rw-r--r-- | firmware/drivers/audio/df1704.c | 14 | ||||
-rw-r--r-- | firmware/export/df1704.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/firmware/drivers/audio/df1704.c b/firmware/drivers/audio/df1704.c index b0b9d7b1d3..ec8d56b955 100644 --- a/firmware/drivers/audio/df1704.c +++ b/firmware/drivers/audio/df1704.c | |||
@@ -113,3 +113,17 @@ void audiohw_set_volume(int vol_l, int vol_r) | |||
113 | df1704_write_reg(DF1704_MODE(0), DF1704_LDL_ON|vol_tenthdb2hw(vol_l)); | 113 | df1704_write_reg(DF1704_MODE(0), DF1704_LDL_ON|vol_tenthdb2hw(vol_l)); |
114 | df1704_write_reg(DF1704_MODE(1), DF1704_LDR_ON|vol_tenthdb2hw(vol_r)); | 114 | df1704_write_reg(DF1704_MODE(1), DF1704_LDR_ON|vol_tenthdb2hw(vol_r)); |
115 | } | 115 | } |
116 | |||
117 | void audiohw_set_filter_roll_off(int value) | ||
118 | { | ||
119 | int mode3_val = DF1704_CKO_HALF | | ||
120 | DF1704_LRP_H | | ||
121 | DF1704_I2S_ON; | ||
122 | |||
123 | if (value == 0) { | ||
124 | mode3_val |= DF1704_SRO_SHARP; | ||
125 | } else { | ||
126 | mode3_val |= DF1704_SRO_SLOW; | ||
127 | } | ||
128 | df1704_write_reg(DF1704_MODE(3), mode3_val); | ||
129 | } | ||
diff --git a/firmware/export/df1704.h b/firmware/export/df1704.h index 59d1372477..4a0bdfd8ba 100644 --- a/firmware/export/df1704.h +++ b/firmware/export/df1704.h | |||
@@ -26,7 +26,9 @@ | |||
26 | #define DF1704_VOLUME_MIN -1270 | 26 | #define DF1704_VOLUME_MIN -1270 |
27 | #define DF1704_VOLUME_MAX 0 | 27 | #define DF1704_VOLUME_MAX 0 |
28 | 28 | ||
29 | #define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP) | ||
29 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, DF1704_VOLUME_MIN/10, DF1704_VOLUME_MAX/10, 0) | 30 | AUDIOHW_SETTING(VOLUME, "dB", 0, 1, DF1704_VOLUME_MIN/10, DF1704_VOLUME_MAX/10, 0) |
31 | AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 1, 0) | ||
30 | 32 | ||
31 | #define DF1704_MODE(x) (((x)&0x03)<<9) | 33 | #define DF1704_MODE(x) (((x)&0x03)<<9) |
32 | 34 | ||