mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: Remove CONFIG_WAKELOCK, CONFIG_HAS_EARLYSUSPEND, and CONFIG_ANDROID_POWER
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
549cb92f47
commit
fc326e6a07
5 changed files with 2 additions and 216 deletions
|
@ -694,140 +694,15 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
|
|||
pwrctrlpriv->btcoex_rfon = false;
|
||||
|
||||
_init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter);
|
||||
|
||||
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
pwrctrlpriv->early_suspend.suspend = NULL;
|
||||
rtw_register_early_suspend(pwrctrlpriv);
|
||||
#endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
void rtw_free_pwrctrl_priv(struct adapter *adapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(adapter);
|
||||
|
||||
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
rtw_unregister_early_suspend(pwrctrlpriv);
|
||||
#endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */
|
||||
|
||||
_free_pwrlock(&pwrctrlpriv->lock);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
inline bool rtw_is_earlysuspend_registered(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
return (pwrpriv->early_suspend.suspend) ? true : false;
|
||||
}
|
||||
|
||||
inline bool rtw_is_do_late_resume(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
return (pwrpriv->do_late_resume) ? true : false;
|
||||
}
|
||||
|
||||
inline void rtw_set_do_late_resume(struct pwrctrl_priv *pwrpriv, bool enable)
|
||||
{
|
||||
pwrpriv->do_late_resume = enable;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_EARLYSUSPEND
|
||||
extern int rtw_resume_process(struct adapter *padapter);
|
||||
static void rtw_early_suspend(struct early_suspend *h)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
DBG_88E("%s\n", __FUNCTION__);
|
||||
|
||||
rtw_set_do_late_resume(pwrpriv, false);
|
||||
}
|
||||
|
||||
static void rtw_late_resume(struct early_suspend *h)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
|
||||
struct adapter *adapter = dvobj->if1;
|
||||
|
||||
DBG_88E("%s\n", __FUNCTION__);
|
||||
if (pwrpriv->do_late_resume) {
|
||||
rtw_set_do_late_resume(pwrpriv, false);
|
||||
rtw_resume_process(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
DBG_88E("%s\n", __FUNCTION__);
|
||||
|
||||
/* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */
|
||||
pwrpriv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20;
|
||||
pwrpriv->early_suspend.suspend = rtw_early_suspend;
|
||||
pwrpriv->early_suspend.resume = rtw_late_resume;
|
||||
register_early_suspend(&pwrpriv->early_suspend);
|
||||
}
|
||||
|
||||
void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
DBG_88E("%s\n", __FUNCTION__);
|
||||
|
||||
rtw_set_do_late_resume(pwrpriv, false);
|
||||
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
unregister_early_suspend(&pwrpriv->early_suspend);
|
||||
|
||||
pwrpriv->early_suspend.suspend = NULL;
|
||||
pwrpriv->early_suspend.resume = NULL;
|
||||
}
|
||||
#endif /* CONFIG_HAS_EARLYSUSPEND */
|
||||
|
||||
#ifdef CONFIG_ANDROID_POWER
|
||||
extern int rtw_resume_process(struct adapter *padapter);
|
||||
static void rtw_early_suspend(android_early_suspend_t *h)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
DBG_88E("%s\n", __FUNCTION__);
|
||||
|
||||
rtw_set_do_late_resume(pwrpriv, false);
|
||||
}
|
||||
|
||||
static void rtw_late_resume(android_early_suspend_t *h)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
|
||||
struct adapter *adapter = dvobj->if1;
|
||||
|
||||
DBG_88E("%s\n", __FUNCTION__);
|
||||
if (pwrpriv->do_late_resume) {
|
||||
rtw_set_do_late_resume(pwrpriv, false);
|
||||
rtw_resume_process(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
DBG_88E("%s\n", __FUNCTION__);
|
||||
|
||||
/* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */
|
||||
pwrpriv->early_suspend.level = ANDROID_EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20;
|
||||
pwrpriv->early_suspend.suspend = rtw_early_suspend;
|
||||
pwrpriv->early_suspend.resume = rtw_late_resume;
|
||||
android_register_early_suspend(&pwrpriv->early_suspend);
|
||||
}
|
||||
|
||||
void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv)
|
||||
{
|
||||
DBG_88E("%s\n", __FUNCTION__);
|
||||
|
||||
rtw_set_do_late_resume(pwrpriv, false);
|
||||
|
||||
if (pwrpriv->early_suspend.suspend)
|
||||
android_unregister_early_suspend(&pwrpriv->early_suspend);
|
||||
|
||||
pwrpriv->early_suspend.suspend = NULL;
|
||||
pwrpriv->early_suspend.resume = NULL;
|
||||
}
|
||||
#endif /* CONFIG_ANDROID_POWER */
|
||||
|
||||
u8 rtw_interface_ps_func(struct adapter *padapter, enum HAL_INTF_PS_FUNC efunc_id, u8* val)
|
||||
{
|
||||
u8 bResult = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue