PMH7: Add dock event control

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Acked-by: Sven Schnelle <svens@stackframe.org>

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6509 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Sven Schnelle 2011-04-17 12:54:32 +00:00
parent 4e67731011
commit 1b9d2ee6ca
3 changed files with 11 additions and 0 deletions

View File

@ -5,5 +5,6 @@ extern struct chip_operations ec_lenovo_pmh7_ops;
struct ec_lenovo_pmh7_config {
int backlight_enable:1;
int dock_event_enable:1;
};
#endif

View File

@ -33,6 +33,14 @@ void pmh7_backlight_enable(int onoff)
pmh7_register_clear_bit(0x50, 5);
}
void pmh7_dock_event_enable(int onoff)
{
if (onoff)
pmh7_register_set_bit(0x60, 3);
else
pmh7_register_clear_bit(0x60, 3);
}
void pmh7_register_set_bit(int reg, int bit)
{
char val;
@ -78,6 +86,7 @@ static void enable_dev(device_t dev)
resource->gran = 5;
pmh7_backlight_enable(conf->backlight_enable);
pmh7_dock_event_enable(conf->dock_event_enable);
}
struct chip_operations ec_lenovo_pmh7_ops = {

View File

@ -32,4 +32,5 @@ char pmh7_register_read(int reg);
void pmh7_register_write(int reg, int val);
void pmh7_backlight_enable(int onoff);
void pmh7_dock_event_enable(int onoff);
#endif