summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPortisch <hugo.portisch@yahoo.de>2020-02-27 12:02:04 +0300
committerDongjin Kim <tobetter@gmail.com>2020-03-12 13:23:11 +0300
commitfea1d22c529c68711ffb2426d70e6fe5eaad98cf (patch)
tree10596dfd2b39c33278f4734e355d72da7b7d1018
parent5e2a0514cdfdbc182f85891a4759ec6c43545882 (diff)
downloadu-boot-fea1d22c529c68711ffb2426d70e6fe5eaad98cf.tar.xz
Fixup: ODROID-N2: spdif: Fix high output after shutdown Revert gpio handling to Amlogic code style
Change-Id: I1f8e19d4309e49638702493ccee8602b61457831
-rw-r--r--arch/arm/cpu/armv8/g12b/firmware/scp_task/suspend.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/arch/arm/cpu/armv8/g12b/firmware/scp_task/suspend.c b/arch/arm/cpu/armv8/g12b/firmware/scp_task/suspend.c
index ce112a31d4..d70eb4c0b6 100644
--- a/arch/arm/cpu/armv8/g12b/firmware/scp_task/suspend.c
+++ b/arch/arm/cpu/armv8/g12b/firmware/scp_task/suspend.c
@@ -54,23 +54,18 @@ void suspend_get_wakeup_source(void *response, unsigned int suspend_from)
*/
void enter_suspend(unsigned int suspend_from)
{
- int i, exit_reason = UDEFINED_WAKEUP;
- unsigned int reg, bit, offset;
- struct meson_bank bank;
-
- for(i = 0; i < 2; ++i) {
- /* clear GPIOA_11/13 pin mux */
- reg = 0xe;
- offset = PK(0xe, (11 + 2 * i)) & 0xff;
- bit = (offset % 8) * 4;
- aml_update_bits((domain + (reg << 2)), (0xf << bit), 0);
-
- /* set as input port */
- bank = mesong12b_banks[0]; /* GPIOA_ */
- reg = bank.regs[REG_DIR].reg;
- bit = bank.regs[REG_DIR].bit + offset;
- aml_update_bits(reg, BIT(bit), BIT(bit));
- }
+ int exit_reason = UDEFINED_WAKEUP;
+
+ /* clear GPIOA_11 pin mux */
+ aml_update_bits(PERIPHS_PIN_MUX_E, 0xf << 12, 0);
+ /* clear GPIOA_13 pin mux */
+ aml_update_bits(PERIPHS_PIN_MUX_E, 0xf << 20, 0);
+
+ /* set GPIOA_11 as input port */
+ aml_update_bits(PREG_PAD_GPIO5_EN_N, 1 << 11, 1 << 11);
+ /* set GPIOA_13 as input port */
+ aml_update_bits(PREG_PAD_GPIO5_EN_N, 1 << 13, 1 << 13);
+
uart_puts("GPIOA_11/13 off\n");
#ifdef CONFIG_CEC_WAKEUP