V4L/DVB (9788): soc-camera: simplify naming

We anyway don't follow the s_fmt_vid_cap / g_fmt_vid_cap / try_fmt_vid_cap
naming, and soc-camera is so far only about video capture, let's simplify
operation names a bit further. set_fmt_cap / try_fmt_cap wasn't a very good
choice too.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Guennadi Liakhovetski 2008-12-01 09:45:21 -03:00 committed by Mauro Carvalho Chehab
parent 25c4d74ea6
commit d8fac217c5
9 changed files with 56 additions and 58 deletions

View File

@ -285,8 +285,8 @@ static unsigned long mt9m001_query_bus_param(struct soc_camera_device *icd)
width_flag; width_flag;
} }
static int mt9m001_set_fmt_cap(struct soc_camera_device *icd, static int mt9m001_set_fmt(struct soc_camera_device *icd,
__u32 pixfmt, struct v4l2_rect *rect) __u32 pixfmt, struct v4l2_rect *rect)
{ {
struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd); struct mt9m001 *mt9m001 = container_of(icd, struct mt9m001, icd);
int ret; int ret;
@ -298,7 +298,7 @@ static int mt9m001_set_fmt_cap(struct soc_camera_device *icd,
ret = reg_write(icd, MT9M001_VERTICAL_BLANKING, vblank); ret = reg_write(icd, MT9M001_VERTICAL_BLANKING, vblank);
/* The caller provides a supported format, as verified per /* The caller provides a supported format, as verified per
* call to icd->try_fmt_cap() */ * call to icd->try_fmt() */
if (!ret) if (!ret)
ret = reg_write(icd, MT9M001_COLUMN_START, rect->left); ret = reg_write(icd, MT9M001_COLUMN_START, rect->left);
if (!ret) if (!ret)
@ -325,8 +325,8 @@ static int mt9m001_set_fmt_cap(struct soc_camera_device *icd,
return ret; return ret;
} }
static int mt9m001_try_fmt_cap(struct soc_camera_device *icd, static int mt9m001_try_fmt(struct soc_camera_device *icd,
struct v4l2_format *f) struct v4l2_format *f)
{ {
if (f->fmt.pix.height < 32 + icd->y_skip_top) if (f->fmt.pix.height < 32 + icd->y_skip_top)
f->fmt.pix.height = 32 + icd->y_skip_top; f->fmt.pix.height = 32 + icd->y_skip_top;
@ -447,8 +447,8 @@ static struct soc_camera_ops mt9m001_ops = {
.release = mt9m001_release, .release = mt9m001_release,
.start_capture = mt9m001_start_capture, .start_capture = mt9m001_start_capture,
.stop_capture = mt9m001_stop_capture, .stop_capture = mt9m001_stop_capture,
.set_fmt_cap = mt9m001_set_fmt_cap, .set_fmt = mt9m001_set_fmt,
.try_fmt_cap = mt9m001_try_fmt_cap, .try_fmt = mt9m001_try_fmt,
.set_bus_param = mt9m001_set_bus_param, .set_bus_param = mt9m001_set_bus_param,
.query_bus_param = mt9m001_query_bus_param, .query_bus_param = mt9m001_query_bus_param,
.controls = mt9m001_controls, .controls = mt9m001_controls,

View File

@ -452,8 +452,8 @@ static int mt9m111_set_pixfmt(struct soc_camera_device *icd, u32 pixfmt)
return ret; return ret;
} }
static int mt9m111_set_fmt_cap(struct soc_camera_device *icd, static int mt9m111_set_fmt(struct soc_camera_device *icd,
__u32 pixfmt, struct v4l2_rect *rect) __u32 pixfmt, struct v4l2_rect *rect)
{ {
struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd); struct mt9m111 *mt9m111 = container_of(icd, struct mt9m111, icd);
int ret; int ret;
@ -473,8 +473,8 @@ static int mt9m111_set_fmt_cap(struct soc_camera_device *icd,
return ret; return ret;
} }
static int mt9m111_try_fmt_cap(struct soc_camera_device *icd, static int mt9m111_try_fmt(struct soc_camera_device *icd,
struct v4l2_format *f) struct v4l2_format *f)
{ {
if (f->fmt.pix.height > MT9M111_MAX_HEIGHT) if (f->fmt.pix.height > MT9M111_MAX_HEIGHT)
f->fmt.pix.height = MT9M111_MAX_HEIGHT; f->fmt.pix.height = MT9M111_MAX_HEIGHT;
@ -597,8 +597,8 @@ static struct soc_camera_ops mt9m111_ops = {
.release = mt9m111_release, .release = mt9m111_release,
.start_capture = mt9m111_start_capture, .start_capture = mt9m111_start_capture,
.stop_capture = mt9m111_stop_capture, .stop_capture = mt9m111_stop_capture,
.set_fmt_cap = mt9m111_set_fmt_cap, .set_fmt = mt9m111_set_fmt,
.try_fmt_cap = mt9m111_try_fmt_cap, .try_fmt = mt9m111_try_fmt,
.query_bus_param = mt9m111_query_bus_param, .query_bus_param = mt9m111_query_bus_param,
.set_bus_param = mt9m111_set_bus_param, .set_bus_param = mt9m111_set_bus_param,
.controls = mt9m111_controls, .controls = mt9m111_controls,

View File

@ -337,14 +337,14 @@ static unsigned long mt9v022_query_bus_param(struct soc_camera_device *icd)
width_flag; width_flag;
} }
static int mt9v022_set_fmt_cap(struct soc_camera_device *icd, static int mt9v022_set_fmt(struct soc_camera_device *icd,
__u32 pixfmt, struct v4l2_rect *rect) __u32 pixfmt, struct v4l2_rect *rect)
{ {
struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd); struct mt9v022 *mt9v022 = container_of(icd, struct mt9v022, icd);
int ret; int ret;
/* The caller provides a supported format, as verified per call to /* The caller provides a supported format, as verified per call to
* icd->try_fmt_cap(), datawidth is from our supported format list */ * icd->try_fmt(), datawidth is from our supported format list */
switch (pixfmt) { switch (pixfmt) {
case V4L2_PIX_FMT_GREY: case V4L2_PIX_FMT_GREY:
case V4L2_PIX_FMT_Y16: case V4L2_PIX_FMT_Y16:
@ -400,8 +400,8 @@ static int mt9v022_set_fmt_cap(struct soc_camera_device *icd,
return 0; return 0;
} }
static int mt9v022_try_fmt_cap(struct soc_camera_device *icd, static int mt9v022_try_fmt(struct soc_camera_device *icd,
struct v4l2_format *f) struct v4l2_format *f)
{ {
if (f->fmt.pix.height < 32 + icd->y_skip_top) if (f->fmt.pix.height < 32 + icd->y_skip_top)
f->fmt.pix.height = 32 + icd->y_skip_top; f->fmt.pix.height = 32 + icd->y_skip_top;
@ -538,8 +538,8 @@ static struct soc_camera_ops mt9v022_ops = {
.release = mt9v022_release, .release = mt9v022_release,
.start_capture = mt9v022_start_capture, .start_capture = mt9v022_start_capture,
.stop_capture = mt9v022_stop_capture, .stop_capture = mt9v022_stop_capture,
.set_fmt_cap = mt9v022_set_fmt_cap, .set_fmt = mt9v022_set_fmt,
.try_fmt_cap = mt9v022_try_fmt_cap, .try_fmt = mt9v022_try_fmt,
.set_bus_param = mt9v022_set_bus_param, .set_bus_param = mt9v022_set_bus_param,
.query_bus_param = mt9v022_query_bus_param, .query_bus_param = mt9v022_query_bus_param,
.controls = mt9v022_controls, .controls = mt9v022_controls,

View File

@ -755,9 +755,9 @@ static int ov772x_set_register(struct soc_camera_device *icd,
} }
#endif #endif
static int ov772x_set_fmt_cap(struct soc_camera_device *icd, static int ov772x_set_fmt(struct soc_camera_device *icd,
__u32 pixfmt, __u32 pixfmt,
struct v4l2_rect *rect) struct v4l2_rect *rect)
{ {
struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd); struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd);
int ret = -EINVAL; int ret = -EINVAL;
@ -778,8 +778,8 @@ static int ov772x_set_fmt_cap(struct soc_camera_device *icd,
return ret; return ret;
} }
static int ov772x_try_fmt_cap(struct soc_camera_device *icd, static int ov772x_try_fmt(struct soc_camera_device *icd,
struct v4l2_format *f) struct v4l2_format *f)
{ {
struct v4l2_pix_format *pix = &f->fmt.pix; struct v4l2_pix_format *pix = &f->fmt.pix;
struct ov772x_priv *priv; struct ov772x_priv *priv;
@ -868,8 +868,8 @@ static struct soc_camera_ops ov772x_ops = {
.release = ov772x_release, .release = ov772x_release,
.start_capture = ov772x_start_capture, .start_capture = ov772x_start_capture,
.stop_capture = ov772x_stop_capture, .stop_capture = ov772x_stop_capture,
.set_fmt_cap = ov772x_set_fmt_cap, .set_fmt = ov772x_set_fmt,
.try_fmt_cap = ov772x_try_fmt_cap, .try_fmt = ov772x_try_fmt,
.set_bus_param = ov772x_set_bus_param, .set_bus_param = ov772x_set_bus_param,
.query_bus_param = ov772x_query_bus_param, .query_bus_param = ov772x_query_bus_param,
.get_chip_id = ov772x_get_chip_id, .get_chip_id = ov772x_get_chip_id,

View File

@ -904,8 +904,8 @@ static int pxa_camera_try_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
return soc_camera_bus_param_compatible(camera_flags, bus_flags) ? 0 : -EINVAL; return soc_camera_bus_param_compatible(camera_flags, bus_flags) ? 0 : -EINVAL;
} }
static int pxa_camera_set_fmt_cap(struct soc_camera_device *icd, static int pxa_camera_set_fmt(struct soc_camera_device *icd,
__u32 pixfmt, struct v4l2_rect *rect) __u32 pixfmt, struct v4l2_rect *rect)
{ {
const struct soc_camera_data_format *cam_fmt; const struct soc_camera_data_format *cam_fmt;
int ret; int ret;
@ -920,15 +920,15 @@ static int pxa_camera_set_fmt_cap(struct soc_camera_device *icd,
return -EINVAL; return -EINVAL;
} }
ret = icd->ops->set_fmt_cap(icd, pixfmt, rect); ret = icd->ops->set_fmt(icd, pixfmt, rect);
if (pixfmt && !ret) if (pixfmt && !ret)
icd->current_fmt = cam_fmt; icd->current_fmt = cam_fmt;
return ret; return ret;
} }
static int pxa_camera_try_fmt_cap(struct soc_camera_device *icd, static int pxa_camera_try_fmt(struct soc_camera_device *icd,
struct v4l2_format *f) struct v4l2_format *f)
{ {
const struct soc_camera_data_format *cam_fmt; const struct soc_camera_data_format *cam_fmt;
int ret = pxa_camera_try_bus_param(icd, f->fmt.pix.pixelformat); int ret = pxa_camera_try_bus_param(icd, f->fmt.pix.pixelformat);
@ -960,7 +960,7 @@ static int pxa_camera_try_fmt_cap(struct soc_camera_device *icd,
f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline; f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
/* limit to sensor capabilities */ /* limit to sensor capabilities */
return icd->ops->try_fmt_cap(icd, f); return icd->ops->try_fmt(icd, f);
} }
static int pxa_camera_reqbufs(struct soc_camera_file *icf, static int pxa_camera_reqbufs(struct soc_camera_file *icf,
@ -1068,8 +1068,8 @@ static struct soc_camera_host_ops pxa_soc_camera_host_ops = {
.remove = pxa_camera_remove_device, .remove = pxa_camera_remove_device,
.suspend = pxa_camera_suspend, .suspend = pxa_camera_suspend,
.resume = pxa_camera_resume, .resume = pxa_camera_resume,
.set_fmt_cap = pxa_camera_set_fmt_cap, .set_fmt = pxa_camera_set_fmt,
.try_fmt_cap = pxa_camera_try_fmt_cap, .try_fmt = pxa_camera_try_fmt,
.init_videobuf = pxa_camera_init_videobuf, .init_videobuf = pxa_camera_init_videobuf,
.reqbufs = pxa_camera_reqbufs, .reqbufs = pxa_camera_reqbufs,
.poll = pxa_camera_poll, .poll = pxa_camera_poll,

View File

@ -450,8 +450,8 @@ static int sh_mobile_ceu_try_bus_param(struct soc_camera_device *icd,
return 0; return 0;
} }
static int sh_mobile_ceu_set_fmt_cap(struct soc_camera_device *icd, static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd,
__u32 pixfmt, struct v4l2_rect *rect) __u32 pixfmt, struct v4l2_rect *rect)
{ {
const struct soc_camera_data_format *cam_fmt; const struct soc_camera_data_format *cam_fmt;
int ret; int ret;
@ -466,15 +466,15 @@ static int sh_mobile_ceu_set_fmt_cap(struct soc_camera_device *icd,
return -EINVAL; return -EINVAL;
} }
ret = icd->ops->set_fmt_cap(icd, pixfmt, rect); ret = icd->ops->set_fmt(icd, pixfmt, rect);
if (pixfmt && !ret) if (pixfmt && !ret)
icd->current_fmt = cam_fmt; icd->current_fmt = cam_fmt;
return ret; return ret;
} }
static int sh_mobile_ceu_try_fmt_cap(struct soc_camera_device *icd, static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
struct v4l2_format *f) struct v4l2_format *f)
{ {
const struct soc_camera_data_format *cam_fmt; const struct soc_camera_data_format *cam_fmt;
int ret = sh_mobile_ceu_try_bus_param(icd, f->fmt.pix.pixelformat); int ret = sh_mobile_ceu_try_bus_param(icd, f->fmt.pix.pixelformat);
@ -508,7 +508,7 @@ static int sh_mobile_ceu_try_fmt_cap(struct soc_camera_device *icd,
f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline; f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
/* limit to sensor capabilities */ /* limit to sensor capabilities */
return icd->ops->try_fmt_cap(icd, f); return icd->ops->try_fmt(icd, f);
} }
static int sh_mobile_ceu_reqbufs(struct soc_camera_file *icf, static int sh_mobile_ceu_reqbufs(struct soc_camera_file *icf,
@ -576,8 +576,8 @@ static struct soc_camera_host_ops sh_mobile_ceu_host_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.add = sh_mobile_ceu_add_device, .add = sh_mobile_ceu_add_device,
.remove = sh_mobile_ceu_remove_device, .remove = sh_mobile_ceu_remove_device,
.set_fmt_cap = sh_mobile_ceu_set_fmt_cap, .set_fmt = sh_mobile_ceu_set_fmt,
.try_fmt_cap = sh_mobile_ceu_try_fmt_cap, .try_fmt = sh_mobile_ceu_try_fmt,
.reqbufs = sh_mobile_ceu_reqbufs, .reqbufs = sh_mobile_ceu_reqbufs,
.poll = sh_mobile_ceu_poll, .poll = sh_mobile_ceu_poll,
.querycap = sh_mobile_ceu_querycap, .querycap = sh_mobile_ceu_querycap,

View File

@ -73,7 +73,7 @@ static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv,
} }
/* limit format to hardware capabilities */ /* limit format to hardware capabilities */
ret = ici->ops->try_fmt_cap(icd, f); ret = ici->ops->try_fmt(icd, f);
return ret; return ret;
} }
@ -324,7 +324,7 @@ static int soc_camera_s_fmt_vid_cap(struct file *file, void *priv,
rect.top = icd->y_current; rect.top = icd->y_current;
rect.width = f->fmt.pix.width; rect.width = f->fmt.pix.width;
rect.height = f->fmt.pix.height; rect.height = f->fmt.pix.height;
ret = ici->ops->set_fmt_cap(icd, f->fmt.pix.pixelformat, &rect); ret = ici->ops->set_fmt(icd, f->fmt.pix.pixelformat, &rect);
if (ret < 0) { if (ret < 0) {
return ret; return ret;
} else if (!icd->current_fmt || } else if (!icd->current_fmt ||
@ -553,7 +553,7 @@ static int soc_camera_s_crop(struct file *file, void *fh,
if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL; return -EINVAL;
ret = ici->ops->set_fmt_cap(icd, 0, &a->c); ret = ici->ops->set_fmt(icd, 0, &a->c);
if (!ret) { if (!ret) {
icd->width = a->c.width; icd->width = a->c.width;
icd->height = a->c.height; icd->height = a->c.height;

View File

@ -79,14 +79,14 @@ soc_camera_platform_query_bus_param(struct soc_camera_device *icd)
return p->bus_param; return p->bus_param;
} }
static int soc_camera_platform_set_fmt_cap(struct soc_camera_device *icd, static int soc_camera_platform_set_fmt(struct soc_camera_device *icd,
__u32 pixfmt, struct v4l2_rect *rect) __u32 pixfmt, struct v4l2_rect *rect)
{ {
return 0; return 0;
} }
static int soc_camera_platform_try_fmt_cap(struct soc_camera_device *icd, static int soc_camera_platform_try_fmt(struct soc_camera_device *icd,
struct v4l2_format *f) struct v4l2_format *f)
{ {
struct soc_camera_platform_info *p = soc_camera_platform_get_info(icd); struct soc_camera_platform_info *p = soc_camera_platform_get_info(icd);
@ -124,8 +124,8 @@ static struct soc_camera_ops soc_camera_platform_ops = {
.release = soc_camera_platform_release, .release = soc_camera_platform_release,
.start_capture = soc_camera_platform_start_capture, .start_capture = soc_camera_platform_start_capture,
.stop_capture = soc_camera_platform_stop_capture, .stop_capture = soc_camera_platform_stop_capture,
.set_fmt_cap = soc_camera_platform_set_fmt_cap, .set_fmt = soc_camera_platform_set_fmt,
.try_fmt_cap = soc_camera_platform_try_fmt_cap, .try_fmt = soc_camera_platform_try_fmt,
.set_bus_param = soc_camera_platform_set_bus_param, .set_bus_param = soc_camera_platform_set_bus_param,
.query_bus_param = soc_camera_platform_query_bus_param, .query_bus_param = soc_camera_platform_query_bus_param,
}; };

View File

@ -66,9 +66,8 @@ struct soc_camera_host_ops {
void (*remove)(struct soc_camera_device *); void (*remove)(struct soc_camera_device *);
int (*suspend)(struct soc_camera_device *, pm_message_t state); int (*suspend)(struct soc_camera_device *, pm_message_t state);
int (*resume)(struct soc_camera_device *); int (*resume)(struct soc_camera_device *);
int (*set_fmt_cap)(struct soc_camera_device *, __u32, int (*set_fmt)(struct soc_camera_device *, __u32, struct v4l2_rect *);
struct v4l2_rect *); int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
int (*try_fmt_cap)(struct soc_camera_device *, struct v4l2_format *);
void (*init_videobuf)(struct videobuf_queue *, void (*init_videobuf)(struct videobuf_queue *,
struct soc_camera_device *); struct soc_camera_device *);
int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *); int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *);
@ -125,9 +124,8 @@ struct soc_camera_ops {
int (*release)(struct soc_camera_device *); int (*release)(struct soc_camera_device *);
int (*start_capture)(struct soc_camera_device *); int (*start_capture)(struct soc_camera_device *);
int (*stop_capture)(struct soc_camera_device *); int (*stop_capture)(struct soc_camera_device *);
int (*set_fmt_cap)(struct soc_camera_device *, __u32, int (*set_fmt)(struct soc_camera_device *, __u32, struct v4l2_rect *);
struct v4l2_rect *); int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
int (*try_fmt_cap)(struct soc_camera_device *, struct v4l2_format *);
unsigned long (*query_bus_param)(struct soc_camera_device *); unsigned long (*query_bus_param)(struct soc_camera_device *);
int (*set_bus_param)(struct soc_camera_device *, unsigned long); int (*set_bus_param)(struct soc_camera_device *, unsigned long);
int (*get_chip_id)(struct soc_camera_device *, int (*get_chip_id)(struct soc_camera_device *,