summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjin Kim <tobetter@gmail.com>2020-05-08 20:21:34 +0300
committerGerrit Code Review <gerrit@almond.hardkernel.com>2020-05-08 20:21:34 +0300
commitf6f0b0f60d806cc8b6066d2c3ba9ca2433697290 (patch)
tree1cb52b6e46cc057eae05903fa724a43920f18673
parent2e4520f1a8d06310dbbe2cc73c04e2cdb109795e (diff)
parentc23dee237cdd697af7f5e0c263a277d860a0525d (diff)
downloadu-boot-f6f0b0f60d806cc8b6066d2c3ba9ca2433697290.tar.xz
Merge "BACKPORT: pwr_ctrl: enable and fix IR remote wakeup for g12a/b" into odroidg12-v2015.01
-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;
}