blob: 9f2a944183be4a6b45457744aa726c6185b88a35 [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>
Stefan Reinauer6651da32012-04-27 23:16:30 +020021#include <types.h>
22#include <console/console.h>
23#include <ec/smsc/mec1308/ec.h>
24#include "ec.h"
25
26void lumpy_ec_init(void)
27{
28 printk(BIOS_DEBUG, "lumpy_ec_init\n");
29
Kyösti Mälkkic3ed8862014-06-19 19:50:51 +030030 if (acpi_is_wakeup_s3())
Stefan Reinauer6651da32012-04-27 23:16:30 +020031 return;
32
33 /*
34 * Enable EC control of fan speed.
35 *
36 * This will be changed to OS control in ACPI EC _REG
37 * method when the OS is ready to control the fan.
38 */
39 ec_write(EC_FAN_SPEED, 0);
40
41 send_ec_command_data(EC_BATTERY_MODE, EC_BATTERY_MODE_NORMAL);
42 send_ec_command_data(EC_POWER_BUTTON_MODE, EC_POWER_BUTTON_MODE_OS);
43 send_ec_command(EC_SMI_DISABLE);
44 send_ec_command(EC_ACPI_ENABLE);
45 send_ec_command(EC_BACKLIGHT_ON);
46}