1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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.
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
14 ******************************************************************************/
16 #include "drv_types.h"
17 #include "rtl8723a_hal.h"
18 #include "rtl8723a_led.h"
19 #include "usb_ops_linux.h"
26 /* Prototype of protected function. */
30 /* LED_819xUsb routines. */
34 /* Turn on LED according to LedPin specified. */
35 void SwLedOn23a(struct rtw_adapter *padapter, struct led_8723a *pLed)
39 if ((padapter->bSurpriseRemoved == true) || (padapter->bDriverStopped == true))
41 switch (pLed->LedPin) {
45 /* SW control led0 on. */
46 rtl8723au_write8(padapter, REG_LEDCFG0,
47 (LedCfg&0xf0)|BIT(5)|BIT(6));
50 /* SW control led1 on. */
51 rtl8723au_write8(padapter, REG_LEDCFG1, (LedCfg&0x00)|BIT(6));
54 LedCfg = rtl8723au_read8(padapter, REG_LEDCFG2);
55 /* SW control led1 on. */
56 rtl8723au_write8(padapter, REG_LEDCFG2, (LedCfg&0x80)|BIT(5));
65 /* Turn off LED according to LedPin specified. */
66 void SwLedOff23a(struct rtw_adapter *padapter, struct led_8723a *pLed)
69 /* struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter); */
71 if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
74 switch (pLed->LedPin) {
78 /* SW control led0 on. */
79 rtl8723au_write8(padapter, REG_LEDCFG0,
80 (LedCfg&0xf0)|BIT(5)|BIT(6));
83 /* SW control led1 on. */
84 rtl8723au_write8(padapter, REG_LEDCFG1,
85 (LedCfg&0x00)|BIT(5)|BIT(6));
88 LedCfg = rtl8723au_read8(padapter, REG_LEDCFG2);
89 /* SW control led1 on. */
90 rtl8723au_write8(padapter, REG_LEDCFG2,
91 (LedCfg&0x80)|BIT(3)|BIT(5));
100 /* Interface to manipulate LED objects. */
103 /* Initialize all LED_871x objects. */
105 rtl8723au_InitSwLeds(struct rtw_adapter *padapter)
107 struct led_priv *pledpriv = &padapter->ledpriv;
109 pledpriv->LedControlHandler = LedControl871x23a;
110 /* 8723as-vau wifi used led2 */
111 InitLed871x23a(padapter, &pledpriv->SwLed0, LED_PIN_LED2);
113 /* InitLed871x23a(padapter,&pledpriv->SwLed1, LED_PIN_LED2); */
117 /* DeInitialize all LED_819xUsb objects. */
119 rtl8723au_DeInitSwLeds(struct rtw_adapter *padapter)
121 struct led_priv *ledpriv = &padapter->ledpriv;
123 DeInitLed871x23a(&ledpriv->SwLed0);