staging: rtl8188eu: Rework function PHY_QueryRFReg()
authornavin patidar <navin.patidar@gmail.com>
Sun, 31 Aug 2014 06:44:22 +0000 (12:14 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 Aug 2014 19:57:41 +0000 (12:57 -0700)
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c
drivers/staging/rtl8188eu/hal/usb_halinit.c
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
drivers/staging/rtl8188eu/include/phy.h

index f837c9552f28699dd36b76cd99eff103b89ad54b..06c55360e217387a7e38f66e19434b005f29790b 100644 (file)
@@ -169,7 +169,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
                     ("===>dm_TXPowerTrackingCallback_ThermalMeter_8188E txpowercontrol %d\n",
                     dm_odm->RFCalibrateInfo.TxPowerTrackControl));
 
-       ThermalValue = (u8)PHY_QueryRFReg(Adapter, RF_PATH_A, RF_T_METER_88E, 0xfc00);  /* 0x42: RF Reg[15:10] 88E */
+       ThermalValue = (u8)phy_query_rf_reg(Adapter, RF_PATH_A, RF_T_METER_88E, 0xfc00);        /* 0x42: RF Reg[15:10] 88E */
 
        ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
                     ("Readback Thermal Meter = 0x%x pre thermal meter 0x%x EEPROMthermalmeter 0x%x\n",
@@ -446,7 +446,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
                                ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
                                             ("TxPwrTracking 0xc80 = 0x%x, 0xc94 = 0x%x RF 0x24 = 0x%x\n",
                                             phy_query_bb_reg(Adapter, 0xc80, bMaskDWord), phy_query_bb_reg(Adapter,
-                                            0xc94, bMaskDWord), PHY_QueryRFReg(Adapter, RF_PATH_A, 0x24, bRFRegOffsetMask)));
+                                            0xc94, bMaskDWord), phy_query_rf_reg(Adapter, RF_PATH_A, 0x24, bRFRegOffsetMask)));
                        }
                }
 
@@ -1216,11 +1216,11 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)
        if ((tmpreg&0x70) != 0) {
                /* 1. Read original RF mode */
                /* Path-A */
-               RF_Amode = PHY_QueryRFReg(adapt, RF_PATH_A, RF_AC, bMask12Bits);
+               RF_Amode = phy_query_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits);
 
                /* Path-B */
                if (is2t)
-                       RF_Bmode = PHY_QueryRFReg(adapt, RF_PATH_B, RF_AC, bMask12Bits);
+                       RF_Bmode = phy_query_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits);
 
                /* 2. Set RF mode = standby mode */
                /* Path-A */
@@ -1232,7 +1232,7 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)
        }
 
        /* 3. Read RF reg18 */
-       LC_Cal = PHY_QueryRFReg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits);
+       LC_Cal = phy_query_rf_reg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits);
 
        /* 4. Set LC calibration begin  bit15 */
        PHY_SetRFReg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits, LC_Cal|0x08000);
index ae7cb8d0fedf49df4958ace902a8e3a25d75a242..a5064ae379e202c8ad9774066a4a1ab50bb48c8b 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/vmalloc.h>
 #include <drv_types.h>
 #include <rtw_efuse.h>
-
+#include <phy.h>
 #include <rtl8188e_hal.h>
 
 #include <rtw_iol.h>
@@ -230,7 +230,7 @@ void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc)
 
        pHalFunc->AntDivBeforeLinkHandler = &AntDivBeforeLink8188E;
        pHalFunc->AntDivCompareHandler = &AntDivCompare8188E;
-       pHalFunc->read_rfreg = &rtl8188e_PHY_QueryRFReg;
+       pHalFunc->read_rfreg = &phy_query_rf_reg;
        pHalFunc->write_rfreg = &rtl8188e_PHY_SetRFReg;
 
        pHalFunc->sreset_init_value = &sreset_init_value;
index 2cbaff5fe72e59b3d63d46f05878e5e36d204e39..506b287088c8488a82a7feaa96e74bc84cfdff5a 100644 (file)
@@ -124,32 +124,15 @@ static void rf_serial_write(struct adapter *adapt,
        phy_set_bb_reg(adapt, phyreg->rf3wireOffset, bMaskDWord, data_and_addr);
 }
 
-/**
-* Function:    PHY_QueryRFReg
-*
-* OverView:    Query "Specific bits" to RF register (page 8~)
-*
-* Input:
-*                      struct adapter *Adapter,
-*                      enum rf_radio_path eRFPath,     Radio path of A/B/C/D
-*                      u32                     RegAddr,        The target address to be read
-*                      u32                     BitMask         The target bit position in the target address
-*                                                                      to be read
-*
-* Output:      None
-* Return:              u32                     Readback value
-* Note:                This function is equal to "GetRFRegSetting" in PHY programming guide
-*/
-u32 rtl8188e_PHY_QueryRFReg(struct adapter *Adapter, enum rf_radio_path eRFPath,
-                           u32 RegAddr, u32 BitMask)
+u32 phy_query_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path,
+                    u32 reg_addr, u32 bit_mask)
 {
-       u32 Original_Value, Readback_Value, BitShift;
-
-       Original_Value = rf_serial_read(Adapter, eRFPath, RegAddr);
+       u32 original_value, readback_value, bit_shift;
 
-       BitShift =  cal_bit_shift(BitMask);
-       Readback_Value = (Original_Value & BitMask) >> BitShift;
-       return Readback_Value;
+       original_value = rf_serial_read(adapt, rf_path, reg_addr);
+       bit_shift =  cal_bit_shift(bit_mask);
+       readback_value = (original_value & bit_mask) >> bit_shift;
+       return readback_value;
 }
 
 /**
index 7503a24f4877df6a692fcbe0a83f48dd78316c31..968707e5218142b4c93d63faf4f864f0f48bb48f 100644 (file)
@@ -818,8 +818,8 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
        usb_write16(Adapter, REG_PKT_BE_BK_LIFE_TIME, 0x0400);  /*  unit: 256us. 256ms */
 
        /* Keep RfRegChnlVal for later use. */
-       haldata->RfRegChnlVal[0] = PHY_QueryRFReg(Adapter, (enum rf_radio_path)0, RF_CHNLBW, bRFRegOffsetMask);
-       haldata->RfRegChnlVal[1] = PHY_QueryRFReg(Adapter, (enum rf_radio_path)1, RF_CHNLBW, bRFRegOffsetMask);
+       haldata->RfRegChnlVal[0] = phy_query_rf_reg(Adapter, (enum rf_radio_path)0, RF_CHNLBW, bRFRegOffsetMask);
+       haldata->RfRegChnlVal[1] = phy_query_rf_reg(Adapter, (enum rf_radio_path)1, RF_CHNLBW, bRFRegOffsetMask);
 
 HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_TURN_ON_BLOCK);
        _BBTurnOnBlock(Adapter);
index cfd59d7c53043bae9f899d78b55d5a3622f2b98e..d080586c78cc8ee2243ad771f2a30e9631a38d99 100644 (file)
@@ -198,8 +198,6 @@ struct ant_sel_cck {
 /*  */
 /*  BB and RF register read/write */
 /*  */
-u32 rtl8188e_PHY_QueryRFReg(struct adapter *adapter, enum rf_radio_path rfpath,
-                           u32 regaddr, u32 mask);
 void rtl8188e_PHY_SetRFReg(struct adapter *adapter, enum rf_radio_path rfpath,
                           u32 regaddr, u32 mask, u32 data);
 
@@ -232,8 +230,6 @@ bool SetAntennaConfig92C(struct adapter *adapter, u8 defaultant);
 
 /*--------------------------Exported Function prototype---------------------*/
 
-#define PHY_QueryRFReg(adapt, rfpath, regaddr, bitmask)        \
-       rtl8188e_PHY_QueryRFReg((adapt), (rfpath), (regaddr), (bitmask))
 #define PHY_SetRFReg(adapt, rfpath, regaddr, bitmask, data)    \
        rtl8188e_PHY_SetRFReg((adapt), (rfpath), (regaddr), (bitmask), (data))
 
index 2d3889b26635331be50aa849602cdcd4a111f509..129b81a733a2f83c3921a00f86b8b646624ae6a2 100644 (file)
@@ -4,3 +4,5 @@ bool rtl88eu_phy_bb_config(struct adapter *adapt);
 
 u32 phy_query_bb_reg(struct adapter *adapt, u32 regaddr, u32 bitmask);
 void phy_set_bb_reg(struct adapter *adapt, u32 regaddr, u32 bitmask, u32 data);
+u32 phy_query_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path,
+                    u32 reg_addr, u32 bit_mask);