summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyeonki Hong <hhk7734@gmail.com>2020-02-11 12:34:14 +0300
committerDongjin Kim <tobetter@gmail.com>2020-02-13 10:25:43 +0300
commit267c12cffd5a8828f330976424756facea549d03 (patch)
tree51a79148f8b0f049534033f4d17416c4ef446f17
parentc989da31a5c1da3ab57d7c6dc5a3fdbcc1c3eed7 (diff)
downloadu-boot-267c12cffd5a8828f330976424756facea549d03.tar.xz
ODROID-N2: spdif: Fix high output after shutdown
SPDIF output remained high-level when odroid was turned off using shutdown command. So, add code to set pin mode to input mode. Change-Id: I3bd5f064c008a4542bebb84e697e1e66519f0bf1
-rw-r--r--arch/arm/cpu/armv8/g12b/firmware/scp_task/suspend.c23
1 files changed, 20 insertions, 3 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 7f89610722..ce112a31d4 100644
--- a/arch/arm/cpu/armv8/g12b/firmware/scp_task/suspend.c
+++ b/arch/arm/cpu/armv8/g12b/firmware/scp_task/suspend.c
@@ -51,10 +51,28 @@ void suspend_get_wakeup_source(void *response, unsigned int suspend_from)
*suspend_from defines who call this function.
* 1: suspend
* 0: power off
-*/
+ */
void enter_suspend(unsigned int suspend_from)
{
- int exit_reason = UDEFINED_WAKEUP;
+ 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));
+ }
+ uart_puts("GPIOA_11/13 off\n");
+
#ifdef CONFIG_CEC_WAKEUP
hdmi_cec_func_config = readl(P_AO_DEBUG_REG0) & 0xff;
uart_puts(CEC_VERSION);
@@ -85,5 +103,4 @@ void enter_suspend(unsigned int suspend_from)
uart_put_hex(exit_reason, 8);
uart_puts("\n");
set_wakeup_method(exit_reason);
-
}