Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196952
b: refs/heads/master
c: 59200df
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed May 11, 2010
1 parent fd981ae commit a05b0b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 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: 09a3c4aeb108dcc2ee89370c511e263dbcc94563
refs/heads/master: 59200df52cf7d4bfb93aeb30289a8e9d2af3058d
24 changes: 7 additions & 17 deletions trunk/drivers/staging/dt3155/dt3155_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,22 @@ u8 i2c_pm_lut_data;
* wait_ibsyclr()
*
* This function handles read/write timing and r/w timeout error
*
* Returns TRUE if NEW_CYCLE clears
* Returns FALSE if NEW_CYCLE doesn't clear in roughly 3 msecs, otherwise
* returns 0
*/
static int wait_ibsyclr(u8 *lpReg)
{
/* wait 100 microseconds */
udelay(100L);
/* __delay(loops_per_sec/10000); */

ReadMReg(lpReg + IIC_CSR2, iic_csr2_r.reg);
if (iic_csr2_r.fld.NEW_CYCLE) {
/* if NEW_CYCLE didn't clear */
/* TIMEOUT ERROR */
dt3155_errno = DT_ERR_I2C_TIMEOUT;
return FALSE;
} else
return TRUE; /* no error */
return -ETIMEDOUT;
}

return 0; /* no error */
}

/*
Expand All @@ -101,14 +100,9 @@ static int wait_ibsyclr(u8 *lpReg)
* 1st parameter is pointer to 32-bit register base address
* 2nd parameter is reg. index;
* 3rd is value to be written
*
* Returns TRUE - Successful completion
* FALSE - Timeout error - cycle did not complete!
*/
int WriteI2C(u8 *lpReg, u_short wIregIndex, u8 byVal)
{
int writestat; /* status for return */

/* read 32 bit IIC_CSR2 register data into union */

ReadMReg((lpReg + IIC_CSR2), iic_csr2_r.reg);
Expand All @@ -126,8 +120,7 @@ int WriteI2C(u8 *lpReg, u_short wIregIndex, u8 byVal)
WriteMReg((lpReg + IIC_CSR2), iic_csr2_r.reg);

/* wait for IIC cycle to finish */
writestat = wait_ibsyclr(lpReg);
return writestat;
return wait_ibsyclr(lpReg);
}

/*
Expand All @@ -138,9 +131,6 @@ int WriteI2C(u8 *lpReg, u_short wIregIndex, u8 byVal)
* 1st parameter is pointer to 32-bit register base address
* 2nd parameter is reg. index;
* 3rd is adrs of value to be read
*
* Returns TRUE - Successful completion
* FALSE - Timeout error - cycle did not complete!
*/
int ReadI2C(u8 *lpReg, u_short wIregIndex, u8 *byVal)
{
Expand Down

0 comments on commit a05b0b6

Please sign in to comment.