]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/vt6655/rf.c
Merge tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas...
[karo-tx-linux.git] / drivers / staging / vt6655 / rf.c
index df38abf508fd198bb0b7a67ce1524cef9a88ed4a..6948984a25ab0b6295449e5c6b56503179faa240 100644 (file)
@@ -46,7 +46,6 @@
 #define SWITCH_CHANNEL_DELAY_AL2230 200 //us
 #define AL2230_PWR_IDX_LEN    64
 
-
 #define BY_AL7230_REG_LEN     23 //24bit
 #define CB_AL7230_INIT_SEQ    16
 #define SWITCH_CHANNEL_DELAY_AL7230 200 //us
@@ -56,8 +55,6 @@
 
 /*---------------------  Static Variables  --------------------------*/
 
-
-
 const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = {
        0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
        0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
@@ -222,7 +219,6 @@ const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = {
        0x12BACF00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // Need modify for 11b/g
 };
 
-
 const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = {
        0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  1, Tf = 2412MHz
        0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  2, Tf = 2417MHz
@@ -418,14 +414,8 @@ const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = {
 };
 //}} RobertYu
 
-
-
-
 /*---------------------  Static Functions  --------------------------*/
 
-
-
-
 /*
  * Description: AIROHA IFRF chip init function
  *
@@ -520,7 +510,6 @@ bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel)
  *
  */
 
-
 //{{ RobertYu: 20041210
 /*
  * Description: UW2452 IFRF chip init function
@@ -535,8 +524,6 @@ bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel)
  *
  */
 
-
-
 //}} RobertYu
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -567,8 +554,6 @@ bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel)
  *
  */
 
-
-
 /*---------------------  Export Variables  --------------------------*/
 
 /*---------------------  Export Functions  --------------------------*/
@@ -607,8 +592,6 @@ bool IFRFbWriteEmbedded(unsigned long dwIoBase, unsigned long dwData)
        return true;
 }
 
-
-
 /*
  * Description: RFMD RF2959 IFRF chip init function
  *
@@ -665,13 +648,10 @@ bool RFbAL2230Init(unsigned long dwIoBase)
 
        MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
-
-
        //patch abnormal AL2230 frequency output
 //2008-8-21 chester <add>
        IFRFbWriteEmbedded(dwIoBase, (0x07168700+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
 
-
        for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++)
                bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230InitTable[ii]);
 //2008-8-21 chester <add>
@@ -729,7 +709,6 @@ bool RFbAL2230SelectChannel(unsigned long dwIoBase, unsigned char byChannel)
  *
  */
 
-
 /*
  * Description: Select channel with UW2451 chip
  *
@@ -843,7 +822,6 @@ bool RFbSelectChannel(unsigned long dwIoBase, unsigned char byRFType, unsigned c
 {
        bool bResult = true;
        switch (byRFType) {
-
        case RF_AIROHA:
        case RF_AL2230S:
                bResult = RFbAL2230SelectChannel(dwIoBase, byChannel);
@@ -912,14 +890,11 @@ bool RFvWriteWakeProgSyn(unsigned long dwIoBase, unsigned char byRFType, unsigne
                        return false;
                }
 
-               if (uChannel <= CB_MAX_CHANNEL_24G)
-               {
+               if (uChannel <= CB_MAX_CHANNEL_24G) {
                        for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++) {
                                MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTable[ii]);
                        }
-               }
-               else
-               {
+               } else {
                        for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++) {
                                MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTableAMode[ii]);
                        }
@@ -988,8 +963,6 @@ bool RFbSetPower(
 //PLICE_DEBUG->
                //byPwr+=5;
 //PLICE_DEBUG <-
-
-//printk("Rate <11:byPwr is %d\n",byPwr);
                break;
        case RATE_6M:
        case RATE_9M:
@@ -1015,8 +988,6 @@ bool RFbSetPower(
 //PLICE_DEBUG->
                //byPwr+=5;
 //PLICE_DEBUG<-
-
-//printk("Rate <24:byPwr is %d\n",byPwr);
                break;
        case RATE_24M:
        case RATE_36M:
@@ -1027,16 +998,14 @@ bool RFbSetPower(
 //PLICE_DEBUG->
                //byPwr+=5;
 //PLICE_DEBUG<-
-//printk("Rate < 54:byPwr is %d\n",byPwr);
                break;
        }
 
-//    if (pDevice->byLocalID <= REV_ID_VT3253_B1) {
        if (pDevice->byCurPwr == byPwr) {
                return true;
        }
+
        bResult = RFbRawSetPower(pDevice, byPwr, uRATE);
-//    }
        if (bResult == true) {
                pDevice->byCurPwr = byPwr;
        }
@@ -1067,10 +1036,9 @@ bool RFbRawSetPower(
        unsigned long dwMax7230Pwr = 0;
 
        if (byPwr >=  pDevice->byMaxPwrLevel) {
-               return (false);
+               return false;
        }
        switch (pDevice->byRFType) {
-
        case RF_AIROHA:
                bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]);
                if (uRATE <= RATE_11M) {
@@ -1080,7 +1048,6 @@ bool RFbRawSetPower(
                }
                break;
 
-
        case RF_AL2230S:
                bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]);
                if (uRATE <= RATE_11M) {
@@ -1101,7 +1068,6 @@ bool RFbRawSetPower(
                bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwMax7230Pwr);
                break;
 
-
        default:
                break;
        }
@@ -1151,7 +1117,6 @@ RFvRSSITodBm(
 ////////////////////////////////////////////////////////////////////////////////
 //{{ RobertYu: 20050104
 
-
 // Post processing for the 11b/g and 11a.
 // for save time on changing Reg2,3,5,7,10,12,15
 bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byOldChannel, unsigned char byNewChannel)
@@ -1163,8 +1128,7 @@ bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byO
        // if change between 11 b/g and 11a need to update the following register
        // Channel Index 1~14
 
-       if ((byOldChannel <= CB_MAX_CHANNEL_24G) && (byNewChannel > CB_MAX_CHANNEL_24G))
-       {
+       if ((byOldChannel <= CB_MAX_CHANNEL_24G) && (byNewChannel > CB_MAX_CHANNEL_24G)) {
                // Change from 2.4G to 5G
                bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[2]); //Reg2
                bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[3]); //Reg3
@@ -1173,9 +1137,7 @@ bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byO
                bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[10]);//Reg10
                bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[12]);//Reg12
                bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[15]);//Reg15
-       }
-       else if ((byOldChannel > CB_MAX_CHANNEL_24G) && (byNewChannel <= CB_MAX_CHANNEL_24G))
-       {
+       } else if ((byOldChannel > CB_MAX_CHANNEL_24G) && (byNewChannel <= CB_MAX_CHANNEL_24G)) {
                // change from 5G to 2.4G
                bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[2]); //Reg2
                bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[3]); //Reg3
@@ -1189,7 +1151,5 @@ bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byO
        return bResult;
 }
 
-
 //}} RobertYu
 ////////////////////////////////////////////////////////////////////////////////
-