| 1 |
|
| 2 |
|
| 3 |
#include <device/device.h> |
| 4 |
#include <device/pci_ops.h> |
| 5 |
#include <drivers/intel/gma/int15.h> |
| 6 |
|
| 7 |
|
| 8 |
#include "ec_oem.c" |
| 9 |
|
| 10 |
#include "mainboard.h" |
| 11 |
|
| 12 |
#define MAX_LCD_BRIGHTNESS 0xd8 |
| 13 |
|
| 14 |
static void ec_enable(void) |
| 15 |
{ |
| 16 |
u16 keymap; |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
keymap = 0x5f1; |
| 21 |
send_ec_oem_command(0x45); |
| 22 |
send_ec_oem_data(0x09); |
| 23 |
|
| 24 |
send_ec_oem_data(keymap >> 8); |
| 25 |
send_ec_oem_data(keymap & 0xff); |
| 26 |
|
| 27 |
|
| 28 |
ec_write(0x17, MAX_LCD_BRIGHTNESS); |
| 29 |
|
| 30 |
|
| 31 |
send_ec_oem_command(0x5e); |
| 32 |
send_ec_oem_data(0xea); |
| 33 |
send_ec_oem_data(0x0c); |
| 34 |
send_ec_oem_data(0x01); |
| 35 |
} |
| 36 |
|
| 37 |
static void mainboard_init(struct device *dev) |
| 38 |
{ |
| 39 |
ec_enable(); |
| 40 |
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_TXT_STRETCH, 0, 3); |
| 41 |
} |
| 42 |
|
| 43 |
static void mainboard_enable(struct device *dev) |
| 44 |
{ |
| 45 |
dev->ops->init = mainboard_init; |
| 46 |
dev->ops->write_acpi_tables = mainboard_write_acpi_tables; |
| 47 |
} |
| 48 |
|
| 49 |
struct chip_operations mainboard_ops = { |
| 50 |
.enable_dev = mainboard_enable, |
| 51 |
}; |