| 1 |
|
| 2 |
|
| 3 |
#include <bootstate.h> |
| 4 |
#include <console/console.h> |
| 5 |
#include <fw_config.h> |
| 6 |
#include <gpio.h> |
| 7 |
|
| 8 |
static const struct pad_config touch_enable_pads[] = { |
| 9 |
|
| 10 |
PAD_CFG_GPO(GPP_C0, 1, DEEP), |
| 11 |
}; |
| 12 |
|
| 13 |
static const struct pad_config touch_disable_pads[] = { |
| 14 |
|
| 15 |
PAD_NC(GPP_C0, NONE), |
| 16 |
}; |
| 17 |
|
| 18 |
static void fw_config_handle(void *unused) |
| 19 |
{ |
| 20 |
if (fw_config_probe(FW_CONFIG(TOUCH, TOUCH_ELAN0001))) { |
| 21 |
printk(BIOS_INFO, "Configure Touch GPIO GPP_C0 to GPO_H.\n"); |
| 22 |
gpio_configure_pads(touch_enable_pads, ARRAY_SIZE(touch_enable_pads)); |
| 23 |
} else { |
| 24 |
printk(BIOS_INFO, "Configure Touch GPIO GPP_C0 to NC.\n"); |
| 25 |
gpio_configure_pads(touch_disable_pads, ARRAY_SIZE(touch_disable_pads)); |
| 26 |
} |
| 27 |
} |
| 28 |
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); |