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