summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPortisch <hugo.portisch@yahoo.de>2019-02-28 15:28:45 +0100
committerDongjin Kim <tobetter@gmail.com>2020-05-03 21:05:31 +0900
commitc23dee237cdd697af7f5e0c263a277d860a0525d (patch)
treec33f1ef2b2215ea8d48988bcaaa019606f3fcd88
parent94642644e8d50fe3f40b8f3806b2e743651d8ec1 (diff)
downloadu-boot-odroid-c1-c23dee237cdd697af7f5e0c263a277d860a0525d.tar.gz
BACKPORT: pwr_ctrl: enable and fix IR remote wakeup for g12a/b
Change-Id: I404a55bb7e09e1490772626cff7ff29ead2d64f5
-rw-r--r--arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c7
-rw-r--r--arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c7
-rw-r--r--board/amlogic/g12a_skt_v1/firmware/scp_task/pwr_ctrl.c4
-rw-r--r--board/amlogic/g12a_u200_v1/firmware/scp_task/pwr_ctrl.c4
-rw-r--r--board/amlogic/g12a_u211_v1/firmware/scp_task/pwr_ctrl.c4
-rw-r--r--board/amlogic/g12a_u212_v1/firmware/scp_task/pwr_ctrl.c4
-rw-r--r--board/amlogic/g12a_u220_v1/firmware/scp_task/pwr_ctrl.c4
-rw-r--r--board/amlogic/g12a_u221_v1/firmware/scp_task/pwr_ctrl.c4
-rw-r--r--board/amlogic/g12b_skt_v1/firmware/scp_task/pwr_ctrl.c4
-rw-r--r--board/amlogic/g12b_w400_v1/firmware/scp_task/pwr_ctrl.c4
-rw-r--r--board/hardkernel/odroidc3/firmware/scp_task/pwr_ctrl.c3
-rw-r--r--board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c3
-rw-r--r--board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c3
13 files changed, 47 insertions, 8 deletions
diff --git a/arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c b/arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c
index aaf1015acc..ae36ba4219 100644
--- a/arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c
+++ b/arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c
@@ -334,7 +334,7 @@ unsigned bakeuAO_IR_DEC_LDR_REPEAT;
**
********************************************************************/
#if 1
-void backuremote_register(void)
+static void backup_remote_register(void)
{
backuAO_RTI_PIN_MUX_REG = readl(AO_RTI_PIN_MUX_REG);
backuAO_IR_DEC_REG0 = readl(AO_MF_IR_DEC_REG0);
@@ -345,7 +345,7 @@ void backuremote_register(void)
bakeuAO_IR_DEC_LDR_REPEAT = readl(AO_MF_IR_DEC_LDR_REPEAT);
}
-void resume_remote_register(void)
+static void restore_remote_register(void)
{
writel(backuAO_RTI_PIN_MUX_REG, AO_RTI_PIN_MUX_REG);
writel(backuAO_IR_DEC_REG0, AO_MF_IR_DEC_REG0);
@@ -398,11 +398,10 @@ static unsigned int kk[] = {
static int init_remote(void)
{
- return 0;
uart_put_hex(readl(AO_IR_DEC_STATUS), 32);
uart_put_hex(readl(AO_IR_DEC_FRAME), 32);
init_custom_trigger();
- //return 0;
+ return 0;
}
/*can be called in pwr_ctrl.c*/
diff --git a/arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c b/arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c
index aaf1015acc..ae36ba4219 100644
--- a/arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c
+++ b/arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c
@@ -334,7 +334,7 @@ unsigned bakeuAO_IR_DEC_LDR_REPEAT;
**
********************************************************************/
#if 1
-void backuremote_register(void)
+static void backup_remote_register(void)
{
backuAO_RTI_PIN_MUX_REG = readl(AO_RTI_PIN_MUX_REG);
backuAO_IR_DEC_REG0 = readl(AO_MF_IR_DEC_REG0);
@@ -345,7 +345,7 @@ void backuremote_register(void)
bakeuAO_IR_DEC_LDR_REPEAT = readl(AO_MF_IR_DEC_LDR_REPEAT);
}
-void resume_remote_register(void)
+static void restore_remote_register(void)
{
writel(backuAO_RTI_PIN_MUX_REG, AO_RTI_PIN_MUX_REG);
writel(backuAO_IR_DEC_REG0, AO_MF_IR_DEC_REG0);
@@ -398,11 +398,10 @@ static unsigned int kk[] = {
static int init_remote(void)
{
- return 0;
uart_put_hex(readl(AO_IR_DEC_STATUS), 32);
uart_put_hex(readl(AO_IR_DEC_FRAME), 32);
init_custom_trigger();
- //return 0;
+ return 0;
}
/*can be called in pwr_ctrl.c*/
diff --git a/board/amlogic/g12a_skt_v1/firmware/scp_task/pwr_ctrl.c b/board/amlogic/g12a_skt_v1/firmware/scp_task/pwr_ctrl.c
index 855ceb73dd..952397cf81 100644
--- a/board/amlogic/g12a_skt_v1/firmware/scp_task/pwr_ctrl.c
+++ b/board/amlogic/g12a_skt_v1/firmware/scp_task/pwr_ctrl.c
@@ -114,6 +114,8 @@ static unsigned int detect_key(unsigned int suspend_from)
{
int exit_reason = 0;
unsigned *irq = (unsigned *)WAKEUP_SRC_IRQ_ADDR_BASE;
+
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -147,6 +149,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/amlogic/g12a_u200_v1/firmware/scp_task/pwr_ctrl.c b/board/amlogic/g12a_u200_v1/firmware/scp_task/pwr_ctrl.c
index 0f1467d6c8..58517dd0bd 100644
--- a/board/amlogic/g12a_u200_v1/firmware/scp_task/pwr_ctrl.c
+++ b/board/amlogic/g12a_u200_v1/firmware/scp_task/pwr_ctrl.c
@@ -145,6 +145,8 @@ static unsigned int detect_key(unsigned int suspend_from)
{
int exit_reason = 0;
unsigned *irq = (unsigned *)WAKEUP_SRC_IRQ_ADDR_BASE;
+
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -204,6 +206,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/amlogic/g12a_u211_v1/firmware/scp_task/pwr_ctrl.c b/board/amlogic/g12a_u211_v1/firmware/scp_task/pwr_ctrl.c
index 07610bbe20..9f2790032d 100644
--- a/board/amlogic/g12a_u211_v1/firmware/scp_task/pwr_ctrl.c
+++ b/board/amlogic/g12a_u211_v1/firmware/scp_task/pwr_ctrl.c
@@ -124,6 +124,8 @@ static unsigned int detect_key(unsigned int suspend_from)
{
int exit_reason = 0;
unsigned *irq = (unsigned *)WAKEUP_SRC_IRQ_ADDR_BASE;
+
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -170,6 +172,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/amlogic/g12a_u212_v1/firmware/scp_task/pwr_ctrl.c b/board/amlogic/g12a_u212_v1/firmware/scp_task/pwr_ctrl.c
index 07610bbe20..9f2790032d 100644
--- a/board/amlogic/g12a_u212_v1/firmware/scp_task/pwr_ctrl.c
+++ b/board/amlogic/g12a_u212_v1/firmware/scp_task/pwr_ctrl.c
@@ -124,6 +124,8 @@ static unsigned int detect_key(unsigned int suspend_from)
{
int exit_reason = 0;
unsigned *irq = (unsigned *)WAKEUP_SRC_IRQ_ADDR_BASE;
+
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -170,6 +172,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/amlogic/g12a_u220_v1/firmware/scp_task/pwr_ctrl.c b/board/amlogic/g12a_u220_v1/firmware/scp_task/pwr_ctrl.c
index 85d580d1c8..974add8dca 100644
--- a/board/amlogic/g12a_u220_v1/firmware/scp_task/pwr_ctrl.c
+++ b/board/amlogic/g12a_u220_v1/firmware/scp_task/pwr_ctrl.c
@@ -135,6 +135,8 @@ static unsigned int detect_key(unsigned int suspend_from)
{
int exit_reason = 0;
unsigned *irq = (unsigned *)WAKEUP_SRC_IRQ_ADDR_BASE;
+
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -186,6 +188,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/amlogic/g12a_u221_v1/firmware/scp_task/pwr_ctrl.c b/board/amlogic/g12a_u221_v1/firmware/scp_task/pwr_ctrl.c
index 334c6b6f54..1567371b80 100644
--- a/board/amlogic/g12a_u221_v1/firmware/scp_task/pwr_ctrl.c
+++ b/board/amlogic/g12a_u221_v1/firmware/scp_task/pwr_ctrl.c
@@ -106,6 +106,8 @@ static unsigned int detect_key(unsigned int suspend_from)
{
int exit_reason = 0;
unsigned *irq = (unsigned *)WAKEUP_SRC_IRQ_ADDR_BASE;
+
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -152,6 +154,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/amlogic/g12b_skt_v1/firmware/scp_task/pwr_ctrl.c b/board/amlogic/g12b_skt_v1/firmware/scp_task/pwr_ctrl.c
index e886823366..f0db4128b8 100644
--- a/board/amlogic/g12b_skt_v1/firmware/scp_task/pwr_ctrl.c
+++ b/board/amlogic/g12b_skt_v1/firmware/scp_task/pwr_ctrl.c
@@ -124,6 +124,8 @@ static unsigned int detect_key(unsigned int suspend_from)
{
int exit_reason = 0;
unsigned *irq = (unsigned *)WAKEUP_SRC_IRQ_ADDR_BASE;
+
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -162,6 +164,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/amlogic/g12b_w400_v1/firmware/scp_task/pwr_ctrl.c b/board/amlogic/g12b_w400_v1/firmware/scp_task/pwr_ctrl.c
index 8d7e79364f..52cb3dfe69 100644
--- a/board/amlogic/g12b_w400_v1/firmware/scp_task/pwr_ctrl.c
+++ b/board/amlogic/g12b_w400_v1/firmware/scp_task/pwr_ctrl.c
@@ -144,6 +144,8 @@ static unsigned int detect_key(unsigned int suspend_from)
{
int exit_reason = 0;
unsigned *irq = (unsigned *)WAKEUP_SRC_IRQ_ADDR_BASE;
+
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -196,6 +198,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/hardkernel/odroidc3/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidc3/firmware/scp_task/pwr_ctrl.c
index cc6036c212..f363ef920b 100644
--- a/board/hardkernel/odroidc3/firmware/scp_task/pwr_ctrl.c
+++ b/board/hardkernel/odroidc3/firmware/scp_task/pwr_ctrl.c
@@ -118,6 +118,7 @@ static unsigned int detect_key(unsigned int suspend_from)
unsigned char adc_key_cnt = 0;
saradc_enable();
#endif
+ backup_remote_register();
init_remote();
do {
@@ -167,6 +168,8 @@ static unsigned int detect_key(unsigned int suspend_from)
saradc_disable();
#endif
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c
index 29fcc9aed1..4a4a785174 100644
--- a/board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c
+++ b/board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c
@@ -145,6 +145,7 @@ static unsigned int detect_key(unsigned int suspend_from)
unsigned int is_gpiokey = 0;
#endif
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -220,6 +221,8 @@ static unsigned int detect_key(unsigned int suspend_from)
saradc_disable();
#endif
+ restore_remote_register();
+
return exit_reason;
}
diff --git a/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c
index ce42cdfe03..f35f92507b 100644
--- a/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c
+++ b/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c
@@ -182,6 +182,7 @@ static unsigned int detect_key(unsigned int suspend_from)
unsigned int is_gpiokey = 0;
#endif
+ backup_remote_register();
init_remote();
#ifdef CONFIG_CEC_WAKEUP
if (hdmi_cec_func_config & 0x1) {
@@ -250,6 +251,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);
+ restore_remote_register();
+
return exit_reason;
}