#include <linux/list.h>
#include <linux/module.h>
#include <linux/slab.h>
-#include <linux/usb.h>
#include <linux/vmalloc.h>
#include <media/v4l2-common.h>
#include <media/tuner.h>
/* call common vendor command request */
status = cx231xx_send_vendor_cmd(dev, &ven_req);
if (status < 0 && !dev->i2c_scan_running) {
- pr_err("%s: failed with status -%d\n",
+ dev_err(&dev->udev->dev, "%s: failed with status -%d\n",
__func__, status);
}
usb_set_interface(dev->udev, usb_interface_index,
dev->video_mode.alt);
if (errCode < 0) {
- pr_err("cannot change alt number to %d (error=%i)\n",
+ dev_err(&dev->udev->dev,
+ "cannot change alt number to %d (error=%i)\n",
dev->video_mode.alt, errCode);
return errCode;
}
}
if (alt > 0 && max_pkt_size == 0) {
- pr_err("can't change interface %d alt no. to %d: Max. Pkt size = 0\n",
+ dev_err(&dev->udev->dev,
+ "can't change interface %d alt no. to %d: Max. Pkt size = 0\n",
usb_interface_index, alt);
/*To workaround error number=-71 on EP0 for videograbber,
need add following codes.*/
if (usb_interface_index > 0) {
status = usb_set_interface(dev->udev, usb_interface_index, alt);
if (status < 0) {
- pr_err("can't change interface %d alt no. to %d (err=%i)\n",
+ dev_err(&dev->udev->dev,
+ "can't change interface %d alt no. to %d (err=%i)\n",
usb_interface_index, alt, status);
return status;
}
buffer, 4096, &actlen, 2000);
if (ret)
- pr_err("bulk message failed: %d (%d/%d)", ret,
- size, actlen);
+ dev_err(&dev->udev->dev,
+ "bulk message failed: %d (%d/%d)", ret,
+ size, actlen);
else {
errCode = actlen != size ? -1 : 0;
}
dev->video_mode.isoc_ctl.urb =
kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
if (!dev->video_mode.isoc_ctl.urb) {
- pr_err("cannot alloc memory for usb buffers\n");
+ dev_err(&dev->udev->dev,
+ "cannot alloc memory for usb buffers\n");
return -ENOMEM;
}
dev->video_mode.isoc_ctl.transfer_buffer =
kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
if (!dev->video_mode.isoc_ctl.transfer_buffer) {
- pr_err("cannot allocate memory for usbtransfer\n");
+ dev_err(&dev->udev->dev,
+ "cannot allocate memory for usbtransfer\n");
kfree(dev->video_mode.isoc_ctl.urb);
return -ENOMEM;
}
for (i = 0; i < dev->video_mode.isoc_ctl.num_bufs; i++) {
urb = usb_alloc_urb(max_packets, GFP_KERNEL);
if (!urb) {
- pr_err("cannot alloc isoc_ctl.urb %i\n", i);
+ dev_err(&dev->udev->dev,
+ "cannot alloc isoc_ctl.urb %i\n", i);
cx231xx_uninit_isoc(dev);
return -ENOMEM;
}
usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
&urb->transfer_dma);
if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
- pr_err("unable to allocate %i bytes for transfer buffer %i%s\n",
+ dev_err(&dev->udev->dev,
+ "unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
cx231xx_uninit_isoc(dev);
rc = usb_submit_urb(dev->video_mode.isoc_ctl.urb[i],
GFP_ATOMIC);
if (rc) {
- pr_err("submit of urb %i failed (error=%i)\n", i,
+ dev_err(&dev->udev->dev,
+ "submit of urb %i failed (error=%i)\n", i,
rc);
cx231xx_uninit_isoc(dev);
return rc;
dev->video_mode.bulk_ctl.urb =
kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
if (!dev->video_mode.bulk_ctl.urb) {
- pr_err("cannot alloc memory for usb buffers\n");
+ dev_err(&dev->udev->dev,
+ "cannot alloc memory for usb buffers\n");
return -ENOMEM;
}
dev->video_mode.bulk_ctl.transfer_buffer =
kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
if (!dev->video_mode.bulk_ctl.transfer_buffer) {
- pr_err("cannot allocate memory for usbtransfer\n");
+ dev_err(&dev->udev->dev,
+ "cannot allocate memory for usbtransfer\n");
kfree(dev->video_mode.bulk_ctl.urb);
return -ENOMEM;
}
for (i = 0; i < dev->video_mode.bulk_ctl.num_bufs; i++) {
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) {
- pr_err("cannot alloc bulk_ctl.urb %i\n", i);
+ dev_err(&dev->udev->dev,
+ "cannot alloc bulk_ctl.urb %i\n", i);
cx231xx_uninit_bulk(dev);
return -ENOMEM;
}
usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
&urb->transfer_dma);
if (!dev->video_mode.bulk_ctl.transfer_buffer[i]) {
- pr_err("unable to allocate %i bytes for transfer buffer %i%s\n",
+ dev_err(&dev->udev->dev,
+ "unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
cx231xx_uninit_bulk(dev);
rc = usb_submit_urb(dev->video_mode.bulk_ctl.urb[i],
GFP_ATOMIC);
if (rc) {
- pr_err("submit of urb %i failed (error=%i)\n", i,rc);
+ dev_err(&dev->udev->dev,
+ "submit of urb %i failed (error=%i)\n", i, rc);
cx231xx_uninit_bulk(dev);
return rc;
}
errCode = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ENXTERNAL_AV);
if (errCode < 0) {
- pr_err("%s: Failed to set Power - errCode [%d]!\n",
+ dev_err(&dev->udev->dev,
+ "%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
errCode = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ANALOGT_TV);
if (errCode < 0) {
- pr_err("%s: Failed to set Power - errCode [%d]!\n",
+ dev_err(&dev->udev->dev,
+ "%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
/* initialize Colibri block */
errCode = cx231xx_afe_init_super_block(dev, 0x23c);
if (errCode < 0) {
- pr_err("%s: cx231xx_afe init super block - errCode [%d]!\n",
+ dev_err(&dev->udev->dev,
+ "%s: cx231xx_afe init super block - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
errCode = cx231xx_afe_init_channels(dev);
if (errCode < 0) {
- pr_err("%s: cx231xx_afe init channels - errCode [%d]!\n",
+ dev_err(&dev->udev->dev,
+ "%s: cx231xx_afe init channels - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
/* Set DIF in By pass mode */
errCode = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
if (errCode < 0) {
- pr_err("%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
+ dev_err(&dev->udev->dev,
+ "%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
/* I2S block related functions */
errCode = cx231xx_i2s_blk_initialize(dev);
if (errCode < 0) {
- pr_err("%s: cx231xx_i2s block initialize - errCode [%d]!\n",
+ dev_err(&dev->udev->dev,
+ "%s: cx231xx_i2s block initialize - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
/* init control pins */
errCode = cx231xx_init_ctrl_pin_status(dev);
if (errCode < 0) {
- pr_err("%s: cx231xx_init ctrl pins - errCode [%d]!\n",
+ dev_err(&dev->udev->dev,
+ "%s: cx231xx_init ctrl pins - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
break;
}
if (errCode < 0) {
- pr_err("%s: cx231xx_AGC mode to Analog - errCode [%d]!\n",
+ dev_err(&dev->udev->dev,
+ "%s: cx231xx_AGC mode to Analog - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
/* call common vendor command request */
status = cx231xx_send_vendor_cmd(dev, &ven_req);
if (status < 0) {
- pr_err("%s: failed with status -%d\n",
+ dev_err(&dev->udev->dev, "%s: failed with status -%d\n",
__func__, status);
}