1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Andree Buschmann 2010-09-24 22:42:06 +00:00
parent 8458fade58
commit 6a9cabc434
4 changed files with 25 additions and 0 deletions

View file

@ -192,6 +192,18 @@ void audiohw_set_lineout_vol(int vol_l, int vol_r)
wmcodec_write(ROUT2VOL, ROUT2VOL_RO2VU | ROUT2VOL_RO2ZC | vol_r);
}
void audiohw_enable_lineout(bool enable)
{
if (enable) {
/* Enable lineout */
wm8975_regs[PWRMGMT2] |= (PWRMGMT2_LOUT2 | PWRMGMT2_ROUT2);
} else {
/* Disable lineout */
wm8975_regs[PWRMGMT2] &= ~(PWRMGMT2_LOUT2 | PWRMGMT2_ROUT2);
}
wm8975_write(PWRMGMT2, wm8975_regs[PWRMGMT2]);
}
void audiohw_set_bass(int value)
{
const int regvalues[] = {

View file

@ -219,6 +219,9 @@
//#define IPOD_ACCESSORY_PROTOCOL
//#define HAVE_SERIAL
/* Define this, if you can switch on/off the lineout */
#define HAVE_LINEOUT_POWEROFF
#define USB_WRITE_BUFFER_SIZE (1024*64)
/* Define this if a programmable hotkey is mapped */

View file

@ -32,6 +32,7 @@ extern int tenthdb2master(int db);
extern void audiohw_set_master_vol(int vol_l, int vol_r);
extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
extern void audiohw_enable_lineout(bool enable);
/* Register addresses and bits */

View file

@ -23,6 +23,7 @@
#include "powermgmt.h"
#include "pmu-target.h"
#include "power.h"
#include "audiohw.h"
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{
@ -77,3 +78,11 @@ void accessory_supply_set(bool enable)
}
}
#endif
#ifdef HAVE_LINEOUT_POWEROFF
void lineout_set(bool enable)
{
/* Call audio hardware driver implementation */
audiohw_enable_lineout(enable);
}
#endif