external/modules/rtl8723au
Revision | e03a5661dbeff5353457b5103b1da84c27998def (tree) |
---|---|
Time | 2013-12-10 01:32:06 |
Author | Jes Sorensen <Jes.Sorensen@redh...> |
Commiter | Larry Finger |
Remove ANDROID_POWER and EARLYSUSPEND hacks
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
@@ -1355,15 +1355,10 @@ _func_enter_; | ||
1355 | 1355 | |
1356 | 1356 | _init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter); |
1357 | 1357 | |
1358 | - #ifdef CONFIG_RESUME_IN_WORKQUEUE | |
1358 | +#ifdef CONFIG_RESUME_IN_WORKQUEUE | |
1359 | 1359 | INIT_WORK(&pwrctrlpriv->resume_work, resume_workitem_callback); |
1360 | 1360 | pwrctrlpriv->rtw_workqueue = create_singlethread_workqueue("rtw_workqueue"); |
1361 | - #endif /* CONFIG_RESUME_IN_WORKQUEUE */ | |
1362 | - | |
1363 | - #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) | |
1364 | - pwrctrlpriv->early_suspend.suspend = NULL; | |
1365 | - rtw_register_early_suspend(pwrctrlpriv); | |
1366 | - #endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ | |
1361 | +#endif /* CONFIG_RESUME_IN_WORKQUEUE */ | |
1367 | 1362 | |
1368 | 1363 | _func_exit_; |
1369 | 1364 | } |
@@ -1376,16 +1371,12 @@ _func_enter_; | ||
1376 | 1371 | |
1377 | 1372 | /* memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); */ |
1378 | 1373 | |
1379 | - #ifdef CONFIG_RESUME_IN_WORKQUEUE | |
1374 | +#ifdef CONFIG_RESUME_IN_WORKQUEUE | |
1380 | 1375 | if (pwrctrlpriv->rtw_workqueue) { |
1381 | 1376 | flush_workqueue(pwrctrlpriv->rtw_workqueue); |
1382 | 1377 | destroy_workqueue(pwrctrlpriv->rtw_workqueue); |
1383 | 1378 | } |
1384 | - #endif | |
1385 | - | |
1386 | - #if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) | |
1387 | - rtw_unregister_early_suspend(pwrctrlpriv); | |
1388 | - #endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ | |
1379 | +#endif | |
1389 | 1380 | |
1390 | 1381 | _func_exit_; |
1391 | 1382 | } |
@@ -1415,117 +1406,6 @@ void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv) | ||
1415 | 1406 | } |
1416 | 1407 | #endif /* CONFIG_RESUME_IN_WORKQUEUE */ |
1417 | 1408 | |
1418 | -#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) | |
1419 | -inline bool rtw_is_earlysuspend_registered(struct pwrctrl_priv *pwrpriv) | |
1420 | -{ | |
1421 | - return (pwrpriv->early_suspend.suspend) ? _TRUE : _FALSE; | |
1422 | -} | |
1423 | - | |
1424 | -inline bool rtw_is_do_late_resume(struct pwrctrl_priv *pwrpriv) | |
1425 | -{ | |
1426 | - return (pwrpriv->do_late_resume) ? _TRUE : _FALSE; | |
1427 | -} | |
1428 | - | |
1429 | -inline void rtw_set_do_late_resume(struct pwrctrl_priv *pwrpriv, bool enable) | |
1430 | -{ | |
1431 | - pwrpriv->do_late_resume = enable; | |
1432 | -} | |
1433 | -#endif | |
1434 | - | |
1435 | -#ifdef CONFIG_HAS_EARLYSUSPEND | |
1436 | -extern int rtw_resume_process(_adapter *padapter); | |
1437 | -static void rtw_early_suspend(struct early_suspend *h) | |
1438 | -{ | |
1439 | - struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); | |
1440 | - DBG_8723A("%s\n",__FUNCTION__); | |
1441 | - | |
1442 | - rtw_set_do_late_resume(pwrpriv, _FALSE); | |
1443 | -} | |
1444 | - | |
1445 | -static void rtw_late_resume(struct early_suspend *h) | |
1446 | -{ | |
1447 | - struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); | |
1448 | - _adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv); | |
1449 | - | |
1450 | - DBG_8723A("%s\n",__FUNCTION__); | |
1451 | - if(pwrpriv->do_late_resume) { | |
1452 | - rtw_set_do_late_resume(pwrpriv, _FALSE); | |
1453 | - rtw_resume_process(adapter); | |
1454 | - } | |
1455 | -} | |
1456 | - | |
1457 | -void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) | |
1458 | -{ | |
1459 | - DBG_8723A("%s\n", __FUNCTION__); | |
1460 | - | |
1461 | - /* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */ | |
1462 | - pwrpriv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20; | |
1463 | - pwrpriv->early_suspend.suspend = rtw_early_suspend; | |
1464 | - pwrpriv->early_suspend.resume = rtw_late_resume; | |
1465 | - register_early_suspend(&pwrpriv->early_suspend); | |
1466 | -} | |
1467 | - | |
1468 | -void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) | |
1469 | -{ | |
1470 | - DBG_8723A("%s\n", __FUNCTION__); | |
1471 | - | |
1472 | - rtw_set_do_late_resume(pwrpriv, _FALSE); | |
1473 | - | |
1474 | - if (pwrpriv->early_suspend.suspend) | |
1475 | - unregister_early_suspend(&pwrpriv->early_suspend); | |
1476 | - | |
1477 | - pwrpriv->early_suspend.suspend = NULL; | |
1478 | - pwrpriv->early_suspend.resume = NULL; | |
1479 | -} | |
1480 | -#endif /* CONFIG_HAS_EARLYSUSPEND */ | |
1481 | - | |
1482 | -#ifdef CONFIG_ANDROID_POWER | |
1483 | -extern int rtw_resume_process(PADAPTER padapter); | |
1484 | -static void rtw_early_suspend(android_early_suspend_t *h) | |
1485 | -{ | |
1486 | - struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); | |
1487 | - DBG_8723A("%s\n",__FUNCTION__); | |
1488 | - | |
1489 | - rtw_set_do_late_resume(pwrpriv, _FALSE); | |
1490 | -} | |
1491 | - | |
1492 | -static void rtw_late_resume(android_early_suspend_t *h) | |
1493 | -{ | |
1494 | - struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); | |
1495 | - _adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv); | |
1496 | - | |
1497 | - DBG_8723A("%s\n",__FUNCTION__); | |
1498 | - if(pwrpriv->do_late_resume) { | |
1499 | - rtw_set_do_late_resume(pwrpriv, _FALSE); | |
1500 | - rtw_resume_process(adapter); | |
1501 | - } | |
1502 | -} | |
1503 | - | |
1504 | -void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) | |
1505 | -{ | |
1506 | - DBG_8723A("%s\n", __FUNCTION__); | |
1507 | - | |
1508 | - /* jeff: set the early suspend level before blank screen, so we wll do late resume after scree is lit */ | |
1509 | - pwrpriv->early_suspend.level = ANDROID_EARLY_SUSPEND_LEVEL_BLANK_SCREEN - 20; | |
1510 | - pwrpriv->early_suspend.suspend = rtw_early_suspend; | |
1511 | - pwrpriv->early_suspend.resume = rtw_late_resume; | |
1512 | - android_register_early_suspend(&pwrpriv->early_suspend); | |
1513 | -} | |
1514 | - | |
1515 | -void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) | |
1516 | -{ | |
1517 | - DBG_8723A("%s\n", __FUNCTION__); | |
1518 | - | |
1519 | - rtw_set_do_late_resume(pwrpriv, _FALSE); | |
1520 | - | |
1521 | - if (pwrpriv->early_suspend.suspend) | |
1522 | - android_unregister_early_suspend(&pwrpriv->early_suspend); | |
1523 | - | |
1524 | - pwrpriv->early_suspend.suspend = NULL; | |
1525 | - pwrpriv->early_suspend.resume = NULL; | |
1526 | -} | |
1527 | -#endif /* CONFIG_ANDROID_POWER */ | |
1528 | - | |
1529 | 1409 | u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val) |
1530 | 1410 | { |
1531 | 1411 | u8 bResult = _TRUE; |
@@ -1592,10 +1472,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) | ||
1592 | 1472 | |
1593 | 1473 | if (pwrpriv->bInternalAutoSuspend == _FALSE && pwrpriv->bInSuspend) { |
1594 | 1474 | DBG_8723A("%s wait bInSuspend...\n", __func__); |
1595 | - while (pwrpriv->bInSuspend | |
1596 | - && ((rtw_get_passing_time_ms(start) <= 3000 && !rtw_is_do_late_resume(pwrpriv)) | |
1597 | - || (rtw_get_passing_time_ms(start) <= 500 && rtw_is_do_late_resume(pwrpriv))) | |
1598 | - ) { | |
1475 | + while (pwrpriv->bInSuspend && | |
1476 | + (rtw_get_passing_time_ms(start) <= 3000)) { | |
1599 | 1477 | msleep(10); |
1600 | 1478 | } |
1601 | 1479 | if (pwrpriv->bInSuspend) |
@@ -32,16 +32,6 @@ | ||
32 | 32 | #define CONFIG_SIGNAL_DISPLAY_DBM |
33 | 33 | #endif |
34 | 34 | |
35 | -#if defined(CONFIG_HAS_EARLYSUSPEND) && defined (CONFIG_RESUME_IN_WORKQUEUE) | |
36 | - #warning "You have CONFIG_HAS_EARLYSUSPEND enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically" | |
37 | - #undef CONFIG_RESUME_IN_WORKQUEUE | |
38 | -#endif | |
39 | - | |
40 | -#if defined(CONFIG_ANDROID_POWER) && defined (CONFIG_RESUME_IN_WORKQUEUE) | |
41 | - #warning "You have CONFIG_ANDROID_POWER enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically" | |
42 | - #undef CONFIG_RESUME_IN_WORKQUEUE | |
43 | -#endif | |
44 | - | |
45 | 35 | #ifdef CONFIG_RESUME_IN_WORKQUEUE //this can be removed, because there is no case for this... |
46 | 36 | #if !defined( CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER) |
47 | 37 | #error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK or CONFIG_ANDROID_POWER will suffer from the danger of wifi's unfunctionality..." |
@@ -359,8 +359,6 @@ static inline u32 bitshift(u32 bitmask) | ||
359 | 359 | // Suspend lock prevent system from going suspend |
360 | 360 | #ifdef CONFIG_WAKELOCK |
361 | 361 | #include <linux/wakelock.h> |
362 | -#elif defined(CONFIG_ANDROID_POWER) | |
363 | -#include <linux/android_power.h> | |
364 | 362 | #endif |
365 | 363 | |
366 | 364 | extern void rtw_suspend_lock_init(void); |
@@ -24,11 +24,6 @@ | ||
24 | 24 | #include <osdep_service.h> |
25 | 25 | #include <drv_types.h> |
26 | 26 | |
27 | -#ifdef CONFIG_HAS_EARLYSUSPEND | |
28 | -#include <linux/earlysuspend.h> | |
29 | -#endif //CONFIG_HAS_EARLYSUSPEND | |
30 | - | |
31 | - | |
32 | 27 | #define FW_PWR0 0 |
33 | 28 | #define FW_PWR1 1 |
34 | 29 | #define FW_PWR2 2 |
@@ -244,16 +239,6 @@ struct pwrctrl_priv | ||
244 | 239 | struct work_struct resume_work; |
245 | 240 | #endif |
246 | 241 | |
247 | - #ifdef CONFIG_HAS_EARLYSUSPEND | |
248 | - struct early_suspend early_suspend; | |
249 | - u8 do_late_resume; | |
250 | - #endif //CONFIG_HAS_EARLYSUSPEND | |
251 | - | |
252 | - #ifdef CONFIG_ANDROID_POWER | |
253 | - android_early_suspend_t early_suspend; | |
254 | - u8 do_late_resume; | |
255 | - #endif | |
256 | - | |
257 | 242 | #ifdef CONFIG_INTEL_PROXIM |
258 | 243 | u8 stored_power_mgnt; |
259 | 244 | #endif |
@@ -320,20 +305,6 @@ void LPS_Leave(PADAPTER padapter); | ||
320 | 305 | void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv); |
321 | 306 | #endif //CONFIG_RESUME_IN_WORKQUEUE |
322 | 307 | |
323 | -#if defined(CONFIG_HAS_EARLYSUSPEND ) || defined(CONFIG_ANDROID_POWER) | |
324 | -bool rtw_is_earlysuspend_registered(struct pwrctrl_priv *pwrpriv); | |
325 | -bool rtw_is_do_late_resume(struct pwrctrl_priv *pwrpriv); | |
326 | -void rtw_set_do_late_resume(struct pwrctrl_priv *pwrpriv, bool enable); | |
327 | -void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv); | |
328 | -void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv); | |
329 | -#else | |
330 | -#define rtw_is_earlysuspend_registered(pwrpriv) _FALSE | |
331 | -#define rtw_is_do_late_resume(pwrpriv) _FALSE | |
332 | -#define rtw_set_do_late_resume(pwrpriv, enable) do {} while (0) | |
333 | -#define rtw_register_early_suspend(pwrpriv) do {} while (0) | |
334 | -#define rtw_unregister_early_suspend(pwrpriv) do {} while (0) | |
335 | -#endif /* CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER */ | |
336 | - | |
337 | 308 | u8 rtw_interface_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id,u8* val); |
338 | 309 | void rtw_set_ips_deny(_adapter *padapter, u32 ms); |
339 | 310 | int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller); |
@@ -203,64 +203,50 @@ void rtw_udelay_os(int us) | ||
203 | 203 | |
204 | 204 | #ifdef CONFIG_WAKELOCK |
205 | 205 | static struct wake_lock rtw_suspend_lock; |
206 | -#elif defined(CONFIG_ANDROID_POWER) | |
207 | -static android_suspend_lock_t rtw_suspend_lock ={ | |
208 | - .name = RTW_SUSPEND_LOCK_NAME | |
209 | -}; | |
210 | 206 | #endif |
211 | 207 | |
212 | 208 | inline void rtw_suspend_lock_init(void) |
213 | 209 | { |
214 | - #ifdef CONFIG_WAKELOCK | |
210 | +#ifdef CONFIG_WAKELOCK | |
215 | 211 | wake_lock_init(&rtw_suspend_lock, WAKE_LOCK_SUSPEND, RTW_SUSPEND_LOCK_NAME); |
216 | - #elif defined(CONFIG_ANDROID_POWER) | |
217 | - android_init_suspend_lock(&rtw_suspend_lock); | |
218 | - #endif | |
212 | +#endif | |
219 | 213 | } |
220 | 214 | |
221 | 215 | inline void rtw_suspend_lock_uninit(void) |
222 | 216 | { |
223 | - #ifdef CONFIG_WAKELOCK | |
217 | +#ifdef CONFIG_WAKELOCK | |
224 | 218 | wake_lock_destroy(&rtw_suspend_lock); |
225 | - #elif defined(CONFIG_ANDROID_POWER) | |
226 | - android_uninit_suspend_lock(&rtw_suspend_lock); | |
227 | - #endif | |
219 | +#endif | |
228 | 220 | } |
229 | 221 | |
230 | 222 | inline void rtw_lock_suspend(void) |
231 | 223 | { |
232 | - #ifdef CONFIG_WAKELOCK | |
224 | +#ifdef CONFIG_WAKELOCK | |
233 | 225 | wake_lock(&rtw_suspend_lock); |
234 | - #elif defined(CONFIG_ANDROID_POWER) | |
235 | - android_lock_suspend(&rtw_suspend_lock); | |
236 | - #endif | |
226 | +#endif | |
237 | 227 | |
238 | - #if defined(CONFIG_WAKELOCK) || defined(CONFIG_ANDROID_POWER) | |
228 | +#if defined(CONFIG_WAKELOCK) | |
239 | 229 | //DBG_8723A("####%s: suspend_lock_count:%d####\n", __FUNCTION__, rtw_suspend_lock.stat.count); |
240 | - #endif | |
230 | +#endif | |
241 | 231 | } |
242 | 232 | |
243 | 233 | inline void rtw_unlock_suspend(void) |
244 | 234 | { |
245 | - #ifdef CONFIG_WAKELOCK | |
235 | +#ifdef CONFIG_WAKELOCK | |
246 | 236 | wake_unlock(&rtw_suspend_lock); |
247 | - #elif defined(CONFIG_ANDROID_POWER) | |
248 | - android_unlock_suspend(&rtw_suspend_lock); | |
249 | - #endif | |
237 | +#endif | |
250 | 238 | |
251 | - #if defined(CONFIG_WAKELOCK) || defined(CONFIG_ANDROID_POWER) | |
239 | +#if defined(CONFIG_WAKELOCK) | |
252 | 240 | //DBG_8723A("####%s: suspend_lock_count:%d####\n", __FUNCTION__, rtw_suspend_lock.stat.count); |
253 | - #endif | |
241 | +#endif | |
254 | 242 | } |
255 | 243 | |
256 | 244 | #ifdef CONFIG_WOWLAN |
257 | 245 | inline void rtw_lock_suspend_timeout(long timeout) |
258 | 246 | { |
259 | - #ifdef CONFIG_WAKELOCK | |
247 | +#ifdef CONFIG_WAKELOCK | |
260 | 248 | wake_lock_timeout(&rtw_suspend_lock, timeout); |
261 | - #elif defined(CONFIG_ANDROID_POWER) | |
262 | - android_lock_suspend_auto_expire(&rtw_suspend_lock, timeout); | |
263 | - #endif | |
249 | +#endif | |
264 | 250 | } |
265 | 251 | #endif //CONFIG_WOWLAN |
266 | 252 |
@@ -782,16 +782,7 @@ static int rtw_resume(struct usb_interface *pusb_intf) | ||
782 | 782 | #ifdef CONFIG_RESUME_IN_WORKQUEUE |
783 | 783 | rtw_resume_in_workqueue(pwrpriv); |
784 | 784 | #else |
785 | - if (rtw_is_earlysuspend_registered(pwrpriv) | |
786 | - #ifdef CONFIG_WOWLAN | |
787 | - && !padapter->pwrctrlpriv.wowlan_mode | |
788 | - #endif /* CONFIG_WOWLAN */ | |
789 | - ) { | |
790 | - /* jeff: bypass resume here, do in late_resume */ | |
791 | - rtw_set_do_late_resume(pwrpriv, _TRUE); | |
792 | - } else { | |
793 | - ret = rtw_resume_process(padapter); | |
794 | - } | |
785 | + ret = rtw_resume_process(padapter); | |
795 | 786 | #endif /* CONFIG_RESUME_IN_WORKQUEUE */ |
796 | 787 | } |
797 | 788 |
@@ -1459,9 +1450,6 @@ _func_enter_; | ||
1459 | 1450 | //DBG_8723A("r871xu_dev_remove():module removed\n"); |
1460 | 1451 | padapter->hw_init_completed = _FALSE; |
1461 | 1452 | }*/ |
1462 | -#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER) | |
1463 | - rtw_unregister_early_suspend(&padapter->pwrctrlpriv); | |
1464 | -#endif | |
1465 | 1453 | |
1466 | 1454 | rtw_pm_set_ips(padapter, IPS_NONE); |
1467 | 1455 | rtw_pm_set_lps(padapter, PS_MODE_ACTIVE); |