Loading drivers/soc/qcom/smp2p_sleepstate.c +7 −7 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ #define PROC_AWAKE_ID 12 /* 12th bit */ #define AWAKE_BIT BIT(PROC_AWAKE_ID) static struct qcom_smem_state *state; struct qcom_smem_state *qstate; static struct wakeup_source notify_ws; /** Loading @@ -31,11 +31,11 @@ static int sleepstate_pm_notifier(struct notifier_block *nb, { switch (event) { case PM_SUSPEND_PREPARE: qcom_smem_state_update_bits(state, AWAKE_BIT, 0); //qcom_smem_state_update_bits(state, AWAKE_BIT, 0); break; case PM_POST_SUSPEND: qcom_smem_state_update_bits(state, AWAKE_BIT, AWAKE_BIT); //qcom_smem_state_update_bits(state, AWAKE_BIT, AWAKE_BIT); break; } Loading @@ -60,10 +60,10 @@ static int smp2p_sleepstate_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; state = qcom_smem_state_get(&pdev->dev, 0, &ret); if (IS_ERR(state)) return PTR_ERR(state); qcom_smem_state_update_bits(state, AWAKE_BIT, AWAKE_BIT); qstate = qcom_smem_state_get(&pdev->dev, 0, &ret); if (IS_ERR(qstate)) return PTR_ERR(qstate); qcom_smem_state_update_bits(qstate, AWAKE_BIT, AWAKE_BIT); ret = register_pm_notifier(&sleepstate_pm_nb); if (ret) { Loading kernel/power/suspend.c +13 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ #include "power.h" #include <linux/gpio.h> #include <linux/soc/qcom/smem_state.h> extern struct qcom_smem_state *qstate; #define PROC_AWAKE_ID 12 /* 12th bit */ #define AWAKE_BIT BIT(PROC_AWAKE_ID) const char * const pm_labels[] = { [PM_SUSPEND_TO_IDLE] = "freeze", [PM_SUSPEND_STANDBY] = "standby", Loading Loading @@ -630,8 +636,15 @@ int pm_suspend(suspend_state_t state) if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) return -EINVAL; qcom_smem_state_update_bits(qstate, AWAKE_BIT, 0); pr_err("%s: PM_SUSPEND_PREPARE smp2p_change_state", __func__); pr_info("suspend entry (%s)\n", mem_sleep_labels[state]); error = enter_state(state); qcom_smem_state_update_bits(qstate, AWAKE_BIT, AWAKE_BIT); pr_err("%s: PM_POST_SUSPEND smp2p_change_state", __func__); if (error) { suspend_stats.fail++; dpm_save_failed_errno(error); Loading Loading
drivers/soc/qcom/smp2p_sleepstate.c +7 −7 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ #define PROC_AWAKE_ID 12 /* 12th bit */ #define AWAKE_BIT BIT(PROC_AWAKE_ID) static struct qcom_smem_state *state; struct qcom_smem_state *qstate; static struct wakeup_source notify_ws; /** Loading @@ -31,11 +31,11 @@ static int sleepstate_pm_notifier(struct notifier_block *nb, { switch (event) { case PM_SUSPEND_PREPARE: qcom_smem_state_update_bits(state, AWAKE_BIT, 0); //qcom_smem_state_update_bits(state, AWAKE_BIT, 0); break; case PM_POST_SUSPEND: qcom_smem_state_update_bits(state, AWAKE_BIT, AWAKE_BIT); //qcom_smem_state_update_bits(state, AWAKE_BIT, AWAKE_BIT); break; } Loading @@ -60,10 +60,10 @@ static int smp2p_sleepstate_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; state = qcom_smem_state_get(&pdev->dev, 0, &ret); if (IS_ERR(state)) return PTR_ERR(state); qcom_smem_state_update_bits(state, AWAKE_BIT, AWAKE_BIT); qstate = qcom_smem_state_get(&pdev->dev, 0, &ret); if (IS_ERR(qstate)) return PTR_ERR(qstate); qcom_smem_state_update_bits(qstate, AWAKE_BIT, AWAKE_BIT); ret = register_pm_notifier(&sleepstate_pm_nb); if (ret) { Loading
kernel/power/suspend.c +13 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ #include "power.h" #include <linux/gpio.h> #include <linux/soc/qcom/smem_state.h> extern struct qcom_smem_state *qstate; #define PROC_AWAKE_ID 12 /* 12th bit */ #define AWAKE_BIT BIT(PROC_AWAKE_ID) const char * const pm_labels[] = { [PM_SUSPEND_TO_IDLE] = "freeze", [PM_SUSPEND_STANDBY] = "standby", Loading Loading @@ -630,8 +636,15 @@ int pm_suspend(suspend_state_t state) if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) return -EINVAL; qcom_smem_state_update_bits(qstate, AWAKE_BIT, 0); pr_err("%s: PM_SUSPEND_PREPARE smp2p_change_state", __func__); pr_info("suspend entry (%s)\n", mem_sleep_labels[state]); error = enter_state(state); qcom_smem_state_update_bits(qstate, AWAKE_BIT, AWAKE_BIT); pr_err("%s: PM_POST_SUSPEND smp2p_change_state", __func__); if (error) { suspend_stats.fail++; dpm_save_failed_errno(error); Loading