Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: vt6655: srom remove dead functions

Remove these unused functions
SROMbWriteEmbedded
SROMvRegBitsOn
SROMvRegBitsOff
SROMbIsRegBitsOn
SROMbIsRegBitsOff
SROMvWriteAllContents
SROMvWriteEtherAddress
SROMvReadSubSysVenId
SROMbAutoLoad

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Malcolm Priestley and committed by
Greg Kroah-Hartman
950701a1 da4f18ed

-264
-251
drivers/staging/vt6655/srom.c
··· 107 107 } 108 108 109 109 /* 110 - * Description: Write a byte to EEPROM, by MAC I2C 111 - * 112 - * Parameters: 113 - * In: 114 - * dwIoBase - I/O base address 115 - * byContntOffset - address of EEPROM 116 - * wData - data to write 117 - * Out: 118 - * none 119 - * 120 - * Return Value: true if succeeded; false if failed. 121 - * 122 - */ 123 - bool SROMbWriteEmbedded(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byData) 124 - { 125 - unsigned short wDelay, wNoACK; 126 - unsigned char byWait; 127 - 128 - unsigned char byOrg; 129 - 130 - VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg); 131 - /* turn off hardware retry for getting NACK */ 132 - VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, (byOrg & (~I2MCFG_NORETRY))); 133 - for (wNoACK = 0; wNoACK < W_MAX_I2CRETRY; wNoACK++) { 134 - VNSvOutPortB(dwIoBase + MAC_REG_I2MTGID, EEP_I2C_DEV_ID); 135 - VNSvOutPortB(dwIoBase + MAC_REG_I2MTGAD, byContntOffset); 136 - VNSvOutPortB(dwIoBase + MAC_REG_I2MDOPT, byData); 137 - 138 - /* issue write command */ 139 - VNSvOutPortB(dwIoBase + MAC_REG_I2MCSR, I2MCSR_EEMW); 140 - /* wait DONE be set */ 141 - for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) { 142 - VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait); 143 - if (byWait & (I2MCSR_DONE | I2MCSR_NACK)) 144 - break; 145 - PCAvDelayByIO(CB_DELAY_LOOP_WAIT); 146 - } 147 - 148 - if ((wDelay < W_MAX_TIMEOUT) && 149 - (!(byWait & I2MCSR_NACK))) { 150 - break; 151 - } 152 - } 153 - if (wNoACK == W_MAX_I2CRETRY) { 154 - VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); 155 - return false; 156 - } 157 - VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); 158 - return true; 159 - } 160 - 161 - /* 162 - * Description: Turn bits on in eeprom 163 - * 164 - * Parameters: 165 - * In: 166 - * dwIoBase - I/O base address 167 - * byContntOffset - address of EEPROM 168 - * byBits - bits to turn on 169 - * Out: 170 - * none 171 - * 172 - * Return Value: none 173 - * 174 - */ 175 - void SROMvRegBitsOn(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byBits) 176 - { 177 - unsigned char byOrgData; 178 - 179 - byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); 180 - SROMbWriteEmbedded(dwIoBase, byContntOffset, (unsigned char)(byOrgData | byBits)); 181 - } 182 - 183 - /* 184 - * Description: Turn bits off in eeprom 185 - * 186 - * Parameters: 187 - * In: 188 - * dwIoBase - I/O base address 189 - * byContntOffset - address of EEPROM 190 - * byBits - bits to turn off 191 - * Out: 192 - * none 193 - * 194 - */ 195 - void SROMvRegBitsOff(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byBits) 196 - { 197 - unsigned char byOrgData; 198 - 199 - byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); 200 - SROMbWriteEmbedded(dwIoBase, byContntOffset, (unsigned char)(byOrgData & (~byBits))); 201 - } 202 - 203 - /* 204 - * Description: Test if bits on in eeprom 205 - * 206 - * Parameters: 207 - * In: 208 - * dwIoBase - I/O base address 209 - * byContntOffset - address of EEPROM 210 - * byTestBits - bits to test 211 - * Out: 212 - * none 213 - * 214 - * Return Value: true if all test bits on; otherwise false 215 - * 216 - */ 217 - bool SROMbIsRegBitsOn(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byTestBits) 218 - { 219 - unsigned char byOrgData; 220 - 221 - byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); 222 - return (byOrgData & byTestBits) == byTestBits; 223 - } 224 - 225 - /* 226 - * Description: Test if bits off in eeprom 227 - * 228 - * Parameters: 229 - * In: 230 - * dwIoBase - I/O base address 231 - * byContntOffset - address of EEPROM 232 - * byTestBits - bits to test 233 - * Out: 234 - * none 235 - * 236 - * Return Value: true if all test bits off; otherwise false 237 - * 238 - */ 239 - bool SROMbIsRegBitsOff(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byTestBits) 240 - { 241 - unsigned char byOrgData; 242 - 243 - byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); 244 - return !(byOrgData & byTestBits); 245 - } 246 - 247 - /* 248 110 * Description: Read all contents of eeprom to buffer 249 111 * 250 112 * Parameters: ··· 125 263 /* ii = Rom Address */ 126 264 for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { 127 265 *pbyEepromRegs = SROMbyReadEmbedded(dwIoBase, (unsigned char)ii); 128 - pbyEepromRegs++; 129 - } 130 - } 131 - 132 - /* 133 - * Description: Write all contents of buffer to eeprom 134 - * 135 - * Parameters: 136 - * In: 137 - * dwIoBase - I/O base address 138 - * pbyEepromRegs - EEPROM content Buffer 139 - * Out: 140 - * none 141 - * 142 - * Return Value: none 143 - * 144 - */ 145 - void SROMvWriteAllContents(void __iomem *dwIoBase, unsigned char *pbyEepromRegs) 146 - { 147 - int ii; 148 - 149 - /* ii = Rom Address */ 150 - for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { 151 - SROMbWriteEmbedded(dwIoBase, (unsigned char)ii, *pbyEepromRegs); 152 266 pbyEepromRegs++; 153 267 } 154 268 } ··· 150 312 *pbyEtherAddress = SROMbyReadEmbedded(dwIoBase, ii); 151 313 pbyEtherAddress++; 152 314 } 153 - } 154 - 155 - /* 156 - * Description: Write Ethernet Address from buffer to eeprom 157 - * 158 - * Parameters: 159 - * In: 160 - * dwIoBase - I/O base address 161 - * pbyEtherAddress - Ethernet Address buffer 162 - * Out: 163 - * none 164 - * 165 - * Return Value: none 166 - * 167 - */ 168 - void SROMvWriteEtherAddress(void __iomem *dwIoBase, unsigned char *pbyEtherAddress) 169 - { 170 - unsigned char ii; 171 - 172 - /* ii = Rom Address */ 173 - for (ii = 0; ii < ETH_ALEN; ii++) { 174 - SROMbWriteEmbedded(dwIoBase, ii, *pbyEtherAddress); 175 - pbyEtherAddress++; 176 - } 177 - } 178 - 179 - /* 180 - * Description: Read Sub_VID and Sub_SysId from eeprom to buffer 181 - * 182 - * Parameters: 183 - * In: 184 - * dwIoBase - I/O base address 185 - * Out: 186 - * pdwSubSysVenId - Sub_VID and Sub_SysId read 187 - * 188 - * Return Value: none 189 - * 190 - */ 191 - void SROMvReadSubSysVenId(void __iomem *dwIoBase, unsigned long *pdwSubSysVenId) 192 - { 193 - unsigned char *pbyData; 194 - 195 - pbyData = (unsigned char *)pdwSubSysVenId; 196 - /* sub vendor */ 197 - *pbyData = SROMbyReadEmbedded(dwIoBase, 6); 198 - *(pbyData+1) = SROMbyReadEmbedded(dwIoBase, 7); 199 - /* sub system */ 200 - *(pbyData+2) = SROMbyReadEmbedded(dwIoBase, 8); 201 - *(pbyData+3) = SROMbyReadEmbedded(dwIoBase, 9); 202 - } 203 - 204 - /* 205 - * Description: Auto Load EEPROM to MAC register 206 - * 207 - * Parameters: 208 - * In: 209 - * dwIoBase - I/O base address 210 - * Out: 211 - * none 212 - * 213 - * Return Value: true if success; otherwise false 214 - * 215 - */ 216 - bool SROMbAutoLoad(void __iomem *dwIoBase) 217 - { 218 - unsigned char byWait; 219 - int ii; 220 - 221 - unsigned char byOrg; 222 - 223 - VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg); 224 - /* turn on hardware retry */ 225 - VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, (byOrg | I2MCFG_NORETRY)); 226 - 227 - MACvRegBitsOn(dwIoBase, MAC_REG_I2MCSR, I2MCSR_AUTOLD); 228 - 229 - /* ii = Rom Address */ 230 - for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { 231 - MACvTimer0MicroSDelay(dwIoBase, CB_EEPROM_READBYTE_WAIT); 232 - VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &byWait); 233 - if (!(byWait & I2MCSR_AUTOLD)) 234 - break; 235 - } 236 - 237 - VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); 238 - 239 - if (ii == EEP_MAX_CONTEXT_SIZE) 240 - return false; 241 - return true; 242 315 }
-13
drivers/staging/vt6655/srom.h
··· 132 132 /*--------------------- Export Functions --------------------------*/ 133 133 134 134 unsigned char SROMbyReadEmbedded(void __iomem *dwIoBase, unsigned char byContntOffset); 135 - bool SROMbWriteEmbedded(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byData); 136 - 137 - void SROMvRegBitsOn(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byBits); 138 - void SROMvRegBitsOff(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byBits); 139 - 140 - bool SROMbIsRegBitsOn(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byTestBits); 141 - bool SROMbIsRegBitsOff(void __iomem *dwIoBase, unsigned char byContntOffset, unsigned char byTestBits); 142 135 143 136 void SROMvReadAllContents(void __iomem *dwIoBase, unsigned char *pbyEepromRegs); 144 - void SROMvWriteAllContents(void __iomem *dwIoBase, unsigned char *pbyEepromRegs); 145 137 146 138 void SROMvReadEtherAddress(void __iomem *dwIoBase, unsigned char *pbyEtherAddress); 147 - void SROMvWriteEtherAddress(void __iomem *dwIoBase, unsigned char *pbyEtherAddress); 148 - 149 - void SROMvReadSubSysVenId(void __iomem *dwIoBase, unsigned long *pdwSubSysVenId); 150 - 151 - bool SROMbAutoLoad(void __iomem *dwIoBase); 152 139 153 140 #endif // __EEPROM_H__