X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fw9968cf.c;h=8f31613b9903897b52fe42f12c9533559d120a5f;hb=6de410c2b0cc055ae9ee640c84331f6a70878d9b;hp=20f211b55ad4c4d17726c579affbfa8cccfb7e46;hpb=3e8e7c93d7eb091463839b5212789c4aae09459e;p=linux-2.6-omap-h63xx.git diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c index 20f211b55ad..8f31613b990 100644 --- a/drivers/media/video/w9968cf.c +++ b/drivers/media/video/w9968cf.c @@ -399,7 +399,7 @@ MODULE_PARM_DESC(specific_debug, ****************************************************************************/ /* Video4linux interface */ -static struct file_operations w9968cf_fops; +static const struct file_operations w9968cf_fops; static int w9968cf_open(struct inode*, struct file*); static int w9968cf_release(struct inode*, struct file*); static int w9968cf_mmap(struct file*, struct vm_area_struct*); @@ -417,7 +417,7 @@ static int w9968cf_write_fsb(struct w9968cf_device*, u16* data); static int w9968cf_write_sb(struct w9968cf_device*, u16 value); static int w9968cf_read_sb(struct w9968cf_device*); static int w9968cf_upload_quantizationtables(struct w9968cf_device*); -static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs); +static void w9968cf_urb_complete(struct urb *urb); /* Low-level I2C (SMBus) I/O */ static int w9968cf_smbus_start(struct w9968cf_device*); @@ -586,15 +586,14 @@ static struct w9968cf_symbolic_list urb_errlist[] = { { -EFBIG, "Too much ISO frames requested" }, { -ENOSR, "Buffer error (overrun)" }, { -EPIPE, "Specified endpoint is stalled (device not responding)"}, - { -EOVERFLOW, "Babble (bad cable?)" }, + { -EOVERFLOW, "Babble (too much data)" }, { -EPROTO, "Bit-stuff error (bad cable?)" }, { -EILSEQ, "CRC/Timeout" }, - { -ETIMEDOUT, "NAK (device does not respond)" }, + { -ETIME, "Device does not respond to token" }, + { -ETIMEDOUT, "Device does not respond to command" }, { -1, NULL } }; - - /**************************************************************************** * Memory management functions * ****************************************************************************/ @@ -782,7 +781,7 @@ static int w9968cf_allocate_memory(struct w9968cf_device* cam) If there are no requested frames in the FIFO list, packets are collected into a temporary buffer. --------------------------------------------------------------------------*/ -static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs) +static void w9968cf_urb_complete(struct urb *urb) { struct w9968cf_device* cam = (struct w9968cf_device*)urb->context; struct w9968cf_frame_t** f; @@ -1574,6 +1573,7 @@ static int w9968cf_i2c_init(struct w9968cf_device* cam) memcpy(&cam->i2c_adapter, &adap, sizeof(struct i2c_adapter)); strcpy(cam->i2c_adapter.name, "w9968cf"); + cam->i2c_adapter.dev.parent = &cam->usbdev->dev; i2c_set_adapdata(&cam->i2c_adapter, cam); DBG(6, "Registering I2C adapter with kernel...") @@ -1828,8 +1828,8 @@ w9968cf_set_window(struct w9968cf_device* cam, struct video_window win) int err = 0; /* Work around to avoid FP arithmetics */ - #define __SC(x) ((x) << 10) - #define __UNSC(x) ((x) >> 10) + #define SC(x) ((x) << 10) + #define UNSC(x) ((x) >> 10) /* Make sure we are using a supported resolution */ if ((err = w9968cf_adjust_window_size(cam, (u16*)&win.width, @@ -1837,15 +1837,15 @@ w9968cf_set_window(struct w9968cf_device* cam, struct video_window win) goto error; /* Scaling factors */ - fw = __SC(win.width) / cam->maxwidth; - fh = __SC(win.height) / cam->maxheight; + fw = SC(win.width) / cam->maxwidth; + fh = SC(win.height) / cam->maxheight; /* Set up the width and height values used by the chip */ if ((win.width > cam->maxwidth) || (win.height > cam->maxheight)) { cam->vpp_flag |= VPP_UPSCALE; /* Calculate largest w,h mantaining the same w/h ratio */ - w = (fw >= fh) ? cam->maxwidth : __SC(win.width)/fh; - h = (fw >= fh) ? __SC(win.height)/fw : cam->maxheight; + w = (fw >= fh) ? cam->maxwidth : SC(win.width)/fh; + h = (fw >= fh) ? SC(win.height)/fw : cam->maxheight; if (w < cam->minwidth) /* just in case */ w = cam->minwidth; if (h < cam->minheight) /* just in case */ @@ -1862,8 +1862,8 @@ w9968cf_set_window(struct w9968cf_device* cam, struct video_window win) /* Calculate cropped area manteining the right w/h ratio */ if (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE)) { - cw = (fw >= fh) ? cam->maxwidth : __SC(win.width)/fh; - ch = (fw >= fh) ? __SC(win.height)/fw : cam->maxheight; + cw = (fw >= fh) ? cam->maxwidth : SC(win.width)/fh; + ch = (fw >= fh) ? SC(win.height)/fw : cam->maxheight; } else { cw = w; ch = h; @@ -1902,8 +1902,8 @@ w9968cf_set_window(struct w9968cf_device* cam, struct video_window win) /* We have to scale win.x and win.y offsets */ if ( (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE)) || (cam->vpp_flag & VPP_UPSCALE) ) { - ax = __SC(win.x)/fw; - ay = __SC(win.y)/fh; + ax = SC(win.x)/fw; + ay = SC(win.y)/fh; } else { ax = win.x; ay = win.y; @@ -1918,8 +1918,8 @@ w9968cf_set_window(struct w9968cf_device* cam, struct video_window win) /* Adjust win.x, win.y */ if ( (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE)) || (cam->vpp_flag & VPP_UPSCALE) ) { - win.x = __UNSC(ax*fw); - win.y = __UNSC(ay*fh); + win.x = UNSC(ax*fw); + win.y = UNSC(ay*fh); } else { win.x = ax; win.y = ay; @@ -3467,7 +3467,7 @@ ioctl_fail: } -static struct file_operations w9968cf_fops = { +static const struct file_operations w9968cf_fops = { .owner = THIS_MODULE, .open = w9968cf_open, .release = w9968cf_release,