summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/b2c2/flexcop-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/b2c2/flexcop-i2c.c')
-rw-r--r--linux/drivers/media/dvb/b2c2/flexcop-i2c.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/linux/drivers/media/dvb/b2c2/flexcop-i2c.c b/linux/drivers/media/dvb/b2c2/flexcop-i2c.c
index 8db1605e0..8b969edfb 100644
--- a/linux/drivers/media/dvb/b2c2/flexcop-i2c.c
+++ b/linux/drivers/media/dvb/b2c2/flexcop-i2c.c
@@ -2,7 +2,7 @@
* This file is part of linux driver the digital TV devices equipped with B2C2 FlexcopII(b)/III
*
* flexcop-i2c.c - flexcop internal 2Wire bus (I2C) and dvb i2c initialization
- *
+ *
* see flexcop.c for copyright information.
*/
#include "flexcop.h"
@@ -16,10 +16,10 @@ static int flexcop_i2c_operation(struct flexcop_device *fc, flexcop_ibi_value *r
r100->tw_sm_c_100.working_start = 1;
deb_i2c("r100 before: %08x\n",r100->raw);
-
+
fc->write_ibi_reg(fc, tw_sm_c_100, ibi_zero);
fc->write_ibi_reg(fc, tw_sm_c_100, *r100); /* initiating i2c operation */
-
+
for (i = 0; i < FC_MAX_I2C_RETRIES; i++) {
r = fc->read_ibi_reg(fc, tw_sm_c_100);
@@ -33,7 +33,7 @@ static int flexcop_i2c_operation(struct flexcop_device *fc, flexcop_ibi_value *r
deb_i2c("suffering from an i2c ack_error\n");
if (++ack_errors >= max_ack_errors)
break;
-
+
fc->write_ibi_reg(fc, tw_sm_c_100, ibi_zero);
fc->write_ibi_reg(fc, tw_sm_c_100, *r100);
}
@@ -44,15 +44,15 @@ static int flexcop_i2c_operation(struct flexcop_device *fc, flexcop_ibi_value *r
static int flexcop_i2c_read4(struct flexcop_device *fc, flexcop_ibi_value r100, u8 *buf)
{
- flexcop_ibi_value r104;
+ flexcop_ibi_value r104;
int len = r100.tw_sm_c_100.total_bytes, /* remember total_bytes is buflen-1 */
ret;
-
+
if ((ret = flexcop_i2c_operation(fc,&r100,30)) != 0)
return ret;
-
+
r104 = fc->read_ibi_reg(fc,tw_sm_c_104);
-
+
deb_i2c("read: r100: %08x, r104: %08x\n",r100.raw,r104.raw);
/* there is at least one byte, otherwise we wouldn't be here */
@@ -82,7 +82,7 @@ static int flexcop_i2c_write4(struct flexcop_device *fc, flexcop_ibi_value r100,
/* write the additional i2c data before doing the actual i2c operation */
fc->write_ibi_reg(fc,tw_sm_c_104,r104);
-
+
return flexcop_i2c_operation(fc,&r100,30);
}
@@ -97,7 +97,7 @@ static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs
/* reading */
if (num == 2 &&
- msgs[0].flags == 0 &&
+ msgs[0].flags == 0 &&
msgs[1].flags == I2C_M_RD &&
msgs[0].buf != NULL &&
msgs[1].buf != NULL) {
@@ -109,7 +109,7 @@ static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs
ret = -EINVAL;
break;
}
-
+
ret = fc->i2c_request(fc, FC_WRITE, FC_I2C_PORT_DEMOD, msgs[i].addr, msgs[i].buf[0], &msgs[i].buf[1], msgs[i].len - 1);
}
@@ -119,7 +119,7 @@ static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs
ret = num;
up(&fc->i2c_sem);
-
+
return ret;
}
@@ -135,7 +135,7 @@ int flexcop_i2c_request(struct flexcop_device *fc, flexcop_access_op_t op,
r100.tw_sm_c_100.chipaddr = chipaddr;
r100.tw_sm_c_100.twoWS_rw = op;
r100.tw_sm_c_100.twoWS_port_reg = port;
-
+
while (len != 0) {
bytes_to_transfer = len > 4 ? 4 : len;
@@ -158,7 +158,7 @@ int flexcop_i2c_request(struct flexcop_device *fc, flexcop_access_op_t op,
return 0;
}
/* exported for PCI i2c */
-EXPORT_SYMBOL(flexcop_i2c_request);
+EXPORT_SYMBOL(flexcop_i2c_request);
static u32 flexcop_i2c_func(struct i2c_adapter *adapter)
{
@@ -177,7 +177,7 @@ int flexcop_i2c_init(struct flexcop_device *fc)
int ret;
sema_init(&fc->i2c_sem,1);
-
+
memset(&fc->i2c_adap, 0, sizeof(struct i2c_adapter));
strncpy(fc->i2c_adap.name, "B2C2 FlexCop device",I2C_NAME_SIZE);
@@ -190,7 +190,7 @@ int flexcop_i2c_init(struct flexcop_device *fc)
if ((ret = i2c_add_adapter(&fc->i2c_adap)) < 0)
return ret;
-
+
fc->init_state |= FC_STATE_I2C_INIT;
return 0;
}
@@ -199,6 +199,6 @@ void flexcop_i2c_exit(struct flexcop_device *fc)
{
if (fc->init_state & FC_STATE_I2C_INIT)
i2c_del_adapter(&fc->i2c_adap);
-
+
fc->init_state &= ~FC_STATE_I2C_INIT;
}