From 883e7acc65e1edba8b2453decf23c88eafeae8b0 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 13 Aug 2014 01:22:13 +0200 Subject: lenovo/h8: Support uwb radio. It's the third minipcie slot in x200. Change-Id: Ibfa8d787698cd23b4abcffe5cff2d62039cf0f86 Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/6641 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Paul Menzel --- src/ec/lenovo/h8/chip.h | 1 + src/ec/lenovo/h8/h8.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src/ec') diff --git a/src/ec/lenovo/h8/chip.h b/src/ec/lenovo/h8/chip.h index bac54ecac6..98a7972d1d 100644 --- a/src/ec/lenovo/h8/chip.h +++ b/src/ec/lenovo/h8/chip.h @@ -49,6 +49,7 @@ struct ec_lenovo_h8_config { u8 has_keyboard_backlight; u8 has_power_management_beeps; + u8 has_uwb; }; #endif /* EC_LENOVO_H8EC_CHIP_H */ diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c index f5b1b77ec8..e70c0e8ed0 100644 --- a/src/ec/lenovo/h8/h8.c +++ b/src/ec/lenovo/h8/h8.c @@ -63,6 +63,15 @@ static void h8_wwan_enable(int on) ec_clr_bit(0x3a, 6); } +/* Controls radio-off pin in UWB MiniPCIe slot. */ +static void h8_uwb_enable(int on) +{ + if (on) + ec_set_bit(0x31, 2); + else + ec_clr_bit(0x31, 2); +} + static void h8_fn_ctrl_swap(int on) { if (on) @@ -239,6 +248,13 @@ static void h8_enable(device_t dev) h8_wwan_enable(val); + if (conf->has_uwb) { + if (get_option(&val, "uwb") != CB_SUCCESS) + val = 1; + + h8_uwb_enable(val); + } + if (get_option(&val, "fn_ctrl_swap") != CB_SUCCESS) val = 0; h8_fn_ctrl_swap(val); -- cgit v1.2.3