xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8189fs/hal/rtl8188f/sdio/rtl8189fs_led.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
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  *****************************************************************************/
15 #define _RTL8188FS_LED_C_
16 
17 #include "rtl8188f_hal.h"
18 #ifdef CONFIG_RTW_SW_LED
19 
20 /* ********************************************************************************
21  * LED object.
22  * ******************************************************************************** */
23 
24 
25 /* ********************************************************************************
26  *	Prototype of protected function.
27  * ******************************************************************************** */
28 
29 /* ********************************************************************************
30  * LED_819xUsb routines.
31  * ******************************************************************************** */
32 
33 /*
34  *	Description:
35  *		Turn on LED according to LedPin specified.
36  *   */
37 void
SwLedOn_8188FS(_adapter * padapter,PLED_SDIO pLed)38 SwLedOn_8188FS(
39 	_adapter			*padapter,
40 	PLED_SDIO		pLed
41 )
42 {
43 	u8	LedCfg;
44 	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(padapter);
45 
46 	if (RTW_CANNOT_RUN(padapter))
47 		return;
48 
49 	pLed->bLedOn = _TRUE;
50 
51 }
52 
53 
54 /*
55  *	Description:
56  *		Turn off LED according to LedPin specified.
57  *   */
58 void
SwLedOff_8188FS(_adapter * padapter,PLED_SDIO pLed)59 SwLedOff_8188FS(
60 	_adapter			*padapter,
61 	PLED_SDIO		pLed
62 )
63 {
64 	u8	LedCfg;
65 	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(padapter);
66 
67 	if (RTW_CANNOT_RUN(padapter))
68 		goto exit;
69 
70 exit:
71 	pLed->bLedOn = _FALSE;
72 
73 }
74 
75 /* ********************************************************************************
76  * Interface to manipulate LED objects.
77  * ******************************************************************************** */
78 
79 /* ********************************************************************************
80  * Default LED behavior.
81  * ******************************************************************************** */
82 
83 /*
84  *	Description:
85  *		Initialize all LED_871x objects.
86  *   */
87 void
rtl8188fs_InitSwLeds(_adapter * padapter)88 rtl8188fs_InitSwLeds(
89 	_adapter	*padapter
90 )
91 {
92 #if 0
93 	struct led_priv *pledpriv = adapter_to_led(padapter);
94 
95 	pledpriv->LedControlHandler = LedControlSDIO;
96 
97 	pledpriv->SwLedOn = SwLedOn_8188FS;
98 	pledpriv->SwLedOff = SwLedOff_8188FS;
99 
100 	InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);
101 
102 	InitLed871x(padapter, &(pledpriv->SwLed1), LED_PIN_LED1);
103 #endif
104 }
105 
106 
107 /*
108  *	Description:
109  *		DeInitialize all LED_819xUsb objects.
110  *   */
111 void
rtl8188fs_DeInitSwLeds(_adapter * padapter)112 rtl8188fs_DeInitSwLeds(
113 	_adapter	*padapter
114 )
115 {
116 #if 0
117 	struct led_priv	*ledpriv = adapter_to_led(padapter);
118 
119 	DeInitLed871x(&(ledpriv->SwLed0));
120 	DeInitLed871x(&(ledpriv->SwLed1));
121 #endif
122 }
123 #endif
124