diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-09-24 22:42:06 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-09-24 22:42:06 +0000 |
commit | 6a9cabc4349238c6c7fddb9828b4c5f3f8099277 (patch) | |
tree | 963173fa83d757a5300e8e23d50b1f9b9b3bd69b | |
parent | 8458fade581d457de6455b95c84eb85a7a27f97d (diff) | |
download | rockbox-6a9cabc4349238c6c7fddb9828b4c5f3f8099277.tar.gz rockbox-6a9cabc4349238c6c7fddb9828b4c5f3f8099277.zip |
Implement lineout en-/disable for WM8975 and activate it for iPod nano 2G.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28159 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/audio/wm8975.c | 12 | ||||
-rw-r--r-- | firmware/export/config/ipodnano2g.h | 3 | ||||
-rw-r--r-- | firmware/export/wm8975.h | 1 | ||||
-rw-r--r-- | firmware/target/arm/s5l8700/ipodnano2g/powermgmt-nano2g.c | 9 |
4 files changed, 25 insertions, 0 deletions
diff --git a/firmware/drivers/audio/wm8975.c b/firmware/drivers/audio/wm8975.c index dbe39d8b62..3fcb01e728 100644 --- a/firmware/drivers/audio/wm8975.c +++ b/firmware/drivers/audio/wm8975.c | |||
@@ -192,6 +192,18 @@ void audiohw_set_lineout_vol(int vol_l, int vol_r) | |||
192 | wmcodec_write(ROUT2VOL, ROUT2VOL_RO2VU | ROUT2VOL_RO2ZC | vol_r); | 192 | wmcodec_write(ROUT2VOL, ROUT2VOL_RO2VU | ROUT2VOL_RO2ZC | vol_r); |
193 | } | 193 | } |
194 | 194 | ||
195 | void audiohw_enable_lineout(bool enable) | ||
196 | { | ||
197 | if (enable) { | ||
198 | /* Enable lineout */ | ||
199 | wm8975_regs[PWRMGMT2] |= (PWRMGMT2_LOUT2 | PWRMGMT2_ROUT2); | ||
200 | } else { | ||
201 | /* Disable lineout */ | ||
202 | wm8975_regs[PWRMGMT2] &= ~(PWRMGMT2_LOUT2 | PWRMGMT2_ROUT2); | ||
203 | } | ||
204 | wm8975_write(PWRMGMT2, wm8975_regs[PWRMGMT2]); | ||
205 | } | ||
206 | |||
195 | void audiohw_set_bass(int value) | 207 | void audiohw_set_bass(int value) |
196 | { | 208 | { |
197 | const int regvalues[] = { | 209 | const int regvalues[] = { |
diff --git a/firmware/export/config/ipodnano2g.h b/firmware/export/config/ipodnano2g.h index a4189b35f3..898871d486 100644 --- a/firmware/export/config/ipodnano2g.h +++ b/firmware/export/config/ipodnano2g.h | |||
@@ -219,6 +219,9 @@ | |||
219 | //#define IPOD_ACCESSORY_PROTOCOL | 219 | //#define IPOD_ACCESSORY_PROTOCOL |
220 | //#define HAVE_SERIAL | 220 | //#define HAVE_SERIAL |
221 | 221 | ||
222 | /* Define this, if you can switch on/off the lineout */ | ||
223 | #define HAVE_LINEOUT_POWEROFF | ||
224 | |||
222 | #define USB_WRITE_BUFFER_SIZE (1024*64) | 225 | #define USB_WRITE_BUFFER_SIZE (1024*64) |
223 | 226 | ||
224 | /* Define this if a programmable hotkey is mapped */ | 227 | /* Define this if a programmable hotkey is mapped */ |
diff --git a/firmware/export/wm8975.h b/firmware/export/wm8975.h index 5524d2e037..8c3cf473d6 100644 --- a/firmware/export/wm8975.h +++ b/firmware/export/wm8975.h | |||
@@ -32,6 +32,7 @@ extern int tenthdb2master(int db); | |||
32 | 32 | ||
33 | extern void audiohw_set_master_vol(int vol_l, int vol_r); | 33 | extern void audiohw_set_master_vol(int vol_l, int vol_r); |
34 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); | 34 | extern void audiohw_set_lineout_vol(int vol_l, int vol_r); |
35 | extern void audiohw_enable_lineout(bool enable); | ||
35 | 36 | ||
36 | /* Register addresses and bits */ | 37 | /* Register addresses and bits */ |
37 | 38 | ||
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/powermgmt-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/powermgmt-nano2g.c index b0578a33d5..52491cf480 100644 --- a/firmware/target/arm/s5l8700/ipodnano2g/powermgmt-nano2g.c +++ b/firmware/target/arm/s5l8700/ipodnano2g/powermgmt-nano2g.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "powermgmt.h" | 23 | #include "powermgmt.h" |
24 | #include "pmu-target.h" | 24 | #include "pmu-target.h" |
25 | #include "power.h" | 25 | #include "power.h" |
26 | #include "audiohw.h" | ||
26 | 27 | ||
27 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | 28 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = |
28 | { | 29 | { |
@@ -77,3 +78,11 @@ void accessory_supply_set(bool enable) | |||
77 | } | 78 | } |
78 | } | 79 | } |
79 | #endif | 80 | #endif |
81 | |||
82 | #ifdef HAVE_LINEOUT_POWEROFF | ||
83 | void lineout_set(bool enable) | ||
84 | { | ||
85 | /* Call audio hardware driver implementation */ | ||
86 | audiohw_enable_lineout(enable); | ||
87 | } | ||
88 | #endif | ||