wifi: renew patch drivers/net/wireless
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rtl8723au / hal / rtl8723a / sdio / rtl8723as_led.c
1 /******************************************************************************\r
2  *\r
3  * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.\r
4  *\r
5  * This program is free software; you can redistribute it and/or modify it\r
6  * under the terms of version 2 of the GNU General Public License as\r
7  * published by the Free Software Foundation.\r
8  *\r
9  * This program is distributed in the hope that it will be useful, but WITHOUT\r
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
12  * more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License along with\r
15  * this program; if not, write to the Free Software Foundation, Inc.,\r
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA\r
17  *\r
18  *\r
19  ******************************************************************************/\r
20 #define _RTL8723AS_LED_C_\r
21 \r
22 #include "drv_types.h"\r
23 #include "rtl8723a_hal.h"\r
24 \r
25 //================================================================================\r
26 // LED object.\r
27 //================================================================================\r
28 \r
29 \r
30 //================================================================================\r
31 //      Prototype of protected function.\r
32 //================================================================================\r
33 \r
34 //================================================================================\r
35 // LED_819xUsb routines.\r
36 //================================================================================\r
37 \r
38 //\r
39 //      Description:\r
40 //              Turn on LED according to LedPin specified.\r
41 //\r
42 void\r
43 SwLedOn(\r
44         _adapter                        *padapter,\r
45         PLED_871x               pLed\r
46 )\r
47 {\r
48         u8      LedCfg;\r
49         //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);\r
50 \r
51         if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))\r
52         {\r
53                 return;\r
54         }\r
55 \r
56         pLed->bLedOn = _TRUE;\r
57 \r
58 }\r
59 \r
60 \r
61 //\r
62 //      Description:\r
63 //              Turn off LED according to LedPin specified.\r
64 //\r
65 void\r
66 SwLedOff(\r
67         _adapter                        *padapter,\r
68         PLED_871x               pLed\r
69 )\r
70 {\r
71         u8      LedCfg;\r
72         //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);\r
73 \r
74         if((padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))\r
75         {\r
76                 goto exit;\r
77         }\r
78 \r
79 exit:\r
80         pLed->bLedOn = _FALSE;\r
81 \r
82 }\r
83 \r
84 //================================================================================\r
85 // Interface to manipulate LED objects.\r
86 //================================================================================\r
87 \r
88 //================================================================================\r
89 // Default LED behavior.\r
90 //================================================================================\r
91 \r
92 //\r
93 //      Description:\r
94 //              Initialize all LED_871x objects.\r
95 //\r
96 void\r
97 rtl8723as_InitSwLeds(\r
98         _adapter        *padapter\r
99         )\r
100 {\r
101         struct led_priv *pledpriv = &(padapter->ledpriv);\r
102 \r
103         pledpriv->LedControlHandler = LedControl871x;\r
104 #if 0\r
105 \r
106         InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);\r
107 \r
108         InitLed871x(padapter,&(pledpriv->SwLed1), LED_PIN_LED1);\r
109 #endif\r
110 }\r
111 \r
112 \r
113 //\r
114 //      Description:\r
115 //              DeInitialize all LED_819xUsb objects.\r
116 //\r
117 void\r
118 rtl8723as_DeInitSwLeds(\r
119         _adapter        *padapter\r
120         )\r
121 {\r
122 #if 0\r
123         struct led_priv *ledpriv = &(padapter->ledpriv);\r
124 \r
125         DeInitLed871x( &(ledpriv->SwLed0) );\r
126         DeInitLed871x( &(ledpriv->SwLed1) );\r
127 #endif\r
128 }\r
129 \r