diff options
Diffstat (limited to 'drivers/media/video/sn9c102')
-rw-r--r-- | drivers/media/video/sn9c102/Makefile | 6 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102.h | 8 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_core.c | 264 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_hv7131d.c | 16 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_mi0343.c | 106 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_ov7630.c | 14 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_pas106b.c | 16 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_pas202bca.c | 6 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_pas202bcb.c | 18 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_sensor.h | 70 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_tas5110c1b.c | 12 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_tas5130d1b.c | 12 |
12 files changed, 274 insertions, 274 deletions
diff --git a/drivers/media/video/sn9c102/Makefile b/drivers/media/video/sn9c102/Makefile index 8bcb0f71d69f..536ad3098da4 100644 --- a/drivers/media/video/sn9c102/Makefile +++ b/drivers/media/video/sn9c102/Makefile @@ -1,7 +1,7 @@ sn9c102-objs := sn9c102_core.o sn9c102_hv7131d.o sn9c102_mi0343.o \ - sn9c102_ov7630.o sn9c102_pas106b.o sn9c102_pas202bca.o \ - sn9c102_pas202bcb.o sn9c102_tas5110c1b.o \ - sn9c102_tas5130d1b.o + sn9c102_ov7630.o sn9c102_pas106b.o sn9c102_pas202bca.o \ + sn9c102_pas202bcb.o sn9c102_tas5110c1b.o \ + sn9c102_tas5130d1b.o obj-$(CONFIG_USB_SN9C102) += sn9c102.o diff --git a/drivers/media/video/sn9c102/sn9c102.h b/drivers/media/video/sn9c102/sn9c102.h index 1d70a62b9f23..2c6ff396dafc 100644 --- a/drivers/media/video/sn9c102/sn9c102.h +++ b/drivers/media/video/sn9c102/sn9c102.h @@ -164,7 +164,7 @@ sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id) void sn9c102_attach_sensor(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor) + struct sn9c102_sensor* sensor) { memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor)); } @@ -183,7 +183,7 @@ do { \ dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ else if ((level) >= 3) \ dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ - __FUNCTION__, __LINE__ , ## args); \ + __FUNCTION__, __LINE__ , ## args); \ } \ } while (0) # define V4LDBG(level, name, cmd) \ @@ -198,7 +198,7 @@ do { \ pr_info("sn9c102: " fmt "\n", ## args); \ else if ((level) == 3) \ pr_debug("sn9c102: [%s:%d] " fmt "\n", __FUNCTION__, \ - __LINE__ , ## args); \ + __LINE__ , ## args); \ } \ } while (0) #else @@ -210,7 +210,7 @@ do { \ #undef PDBG #define PDBG(fmt, args...) \ dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ - __FUNCTION__, __LINE__ , ## args) + __FUNCTION__, __LINE__ , ## args) #undef PDBGG #define PDBGG(fmt, args...) do {;} while(0) /* placeholder */ diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 4c6cc6395723..ea4394dc9415 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c @@ -62,53 +62,53 @@ MODULE_LICENSE(SN9C102_MODULE_LICENSE); static short video_nr[] = {[0 ... SN9C102_MAX_DEVICES-1] = -1}; module_param_array(video_nr, short, NULL, 0444); MODULE_PARM_DESC(video_nr, - "\n<-1|n[,...]> Specify V4L2 minor mode number." - "\n -1 = use next available (default)" - "\n n = use minor number n (integer >= 0)" - "\nYou can specify up to "__MODULE_STRING(SN9C102_MAX_DEVICES) - " cameras this way." - "\nFor example:" - "\nvideo_nr=-1,2,-1 would assign minor number 2 to" - "\nthe second camera and use auto for the first" - "\none and for every other camera." - "\n"); - -static short force_munmap[] = {[0 ... SN9C102_MAX_DEVICES-1] = - SN9C102_FORCE_MUNMAP}; + "\n<-1|n[,...]> Specify V4L2 minor mode number." + "\n -1 = use next available (default)" + "\n n = use minor number n (integer >= 0)" + "\nYou can specify up to "__MODULE_STRING(SN9C102_MAX_DEVICES) + " cameras this way." + "\nFor example:" + "\nvideo_nr=-1,2,-1 would assign minor number 2 to" + "\nthe second camera and use auto for the first" + "\none and for every other camera." + "\n"); + +static short force_munmap[] = {[0 ... SN9C102_MAX_DEVICES-1] = + SN9C102_FORCE_MUNMAP}; module_param_array(force_munmap, bool, NULL, 0444); MODULE_PARM_DESC(force_munmap, - "\n<0|1[,...]> Force the application to unmap previously" - "\nmapped buffer memory before calling any VIDIOC_S_CROP or" - "\nVIDIOC_S_FMT ioctl's. Not all the applications support" - "\nthis feature. This parameter is specific for each" - "\ndetected camera." - "\n 0 = do not force memory unmapping" - "\n 1 = force memory unmapping (save memory)" - "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." - "\n"); + "\n<0|1[,...]> Force the application to unmap previously" + "\nmapped buffer memory before calling any VIDIOC_S_CROP or" + "\nVIDIOC_S_FMT ioctl's. Not all the applications support" + "\nthis feature. This parameter is specific for each" + "\ndetected camera." + "\n 0 = do not force memory unmapping" + "\n 1 = force memory unmapping (save memory)" + "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." + "\n"); static unsigned int frame_timeout[] = {[0 ... SN9C102_MAX_DEVICES-1] = - SN9C102_FRAME_TIMEOUT}; + SN9C102_FRAME_TIMEOUT}; module_param_array(frame_timeout, uint, NULL, 0644); MODULE_PARM_DESC(frame_timeout, - "\n<n[,...]> Timeout for a video frame in seconds." - "\nThis parameter is specific for each detected camera." - "\nDefault value is "__MODULE_STRING(SN9C102_FRAME_TIMEOUT)"." - "\n"); + "\n<n[,...]> Timeout for a video frame in seconds." + "\nThis parameter is specific for each detected camera." + "\nDefault value is "__MODULE_STRING(SN9C102_FRAME_TIMEOUT)"." + "\n"); #ifdef SN9C102_DEBUG static unsigned short debug = SN9C102_DEBUG_LEVEL; module_param(debug, ushort, 0644); MODULE_PARM_DESC(debug, - "\n<n> Debugging information level, from 0 to 3:" - "\n0 = none (use carefully)" - "\n1 = critical errors" - "\n2 = significant informations" - "\n3 = more verbose messages" - "\nLevel 3 is useful for testing only, when only " - "one device is used." - "\nDefault value is "__MODULE_STRING(SN9C102_DEBUG_LEVEL)"." - "\n"); + "\n<n> Debugging information level, from 0 to 3:" + "\n0 = none (use carefully)" + "\n1 = critical errors" + "\n2 = significant informations" + "\n3 = more verbose messages" + "\nLevel 3 is useful for testing only, when only " + "one device is used." + "\nDefault value is "__MODULE_STRING(SN9C102_DEBUG_LEVEL)"." + "\n"); #endif /*****************************************************************************/ @@ -131,16 +131,16 @@ static sn9c102_eof_header_t sn9c102_eof_header[] = { /*****************************************************************************/ -static u32 -sn9c102_request_buffers(struct sn9c102_device* cam, u32 count, - enum sn9c102_io_method io) +static u32 +sn9c102_request_buffers(struct sn9c102_device* cam, u32 count, + enum sn9c102_io_method io) { struct v4l2_pix_format* p = &(cam->sensor.pix_format); struct v4l2_rect* r = &(cam->sensor.cropcap.bounds); const size_t imagesize = cam->module_param.force_munmap || - io == IO_READ ? - (p->width * p->height * p->priv) / 8 : - (r->width * r->height * p->priv) / 8; + io == IO_READ ? + (p->width * p->height * p->priv) / 8 : + (r->width * r->height * p->priv) / 8; void* buff = NULL; u32 i; @@ -232,8 +232,8 @@ int sn9c102_write_regs(struct sn9c102_device* cam, u8* buff, u16 index) return -1; res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, - index, 0, buff, sizeof(buff), - SN9C102_CTRL_TIMEOUT*sizeof(buff)); + index, 0, buff, sizeof(buff), + SN9C102_CTRL_TIMEOUT*sizeof(buff)); if (res < 0) { DBG(3, "Failed to write registers (index 0x%02X, error %d)", index, res); @@ -259,7 +259,7 @@ int sn9c102_write_reg(struct sn9c102_device* cam, u8 value, u16 index) *buff = value; res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, - index, 0, buff, 1, SN9C102_CTRL_TIMEOUT); + index, 0, buff, 1, SN9C102_CTRL_TIMEOUT); if (res < 0) { DBG(3, "Failed to write a register (value 0x%02X, index " "0x%02X, error %d)", value, index, res); @@ -280,7 +280,7 @@ static int sn9c102_read_reg(struct sn9c102_device* cam, u16 index) int res; res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1, - index, 0, buff, 1, SN9C102_CTRL_TIMEOUT); + index, 0, buff, 1, SN9C102_CTRL_TIMEOUT); if (res < 0) DBG(3, "Failed to read a register (index 0x%02X, error %d)", index, res); @@ -319,8 +319,8 @@ sn9c102_i2c_wait(struct sn9c102_device* cam, struct sn9c102_sensor* sensor) static int -sn9c102_i2c_detect_read_error(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor) +sn9c102_i2c_detect_read_error(struct sn9c102_device* cam, + struct sn9c102_sensor* sensor) { int r; r = sn9c102_read_reg(cam, 0x08); @@ -329,8 +329,8 @@ sn9c102_i2c_detect_read_error(struct sn9c102_device* cam, static int -sn9c102_i2c_detect_write_error(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor) +sn9c102_i2c_detect_write_error(struct sn9c102_device* cam, + struct sn9c102_sensor* sensor) { int r; r = sn9c102_read_reg(cam, 0x08); @@ -338,10 +338,10 @@ sn9c102_i2c_detect_write_error(struct sn9c102_device* cam, } -int +int sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor, u8 data0, u8 data1, - u8 n, u8 buffer[]) + struct sn9c102_sensor* sensor, u8 data0, u8 data1, + u8 n, u8 buffer[]) { struct usb_device* udev = cam->usbdev; u8* data = cam->control_buffer; @@ -349,12 +349,12 @@ sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, /* Write cycle */ data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) | - ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | 0x10; + ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | 0x10; data[1] = data0; /* I2C slave id */ data[2] = data1; /* address */ data[7] = 0x10; res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, - 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); + 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); if (res < 0) err += res; @@ -362,12 +362,12 @@ sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, /* Read cycle - n bytes */ data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) | - ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | - (n << 4) | 0x02; + ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | + (n << 4) | 0x02; data[1] = data0; data[7] = 0x10; res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, - 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); + 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); if (res < 0) err += res; @@ -375,7 +375,7 @@ sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, /* The first read byte will be placed in data[4] */ res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1, - 0x0a, 0, data, 5, SN9C102_CTRL_TIMEOUT); + 0x0a, 0, data, 5, SN9C102_CTRL_TIMEOUT); if (res < 0) err += res; @@ -396,10 +396,10 @@ sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, } -int +int sn9c102_i2c_try_raw_write(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor, u8 n, u8 data0, - u8 data1, u8 data2, u8 data3, u8 data4, u8 data5) + struct sn9c102_sensor* sensor, u8 n, u8 data0, + u8 data1, u8 data2, u8 data3, u8 data4, u8 data5) { struct usb_device* udev = cam->usbdev; u8* data = cam->control_buffer; @@ -407,8 +407,8 @@ sn9c102_i2c_try_raw_write(struct sn9c102_device* cam, /* Write cycle. It usually is address + value */ data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) | - ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) - | ((n - 1) << 4); + ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) + | ((n - 1) << 4); data[1] = data0; data[2] = data1; data[3] = data2; @@ -417,7 +417,7 @@ sn9c102_i2c_try_raw_write(struct sn9c102_device* cam, data[6] = data5; data[7] = 0x14; res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, - 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); + 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); if (res < 0) err += res; @@ -437,20 +437,20 @@ sn9c102_i2c_try_raw_write(struct sn9c102_device* cam, int sn9c102_i2c_try_read(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor, u8 address) + struct sn9c102_sensor* sensor, u8 address) { return sn9c102_i2c_try_raw_read(cam, sensor, sensor->i2c_slave_id, - address, 1, NULL); + address, 1, NULL); } int sn9c102_i2c_try_write(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor, u8 address, u8 value) + struct sn9c102_sensor* sensor, u8 address, u8 value) { - return sn9c102_i2c_try_raw_write(cam, sensor, 3, - sensor->i2c_slave_id, address, - value, 0, 0, 0); + return sn9c102_i2c_try_raw_write(cam, sensor, 3, + sensor->i2c_slave_id, address, + value, 0, 0, 0); } @@ -484,7 +484,7 @@ sn9c102_find_sof_header(struct sn9c102_device* cam, void* mem, size_t len) n = sizeof(sn9c103_sof_header) / soflen; } - for (i = 0; (len >= soflen) && (i <= len - soflen); i++) + for (i = 0; (len >= soflen) && (i <= len - soflen); i++) for (j = 0; j < n; j++) /* The invariable part of the header is 6 bytes long */ if ((cam->bridge != BRIDGE_SN9C103 && @@ -552,15 +552,15 @@ static void sn9c102_urb_complete(struct urb *urb, struct pt_regs* regs) if (!(*f)) (*f) = list_entry(cam->inqueue.next, struct sn9c102_frame_t, - frame); + frame); imagesize = (cam->sensor.pix_format.width * - cam->sensor.pix_format.height * - cam->sensor.pix_format.priv) / 8; + cam->sensor.pix_format.height * + cam->sensor.pix_format.priv) / 8; soflen = (cam->bridge) == BRIDGE_SN9C103 ? - sizeof(sn9c103_sof_header_t) : - sizeof(sn9c102_sof_header_t); + sizeof(sn9c103_sof_header_t) : + sizeof(sn9c102_sof_header_t); for (i = 0; i < urb->number_of_packets; i++) { unsigned int img, len, status; @@ -611,19 +611,19 @@ end_of_frame: if ((*f)->buf.bytesused == imagesize || (cam->sensor.pix_format.pixelformat == - V4L2_PIX_FMT_SN9C10X && eof)) { + V4L2_PIX_FMT_SN9C10X && eof)) { u32 b; b = (*f)->buf.bytesused; (*f)->state = F_DONE; (*f)->buf.sequence= ++cam->frame_count; spin_lock(&cam->queue_lock); list_move_tail(&(*f)->frame, - &cam->outqueue); + &cam->outqueue); if (!list_empty(&cam->inqueue)) (*f) = list_entry( - cam->inqueue.next, - struct sn9c102_frame_t, - frame ); + cam->inqueue.next, + struct sn9c102_frame_t, + frame ); else (*f) = NULL; spin_unlock(&cam->queue_lock); @@ -638,7 +638,7 @@ end_of_frame: } else if (eof) { (*f)->state = F_ERROR; DBG(3, "Not expected EOF after %lu " - "bytes of image data", + "bytes of image data", (unsigned long) ((*f)->buf.bytesused)); } @@ -676,7 +676,7 @@ start_of_frame: goto end_of_frame; } else { DBG(3, "SOF before expected EOF after " - "%lu bytes of image data", + "%lu bytes of image data", (unsigned long) ((*f)->buf.bytesused)); goto start_of_frame; @@ -702,18 +702,18 @@ static int sn9c102_start_transfer(struct sn9c102_device* cam) struct usb_device *udev = cam->usbdev; struct urb* urb; const unsigned int sn9c102_wMaxPacketSize[] = {0, 128, 256, 384, 512, - 680, 800, 900, 1023}; + 680, 800, 900, 1023}; const unsigned int sn9c103_wMaxPacketSize[] = {0, 128, 256, 384, 512, - 680, 800, 900, 1003}; + 680, 800, 900, 1003}; const unsigned int psz = (cam->bridge == BRIDGE_SN9C103) ? - sn9c103_wMaxPacketSize[SN9C102_ALTERNATE_SETTING] : - sn9c102_wMaxPacketSize[SN9C102_ALTERNATE_SETTING]; + sn9c103_wMaxPacketSize[SN9C102_ALTERNATE_SETTING] : + sn9c102_wMaxPacketSize[SN9C102_ALTERNATE_SETTING]; s8 i, j; int err = 0; for (i = 0; i < SN9C102_URBS; i++) { cam->transfer_buffer[i] = kzalloc(SN9C102_ISO_PACKETS * psz, - GFP_KERNEL); + GFP_KERNEL); if (!cam->transfer_buffer[i]) { err = -ENOMEM; DBG(1, "Not enough memory"); @@ -815,9 +815,9 @@ static int sn9c102_stream_interrupt(struct sn9c102_device* cam) cam->stream = STREAM_INTERRUPT; timeout = wait_event_timeout(cam->wait_stream, - (cam->stream == STREAM_OFF) || - (cam->state & DEV_DISCONNECTED), - SN9C102_URB_TIMEOUT); + (cam->stream == STREAM_OFF) || + (cam->state & DEV_DISCONNECTED), + SN9C102_URB_TIMEOUT); if (cam->state & DEV_DISCONNECTED) return -ENODEV; else if (cam->stream != STREAM_OFF) { @@ -861,7 +861,7 @@ static u8 sn9c102_strtou8(const char* buff, size_t len, ssize_t* count) /* NOTE 1: being inside one of the following methods implies that the v4l - device exists for sure (see kobjects and reference counters) + device exists for sure (see kobjects and reference counters) NOTE 2: buffers are PAGE_SIZE long */ @@ -884,10 +884,10 @@ static ssize_t sn9c102_show_reg(struct class_device* cd, char* buf) mutex_unlock(&sn9c102_sysfs_lock); return count; -} +} -static ssize_t +static ssize_t sn9c102_store_reg(struct class_device* cd, const char* buf, size_t len) { struct sn9c102_device* cam; @@ -947,7 +947,7 @@ static ssize_t sn9c102_show_val(struct class_device* cd, char* buf) mutex_unlock(&sn9c102_sysfs_lock); return count; -} +} static ssize_t @@ -1013,7 +1013,7 @@ static ssize_t sn9c102_show_i2c_reg(struct class_device* cd, char* buf) } -static ssize_t +static ssize_t sn9c102_store_i2c_reg(struct class_device* cd, const char* buf, size_t len) { struct sn9c102_device* cam; @@ -1078,7 +1078,7 @@ static ssize_t sn9c102_show_i2c_val(struct class_device* cd, char* buf) mutex_unlock(&sn9c102_sysfs_lock); return count; -} +} static ssize_t @@ -1222,22 +1222,22 @@ static ssize_t sn9c102_show_frame_header(struct class_device* cd, char* buf) DBG(3, "Frame header, read bytes: %zd", count); return count; -} +} static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUSR, - sn9c102_show_reg, sn9c102_store_reg); + sn9c102_show_reg, sn9c102_store_reg); static CLASS_DEVICE_ATTR(val, S_IRUGO | S_IWUSR, - sn9c102_show_val, sn9c102_store_val); + sn9c102_show_val, sn9c102_store_val); static CLASS_DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR, - sn9c102_show_i2c_reg, sn9c102_store_i2c_reg); + sn9c102_show_i2c_reg, sn9c102_store_i2c_reg); static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, - sn9c102_show_i2c_val, sn9c102_store_i2c_val); + sn9c102_show_i2c_val, sn9c102_store_i2c_val); static CLASS_DEVICE_ATTR(green, S_IWUGO, NULL, sn9c102_store_green); static CLASS_DEVICE_ATTR(blue, S_IWUGO, NULL, sn9c102_store_blue); static CLASS_DEVICE_ATTR(red, S_IWUGO, NULL, sn9c102_store_red); static CLASS_DEVICE_ATTR(frame_header, S_IRUGO, - sn9c102_show_frame_header, NULL); + sn9c102_show_frame_header, NULL); static void sn9c102_create_sysfs(struct sn9c102_device* cam) @@ -1278,7 +1278,7 @@ sn9c102_set_pix_format(struct sn9c102_device* cam, struct v4l2_pix_format* pix) static int sn9c102_set_compression(struct sn9c102_device* cam, - struct v4l2_jpegcompression* compression) + struct v4l2_jpegcompression* compression) { int err = 0; @@ -1469,8 +1469,8 @@ static int sn9c102_open(struct inode* inode, struct file* filp) } mutex_unlock(&cam->dev_mutex); err = wait_event_interruptible_exclusive(cam->open, - cam->state & DEV_DISCONNECTED - || !cam->users); + cam->state & DEV_DISCONNECTED + || !cam->users); if (err) { up_read(&sn9c102_disconnect); return err; @@ -1600,12 +1600,12 @@ sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) return -EAGAIN; } timeout = wait_event_interruptible_timeout - ( cam->wait_frame, - (!list_empty(&cam->outqueue)) || - (cam->state & DEV_DISCONNECTED) || - (cam->state & DEV_MISCONFIGURED), - cam->module_param.frame_timeout * - 1000 * msecs_to_jiffies(1) ); + ( cam->wait_frame, + (!list_empty(&cam->outqueue)) || + (cam->state & DEV_DISCONNECTED) || + (cam->state & DEV_MISCONFIGURED), + cam->module_param.frame_timeout * + 1000 * msecs_to_jiffies(1) ); if (timeout < 0) { mutex_unlock(&cam->fileop_mutex); return timeout; @@ -1672,7 +1672,7 @@ static unsigned int sn9c102_poll(struct file *filp, poll_table *wait) if (cam->io == IO_NONE) { if (!sn9c102_request_buffers(cam, cam->nreadbuffers, - IO_READ)) { + IO_READ)) { DBG(1, "poll() failed, not enough memory"); goto error; } @@ -1729,7 +1729,7 @@ static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma) { struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); unsigned long size = vma->vm_end - vma->vm_start, - start = vma->vm_start; + start = vma->vm_start; void *pos; u32 i; @@ -1797,13 +1797,13 @@ sn9c102_vidioc_querycap(struct sn9c102_device* cam, void __user * arg) .driver = "sn9c102", .version = SN9C102_MODULE_VERSION_CODE, .capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | - V4L2_CAP_STREAMING, + V4L2_CAP_STREAMING, }; strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card)); if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0) strlcpy(cap.bus_info, cam->usbdev->dev.bus_id, - sizeof(cap.bus_info)); + sizeof(cap.bus_info)); if (copy_to_user(arg, &cap, sizeof(cap))) return -EFAULT; @@ -2138,7 +2138,7 @@ sn9c102_vidioc_g_fmt(struct sn9c102_device* cam, void __user * arg) return -EINVAL; pfmt->bytesperline = (pfmt->pixelformat==V4L2_PIX_FMT_SN9C10X) - ? 0 : (pfmt->width * pfmt->priv) / 8; + ? 0 : (pfmt->width * pfmt->priv) / 8; pfmt->sizeimage = pfmt->height * ((pfmt->width*pfmt->priv)/8); pfmt->field = V4L2_FIELD_NONE; memcpy(&(format.fmt.pix), pfmt, sizeof(*pfmt)); @@ -2152,7 +2152,7 @@ sn9c102_vidioc_g_fmt(struct sn9c102_device* cam, void __user * arg) static int sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd, - void __user * arg) + void __user * arg) { struct sn9c102_sensor* s = &cam->sensor; struct v4l2_format format; @@ -2214,7 +2214,7 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd, pix->priv = pfmt->priv; /* bpp */ pix->colorspace = pfmt->colorspace; pix->bytesperline = (pix->pixelformat == V4L2_PIX_FMT_SN9C10X) - ? 0 : (pix->width * pix->priv) / 8; + ? 0 : (pix->width * pix->priv) / 8; pix->sizeimage = pix->height * ((pix->width * pix->priv) / 8); pix->field = V4L2_FIELD_NONE; @@ -2287,7 +2287,7 @@ static int sn9c102_vidioc_g_jpegcomp(struct sn9c102_device* cam, void __user * arg) { if (copy_to_user(arg, &cam->compression, - sizeof(cam->compression))) + sizeof(cam->compression))) return -EFAULT; return 0; @@ -2436,7 +2436,7 @@ sn9c102_vidioc_qbuf(struct sn9c102_device* cam, void __user * arg) static int sn9c102_vidioc_dqbuf(struct sn9c102_device* cam, struct file* filp, - void __user * arg) + void __user * arg) { struct v4l2_buffer b; struct sn9c102_frame_t *f; @@ -2455,12 +2455,12 @@ sn9c102_vidioc_dqbuf(struct sn9c102_device* cam, struct file* filp, if (filp->f_flags & O_NONBLOCK) return -EAGAIN; timeout = wait_event_interruptible_timeout - ( cam->wait_frame, - (!list_empty(&cam->outqueue)) || - (cam->state & DEV_DISCONNECTED) || - (cam->state & DEV_MISCONFIGURED), - cam->module_param.frame_timeout * - 1000 * msecs_to_jiffies(1) ); + ( cam->wait_frame, + (!list_empty(&cam->outqueue)) || + (cam->state & DEV_DISCONNECTED) || + (cam->state & DEV_MISCONFIGURED), + cam->module_param.frame_timeout * + 1000 * msecs_to_jiffies(1) ); if (timeout < 0) return timeout; if (cam->state & DEV_DISCONNECTED) @@ -2584,7 +2584,7 @@ sn9c102_vidioc_s_parm(struct sn9c102_device* cam, void __user * arg) static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, - unsigned int cmd, void __user * arg) + unsigned int cmd, void __user * arg) { struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); @@ -2678,7 +2678,7 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, static int sn9c102_ioctl(struct inode* inode, struct file* filp, - unsigned int cmd, unsigned long arg) + unsigned int cmd, unsigned long arg) { struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); int err = 0; @@ -2761,7 +2761,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) } cam->bridge = (id->idProduct & 0xffc0) == 0x6080 ? - BRIDGE_SN9C103 : BRIDGE_SN9C102; + BRIDGE_SN9C103 : BRIDGE_SN9C102; switch (cam->bridge) { case BRIDGE_SN9C101: case BRIDGE_SN9C102: @@ -2807,7 +2807,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) mutex_lock(&cam->dev_mutex); err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER, - video_nr[dev_nr]); + video_nr[dev_nr]); if (err) { DBG(1, "V4L2 device registration failed"); if (err == -ENFILE && video_nr[dev_nr] == -1) diff --git a/drivers/media/video/sn9c102/sn9c102_hv7131d.c b/drivers/media/video/sn9c102/sn9c102_hv7131d.c index 46c12ec3ca62..c4117bf64b69 100644 --- a/drivers/media/video/sn9c102/sn9c102_hv7131d.c +++ b/drivers/media/video/sn9c102/sn9c102_hv7131d.c @@ -44,8 +44,8 @@ static int hv7131d_init(struct sn9c102_device* cam) } -static int hv7131d_get_ctrl(struct sn9c102_device* cam, - struct v4l2_control* ctrl) +static int hv7131d_get_ctrl(struct sn9c102_device* cam, + struct v4l2_control* ctrl) { switch (ctrl->id) { case V4L2_CID_EXPOSURE: @@ -88,8 +88,8 @@ static int hv7131d_get_ctrl(struct sn9c102_device* cam, } -static int hv7131d_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) +static int hv7131d_set_ctrl(struct sn9c102_device* cam, + const struct v4l2_control* ctrl) { int err = 0; @@ -121,8 +121,8 @@ static int hv7131d_set_ctrl(struct sn9c102_device* cam, } -static int hv7131d_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) +static int hv7131d_set_crop(struct sn9c102_device* cam, + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &hv7131d; int err = 0; @@ -136,8 +136,8 @@ static int hv7131d_set_crop(struct sn9c102_device* cam, } -static int hv7131d_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) +static int hv7131d_set_pix_format(struct sn9c102_device* cam, + const struct v4l2_pix_format* pix) { int err = 0; diff --git a/drivers/media/video/sn9c102/sn9c102_mi0343.c b/drivers/media/video/sn9c102/sn9c102_mi0343.c index d9aa7a61095d..4169ea4a2e20 100644 --- a/drivers/media/video/sn9c102/sn9c102_mi0343.c +++ b/drivers/media/video/sn9c102/sn9c102_mi0343.c @@ -39,64 +39,64 @@ static int mi0343_init(struct sn9c102_device* cam) err += sn9c102_write_reg(cam, 0xa0, 0x19); err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, - 0x0d, 0x00, 0x01, 0, 0); + 0x0d, 0x00, 0x01, 0, 0); err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, - 0x0d, 0x00, 0x00, 0, 0); + 0x0d, 0x00, 0x00, 0, 0); err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, - 0x03, 0x01, 0xe1, 0, 0); + 0x03, 0x01, 0xe1, 0, 0); err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, - 0x04, 0x02, 0x81, 0, 0); + 0x04, 0x02, 0x81, 0, 0); err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, - 0x05, 0x00, 0x17, 0, 0); + 0x05, 0x00, 0x17, 0, 0); err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, - 0x06, 0x00, 0x11, 0, 0); + 0x06, 0x00, 0x11, 0, 0); err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, - 0x62, 0x04, 0x9a, 0, 0); + 0x62, 0x04, 0x9a, 0, 0); return err; } -static int mi0343_get_ctrl(struct sn9c102_device* cam, - struct v4l2_control* ctrl) +static int mi0343_get_ctrl(struct sn9c102_device* cam, + struct v4l2_control* ctrl) { switch (ctrl->id) { case V4L2_CID_EXPOSURE: if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, - 0x09, 2+1, mi0343_i2c_data) < 0) + 0x09, 2+1, mi0343_i2c_data) < 0) return -EIO; ctrl->value = mi0343_i2c_data[2]; return 0; case V4L2_CID_GAIN: if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, - 0x35, 2+1, mi0343_i2c_data) < 0) + 0x35, 2+1, mi0343_i2c_data) < 0) return -EIO; break; case V4L2_CID_HFLIP: if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, - 0x20, 2+1, mi0343_i2c_data) < 0) + 0x20, 2+1, mi0343_i2c_data) < 0) return -EIO; ctrl->value = mi0343_i2c_data[3] & 0x20 ? 1 : 0; return 0; case V4L2_CID_VFLIP: if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, - 0x20, 2+1, mi0343_i2c_data) < 0) + 0x20, 2+1, mi0343_i2c_data) < 0) return -EIO; ctrl->value = mi0343_i2c_data[3] & 0x80 ? 1 : 0; return 0; case V4L2_CID_RED_BALANCE: if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, - 0x2d, 2+1, mi0343_i2c_data) < 0) + 0x2d, 2+1, mi0343_i2c_data) < 0) return -EIO; break; case V4L2_CID_BLUE_BALANCE: if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, - 0x2c, 2+1, mi0343_i2c_data) < 0) + 0x2c, 2+1, mi0343_i2c_data) < 0) return -EIO; break; case SN9C102_V4L2_CID_GREEN_BALANCE: if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, - 0x2e, 2+1, mi0343_i2c_data) < 0) + 0x2e, 2+1, mi0343_i2c_data) < 0) return -EIO; break; default: @@ -121,8 +121,8 @@ static int mi0343_get_ctrl(struct sn9c102_device* cam, } -static int mi0343_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) +static int mi0343_set_ctrl(struct sn9c102_device* cam, + const struct v4l2_control* ctrl) { u16 reg = 0; int err = 0; @@ -144,51 +144,51 @@ static int mi0343_set_ctrl(struct sn9c102_device* cam, switch (ctrl->id) { case V4L2_CID_EXPOSURE: err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x09, ctrl->value, 0x00, - 0, 0); + mi0343.i2c_slave_id, + 0x09, ctrl->value, 0x00, + 0, 0); break; case V4L2_CID_GAIN: err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x35, reg >> 8, reg & 0xff, - 0, 0); + mi0343.i2c_slave_id, + 0x35, reg >> 8, reg & 0xff, + 0, 0); break; case V4L2_CID_HFLIP: err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x20, ctrl->value ? 0x40:0x00, - ctrl->value ? 0x20:0x00, - 0, 0); + mi0343.i2c_slave_id, + 0x20, ctrl->value ? 0x40:0x00, + ctrl->value ? 0x20:0x00, + 0, 0); break; case V4L2_CID_VFLIP: err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x20, ctrl->value ? 0x80:0x00, - ctrl->value ? 0x80:0x00, - 0, 0); + mi0343.i2c_slave_id, + 0x20, ctrl->value ? 0x80:0x00, + ctrl->value ? 0x80:0x00, + 0, 0); break; case V4L2_CID_RED_BALANCE: err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x2d, reg >> 8, reg & 0xff, - 0, 0); + mi0343.i2c_slave_id, + 0x2d, reg >> 8, reg & 0xff, + 0, 0); break; case V4L2_CID_BLUE_BALANCE: err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x2c, reg >> 8, reg & 0xff, - 0, 0); + mi0343.i2c_slave_id, + 0x2c, reg >> 8, reg & 0xff, + 0, 0); break; case SN9C102_V4L2_CID_GREEN_BALANCE: err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x2b, reg >> 8, reg & 0xff, - 0, 0); + mi0343.i2c_slave_id, + 0x2b, reg >> 8, reg & 0xff, + 0, 0); err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x2e, reg >> 8, reg & 0xff, - 0, 0); + mi0343.i2c_slave_id, + 0x2e, reg >> 8, reg & 0xff, + 0, 0); break; default: return -EINVAL; @@ -198,8 +198,8 @@ static int mi0343_set_ctrl(struct sn9c102_device* cam, } -static int mi0343_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) +static int mi0343_set_crop(struct sn9c102_device* cam, + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &mi0343; int err = 0; @@ -213,20 +213,20 @@ static int mi0343_set_crop(struct sn9c102_device* cam, } -static int mi0343_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) +static int mi0343_set_pix_format(struct sn9c102_device* cam, + const struct v4l2_pix_format* pix) { int err = 0; if (pix->pixelformat == V4L2_PIX_FMT_SN9C10X) { err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x0a, 0x00, 0x03, 0, 0); + mi0343.i2c_slave_id, + 0x0a, 0x00, 0x03, 0, 0); err += sn9c102_write_reg(cam, 0x20, 0x19); } else { err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, - mi0343.i2c_slave_id, - 0x0a, 0x00, 0x05, 0, 0); + mi0343.i2c_slave_id, + 0x0a, 0x00, 0x05, 0, 0); err += sn9c102_write_reg(cam, 0xa0, 0x19); } @@ -351,7 +351,7 @@ int sn9c102_probe_mi0343(struct sn9c102_device* cam) return -EIO; if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 0x00, - 2, mi0343_i2c_data) < 0) + 2, mi0343_i2c_data) < 0) return -EIO; if (mi0343_i2c_data[4] != 0x32 && mi0343_i2c_data[3] != 0xe3) diff --git a/drivers/media/video/sn9c102/sn9c102_ov7630.c b/drivers/media/video/sn9c102/sn9c102_ov7630.c index 42852b7cb042..3da042021787 100644 --- a/drivers/media/video/sn9c102/sn9c102_ov7630.c +++ b/drivers/media/video/sn9c102/sn9c102_ov7630.c @@ -69,7 +69,7 @@ static int ov7630_init(struct sn9c102_device* cam) static int ov7630_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) + const struct v4l2_control* ctrl) { int err = 0; @@ -89,8 +89,8 @@ static int ov7630_set_ctrl(struct sn9c102_device* cam, break; case V4L2_CID_CONTRAST: err += ctrl->value ? sn9c102_i2c_write(cam, 0x05, - (ctrl->value-1) | 0x20) - : sn9c102_i2c_write(cam, 0x05, 0x00); + (ctrl->value-1) | 0x20) + : sn9c102_i2c_write(cam, 0x05, 0x00); break; case V4L2_CID_BRIGHTNESS: err += sn9c102_i2c_write(cam, 0x06, ctrl->value); @@ -100,8 +100,8 @@ static int ov7630_set_ctrl(struct sn9c102_device* cam, break; case V4L2_CID_HUE: err += ctrl->value ? sn9c102_i2c_write(cam, 0x04, - (ctrl->value-1) | 0x20) - : sn9c102_i2c_write(cam, 0x04, 0x00); + (ctrl->value-1) | 0x20) + : sn9c102_i2c_write(cam, 0x04, 0x00); break; case V4L2_CID_DO_WHITE_BALANCE: err += sn9c102_i2c_write(cam, 0x0c, ctrl->value); @@ -139,7 +139,7 @@ static int ov7630_set_ctrl(struct sn9c102_device* cam, static int ov7630_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &ov7630; int err = 0; @@ -152,7 +152,7 @@ static int ov7630_set_crop(struct sn9c102_device* cam, static int ov7630_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) + const struct v4l2_pix_format* pix) { int err = 0; diff --git a/drivers/media/video/sn9c102/sn9c102_pas106b.c b/drivers/media/video/sn9c102/sn9c102_pas106b.c index b1dee78abe04..9915944235e8 100644 --- a/drivers/media/video/sn9c102/sn9c102_pas106b.c +++ b/drivers/media/video/sn9c102/sn9c102_pas106b.c @@ -53,8 +53,8 @@ static int pas106b_init(struct sn9c102_device* cam) } -static int pas106b_get_ctrl(struct sn9c102_device* cam, - struct v4l2_control* ctrl) +static int pas106b_get_ctrl(struct sn9c102_device* cam, + struct v4l2_control* ctrl) { switch (ctrl->id) { case V4L2_CID_EXPOSURE: @@ -102,8 +102,8 @@ static int pas106b_get_ctrl(struct sn9c102_device* cam, } -static int pas106b_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) +static int pas106b_set_ctrl(struct sn9c102_device* cam, + const struct v4l2_control* ctrl) { int err = 0; @@ -140,8 +140,8 @@ static int pas106b_set_ctrl(struct sn9c102_device* cam, } -static int pas106b_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) +static int pas106b_set_crop(struct sn9c102_device* cam, + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &pas106b; int err = 0; @@ -155,8 +155,8 @@ static int pas106b_set_crop(struct sn9c102_device* cam, } -static int pas106b_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) +static int pas106b_set_pix_format(struct sn9c102_device* cam, + const struct v4l2_pix_format* pix) { int err = 0; diff --git a/drivers/media/video/sn9c102/sn9c102_pas202bca.c b/drivers/media/video/sn9c102/sn9c102_pas202bca.c index 3453237055bb..c8f1ae2152b8 100644 --- a/drivers/media/video/sn9c102/sn9c102_pas202bca.c +++ b/drivers/media/video/sn9c102/sn9c102_pas202bca.c @@ -54,7 +54,7 @@ static int pas202bca_init(struct sn9c102_device* cam) static int pas202bca_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) + const struct v4l2_pix_format* pix) { int err = 0; @@ -68,7 +68,7 @@ static int pas202bca_set_pix_format(struct sn9c102_device* cam, static int pas202bca_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) + const struct v4l2_control* ctrl) { int err = 0; @@ -102,7 +102,7 @@ static int pas202bca_set_ctrl(struct sn9c102_device* cam, static int pas202bca_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &pas202bca; int err = 0; diff --git a/drivers/media/video/sn9c102/sn9c102_pas202bcb.c b/drivers/media/video/sn9c102/sn9c102_pas202bcb.c index d068616ab337..e3c1178e339c 100644 --- a/drivers/media/video/sn9c102/sn9c102_pas202bcb.c +++ b/drivers/media/video/sn9c102/sn9c102_pas202bcb.c @@ -58,8 +58,8 @@ static int pas202bcb_init(struct sn9c102_device* cam) } -static int pas202bcb_get_ctrl(struct sn9c102_device* cam, - struct v4l2_control* ctrl) +static int pas202bcb_get_ctrl(struct sn9c102_device* cam, + struct v4l2_control* ctrl) { switch (ctrl->id) { case V4L2_CID_EXPOSURE: @@ -101,8 +101,8 @@ static int pas202bcb_get_ctrl(struct sn9c102_device* cam, } -static int pas202bcb_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) +static int pas202bcb_set_pix_format(struct sn9c102_device* cam, + const struct v4l2_pix_format* pix) { int err = 0; @@ -115,8 +115,8 @@ static int pas202bcb_set_pix_format(struct sn9c102_device* cam, } -static int pas202bcb_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) +static int pas202bcb_set_ctrl(struct sn9c102_device* cam, + const struct v4l2_control* ctrl) { int err = 0; @@ -149,8 +149,8 @@ static int pas202bcb_set_ctrl(struct sn9c102_device* cam, } -static int pas202bcb_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) +static int pas202bcb_set_crop(struct sn9c102_device* cam, + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &pas202bcb; int err = 0; @@ -167,7 +167,7 @@ static int pas202bcb_set_crop(struct sn9c102_device* cam, static struct sn9c102_sensor pas202bcb = { .name = "PAS202BCB", .maintainer = "Carlos Eduardo Medaglia Dyonisio " - "<medaglia@undl.org.br>", + "<medaglia@undl.org.br>", .sysfs_ops = SN9C102_I2C_READ | SN9C102_I2C_WRITE, .frequency = SN9C102_I2C_400KHZ | SN9C102_I2C_100KHZ, .interface = SN9C102_I2C_2WIRES, diff --git a/drivers/media/video/sn9c102/sn9c102_sensor.h b/drivers/media/video/sn9c102/sn9c102_sensor.h index 2afd9e9d09bb..2a874ee6f9f5 100644 --- a/drivers/media/video/sn9c102/sn9c102_sensor.h +++ b/drivers/media/video/sn9c102/sn9c102_sensor.h @@ -58,7 +58,7 @@ struct sn9c102_sensor; Probing functions: on success, you must attach the sensor to the camera by calling sn9c102_attach_sensor() provided below. To enable the I2C communication, you might need to perform a really basic - initialization of the SN9C10X chip by using the write function declared + initialization of the SN9C10X chip by using the write function declared ahead. Functions must return 0 on success, the appropriate error otherwise. */ @@ -73,7 +73,7 @@ extern int sn9c102_probe_tas5130d1b(struct sn9c102_device* cam); /* Add the above entries to this table. Be sure to add the entry in the right - place, since, on failure, the next probing routine is called according to + place, since, on failure, the next probing routine is called according to the order of the list below, from top to bottom. */ #define SN9C102_SENSOR_TABLE \ @@ -94,9 +94,9 @@ extern struct sn9c102_device* sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id); /* Attach a probed sensor to the camera. */ -extern void +extern void sn9c102_attach_sensor(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor); + struct sn9c102_sensor* sensor); /* Each SN9C10x camera has proper PID/VID identifiers. @@ -105,7 +105,7 @@ sn9c102_attach_sensor(struct sn9c102_device* cam, */ #define SN9C102_USB_DEVICE(vend, prod, intclass) \ .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ - USB_DEVICE_ID_MATCH_INT_CLASS, \ + USB_DEVICE_ID_MATCH_INT_CLASS, \ .idVendor = (vend), \ .idProduct = (prod), \ .bInterfaceClass = (intclass) @@ -162,19 +162,19 @@ static const struct usb_device_id sn9c102_id_table[] = { \ Read/write routines: they always return -1 on error, 0 or the read value otherwise. NOTE that a real read operation is not supported by the SN9C10X chip for some of its registers. To work around this problem, a pseudo-read - call is provided instead: it returns the last successfully written value + call is provided instead: it returns the last successfully written value on the register (0 if it has never been written), the usual -1 on error. */ /* The "try" I2C I/O versions are used when probing the sensor */ extern int sn9c102_i2c_try_write(struct sn9c102_device*,struct sn9c102_sensor*, - u8 address, u8 value); + u8 address, u8 value); extern int sn9c102_i2c_try_read(struct sn9c102_device*,struct sn9c102_sensor*, - u8 address); + u8 address); /* These must be used if and only if the sensor doesn't implement the standard - I2C protocol. There are a number of good reasons why you must use the + I2C protocol. There are a number of good reasons why you must use the single-byte versions of these functions: do not abuse. The first function writes n bytes, from data0 to datan, to registers 0x09 - 0x09+n of SN9C10X chip. The second one programs the registers 0x09 and 0x10 with data0 and @@ -184,12 +184,12 @@ extern int sn9c102_i2c_try_read(struct sn9c102_device*,struct sn9c102_sensor*, byte. */ extern int sn9c102_i2c_try_raw_write(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor, u8 n, - u8 data0, u8 data1, u8 data2, u8 data3, - u8 data4, u8 data5); + struct sn9c102_sensor* sensor, u8 n, + u8 data0, u8 data1, u8 data2, u8 data3, + u8 data4, u8 data5); extern int sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, - struct sn9c102_sensor* sensor, u8 data0, - u8 data1, u8 n, u8 buffer[]); + struct sn9c102_sensor* sensor, u8 data0, + u8 data1, u8 n, u8 buffer[]); /* To be used after the sensor struct has been attached to the camera struct */ extern int sn9c102_i2c_write(struct sn9c102_device*, u8 address, u8 value); @@ -252,17 +252,17 @@ struct sn9c102_sensor { /* NOTE: Where not noted,most of the functions below are not mandatory. - Set to null if you do not implement them. If implemented, - they must return 0 on success, the proper error otherwise. + Set to null if you do not implement them. If implemented, + they must return 0 on success, the proper error otherwise. */ int (*init)(struct sn9c102_device* cam); /* - This function will be called after the sensor has been attached. + This function will be called after the sensor has been attached. It should be used to initialize the sensor only, but may also configure part of the SN9C10X chip if necessary. You don't need to setup picture settings like brightness, contrast, etc.. here, if - the corrisponding controls are implemented (see below), since + the corrisponding controls are implemented (see below), since they are adjusted in the core driver by calling the set_ctrl() method after init(), where the arguments are the default values specified in the v4l2_queryctrl list of supported controls; @@ -273,13 +273,13 @@ struct sn9c102_sensor { struct v4l2_queryctrl qctrl[SN9C102_MAX_CTRLS]; /* - Optional list of default controls, defined as indicated in the + Optional list of default controls, defined as indicated in the V4L2 API. Menu type controls are not handled by this interface. */ int (*get_ctrl)(struct sn9c102_device* cam, struct v4l2_control* ctrl); int (*set_ctrl)(struct sn9c102_device* cam, - const struct v4l2_control* ctrl); + const struct v4l2_control* ctrl); /* You must implement at least the set_ctrl method if you have defined the list above. The returned value must follow the V4L2 @@ -306,7 +306,7 @@ struct sn9c102_sensor { specified in the cropcap substructures 'bounds' and 'defrect'. By default, the source rectangle should cover the largest possible area. Again, it is not always true that the largest source rectangle - can cover the entire active window, although it is a rare case for + can cover the entire active window, although it is a rare case for the hardware we have. The bounds of the source rectangle _must_ be multiple of 16 and must use the same coordinate system as indicated before; their centers shall align initially. @@ -317,13 +317,13 @@ struct sn9c102_sensor { defined the correct default bounds in the structures. See the V4L2 API for further details. NOTE: once you have defined the bounds of the active window - (struct cropcap.bounds) you must not change them.anymore. + (struct cropcap.bounds) you must not change them.anymore. Only 'bounds' and 'defrect' fields are mandatory, other fields will be ignored. */ int (*set_crop)(struct sn9c102_device* cam, - const struct v4l2_rect* rect); + const struct v4l2_rect* rect); /* To be called on VIDIOC_C_SETCROP. The core module always calls a default routine which configures the appropriate SN9C10X regs (also @@ -332,12 +332,12 @@ struct sn9c102_sensor { case you override the default function, you always have to program the chip to match those values; on error return the corresponding error code without rolling back. - NOTE: in case, you must program the SN9C10X chip to get rid of - blank pixels or blank lines at the _start_ of each line or - frame after each HSYNC or VSYNC, so that the image starts with - real RGB data (see regs 0x12, 0x13) (having set H_SIZE and, - V_SIZE you don't have to care about blank pixels or blank - lines at the end of each line or frame). + NOTE: in case, you must program the SN9C10X chip to get rid of + blank pixels or blank lines at the _start_ of each line or + frame after each HSYNC or VSYNC, so that the image starts with + real RGB data (see regs 0x12, 0x13) (having set H_SIZE and, + V_SIZE you don't have to care about blank pixels or blank + lines at the end of each line or frame). */ struct v4l2_pix_format pix_format; @@ -349,17 +349,17 @@ struct sn9c102_sensor { number of bits per pixel for uncompressed video, 8 or 9 (despite the current value of 'pixelformat'). NOTE 1: both 'width' and 'height' _must_ be either 1/1 or 1/2 or 1/4 - of cropcap.defrect.width and cropcap.defrect.height. I - suggest 1/1. + of cropcap.defrect.width and cropcap.defrect.height. I + suggest 1/1. NOTE 2: The initial compression quality is defined by the first bit - of reg 0x17 during the initialization of the image sensor. + of reg 0x17 during the initialization of the image sensor. NOTE 3: as said above, you have to program the SN9C10X chip to get - rid of any blank pixels, so that the output of the sensor - matches the RGB bayer sequence (i.e. BGBGBG...GRGRGR). + rid of any blank pixels, so that the output of the sensor + matches the RGB bayer sequence (i.e. BGBGBG...GRGRGR). */ int (*set_pix_format)(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix); + const struct v4l2_pix_format* pix); /* To be called on VIDIOC_S_FMT, when switching from the SBGGR8 to SN9C10X pixel format or viceversa. On error return the corresponding diff --git a/drivers/media/video/sn9c102/sn9c102_tas5110c1b.c b/drivers/media/video/sn9c102/sn9c102_tas5110c1b.c index 2e08c552f40a..294eb02fbd88 100644 --- a/drivers/media/video/sn9c102/sn9c102_tas5110c1b.c +++ b/drivers/media/video/sn9c102/sn9c102_tas5110c1b.c @@ -44,8 +44,8 @@ static int tas5110c1b_init(struct sn9c102_device* cam) } -static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) +static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, + const struct v4l2_control* ctrl) { int err = 0; @@ -61,8 +61,8 @@ static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, } -static int tas5110c1b_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) +static int tas5110c1b_set_crop(struct sn9c102_device* cam, + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &tas5110c1b; int err = 0; @@ -81,8 +81,8 @@ static int tas5110c1b_set_crop(struct sn9c102_device* cam, } -static int tas5110c1b_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) +static int tas5110c1b_set_pix_format(struct sn9c102_device* cam, + const struct v4l2_pix_format* pix) { int err = 0; diff --git a/drivers/media/video/sn9c102/sn9c102_tas5130d1b.c b/drivers/media/video/sn9c102/sn9c102_tas5130d1b.c index c7b339740bbf..9ecb09032b68 100644 --- a/drivers/media/video/sn9c102/sn9c102_tas5130d1b.c +++ b/drivers/media/video/sn9c102/sn9c102_tas5130d1b.c @@ -42,8 +42,8 @@ static int tas5130d1b_init(struct sn9c102_device* cam) } -static int tas5130d1b_set_ctrl(struct sn9c102_device* cam, - const struct v4l2_control* ctrl) +static int tas5130d1b_set_ctrl(struct sn9c102_device* cam, + const struct v4l2_control* ctrl) { int err = 0; @@ -62,8 +62,8 @@ static int tas5130d1b_set_ctrl(struct sn9c102_device* cam, } -static int tas5130d1b_set_crop(struct sn9c102_device* cam, - const struct v4l2_rect* rect) +static int tas5130d1b_set_crop(struct sn9c102_device* cam, + const struct v4l2_rect* rect) { struct sn9c102_sensor* s = &tas5130d1b; u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 104, @@ -82,8 +82,8 @@ static int tas5130d1b_set_crop(struct sn9c102_device* cam, } -static int tas5130d1b_set_pix_format(struct sn9c102_device* cam, - const struct v4l2_pix_format* pix) +static int tas5130d1b_set_pix_format(struct sn9c102_device* cam, + const struct v4l2_pix_format* pix) { int err = 0; |