Commit cd6ff5c2 authored by Jinqiang Zeng's avatar Jinqiang Zeng Committed by Mauro Carvalho Chehab

[media] fix the code style errors in sn9c102

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent bc8aacec
...@@ -53,7 +53,7 @@ enum sn9c102_frame_state { ...@@ -53,7 +53,7 @@ enum sn9c102_frame_state {
}; };
struct sn9c102_frame_t { struct sn9c102_frame_t {
void* bufmem; void *bufmem;
struct v4l2_buffer buf; struct v4l2_buffer buf;
enum sn9c102_frame_state state; enum sn9c102_frame_state state;
struct list_head frame; struct list_head frame;
...@@ -99,17 +99,17 @@ static DEFINE_MUTEX(sn9c102_sysfs_lock); ...@@ -99,17 +99,17 @@ static DEFINE_MUTEX(sn9c102_sysfs_lock);
static DECLARE_RWSEM(sn9c102_dev_lock); static DECLARE_RWSEM(sn9c102_dev_lock);
struct sn9c102_device { struct sn9c102_device {
struct video_device* v4ldev; struct video_device *v4ldev;
struct v4l2_device v4l2_dev; struct v4l2_device v4l2_dev;
enum sn9c102_bridge bridge; enum sn9c102_bridge bridge;
struct sn9c102_sensor sensor; struct sn9c102_sensor sensor;
struct usb_device* usbdev; struct usb_device *usbdev;
struct urb* urb[SN9C102_URBS]; struct urb *urb[SN9C102_URBS];
void* transfer_buffer[SN9C102_URBS]; void *transfer_buffer[SN9C102_URBS];
u8* control_buffer; u8 *control_buffer;
struct sn9c102_frame_t *frame_current, frame[SN9C102_MAX_FRAMES]; struct sn9c102_frame_t *frame_current, frame[SN9C102_MAX_FRAMES];
struct list_head inqueue, outqueue; struct list_head inqueue, outqueue;
...@@ -139,28 +139,28 @@ struct sn9c102_device { ...@@ -139,28 +139,28 @@ struct sn9c102_device {
/*****************************************************************************/ /*****************************************************************************/
struct sn9c102_device* struct sn9c102_device*
sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id) sn9c102_match_id(struct sn9c102_device *cam, const struct usb_device_id *id)
{ {
return usb_match_id(usb_ifnum_to_if(cam->usbdev, 0), id) ? cam : NULL; return usb_match_id(usb_ifnum_to_if(cam->usbdev, 0), id) ? cam : NULL;
} }
void void
sn9c102_attach_sensor(struct sn9c102_device* cam, sn9c102_attach_sensor(struct sn9c102_device *cam,
const struct sn9c102_sensor* sensor) const struct sn9c102_sensor *sensor)
{ {
memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor)); memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor));
} }
enum sn9c102_bridge enum sn9c102_bridge
sn9c102_get_bridge(struct sn9c102_device* cam) sn9c102_get_bridge(struct sn9c102_device *cam)
{ {
return cam->bridge; return cam->bridge;
} }
struct sn9c102_sensor* sn9c102_get_sensor(struct sn9c102_device* cam) struct sn9c102_sensor *sn9c102_get_sensor(struct sn9c102_device *cam)
{ {
return &cam->sensor; return &cam->sensor;
} }
...@@ -198,9 +198,9 @@ do { \ ...@@ -198,9 +198,9 @@ do { \
} \ } \
} while (0) } while (0)
#else #else
# define DBG(level, fmt, args...) do {;} while(0) # define DBG(level, fmt, args...) do { ; } while (0)
# define V4LDBG(level, name, cmd) do {;} while(0) # define V4LDBG(level, name, cmd) do { ; } while (0)
# define KDBG(level, fmt, args...) do {;} while(0) # define KDBG(level, fmt, args...) do { ; } while (0)
#endif #endif
#undef PDBG #undef PDBG
...@@ -209,6 +209,6 @@ dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", __FILE__, __func__, \ ...@@ -209,6 +209,6 @@ dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", __FILE__, __func__, \
__LINE__ , ## args) __LINE__ , ## args)
#undef PDBGG #undef PDBGG
#define PDBGG(fmt, args...) do {;} while(0) /* placeholder */ #define PDBGG(fmt, args...) do { ; } while (0) /* placeholder */
#endif /* _SN9C102_H_ */ #endif /* _SN9C102_H_ */
...@@ -129,17 +129,17 @@ static const struct usb_device_id sn9c102_id_table[] = { ...@@ -129,17 +129,17 @@ static const struct usb_device_id sn9c102_id_table[] = {
initialization of the SN9C1XX chip. initialization of the SN9C1XX chip.
Functions must return 0 on success, the appropriate error otherwise. Functions must return 0 on success, the appropriate error otherwise.
*/ */
extern int sn9c102_probe_hv7131d(struct sn9c102_device* cam); extern int sn9c102_probe_hv7131d(struct sn9c102_device *cam);
extern int sn9c102_probe_hv7131r(struct sn9c102_device* cam); extern int sn9c102_probe_hv7131r(struct sn9c102_device *cam);
extern int sn9c102_probe_mi0343(struct sn9c102_device* cam); extern int sn9c102_probe_mi0343(struct sn9c102_device *cam);
extern int sn9c102_probe_mi0360(struct sn9c102_device* cam); extern int sn9c102_probe_mi0360(struct sn9c102_device *cam);
extern int sn9c102_probe_mt9v111(struct sn9c102_device *cam); extern int sn9c102_probe_mt9v111(struct sn9c102_device *cam);
extern int sn9c102_probe_ov7630(struct sn9c102_device* cam); extern int sn9c102_probe_ov7630(struct sn9c102_device *cam);
extern int sn9c102_probe_ov7660(struct sn9c102_device* cam); extern int sn9c102_probe_ov7660(struct sn9c102_device *cam);
extern int sn9c102_probe_pas106b(struct sn9c102_device* cam); extern int sn9c102_probe_pas106b(struct sn9c102_device *cam);
extern int sn9c102_probe_pas202bcb(struct sn9c102_device* cam); extern int sn9c102_probe_pas202bcb(struct sn9c102_device *cam);
extern int sn9c102_probe_tas5110c1b(struct sn9c102_device* cam); extern int sn9c102_probe_tas5110c1b(struct sn9c102_device *cam);
extern int sn9c102_probe_tas5110d(struct sn9c102_device* cam); extern int sn9c102_probe_tas5110d(struct sn9c102_device *cam);
extern int sn9c102_probe_tas5130d1b(struct sn9c102_device* cam); extern int sn9c102_probe_tas5130d1b(struct sn9c102_device *cam);
#endif /* _SN9C102_DEVTABLE_H_ */ #endif /* _SN9C102_DEVTABLE_H_ */
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int hv7131d_init(struct sn9c102_device* cam) static int hv7131d_init(struct sn9c102_device *cam)
{ {
int err; int err;
...@@ -39,8 +39,8 @@ static int hv7131d_init(struct sn9c102_device* cam) ...@@ -39,8 +39,8 @@ static int hv7131d_init(struct sn9c102_device* cam)
} }
static int hv7131d_get_ctrl(struct sn9c102_device* cam, static int hv7131d_get_ctrl(struct sn9c102_device *cam,
struct v4l2_control* ctrl) struct v4l2_control *ctrl)
{ {
switch (ctrl->id) { switch (ctrl->id) {
case V4L2_CID_EXPOSURE: case V4L2_CID_EXPOSURE:
...@@ -88,8 +88,8 @@ static int hv7131d_get_ctrl(struct sn9c102_device* cam, ...@@ -88,8 +88,8 @@ static int hv7131d_get_ctrl(struct sn9c102_device* cam,
} }
static int hv7131d_set_ctrl(struct sn9c102_device* cam, static int hv7131d_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
int err = 0; int err = 0;
...@@ -121,10 +121,10 @@ static int hv7131d_set_ctrl(struct sn9c102_device* cam, ...@@ -121,10 +121,10 @@ static int hv7131d_set_ctrl(struct sn9c102_device* cam,
} }
static int hv7131d_set_crop(struct sn9c102_device* cam, static int hv7131d_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 2, u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 2,
v_start = (u8)(rect->top - s->cropcap.bounds.top) + 2; v_start = (u8)(rect->top - s->cropcap.bounds.top) + 2;
...@@ -136,8 +136,8 @@ static int hv7131d_set_crop(struct sn9c102_device* cam, ...@@ -136,8 +136,8 @@ static int hv7131d_set_crop(struct sn9c102_device* cam,
} }
static int hv7131d_set_pix_format(struct sn9c102_device* cam, static int hv7131d_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
int err = 0; int err = 0;
...@@ -248,7 +248,7 @@ static const struct sn9c102_sensor hv7131d = { ...@@ -248,7 +248,7 @@ static const struct sn9c102_sensor hv7131d = {
}; };
int sn9c102_probe_hv7131d(struct sn9c102_device* cam) int sn9c102_probe_hv7131d(struct sn9c102_device *cam)
{ {
int r0 = 0, r1 = 0, err; int r0 = 0, r1 = 0, err;
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int mi0343_init(struct sn9c102_device* cam) static int mi0343_init(struct sn9c102_device *cam)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
err = sn9c102_write_const_regs(cam, {0x00, 0x10}, {0x00, 0x11}, err = sn9c102_write_const_regs(cam, {0x00, 0x10}, {0x00, 0x11},
...@@ -52,10 +52,10 @@ static int mi0343_init(struct sn9c102_device* cam) ...@@ -52,10 +52,10 @@ static int mi0343_init(struct sn9c102_device* cam)
} }
static int mi0343_get_ctrl(struct sn9c102_device* cam, static int mi0343_get_ctrl(struct sn9c102_device *cam,
struct v4l2_control* ctrl) struct v4l2_control *ctrl)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
u8 data[2]; u8 data[2];
switch (ctrl->id) { switch (ctrl->id) {
...@@ -119,10 +119,10 @@ static int mi0343_get_ctrl(struct sn9c102_device* cam, ...@@ -119,10 +119,10 @@ static int mi0343_get_ctrl(struct sn9c102_device* cam,
} }
static int mi0343_set_ctrl(struct sn9c102_device* cam, static int mi0343_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
u16 reg = 0; u16 reg = 0;
int err = 0; int err = 0;
...@@ -189,10 +189,10 @@ static int mi0343_set_ctrl(struct sn9c102_device* cam, ...@@ -189,10 +189,10 @@ static int mi0343_set_ctrl(struct sn9c102_device* cam,
} }
static int mi0343_set_crop(struct sn9c102_device* cam, static int mi0343_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 0, u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 0,
v_start = (u8)(rect->top - s->cropcap.bounds.top) + 2; v_start = (u8)(rect->top - s->cropcap.bounds.top) + 2;
...@@ -204,10 +204,10 @@ static int mi0343_set_crop(struct sn9c102_device* cam, ...@@ -204,10 +204,10 @@ static int mi0343_set_crop(struct sn9c102_device* cam,
} }
static int mi0343_set_pix_format(struct sn9c102_device* cam, static int mi0343_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
if (pix->pixelformat == V4L2_PIX_FMT_SN9C10X) { if (pix->pixelformat == V4L2_PIX_FMT_SN9C10X) {
...@@ -331,7 +331,7 @@ static const struct sn9c102_sensor mi0343 = { ...@@ -331,7 +331,7 @@ static const struct sn9c102_sensor mi0343 = {
}; };
int sn9c102_probe_mi0343(struct sn9c102_device* cam) int sn9c102_probe_mi0343(struct sn9c102_device *cam)
{ {
u8 data[2]; u8 data[2];
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int mi0360_init(struct sn9c102_device* cam) static int mi0360_init(struct sn9c102_device *cam)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
switch (sn9c102_get_bridge(cam)) { switch (sn9c102_get_bridge(cam)) {
...@@ -147,10 +147,10 @@ static int mi0360_init(struct sn9c102_device* cam) ...@@ -147,10 +147,10 @@ static int mi0360_init(struct sn9c102_device* cam)
} }
static int mi0360_get_ctrl(struct sn9c102_device* cam, static int mi0360_get_ctrl(struct sn9c102_device *cam,
struct v4l2_control* ctrl) struct v4l2_control *ctrl)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
u8 data[2]; u8 data[2];
switch (ctrl->id) { switch (ctrl->id) {
...@@ -204,10 +204,10 @@ static int mi0360_get_ctrl(struct sn9c102_device* cam, ...@@ -204,10 +204,10 @@ static int mi0360_get_ctrl(struct sn9c102_device* cam,
} }
static int mi0360_set_ctrl(struct sn9c102_device* cam, static int mi0360_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
switch (ctrl->id) { switch (ctrl->id) {
...@@ -259,10 +259,10 @@ static int mi0360_set_ctrl(struct sn9c102_device* cam, ...@@ -259,10 +259,10 @@ static int mi0360_set_ctrl(struct sn9c102_device* cam,
} }
static int mi0360_set_crop(struct sn9c102_device* cam, static int mi0360_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = 0, v_start = (u8)(rect->top - s->cropcap.bounds.top) + 1; u8 h_start = 0, v_start = (u8)(rect->top - s->cropcap.bounds.top) + 1;
...@@ -285,10 +285,10 @@ static int mi0360_set_crop(struct sn9c102_device* cam, ...@@ -285,10 +285,10 @@ static int mi0360_set_crop(struct sn9c102_device* cam,
} }
static int mi0360_set_pix_format(struct sn9c102_device* cam, static int mi0360_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
if (pix->pixelformat == V4L2_PIX_FMT_SBGGR8) { if (pix->pixelformat == V4L2_PIX_FMT_SBGGR8) {
...@@ -418,7 +418,7 @@ static const struct sn9c102_sensor mi0360 = { ...@@ -418,7 +418,7 @@ static const struct sn9c102_sensor mi0360 = {
}; };
int sn9c102_probe_mi0360(struct sn9c102_device* cam) int sn9c102_probe_mi0360(struct sn9c102_device *cam)
{ {
u8 data[2]; u8 data[2];
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int ov7630_init(struct sn9c102_device* cam) static int ov7630_init(struct sn9c102_device *cam)
{ {
int err = 0; int err = 0;
...@@ -252,8 +252,8 @@ static int ov7630_init(struct sn9c102_device* cam) ...@@ -252,8 +252,8 @@ static int ov7630_init(struct sn9c102_device* cam)
} }
static int ov7630_get_ctrl(struct sn9c102_device* cam, static int ov7630_get_ctrl(struct sn9c102_device *cam,
struct v4l2_control* ctrl) struct v4l2_control *ctrl)
{ {
enum sn9c102_bridge bridge = sn9c102_get_bridge(cam); enum sn9c102_bridge bridge = sn9c102_get_bridge(cam);
int err = 0; int err = 0;
...@@ -330,8 +330,8 @@ static int ov7630_get_ctrl(struct sn9c102_device* cam, ...@@ -330,8 +330,8 @@ static int ov7630_get_ctrl(struct sn9c102_device* cam,
} }
static int ov7630_set_ctrl(struct sn9c102_device* cam, static int ov7630_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
enum sn9c102_bridge bridge = sn9c102_get_bridge(cam); enum sn9c102_bridge bridge = sn9c102_get_bridge(cam);
int err = 0; int err = 0;
...@@ -385,10 +385,10 @@ static int ov7630_set_ctrl(struct sn9c102_device* cam, ...@@ -385,10 +385,10 @@ static int ov7630_set_ctrl(struct sn9c102_device* cam,
} }
static int ov7630_set_crop(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 = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = 0, v_start = (u8)(rect->top - s->cropcap.bounds.top) + 1; u8 h_start = 0, v_start = (u8)(rect->top - s->cropcap.bounds.top) + 1;
...@@ -413,8 +413,8 @@ static int ov7630_set_crop(struct sn9c102_device* cam, ...@@ -413,8 +413,8 @@ static int ov7630_set_crop(struct sn9c102_device* cam,
} }
static int ov7630_set_pix_format(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; int err = 0;
...@@ -594,7 +594,7 @@ static const struct sn9c102_sensor ov7630 = { ...@@ -594,7 +594,7 @@ static const struct sn9c102_sensor ov7630 = {
}; };
int sn9c102_probe_ov7630(struct sn9c102_device* cam) int sn9c102_probe_ov7630(struct sn9c102_device *cam)
{ {
int pid, ver, err = 0; int pid, ver, err = 0;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int ov7660_init(struct sn9c102_device* cam) static int ov7660_init(struct sn9c102_device *cam)
{ {
int err = 0; int err = 0;
...@@ -271,8 +271,8 @@ static int ov7660_init(struct sn9c102_device* cam) ...@@ -271,8 +271,8 @@ static int ov7660_init(struct sn9c102_device* cam)
} }
static int ov7660_get_ctrl(struct sn9c102_device* cam, static int ov7660_get_ctrl(struct sn9c102_device *cam,
struct v4l2_control* ctrl) struct v4l2_control *ctrl)
{ {
int err = 0; int err = 0;
...@@ -332,8 +332,8 @@ static int ov7660_get_ctrl(struct sn9c102_device* cam, ...@@ -332,8 +332,8 @@ static int ov7660_get_ctrl(struct sn9c102_device* cam,
} }
static int ov7660_set_ctrl(struct sn9c102_device* cam, static int ov7660_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
int err = 0; int err = 0;
...@@ -371,10 +371,10 @@ static int ov7660_set_ctrl(struct sn9c102_device* cam, ...@@ -371,10 +371,10 @@ static int ov7660_set_ctrl(struct sn9c102_device* cam,
} }
static int ov7660_set_crop(struct sn9c102_device* cam, static int ov7660_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 1, u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 1,
v_start = (u8)(rect->top - s->cropcap.bounds.top) + 1; v_start = (u8)(rect->top - s->cropcap.bounds.top) + 1;
...@@ -386,8 +386,8 @@ static int ov7660_set_crop(struct sn9c102_device* cam, ...@@ -386,8 +386,8 @@ static int ov7660_set_crop(struct sn9c102_device* cam,
} }
static int ov7660_set_pix_format(struct sn9c102_device* cam, static int ov7660_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
int r0, err = 0; int r0, err = 0;
...@@ -525,7 +525,7 @@ static const struct sn9c102_sensor ov7660 = { ...@@ -525,7 +525,7 @@ static const struct sn9c102_sensor ov7660 = {
}; };
int sn9c102_probe_ov7660(struct sn9c102_device* cam) int sn9c102_probe_ov7660(struct sn9c102_device *cam)
{ {
int pid, ver, err; int pid, ver, err;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int pas106b_init(struct sn9c102_device* cam) static int pas106b_init(struct sn9c102_device *cam)
{ {
int err = 0; int err = 0;
...@@ -48,8 +48,8 @@ static int pas106b_init(struct sn9c102_device* cam) ...@@ -48,8 +48,8 @@ static int pas106b_init(struct sn9c102_device* cam)
} }
static int pas106b_get_ctrl(struct sn9c102_device* cam, static int pas106b_get_ctrl(struct sn9c102_device *cam,
struct v4l2_control* ctrl) struct v4l2_control *ctrl)
{ {
switch (ctrl->id) { switch (ctrl->id) {
case V4L2_CID_EXPOSURE: case V4L2_CID_EXPOSURE:
...@@ -103,8 +103,8 @@ static int pas106b_get_ctrl(struct sn9c102_device* cam, ...@@ -103,8 +103,8 @@ static int pas106b_get_ctrl(struct sn9c102_device* cam,
} }
static int pas106b_set_ctrl(struct sn9c102_device* cam, static int pas106b_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
int err = 0; int err = 0;
...@@ -141,10 +141,10 @@ static int pas106b_set_ctrl(struct sn9c102_device* cam, ...@@ -141,10 +141,10 @@ static int pas106b_set_ctrl(struct sn9c102_device* cam,
} }
static int pas106b_set_crop(struct sn9c102_device* cam, static int pas106b_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 4, u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 4,
v_start = (u8)(rect->top - s->cropcap.bounds.top) + 3; v_start = (u8)(rect->top - s->cropcap.bounds.top) + 3;
...@@ -156,8 +156,8 @@ static int pas106b_set_crop(struct sn9c102_device* cam, ...@@ -156,8 +156,8 @@ static int pas106b_set_crop(struct sn9c102_device* cam,
} }
static int pas106b_set_pix_format(struct sn9c102_device* cam, static int pas106b_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
int err = 0; int err = 0;
...@@ -278,7 +278,7 @@ static const struct sn9c102_sensor pas106b = { ...@@ -278,7 +278,7 @@ static const struct sn9c102_sensor pas106b = {
}; };
int sn9c102_probe_pas106b(struct sn9c102_device* cam) int sn9c102_probe_pas106b(struct sn9c102_device *cam)
{ {
int r0 = 0, r1 = 0; int r0 = 0, r1 = 0;
unsigned int pid = 0; unsigned int pid = 0;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int pas202bcb_init(struct sn9c102_device* cam) static int pas202bcb_init(struct sn9c102_device *cam)
{ {
int err = 0; int err = 0;
...@@ -78,8 +78,8 @@ static int pas202bcb_init(struct sn9c102_device* cam) ...@@ -78,8 +78,8 @@ static int pas202bcb_init(struct sn9c102_device* cam)
} }
static int pas202bcb_get_ctrl(struct sn9c102_device* cam, static int pas202bcb_get_ctrl(struct sn9c102_device *cam,
struct v4l2_control* ctrl) struct v4l2_control *ctrl)
{ {
switch (ctrl->id) { switch (ctrl->id) {
case V4L2_CID_EXPOSURE: case V4L2_CID_EXPOSURE:
...@@ -126,8 +126,8 @@ static int pas202bcb_get_ctrl(struct sn9c102_device* cam, ...@@ -126,8 +126,8 @@ static int pas202bcb_get_ctrl(struct sn9c102_device* cam,
} }
static int pas202bcb_set_pix_format(struct sn9c102_device* cam, static int pas202bcb_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
int err = 0; int err = 0;
...@@ -140,8 +140,8 @@ static int pas202bcb_set_pix_format(struct sn9c102_device* cam, ...@@ -140,8 +140,8 @@ static int pas202bcb_set_pix_format(struct sn9c102_device* cam,
} }
static int pas202bcb_set_ctrl(struct sn9c102_device* cam, static int pas202bcb_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
int err = 0; int err = 0;
...@@ -174,10 +174,10 @@ static int pas202bcb_set_ctrl(struct sn9c102_device* cam, ...@@ -174,10 +174,10 @@ static int pas202bcb_set_ctrl(struct sn9c102_device* cam,
} }
static int pas202bcb_set_crop(struct sn9c102_device* cam, static int pas202bcb_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = 0, u8 h_start = 0,
v_start = (u8)(rect->top - s->cropcap.bounds.top) + 3; v_start = (u8)(rect->top - s->cropcap.bounds.top) + 3;
...@@ -299,7 +299,7 @@ static const struct sn9c102_sensor pas202bcb = { ...@@ -299,7 +299,7 @@ static const struct sn9c102_sensor pas202bcb = {
}; };
int sn9c102_probe_pas202bcb(struct sn9c102_device* cam) int sn9c102_probe_pas202bcb(struct sn9c102_device *cam)
{ {
int r0 = 0, r1 = 0, err = 0; int r0 = 0, r1 = 0, err = 0;
unsigned int pid = 0; unsigned int pid = 0;
......
...@@ -62,19 +62,19 @@ enum sn9c102_bridge { ...@@ -62,19 +62,19 @@ enum sn9c102_bridge {
}; };
/* Return the bridge name */ /* Return the bridge name */
enum sn9c102_bridge sn9c102_get_bridge(struct sn9c102_device* cam); enum sn9c102_bridge sn9c102_get_bridge(struct sn9c102_device *cam);
/* Return a pointer the sensor struct attached to the camera */ /* Return a pointer the sensor struct attached to the camera */
struct sn9c102_sensor* sn9c102_get_sensor(struct sn9c102_device* cam); struct sn9c102_sensor *sn9c102_get_sensor(struct sn9c102_device *cam);
/* Identify a device */ /* Identify a device */
extern struct sn9c102_device* extern struct sn9c102_device*
sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id); sn9c102_match_id(struct sn9c102_device *cam, const struct usb_device_id *id);
/* Attach a probed sensor to the camera. */ /* Attach a probed sensor to the camera. */
extern void extern void
sn9c102_attach_sensor(struct sn9c102_device* cam, sn9c102_attach_sensor(struct sn9c102_device *cam,
const struct sn9c102_sensor* sensor); const struct sn9c102_sensor *sensor);
/* /*
Read/write routines: they always return -1 on error, 0 or the read value Read/write routines: they always return -1 on error, 0 or the read value
...@@ -99,12 +99,12 @@ extern int sn9c102_i2c_try_read(struct sn9c102_device*, ...@@ -99,12 +99,12 @@ extern int sn9c102_i2c_try_read(struct sn9c102_device*,
version returns 0 on success, while the read version returns the first read version returns 0 on success, while the read version returns the first read
byte. byte.
*/ */
extern int sn9c102_i2c_try_raw_write(struct sn9c102_device* cam, extern int sn9c102_i2c_try_raw_write(struct sn9c102_device *cam,
const struct sn9c102_sensor* sensor, u8 n, const struct sn9c102_sensor *sensor, u8 n,
u8 data0, u8 data1, u8 data2, u8 data3, u8 data0, u8 data1, u8 data2, u8 data3,
u8 data4, u8 data5); u8 data4, u8 data5);
extern int sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, extern int sn9c102_i2c_try_raw_read(struct sn9c102_device *cam,
const struct sn9c102_sensor* sensor, const struct sn9c102_sensor *sensor,
u8 data0, u8 data1, u8 n, u8 buffer[]); u8 data0, u8 data1, u8 n, u8 buffer[]);
/* To be used after the sensor struct has been attached to the camera struct */ /* To be used after the sensor struct has been attached to the camera struct */
...@@ -174,7 +174,7 @@ struct sn9c102_sensor { ...@@ -174,7 +174,7 @@ struct sn9c102_sensor {
they must return 0 on success, the proper error otherwise. they must return 0 on success, the proper error otherwise.
*/ */
int (*init)(struct sn9c102_device* cam); 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 It should be used to initialize the sensor only, but may also
...@@ -195,9 +195,9 @@ struct sn9c102_sensor { ...@@ -195,9 +195,9 @@ struct sn9c102_sensor {
V4L2 API. Menu type controls are not handled by this interface. V4L2 API. Menu type controls are not handled by this interface.
*/ */
int (*get_ctrl)(struct sn9c102_device* cam, struct v4l2_control* ctrl); int (*get_ctrl)(struct sn9c102_device *cam, struct v4l2_control *ctrl);
int (*set_ctrl)(struct sn9c102_device* cam, 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 You must implement at least the set_ctrl method if you have defined
the list above. The returned value must follow the V4L2 the list above. The returned value must follow the V4L2
...@@ -240,8 +240,8 @@ struct sn9c102_sensor { ...@@ -240,8 +240,8 @@ struct sn9c102_sensor {
will be ignored. will be ignored.
*/ */
int (*set_crop)(struct sn9c102_device* cam, 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 To be called on VIDIOC_C_SETCROP. The core module always calls a
default routine which configures the appropriate SN9C1XX regs (also default routine which configures the appropriate SN9C1XX regs (also
...@@ -276,8 +276,8 @@ struct sn9c102_sensor { ...@@ -276,8 +276,8 @@ struct sn9c102_sensor {
matches the RGB bayer sequence (i.e. BGBGBG...GRGRGR). matches the RGB bayer sequence (i.e. BGBGBG...GRGRGR).
*/ */
int (*set_pix_format)(struct sn9c102_device* cam, 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 To be called on VIDIOC_S_FMT, when switching from the SBGGR8 to
SN9C10X pixel format or viceversa. On error return the corresponding SN9C10X pixel format or viceversa. On error return the corresponding
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int tas5110c1b_init(struct sn9c102_device* cam) static int tas5110c1b_init(struct sn9c102_device *cam)
{ {
int err = 0; int err = 0;
...@@ -38,8 +38,8 @@ static int tas5110c1b_init(struct sn9c102_device* cam) ...@@ -38,8 +38,8 @@ static int tas5110c1b_init(struct sn9c102_device* cam)
} }
static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, static int tas5110c1b_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
int err = 0; int err = 0;
...@@ -55,10 +55,10 @@ static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, ...@@ -55,10 +55,10 @@ static int tas5110c1b_set_ctrl(struct sn9c102_device* cam,
} }
static int tas5110c1b_set_crop(struct sn9c102_device* cam, static int tas5110c1b_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 69, u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 69,
v_start = (u8)(rect->top - s->cropcap.bounds.top) + 9; v_start = (u8)(rect->top - s->cropcap.bounds.top) + 9;
...@@ -75,8 +75,8 @@ static int tas5110c1b_set_crop(struct sn9c102_device* cam, ...@@ -75,8 +75,8 @@ static int tas5110c1b_set_crop(struct sn9c102_device* cam,
} }
static int tas5110c1b_set_pix_format(struct sn9c102_device* cam, static int tas5110c1b_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
int err = 0; int err = 0;
...@@ -135,7 +135,7 @@ static const struct sn9c102_sensor tas5110c1b = { ...@@ -135,7 +135,7 @@ static const struct sn9c102_sensor tas5110c1b = {
}; };
int sn9c102_probe_tas5110c1b(struct sn9c102_device* cam) int sn9c102_probe_tas5110c1b(struct sn9c102_device *cam)
{ {
const struct usb_device_id tas5110c1b_id_table[] = { const struct usb_device_id tas5110c1b_id_table[] = {
{ USB_DEVICE(0x0c45, 0x6001), }, { USB_DEVICE(0x0c45, 0x6001), },
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int tas5110d_init(struct sn9c102_device* cam) static int tas5110d_init(struct sn9c102_device *cam)
{ {
int err; int err;
...@@ -37,10 +37,10 @@ static int tas5110d_init(struct sn9c102_device* cam) ...@@ -37,10 +37,10 @@ static int tas5110d_init(struct sn9c102_device* cam)
} }
static int tas5110d_set_crop(struct sn9c102_device* cam, static int tas5110d_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
int err = 0; int err = 0;
u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 69, u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 69,
v_start = (u8)(rect->top - s->cropcap.bounds.top) + 9; v_start = (u8)(rect->top - s->cropcap.bounds.top) + 9;
...@@ -55,8 +55,8 @@ static int tas5110d_set_crop(struct sn9c102_device* cam, ...@@ -55,8 +55,8 @@ static int tas5110d_set_crop(struct sn9c102_device* cam,
} }
static int tas5110d_set_pix_format(struct sn9c102_device* cam, static int tas5110d_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
int err = 0; int err = 0;
...@@ -103,7 +103,7 @@ static const struct sn9c102_sensor tas5110d = { ...@@ -103,7 +103,7 @@ static const struct sn9c102_sensor tas5110d = {
}; };
int sn9c102_probe_tas5110d(struct sn9c102_device* cam) int sn9c102_probe_tas5110d(struct sn9c102_device *cam)
{ {
const struct usb_device_id tas5110d_id_table[] = { const struct usb_device_id tas5110d_id_table[] = {
{ USB_DEVICE(0x0c45, 0x6007), }, { USB_DEVICE(0x0c45, 0x6007), },
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "sn9c102_devtable.h" #include "sn9c102_devtable.h"
static int tas5130d1b_init(struct sn9c102_device* cam) static int tas5130d1b_init(struct sn9c102_device *cam)
{ {
int err; int err;
...@@ -36,8 +36,8 @@ static int tas5130d1b_init(struct sn9c102_device* cam) ...@@ -36,8 +36,8 @@ static int tas5130d1b_init(struct sn9c102_device* cam)
} }
static int tas5130d1b_set_ctrl(struct sn9c102_device* cam, static int tas5130d1b_set_ctrl(struct sn9c102_device *cam,
const struct v4l2_control* ctrl) const struct v4l2_control *ctrl)
{ {
int err = 0; int err = 0;
...@@ -56,10 +56,10 @@ static int tas5130d1b_set_ctrl(struct sn9c102_device* cam, ...@@ -56,10 +56,10 @@ static int tas5130d1b_set_ctrl(struct sn9c102_device* cam,
} }
static int tas5130d1b_set_crop(struct sn9c102_device* cam, static int tas5130d1b_set_crop(struct sn9c102_device *cam,
const struct v4l2_rect* rect) const struct v4l2_rect *rect)
{ {
struct sn9c102_sensor* s = sn9c102_get_sensor(cam); struct sn9c102_sensor *s = sn9c102_get_sensor(cam);
u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 104, u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 104,
v_start = (u8)(rect->top - s->cropcap.bounds.top) + 12; v_start = (u8)(rect->top - s->cropcap.bounds.top) + 12;
int err = 0; int err = 0;
...@@ -76,8 +76,8 @@ static int tas5130d1b_set_crop(struct sn9c102_device* cam, ...@@ -76,8 +76,8 @@ static int tas5130d1b_set_crop(struct sn9c102_device* cam,
} }
static int tas5130d1b_set_pix_format(struct sn9c102_device* cam, static int tas5130d1b_set_pix_format(struct sn9c102_device *cam,
const struct v4l2_pix_format* pix) const struct v4l2_pix_format *pix)
{ {
int err = 0; int err = 0;
...@@ -146,7 +146,7 @@ static const struct sn9c102_sensor tas5130d1b = { ...@@ -146,7 +146,7 @@ static const struct sn9c102_sensor tas5130d1b = {
}; };
int sn9c102_probe_tas5130d1b(struct sn9c102_device* cam) int sn9c102_probe_tas5130d1b(struct sn9c102_device *cam)
{ {
const struct usb_device_id tas5130d1b_id_table[] = { const struct usb_device_id tas5130d1b_id_table[] = {
{ USB_DEVICE(0x0c45, 0x6024), }, { USB_DEVICE(0x0c45, 0x6024), },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment