diff options
author | Shelley Chen <shchen@google.com> | 2018-05-30 20:13:24 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-06-06 10:28:59 +0000 |
commit | 528448e3fc5c82e982817b81b643084977db9cdf (patch) | |
tree | d227feeaeb081a7a1209cd0de60b99d96b39e8a0 /src/mainboard/google/poppy/variants/nami/smihandler.c | |
parent | 088f09dc2f11141bc66e56028c26204e8afb3217 (diff) | |
download | coreboot-528448e3fc5c82e982817b81b643084977db9cdf.tar.gz coreboot-528448e3fc5c82e982817b81b643084977db9cdf.tar.bz2 coreboot-528448e3fc5c82e982817b81b643084977db9cdf.zip |
mb/google/poppy/variants/nami: Fix Elan touchscreen power off sequence
Power off does not seem to use the ACPI _OFF function, but rather the
smihandler. Creating variant_smi_sleep function for nami to handle
the power off sequence during reboot/power off.
BUG=b:78311818
BRANCH=None
TEST=Run "poweroff" command from AP console with SMI_DEBUG enabled
Make sure delays are consistent with spec
Change-Id: Ifeea545fe268be249793b3e508c51f5e4c1a3460
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/26724
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/mainboard/google/poppy/variants/nami/smihandler.c')
-rw-r--r-- | src/mainboard/google/poppy/variants/nami/smihandler.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/mainboard/google/poppy/variants/nami/smihandler.c b/src/mainboard/google/poppy/variants/nami/smihandler.c new file mode 100644 index 000000000000..b29e8ccb56cd --- /dev/null +++ b/src/mainboard/google/poppy/variants/nami/smihandler.c @@ -0,0 +1,47 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2018 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <arch/acpi.h> +#include <baseboard/variants.h> +#include <console/console.h> +#include <delay.h> +#include "gpio.h" + +#define TOUCH_DISABLE GPP_C3 +#define TOUCH_RESET GPP_B3 +#define TOUCH_ENABLE GPP_B4 + +/* + * Elan touchscreen has higher delay requirements than the other + * devices, so using that. + */ +#define ELAN_STOP_OFF_DELAY 2 +#define ELAN_RESET_OFF_DELAY 2 +#define ELAN_ENABLE_OFF_DELAY 100 + +void variant_smi_sleep(u8 slp_typ) +{ + if (slp_typ == ACPI_S5) { + /* TOUCHSCREEN_DIS# */ + gpio_set(TOUCH_DISABLE, 0); + mdelay(ELAN_STOP_OFF_DELAY); + /* TOUCHSCREEN_RST# */ + gpio_set(TOUCH_RESET, 0); + mdelay(ELAN_RESET_OFF_DELAY); + /* EN_PP3300_DX_TOUCHSCREEN */ + gpio_set(TOUCH_ENABLE, 0); + mdelay(ELAN_ENABLE_OFF_DELAY); + } +} |