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