From: Malcolm Priestley Date: Mon, 26 May 2014 12:59:03 +0000 (+0100) Subject: staging: vt6656: replace ControlvWriteByte with vnt_control_out_u8 X-Git-Tag: next-20140530~19^2~175 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=285d58c486a1b0921a10730772b64e38cb06ae54;p=karo-tx-linux.git staging: vt6656: replace ControlvWriteByte with vnt_control_out_u8 add new function in usbpipe.c to replace ControlvWriteByte Signed-off-by: Malcolm Priestley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c index 8a965bf821c5..3373812c80bc 100644 --- a/drivers/staging/vt6656/baseband.c +++ b/drivers/staging/vt6656/baseband.c @@ -1028,17 +1028,17 @@ int BBbVT3184Init(struct vnt_private *priv) if ((priv->byRFType == RF_VT3226) || (priv->byRFType == RF_VT3342A0)) { - ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG, + vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG, MAC_REG_ITRTMSET, 0x23); MACvRegBitsOn(priv, MAC_REG_PAPEDELAY, 0x01); } else if (priv->byRFType == RF_VT3226D0) { - ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG, + vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG, MAC_REG_ITRTMSET, 0x11); MACvRegBitsOn(priv, MAC_REG_PAPEDELAY, 0x01); } - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x04, 0x7f); - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x04, 0x7f); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01); RFbRFTableDownload(priv); @@ -1081,13 +1081,13 @@ void BBvSetShortSlotTime(struct vnt_private *priv) if (bb_vga == priv->abyBBVGA[0]) priv->byBBRxConf |= 0x20; - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf); } void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data) { - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xE7, data); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xE7, data); /* patch for 3253B0 Baseband with Cardbus module */ if (priv->bShortSlotTime) @@ -1095,7 +1095,7 @@ void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data) else priv->byBBRxConf |= 0x20; /* 0010 0000 */ - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf); } /* @@ -1112,14 +1112,14 @@ void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data) */ void BBvSetDeepSleep(struct vnt_private *priv) { - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);/* CR12 */ - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0xB9);/* CR13 */ + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);/* CR12 */ + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0xB9);/* CR13 */ } void BBvExitDeepSleep(struct vnt_private *priv) { - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x00);/* CR12 */ - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);/* CR13 */ + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x00);/* CR12 */ + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);/* CR13 */ } void BBvUpdatePreEDThreshold(struct vnt_private *priv, int scanning) @@ -1384,7 +1384,7 @@ void BBvUpdatePreEDThreshold(struct vnt_private *priv, int scanning) if (!cr_201 && !cr_206) return; - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201); - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206); } diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index 1f20e9adc923..9313730117fc 100644 --- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -111,7 +111,7 @@ void CARDbSetMediaChannel(struct vnt_private *priv, u32 connection_channel) priv->abyCCKPwrTbl[connection_channel-1], RATE_1M); } - ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL, + vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL, (u8)(connection_channel|0x80)); } @@ -844,11 +844,11 @@ void CARDvSetBSSMode(struct vnt_private *priv) priv->byPacketType = CARDbyGetPktType(priv); if (priv->byBBType == BB_TYPE_11A) - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x03); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x03); else if (priv->byBBType == BB_TYPE_11B) - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x02); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x02); else if (priv->byBBType == BB_TYPE_11G) - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x08); + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x08); vUpdateIFS(priv); CARDvSetRSPINF(priv, (u8)priv->byBBType); @@ -857,7 +857,7 @@ void CARDvSetBSSMode(struct vnt_private *priv) if (priv->byRFType == RF_AIROHA7230) { priv->abyBBVGA[0] = 0x20; - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xe7, priv->abyBBVGA[0]); } @@ -867,7 +867,7 @@ void CARDvSetBSSMode(struct vnt_private *priv) if (priv->byRFType == RF_AIROHA7230) { priv->abyBBVGA[0] = 0x1c; - ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, + vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xe7, priv->abyBBVGA[0]); } diff --git a/drivers/staging/vt6656/control.c b/drivers/staging/vt6656/control.c index 0c59d6d13f9b..14346a6b928e 100644 --- a/drivers/staging/vt6656/control.c +++ b/drivers/staging/vt6656/control.c @@ -27,7 +27,6 @@ * * Functions: * vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM - * ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM * ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM * ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set * some bits in the same address @@ -44,16 +43,6 @@ /* static int msglevel =MSG_LEVEL_INFO; */ /* static int msglevel =MSG_LEVEL_DEBUG; */ -void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off, - u8 data) -{ - - vnt_control_out(pDevice, MESSAGE_TYPE_WRITE, reg_off, reg, - sizeof(u8), &data); - - return; -} - void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off, u8 *data) { diff --git a/drivers/staging/vt6656/control.h b/drivers/staging/vt6656/control.h index db9dd54c7623..e4e252ecbc28 100644 --- a/drivers/staging/vt6656/control.h +++ b/drivers/staging/vt6656/control.h @@ -33,9 +33,6 @@ #include "device.h" #include "usbpipe.h" -void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off, - u8 data); - void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off, u8 *data); diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 01dd0680c012..6cc056d07a22 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -468,28 +468,28 @@ static int device_init_registers(struct vnt_private *pDevice) byCalibRXIQ = pDevice->abyEEPROM[EEP_OFS_CALIB_RX_IQ]; if (byCalibTXIQ || byCalibTXDC || byCalibRXIQ) { /* CR255, enable TX/RX IQ and DC compensation mode */ - ControlvWriteByte(pDevice, + vnt_control_out_u8(pDevice, MESSAGE_REQUEST_BBREG, 0xff, 0x03); /* CR251, TX I/Q Imbalance Calibration */ - ControlvWriteByte(pDevice, + vnt_control_out_u8(pDevice, MESSAGE_REQUEST_BBREG, 0xfb, byCalibTXIQ); /* CR252, TX DC-Offset Calibration */ - ControlvWriteByte(pDevice, + vnt_control_out_u8(pDevice, MESSAGE_REQUEST_BBREG, 0xfC, byCalibTXDC); /* CR253, RX I/Q Imbalance Calibration */ - ControlvWriteByte(pDevice, + vnt_control_out_u8(pDevice, MESSAGE_REQUEST_BBREG, 0xfd, byCalibRXIQ); } else { /* CR255, turn off BB Calibration compensation */ - ControlvWriteByte(pDevice, + vnt_control_out_u8(pDevice, MESSAGE_REQUEST_BBREG, 0xff, 0x0); @@ -1310,7 +1310,7 @@ void vnt_configure_filter(struct vnt_private *priv) priv->byRxMode &= ~(RCR_UNICAST); } - ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG, + vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG, MAC_REG_RCR, priv->byRxMode); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 7d4e131303de..2264c8c7ec7e 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -28,7 +28,7 @@ * Functions: * vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM * vnt_control_in - Read variable length bytes from MEM/BB/MAC/EEPROM - * ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM + * vnt_control_out_u8 - Write one byte to MEM/BB/MAC/EEPROM * ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM * ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set some bits in the same address * @@ -83,6 +83,12 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value, return STATUS_SUCCESS; } +void vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 data) +{ + vnt_control_out(priv, MESSAGE_TYPE_WRITE, + reg_off, reg, sizeof(u8), &data); +} + int vnt_control_in(struct vnt_private *priv, u8 request, u16 value, u16 index, u16 length, u8 *buffer) { diff --git a/drivers/staging/vt6656/usbpipe.h b/drivers/staging/vt6656/usbpipe.h index f04e30bfbfae..a3d3bacd4d66 100644 --- a/drivers/staging/vt6656/usbpipe.h +++ b/drivers/staging/vt6656/usbpipe.h @@ -35,6 +35,8 @@ int vnt_control_out(struct vnt_private *, u8, u16, u16, u16, u8 *); int vnt_control_in(struct vnt_private *, u8, u16, u16, u16, u8 *); +void vnt_control_out_u8(struct vnt_private *, u8, u8, u8); + int PIPEnsInterruptRead(struct vnt_private *); int PIPEnsBulkInUsbRead(struct vnt_private *, struct vnt_rcb *pRCB); int PIPEnsSendBulkOut(struct vnt_private *,