Patch "staging: r8188eu: fix led register settings" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    staging: r8188eu: fix led register settings

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     staging-r8188eu-fix-led-register-settings.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6790995f2913d059f09e2abda5fb8540402b4407
Author: Martin Kaiser <martin@xxxxxxxxx>
Date:   Sat Oct 15 17:11:06 2022 +0200

    staging: r8188eu: fix led register settings
    
    [ Upstream commit 12c6223fc1804fd9295dc50d358294539b4a4184 ]
    
    Using an InterTech DMG-02 dongle, the led remains on when the system goes
    into standby mode. After wakeup, it's no longer possible to control the
    led.
    
    It turned out that the register settings to enable or disable the led were
    not correct. They worked for some dongles like the Edimax V2 but not for
    others like the InterTech DMG-02.
    
    This patch fixes the register settings. Bit 3 in the led_cfg2 register
    controls the led status, bit 5 must always be set to be able to control
    the led, bit 6 has no influence on the led. Setting the mac_pinmux_cfg
    register is not necessary.
    
    These settings were tested with Edimax V2 and InterTech DMG-02.
    
    Cc: stable@xxxxxxxxxxxxxxx
    Fixes: 8cd574e6af54 ("staging: r8188eu: introduce new hal dir for RTL8188eu driver")
    Suggested-by: Michael Straube <straube.linux@xxxxxxxxx>
    Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
    Tested-by: Michael Straube <straube.linux@xxxxxxxxx> # InterTech DMG-02,
    Tested-by: Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx> # Edimax N150
    Link: https://lore.kernel.org/r/20221015151115.232095-2-martin@xxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c
index 42e35953fd7b..1993c3993b3d 100644
--- a/drivers/staging/r8188eu/core/rtw_led.c
+++ b/drivers/staging/r8188eu/core/rtw_led.c
@@ -34,40 +34,19 @@ static void ResetLedStatus(struct led_priv *pLed)
 
 static void SwLedOn(struct adapter *padapter, struct led_priv *pLed)
 {
-	u8	LedCfg;
-	int res;
-
 	if (padapter->bDriverStopped)
 		return;
 
-	res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);
-	if (res)
-		return;
-
-	rtw_write8(padapter, REG_LEDCFG2, (LedCfg & 0xf0) | BIT(5) | BIT(6)); /*  SW control led0 on. */
+	rtw_write8(padapter, REG_LEDCFG2, BIT(5)); /*  SW control led0 on. */
 	pLed->bLedOn = true;
 }
 
 static void SwLedOff(struct adapter *padapter, struct led_priv *pLed)
 {
-	u8	LedCfg;
-	int res;
-
 	if (padapter->bDriverStopped)
 		goto exit;
 
-	res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */
-	if (res)
-		goto exit;
-
-	LedCfg &= 0x90; /*  Set to software control. */
-	rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3)));
-	res = rtw_read8(padapter, REG_MAC_PINMUX_CFG, &LedCfg);
-	if (res)
-		goto exit;
-
-	LedCfg &= 0xFE;
-	rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
+	rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3));
 exit:
 	pLed->bLedOn = false;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux