]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
staging: vt6656: put radio power off and on into correct state every time.
authorMalcolm Priestley <tvboxspy@gmail.com>
Fri, 18 Jul 2014 22:00:54 +0000 (23:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jul 2014 23:11:28 +0000 (16:11 -0700)
When radio is off bit GPIO3_INTMD should be on and off when radio is on.

Add these to the tail of vnt_radio_power_off and vnt_radio_power_on
and remove variable bHWRadioOff.

In device_init_registers just check GPIO3_DATA are in correct state and
always power on.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/card.c
drivers/staging/vt6656/device.h
drivers/staging/vt6656/main_usb.c

index ca77a191128347bebb830bc1fd86227bdfd4d49f..19a7931105a83362f9ef77a5d1ab02ed07261175 100644 (file)
@@ -750,6 +750,8 @@ int vnt_radio_power_off(struct vnt_private *priv)
 
        vnt_set_deep_sleep(priv);
 
+       vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD);
+
        return ret;
 }
 
@@ -769,9 +771,6 @@ int vnt_radio_power_on(struct vnt_private *priv)
 {
        int ret = true;
 
-       if (priv->bHWRadioOff == true)
-               return false;
-
        vnt_exit_deep_sleep(priv);
 
        vnt_mac_reg_bits_on(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
@@ -788,6 +787,8 @@ int vnt_radio_power_on(struct vnt_private *priv)
                break;
        }
 
+       vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD);
+
        return ret;
 }
 
index 69cac959a9647e7f51672fbb6dba1c83d71ac7af..ffcbaca8622a1f2f8abf7e915e853df4652c74fc 100644 (file)
@@ -326,7 +326,6 @@ struct vnt_private {
        u8 byRxAntennaMode;
        u8 byTxAntennaMode;
        u8 byRadioCtl;
-       u8 bHWRadioOff;
 
        /* IFS & Cw */
        u32 uSIFS;  /* Current SIFS */
index 68367414080f9017371ab96b7d2f8113c00b9bcc..0802ecdf74805852aedf5106446c069cee51cfa3 100644 (file)
@@ -354,7 +354,6 @@ static int device_init_registers(struct vnt_private *priv)
        vnt_set_short_slot_time(priv);
 
        priv->byRadioCtl = priv->abyEEPROM[EEP_OFS_RADIOCTL];
-       priv->bHWRadioOff = false;
 
        if ((priv->byRadioCtl & EEP_RADIOCTL_ENABLE) != 0) {
                status = vnt_control_in(priv, MESSAGE_TYPE_READ,
@@ -363,16 +362,12 @@ static int device_init_registers(struct vnt_private *priv)
                if (status != STATUS_SUCCESS)
                        return false;
 
-               if ((tmp & GPIO3_DATA) == 0) {
-                       priv->bHWRadioOff = true;
+               if ((tmp & GPIO3_DATA) == 0)
                        vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL1,
                                                                GPIO3_INTMD);
-               } else {
+               else
                        vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1,
                                                                GPIO3_INTMD);
-                       priv->bHWRadioOff = false;
-               }
-
        }
 
        vnt_mac_set_led(priv, LEDSTS_TMLEN, 0x38);
@@ -381,11 +376,7 @@ static int device_init_registers(struct vnt_private *priv)
 
        vnt_mac_reg_bits_on(priv, MAC_REG_GPIOCTL0, 0x01);
 
-       if (priv->bHWRadioOff == true) {
-               vnt_radio_power_off(priv);
-       } else {
-               vnt_radio_power_on(priv);
-       }
+       vnt_radio_power_on(priv);
 
        dev_dbg(&priv->usb->dev, "<----INIbInitAdapter Exit\n");