Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337436
b: refs/heads/master
c: 6bbdee1
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Oct 30, 2012
1 parent 36d3e45 commit 952f2bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e77e35bc3c0b6cb2ab90051b1bf79a35e57713f
refs/heads/master: 6bbdee1435531ba90ed5b9ef0f083bd7598d847b
29 changes: 10 additions & 19 deletions trunk/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,21 @@ int i_EepromReadAnlogInputHeader(unsigned short w_PCIBoardEepromAddress,

unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc_PCIChipInformation,
unsigned short w_EepromStartAddress);
void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress);
void v_EepromClock76(unsigned int dw_Address, unsigned int dw_RegisterValue);
void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress);
void v_EepromSendCommand76(unsigned int dw_Address, unsigned int dw_EepromCommand,
unsigned char b_DataLengthInBits);
void v_EepromCs76Read(unsigned int dw_Address, unsigned short w_offset, unsigned short *pw_Value);

static void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress)
{
unsigned char b_EepromBusy = 0;

do {
b_EepromBusy = inb(w_PCIBoardEepromAddress + 0x3F);
b_EepromBusy = b_EepromBusy & 0x80;
} while (b_EepromBusy == 0x80);
}

unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc_PCIChipInformation,
unsigned short w_EepromStartAddress)
{
Expand Down Expand Up @@ -221,23 +229,6 @@ unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc
return w_ReadWord;
}

void v_EepromWaitBusy(unsigned short w_PCIBoardEepromAddress)
{
unsigned char b_EepromBusy = 0;

do
{
/* IMPORTANT */
/* An error has been written in the AMCC 5933 book at the page B-13 */
/* Ex: if you read a byte and look for the busy statusEEPROM=0x80 and */
/* the operator register is AMCC_OP_REG_MCSR+3 */
/* unsigned short read EEPROM=0x8000 andAMCC_OP_REG_MCSR+2 */
/* unsigned int read EEPROM=0x80000000 and AMCC_OP_REG_MCSR */
b_EepromBusy = inb(w_PCIBoardEepromAddress + 0x3F);
b_EepromBusy = b_EepromBusy & 0x80;
} while (b_EepromBusy == 0x80);
}

void v_EepromClock76(unsigned int dw_Address, unsigned int dw_RegisterValue)
{
/* Set EEPROM clock Low */
Expand Down

0 comments on commit 952f2bd

Please sign in to comment.