Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 1 | /* |
| 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 Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <arch/acpi.h> |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 17 | #include <types.h> |
| 18 | #include <console/console.h> |
| 19 | #include <ec/smsc/mec1308/ec.h> |
| 20 | #include "ec.h" |
| 21 | |
| 22 | void lumpy_ec_init(void) |
| 23 | { |
| 24 | printk(BIOS_DEBUG, "lumpy_ec_init\n"); |
| 25 | |
Kyösti Mälkki | c3ed886 | 2014-06-19 19:50:51 +0300 | [diff] [blame] | 26 | if (acpi_is_wakeup_s3()) |
Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame] | 27 | 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 | } |