26aeebbd470df525fce11ecfbc9ee2d3c66bb9c8
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723bs / hal / rtl8723b / sdio / rtl8723bs_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 _RTL8723BS_LED_C_\r
21 \r
22 #include "rtl8723b_hal.h"\r
23 \r
24 //================================================================================\r
25 // LED object.\r
26 //================================================================================\r
27 \r
28 \r
29 //================================================================================\r
30 //      Prototype of protected function.\r
31 //================================================================================\r
32 \r
33 //================================================================================\r
34 // LED_819xUsb routines.\r
35 //================================================================================\r
36 \r
37 //\r
38 //      Description:\r
39 //              Turn on LED according to LedPin specified.\r
40 //\r
41 void\r
42 SwLedOn_8723BS(\r
43         _adapter                        *padapter,\r
44         PLED_SDIO               pLed\r
45 )\r
46 {\r
47         u8      LedCfg;\r
48         HAL_DATA_TYPE   *pHalData = GET_HAL_DATA(padapter);\r
49 \r
50         if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))\r
51         {\r
52                 return;\r
53         }\r
54 \r
55         pLed->bLedOn = _TRUE;\r
56 \r
57 }\r
58 \r
59 \r
60 //\r
61 //      Description:\r
62 //              Turn off LED according to LedPin specified.\r
63 //\r
64 void\r
65 SwLedOff_8723BS(\r
66         _adapter                        *padapter,\r
67         PLED_SDIO               pLed\r
68 )\r
69 {\r
70         u8      LedCfg;\r
71         HAL_DATA_TYPE   *pHalData = GET_HAL_DATA(padapter);\r
72 \r
73         if((padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))\r
74         {\r
75                 goto exit;\r
76         }\r
77 \r
78 exit:\r
79         pLed->bLedOn = _FALSE;\r
80 \r
81 }\r
82 \r
83 //================================================================================\r
84 // Interface to manipulate LED objects.\r
85 //================================================================================\r
86 \r
87 //================================================================================\r
88 // Default LED behavior.\r
89 //================================================================================\r
90 \r
91 //\r
92 //      Description:\r
93 //              Initialize all LED_871x objects.\r
94 //\r
95 void\r
96 rtl8723bs_InitSwLeds(\r
97         _adapter        *padapter\r
98         )\r
99 {\r
100 #if 0\r
101         struct led_priv *pledpriv = &(padapter->ledpriv);\r
102 \r
103         pledpriv->LedControlHandler = LedControlSDIO;\r
104 \r
105         pledpriv->SwLedOn = SwLedOn_8723BS;\r
106         pledpriv->SwLedOff = SwLedOff_8723BS;\r
107         \r
108         InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);\r
109 \r
110         InitLed871x(padapter,&(pledpriv->SwLed1), LED_PIN_LED1);\r
111 #endif\r
112 }\r
113 \r
114 \r
115 //\r
116 //      Description:\r
117 //              DeInitialize all LED_819xUsb objects.\r
118 //\r
119 void\r
120 rtl8723bs_DeInitSwLeds(\r
121         _adapter        *padapter\r
122         )\r
123 {\r
124 #if 0\r
125         struct led_priv *ledpriv = &(padapter->ledpriv);\r
126 \r
127         DeInitLed871x( &(ledpriv->SwLed0) );\r
128         DeInitLed871x( &(ledpriv->SwLed1) );\r
129 #endif\r
130 }\r
131 \r