aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/b2c2/flexcop-usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/b2c2/flexcop-usb.c')
-rw-r--r--drivers/media/dvb/b2c2/flexcop-usb.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c
index 87fb75f0d1cf..449fb5c3d0b1 100644
--- a/drivers/media/dvb/b2c2/flexcop-usb.c
+++ b/drivers/media/dvb/b2c2/flexcop-usb.c
@@ -211,10 +211,11 @@ static int flexcop_usb_utility_req(struct flexcop_usb *fc_usb, int set,
211#endif 211#endif
212 212
213/* usb i2c stuff */ 213/* usb i2c stuff */
214static int flexcop_usb_i2c_req(struct flexcop_usb *fc_usb, 214static int flexcop_usb_i2c_req(struct flexcop_i2c_adapter *i2c,
215 flexcop_usb_request_t req, flexcop_usb_i2c_function_t func, 215 flexcop_usb_request_t req, flexcop_usb_i2c_function_t func,
216 flexcop_i2c_port_t port, u8 chipaddr, u8 addr, u8 *buf, u8 buflen) 216 u8 chipaddr, u8 addr, u8 *buf, u8 buflen)
217{ 217{
218 struct flexcop_usb *fc_usb = i2c->fc->bus_specific;
218 u16 wValue, wIndex; 219 u16 wValue, wIndex;
219 int nWaitTime,pipe,len; 220 int nWaitTime,pipe,len;
220// u8 dwRequestType; 221// u8 dwRequestType;
@@ -242,7 +243,7 @@ static int flexcop_usb_i2c_req(struct flexcop_usb *fc_usb,
242 deb_info("unsupported function for i2c_req %x\n",func); 243 deb_info("unsupported function for i2c_req %x\n",func);
243 return -EINVAL; 244 return -EINVAL;
244 } 245 }
245 wValue = (func << 8 ) | (port << 4); 246 wValue = (func << 8) | (i2c->port << 4);
246 wIndex = (chipaddr << 8 ) | addr; 247 wIndex = (chipaddr << 8 ) | addr;
247 248
248 deb_i2c("i2c %2d: %02x %02x %02x %02x %02x %02x\n",func,request_type,req, 249 deb_i2c("i2c %2d: %02x %02x %02x %02x %02x %02x\n",func,request_type,req,
@@ -274,13 +275,15 @@ static int flexcop_usb_write_ibi_reg(struct flexcop_device *fc, flexcop_ibi_regi
274 return flexcop_usb_readwrite_dw(fc,reg, &val.raw, 0); 275 return flexcop_usb_readwrite_dw(fc,reg, &val.raw, 0);
275} 276}
276 277
277static int flexcop_usb_i2c_request(struct flexcop_device *fc, flexcop_access_op_t op, 278static int flexcop_usb_i2c_request(struct flexcop_i2c_adapter *i2c,
278 flexcop_i2c_port_t port, u8 chipaddr, u8 addr, u8 *buf, u16 len) 279 flexcop_access_op_t op, u8 chipaddr, u8 addr, u8 *buf, u16 len)
279{ 280{
280 if (op == FC_READ) 281 if (op == FC_READ)
281 return flexcop_usb_i2c_req(fc->bus_specific,B2C2_USB_I2C_REQUEST,USB_FUNC_I2C_READ,port,chipaddr,addr,buf,len); 282 return flexcop_usb_i2c_req(i2c, B2C2_USB_I2C_REQUEST,
283 USB_FUNC_I2C_READ, chipaddr, addr, buf, len);
282 else 284 else
283 return flexcop_usb_i2c_req(fc->bus_specific,B2C2_USB_I2C_REQUEST,USB_FUNC_I2C_WRITE,port,chipaddr,addr,buf,len); 285 return flexcop_usb_i2c_req(i2c, B2C2_USB_I2C_REQUEST,
286 USB_FUNC_I2C_WRITE, chipaddr, addr, buf, len);
284} 287}
285 288
286static void flexcop_usb_process_frame(struct flexcop_usb *fc_usb, u8 *buffer, int buffer_length) 289static void flexcop_usb_process_frame(struct flexcop_usb *fc_usb, u8 *buffer, int buffer_length)