blob: c3a2555780e4db2063661925eae7d6d2841fc14a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2017 Patrick Rudolph <siro@das-labor.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <southbridge/intel/common/gpio.h>
#include <console/console.h>
#include <device/device.h>
#include <ec/acpi/ec.h>
#include <option.h>
#include "h8.h"
#include "chip.h"
/*
* Controls BDC (Bluetooth daughter card) power.
*/
void h8_bluetooth_enable(int on)
{
if (on)
ec_set_bit(0x3a, 4);
else
ec_clr_bit(0x3a, 4);
}
/*
* Detect BDC on supported MBs.
*/
bool h8_has_bdc(struct device *dev)
{
struct ec_lenovo_h8_config *conf = dev->chip_info;
if (!conf->has_bdc_detection) {
printk(BIOS_INFO, "H8: BDC detection not implemented. "
"Assuming BDC installed\n");
return true;
}
if (get_gpio(conf->bdc_gpio_num) == conf->bdc_gpio_lvl) {
printk(BIOS_INFO, "H8: BDC installed\n");
return true;
}
printk(BIOS_INFO, "H8: BDC not installed\n");
return false;
}
/*
* Return BDC NVRAM setting.
*/
bool h8_bluetooth_nv_enable(void)
{
u8 val;
if (get_option(&val, "bluetooth") != CB_SUCCESS)
return true;
return val;
}
|