diff options
author | Vladimir Serbinenko <phcoder@gmail.com> | 2014-08-18 23:52:53 +0200 |
---|---|---|
committer | Vladimir Serbinenko <phcoder@gmail.com> | 2014-08-19 20:26:39 +0200 |
commit | dc9cfa431e46d6083ebb83fff5be22de7969bb26 (patch) | |
tree | 1d84932a18cd3f2ab4b126573cef264ca0c4dfee /src/mainboard/lenovo/x200/dock.c | |
parent | 8128a56c0ec7e147d4ad68e6ba55979e9ead25ae (diff) |
lenovo/x200: Dock support
Change-Id: I4e25630ae82e8030a9d6bfccb60844c301b1d635
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/6705
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/mainboard/lenovo/x200/dock.c')
-rw-r--r-- | src/mainboard/lenovo/x200/dock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mainboard/lenovo/x200/dock.c b/src/mainboard/lenovo/x200/dock.c index 5b23f87e6e..6f9e953b1d 100644 --- a/src/mainboard/lenovo/x200/dock.c +++ b/src/mainboard/lenovo/x200/dock.c @@ -44,16 +44,16 @@ void h8_mainboard_init_dock (void) void dock_connect(void) { + u16 gpiobase = pci_read_config16(LPC_DEV, D31F0_GPIO_BASE) & 0xfffc; ec_set_bit(0x02, 0); - ec_set_bit(0x1a, 0); - ec_set_bit(0xfe, 4); + outl(inl(gpiobase + 0x0c) | (1 << 28), gpiobase + 0x0c); } void dock_disconnect(void) { + u16 gpiobase = pci_read_config16(LPC_DEV, D31F0_GPIO_BASE) & 0xfffc; ec_clr_bit(0x02, 0); - ec_clr_bit(0x1a, 0); - ec_clr_bit(0xfe, 4); + outl(inl(gpiobase + 0x0c) & ~(1 << 28), gpiobase + 0x0c); } int dock_present(void) @@ -61,5 +61,5 @@ int dock_present(void) u16 gpiobase = pci_read_config16(LPC_DEV, D31F0_GPIO_BASE) & 0xfffc; u8 st = inb(gpiobase + 0x0c); - return !((st >> 3) & 1); + return ((st >> 2) & 7) != 7; } |