Commit 66be78f6 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: addi_eeprom: cleanup v_EepromReadWord()

Add namespace to the function by renaming the CamelCase function to
addi_eeprom_readw().

Rename the CamelCase parameters and local variables.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ed4d2b26
...@@ -60,7 +60,7 @@ static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev, ...@@ -60,7 +60,7 @@ static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev,
unsigned short w_Address = CR_CHAN(insn->chanspec); unsigned short w_Address = CR_CHAN(insn->chanspec);
unsigned short w_Data; unsigned short w_Data;
w_Data = w_EepromReadWord(devpriv->i_IobaseAmcc, w_Data = addi_eeprom_readw(devpriv->i_IobaseAmcc,
this_board->pc_EepromChip, 0x100 + (2 * w_Address)); this_board->pc_EepromChip, 0x100 + (2 * w_Address));
data[0] = w_Data; data[0] = w_Data;
......
...@@ -223,20 +223,19 @@ static unsigned short addi_eeprom_readw_nvram(unsigned long iobase, ...@@ -223,20 +223,19 @@ static unsigned short addi_eeprom_readw_nvram(unsigned long iobase,
return val; return val;
} }
static unsigned short w_EepromReadWord(unsigned long iobase, static unsigned short addi_eeprom_readw(unsigned long iobase,
char *type, char *type,
unsigned short w_EepromStartAddress) unsigned short addr)
{ {
unsigned short w_ReadWord = 0; unsigned short val = 0;
/* Test the PCI chip type */
if (!strcmp(type, "S5920") || !strcmp(type, "S5933")) if (!strcmp(type, "S5920") || !strcmp(type, "S5933"))
w_ReadWord = addi_eeprom_readw_nvram(iobase, w_EepromStartAddress); val = addi_eeprom_readw_nvram(iobase, addr);
if (!strcmp(type, "93C76")) if (!strcmp(type, "93C76"))
w_ReadWord = addi_eeprom_readw_93c76(iobase, w_EepromStartAddress); val = addi_eeprom_readw_93c76(iobase, addr);
return w_ReadWord; return val;
} }
static int i_EepromReadDigitalInputHeader(unsigned long iobase, static int i_EepromReadDigitalInputHeader(unsigned long iobase,
...@@ -247,17 +246,17 @@ static int i_EepromReadDigitalInputHeader(unsigned long iobase, ...@@ -247,17 +246,17 @@ static int i_EepromReadDigitalInputHeader(unsigned long iobase,
unsigned short w_Temp; unsigned short w_Temp;
/* read nbr of channels */ /* read nbr of channels */
s_Header->w_Nchannel = w_EepromReadWord(iobase, type, s_Header->w_Nchannel = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 6); 0x100 + w_Address + 6);
/* interruptible or not */ /* interruptible or not */
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 8); 0x100 + w_Address + 8);
s_Header->b_Interruptible = (unsigned char) (w_Temp >> 7) & 0x01; s_Header->b_Interruptible = (unsigned char) (w_Temp >> 7) & 0x01;
/* How many interruptible logic */ /* How many interruptible logic */
s_Header->w_NinterruptLogic = w_EepromReadWord(iobase, type, s_Header->w_NinterruptLogic = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 10); 0x100 + w_Address + 10);
return 0; return 0;
} }
...@@ -268,8 +267,8 @@ static int i_EepromReadDigitalOutputHeader(unsigned long iobase, ...@@ -268,8 +267,8 @@ static int i_EepromReadDigitalOutputHeader(unsigned long iobase,
struct str_DigitalOutputHeader *s_Header) struct str_DigitalOutputHeader *s_Header)
{ {
/* Read Nbr channels */ /* Read Nbr channels */
s_Header->w_Nchannel = w_EepromReadWord(iobase, type, s_Header->w_Nchannel = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 6); 0x100 + w_Address + 6);
return 0; return 0;
} }
...@@ -283,15 +282,15 @@ static int i_EepromReadTimerHeader(unsigned long iobase, ...@@ -283,15 +282,15 @@ static int i_EepromReadTimerHeader(unsigned long iobase,
unsigned short i, w_Size = 0, w_Temp; unsigned short i, w_Size = 0, w_Temp;
/* Read No of Timer */ /* Read No of Timer */
s_Header->w_Ntimer = w_EepromReadWord(iobase, type, s_Header->w_Ntimer = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 6); 0x100 + w_Address + 6);
/* Read header size */ /* Read header size */
for (i = 0; i < s_Header->w_Ntimer; i++) { for (i = 0; i < s_Header->w_Ntimer; i++) {
s_Header->s_TimerDetails[i].w_HeaderSize = s_Header->s_TimerDetails[i].w_HeaderSize =
w_EepromReadWord(iobase, type, addi_eeprom_readw(iobase, type,
0x100 + w_Address + 8 + w_Size + 0); 0x100 + w_Address + 8 + w_Size + 0);
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 8 + w_Size + 2); 0x100 + w_Address + 8 + w_Size + 2);
/* Read Resolution */ /* Read Resolution */
s_Header->s_TimerDetails[i].b_Resolution = s_Header->s_TimerDetails[i].b_Resolution =
...@@ -301,8 +300,8 @@ static int i_EepromReadTimerHeader(unsigned long iobase, ...@@ -301,8 +300,8 @@ static int i_EepromReadTimerHeader(unsigned long iobase,
s_Header->s_TimerDetails[i].b_Mode = s_Header->s_TimerDetails[i].b_Mode =
(unsigned char) (w_Temp >> 4) & 0x3F; (unsigned char) (w_Temp >> 4) & 0x3F;
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 8 + w_Size + 4); 0x100 + w_Address + 8 + w_Size + 4);
/* Read MinTiming */ /* Read MinTiming */
s_Header->s_TimerDetails[i].w_MinTiming = (w_Temp >> 6) & 0x3FF; s_Header->s_TimerDetails[i].w_MinTiming = (w_Temp >> 6) & 0x3FF;
...@@ -324,12 +323,12 @@ static int i_EepromReadAnlogOutputHeader(unsigned long iobase, ...@@ -324,12 +323,12 @@ static int i_EepromReadAnlogOutputHeader(unsigned long iobase,
unsigned short w_Temp; unsigned short w_Temp;
/* No of channels for 1st hard component */ /* No of channels for 1st hard component */
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 10); 0x100 + w_Address + 10);
s_Header->w_Nchannel = (w_Temp >> 4) & 0x03FF; s_Header->w_Nchannel = (w_Temp >> 4) & 0x03FF;
/* Resolution for 1st hard component */ /* Resolution for 1st hard component */
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 16); 0x100 + w_Address + 16);
s_Header->b_Resolution = (unsigned char) (w_Temp >> 8) & 0xFF; s_Header->b_Resolution = (unsigned char) (w_Temp >> 8) & 0xFF;
return 0; return 0;
} }
...@@ -341,19 +340,19 @@ static int i_EepromReadAnlogInputHeader(unsigned long iobase, ...@@ -341,19 +340,19 @@ static int i_EepromReadAnlogInputHeader(unsigned long iobase,
struct str_AnalogInputHeader *s_Header) struct str_AnalogInputHeader *s_Header)
{ {
unsigned short w_Temp, w_Offset; unsigned short w_Temp, w_Offset;
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 10); 0x100 + w_Address + 10);
s_Header->w_Nchannel = (w_Temp >> 4) & 0x03FF; s_Header->w_Nchannel = (w_Temp >> 4) & 0x03FF;
s_Header->w_MinConvertTiming = w_EepromReadWord(iobase, type, s_Header->w_MinConvertTiming = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 16); 0x100 + w_Address + 16);
s_Header->w_MinDelayTiming = w_EepromReadWord(iobase, type, s_Header->w_MinDelayTiming = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 30); 0x100 + w_Address + 30);
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 20); 0x100 + w_Address + 20);
s_Header->b_HasDma = (w_Temp >> 13) & 0x01; /* whether dma present or not */ s_Header->b_HasDma = (w_Temp >> 13) & 0x01; /* whether dma present or not */
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + 72); /* reading Y */ 0x100 + w_Address + 72); /* reading Y */
w_Temp = w_Temp & 0x00FF; w_Temp = w_Temp & 0x00FF;
if (w_Temp) /* Y>0 */ if (w_Temp) /* Y>0 */
{ {
...@@ -366,8 +365,8 @@ static int i_EepromReadAnlogInputHeader(unsigned long iobase, ...@@ -366,8 +365,8 @@ static int i_EepromReadAnlogInputHeader(unsigned long iobase,
} }
/* read Resolution */ /* read Resolution */
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + w_Address + w_Offset); 0x100 + w_Address + w_Offset);
s_Header->b_Resolution = w_Temp & 0x001F; /* last 5 bits */ s_Header->b_Resolution = w_Temp & 0x001F; /* last 5 bits */
return 0; return 0;
...@@ -389,25 +388,25 @@ static int i_EepromReadMainHeader(unsigned long iobase, ...@@ -389,25 +388,25 @@ static int i_EepromReadMainHeader(unsigned long iobase,
struct str_AnalogInputHeader s_AnalogInputHeader; struct str_AnalogInputHeader s_AnalogInputHeader;
/* Read size */ /* Read size */
s_MainHeader.w_HeaderSize = w_EepromReadWord(iobase, type, s_MainHeader.w_HeaderSize = addi_eeprom_readw(iobase, type,
0x100 + 8); 0x100 + 8);
/* Read nbr of functionality */ /* Read nbr of functionality */
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + 10); 0x100 + 10);
s_MainHeader.b_Nfunctions = (unsigned char) w_Temp & 0x00FF; s_MainHeader.b_Nfunctions = (unsigned char) w_Temp & 0x00FF;
/* Read functionality details */ /* Read functionality details */
for (i = 0; i < s_MainHeader.b_Nfunctions; i++) { for (i = 0; i < s_MainHeader.b_Nfunctions; i++) {
/* Read Type */ /* Read Type */
w_Temp = w_EepromReadWord(iobase, type, w_Temp = addi_eeprom_readw(iobase, type,
0x100 + 12 + w_Count); 0x100 + 12 + w_Count);
s_MainHeader.s_Functions[i].b_Type = (unsigned char) w_Temp & 0x3F; s_MainHeader.s_Functions[i].b_Type = (unsigned char) w_Temp & 0x3F;
w_Count = w_Count + 2; w_Count = w_Count + 2;
/* Read Address */ /* Read Address */
s_MainHeader.s_Functions[i].w_Address = s_MainHeader.s_Functions[i].w_Address =
w_EepromReadWord(iobase, type, addi_eeprom_readw(iobase, type,
0x100 + 12 + w_Count); 0x100 + 12 + w_Count);
w_Count = w_Count + 2; w_Count = w_Count + 2;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment