blob: ac37b0b0b52e505fd70e26ab8039cd30eb2f532c [file] [log] [blame]
Stefan Reinauer6651da32012-04-27 23:16:30 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <arch/acpi.h>
21#include <vendorcode/google/chromeos/chromeos.h>
22#include <types.h>
23#include <console/console.h>
24#include <ec/smsc/mec1308/ec.h>
25#include "ec.h"
26
27void lumpy_ec_init(void)
28{
29 printk(BIOS_DEBUG, "lumpy_ec_init\n");
30
31 if (acpi_slp_type == 3)
32 return;
33
34 /*
35 * Enable EC control of fan speed.
36 *
37 * This will be changed to OS control in ACPI EC _REG
38 * method when the OS is ready to control the fan.
39 */
40 ec_write(EC_FAN_SPEED, 0);
41
42 send_ec_command_data(EC_BATTERY_MODE, EC_BATTERY_MODE_NORMAL);
43 send_ec_command_data(EC_POWER_BUTTON_MODE, EC_POWER_BUTTON_MODE_OS);
44 send_ec_command(EC_SMI_DISABLE);
45 send_ec_command(EC_ACPI_ENABLE);
46 send_ec_command(EC_BACKLIGHT_ON);
47}