From 1b9d2ee6ca80a0ac9a946d3fad4efb884998622c Mon Sep 17 00:00:00 2001 From: Sven Schnelle Date: Sun, 17 Apr 2011 12:54:32 +0000 Subject: [PATCH] PMH7: Add dock event control Signed-off-by: Sven Schnelle Acked-by: Sven Schnelle git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6509 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/ec/lenovo/pmh7/chip.h | 1 + src/ec/lenovo/pmh7/pmh7.c | 9 +++++++++ src/ec/lenovo/pmh7/pmh7.h | 1 + 3 files changed, 11 insertions(+) diff --git a/src/ec/lenovo/pmh7/chip.h b/src/ec/lenovo/pmh7/chip.h index e11b772697..9867ba657e 100644 --- a/src/ec/lenovo/pmh7/chip.h +++ b/src/ec/lenovo/pmh7/chip.h @@ -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 diff --git a/src/ec/lenovo/pmh7/pmh7.c b/src/ec/lenovo/pmh7/pmh7.c index ba378666a2..042a4edbf7 100644 --- a/src/ec/lenovo/pmh7/pmh7.c +++ b/src/ec/lenovo/pmh7/pmh7.c @@ -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 = { diff --git a/src/ec/lenovo/pmh7/pmh7.h b/src/ec/lenovo/pmh7/pmh7.h index a85d710689..588be70c4a 100644 --- a/src/ec/lenovo/pmh7/pmh7.h +++ b/src/ec/lenovo/pmh7/pmh7.h @@ -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