Wakeup: Clean up netflix wakeup reason. [1/1]

PD#SWPL-192039

Problem:
kernel6.12 need sync code.

Solution:
add clean netflix config.

Verify:
Compiled to pass

Change-Id: I1597831658b68f2e1db91d0c61519895bc8ccbd2
Signed-off-by: hongyu.chen1 <hongyu.chen1@amlogic.com>
This commit is contained in:
hongyu.chen1
2024-11-07 14:14:44 +08:00
committed by gerrit autosubmit
parent e1343a8bde
commit a1cd3269bc
7 changed files with 30 additions and 0 deletions
+1
View File
@@ -182,6 +182,7 @@
status = "okay";
device_name = "aml_pm";
extend_resume_reason;
clear_suspend_reason = <9>; /* Clear netflix wakeup reason */
reg = <0xfe010288 0x4>, /*SYSCTRL_STATUS_REG2*/
<0xfe0102dc 0x4>; /*SYSCTRL_STICKY_REG7*/
};
+1
View File
@@ -203,6 +203,7 @@
status = "okay";
device_name = "aml_pm";
extend_resume_reason;
clear_suspend_reason = <9>; /* Clear netflix wakeup reason */
reg = <0xfe010288 0x4>, /*SYSCTRL_STATUS_REG2*/
<0xfe0102dc 0x4>; /*SYSCTRL_STICKY_REG7*/
};
+1
View File
@@ -144,6 +144,7 @@
status = "okay";
device_name = "aml_pm";
extend_resume_reason;
clear_suspend_reason = <9>; /* Clear netflix wakeup reason */
reg = <0xfe010288 0x4>, /*SYSCTRL_STATUS_REG2*/
<0xfe0102dc 0x4>; /*SYSCTRL_STICKY_REG7*/
};
@@ -183,6 +183,7 @@
status = "okay";
device_name = "aml_pm";
extend_resume_reason;
clear_suspend_reason = <9>; /* Clear netflix wakeup reason */
reg = <0x0 0xfe010288 0x0 0x4>, /*SYSCTRL_STATUS_REG2*/
<0x0 0xfe0102dc 0x0 0x4>; /*SYSCTRL_STICKY_REG7*/
};
@@ -203,6 +203,7 @@
status = "okay";
device_name = "aml_pm";
extend_resume_reason;
clear_suspend_reason = <9>; /* Clear netflix wakeup reason */
reg = <0x0 0xfe010288 0x0 0x4>, /*SYSCTRL_STATUS_REG2*/
<0x0 0xfe0102dc 0x0 0x4>; /*SYSCTRL_STICKY_REG7*/
};
@@ -144,6 +144,7 @@
status = "okay";
device_name = "aml_pm";
extend_resume_reason;
clear_suspend_reason = <9>; /* Clear netflix wakeup reason */
reg = <0x0 0xfe010288 0x0 0x4>, /*SYSCTRL_STATUS_REG2*/
<0x0 0xfe0102dc 0x0 0x4>; /*SYSCTRL_STICKY_REG7*/
};
+24
View File
@@ -386,6 +386,7 @@ static void __iomem *exit_reg;
static suspend_state_t pm_state;
static unsigned int resume_reason;
static unsigned int suspend_reason;
static unsigned int clear_suspend_reason;
static bool is_extd_resume_reason;
/*
@@ -586,6 +587,20 @@ int gx_pm_syscore_suspend(void)
return 0;
}
/*clear wakeup reason*/
void gx_pm_syscore_shutdown(void)
{
u32 val;
if (exit_reg && is_extd_resume_reason &&
clear_suspend_reason) {
val = readl_relaxed(exit_reg);
if ((val & 0x7f) == clear_suspend_reason)
val &= ~clear_suspend_reason;
writel_relaxed(val, exit_reg);
}
}
void gx_pm_syscore_resume(void)
{
sys_time_out = 0;
@@ -595,6 +610,7 @@ void gx_pm_syscore_resume(void)
static struct syscore_ops gx_pm_syscore_ops = {
.suspend = gx_pm_syscore_suspend,
.resume = gx_pm_syscore_resume,
.shutdown = gx_pm_syscore_shutdown,
};
static int __init gx_pm_init_ops(void)
@@ -618,6 +634,14 @@ static int meson_pm_probe(struct platform_device *pdev)
else
is_extd_resume_reason = false;
if (of_property_read_u32(pdev->dev.of_node, "clear_suspend_reason",
&clear_suspend_reason)) {
dev_info(&pdev->dev, "clear_suspend_reason not found, using default\n");
clear_suspend_reason = 0;
} else {
dev_info(&pdev->dev, "clear_suspend_reason found: 0x%x\n", clear_suspend_reason);
}
debug_reg = of_iomap(pdev->dev.of_node, 0);
if (!debug_reg)
return -ENOMEM;