Skip to content

Commit

Permalink
BACKPORT: pwr_ctrl: enable and fix IR remote wakeup for g12a/b
Browse files Browse the repository at this point in the history
Change-Id: I404a55bb7e09e1490772626cff7ff29ead2d64f5
  • Loading branch information
Portisch authored and tobetter committed May 3, 2020
1 parent 9464264 commit c23dee2
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 8 deletions.
7 changes: 3 additions & 4 deletions arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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*/
Expand Down
7 changes: 3 additions & 4 deletions arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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*/
Expand Down
4 changes: 4 additions & 0 deletions board/amlogic/g12a_skt_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -147,6 +149,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down
4 changes: 4 additions & 0 deletions board/amlogic/g12a_u200_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -204,6 +206,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down
4 changes: 4 additions & 0 deletions board/amlogic/g12a_u211_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -170,6 +172,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down
4 changes: 4 additions & 0 deletions board/amlogic/g12a_u212_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -170,6 +172,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down
4 changes: 4 additions & 0 deletions board/amlogic/g12a_u220_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -186,6 +188,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down
4 changes: 4 additions & 0 deletions board/amlogic/g12a_u221_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -152,6 +154,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down
4 changes: 4 additions & 0 deletions board/amlogic/g12b_skt_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -162,6 +164,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down
4 changes: 4 additions & 0 deletions board/amlogic/g12b_w400_v1/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -196,6 +198,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down
3 changes: 3 additions & 0 deletions board/hardkernel/odroidc3/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -167,6 +168,8 @@ static unsigned int detect_key(unsigned int suspend_from)
saradc_disable();
#endif

restore_remote_register();

return exit_reason;
}

Expand Down
3 changes: 3 additions & 0 deletions board/hardkernel/odroidc4/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -220,6 +221,8 @@ static unsigned int detect_key(unsigned int suspend_from)
saradc_disable();
#endif

restore_remote_register();

return exit_reason;
}

Expand Down
3 changes: 3 additions & 0 deletions board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -250,6 +251,8 @@ static unsigned int detect_key(unsigned int suspend_from)
__switch_idle_task();
} while (1);

restore_remote_register();

return exit_reason;
}

Expand Down

0 comments on commit c23dee2

Please sign in to comment.