提交 d8fac217 编写于 作者: G Guennadi Liakhovetski 提交者: Mauro Carvalho Chehab

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: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 25c4d74e
...@@ -285,7 +285,7 @@ static unsigned long mt9m001_query_bus_param(struct soc_camera_device *icd) ...@@ -285,7 +285,7 @@ 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);
...@@ -298,7 +298,7 @@ static int mt9m001_set_fmt_cap(struct soc_camera_device *icd, ...@@ -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,7 +325,7 @@ static int mt9m001_set_fmt_cap(struct soc_camera_device *icd, ...@@ -325,7 +325,7 @@ 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)
...@@ -447,8 +447,8 @@ static struct soc_camera_ops mt9m001_ops = { ...@@ -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,
......
...@@ -452,7 +452,7 @@ static int mt9m111_set_pixfmt(struct soc_camera_device *icd, u32 pixfmt) ...@@ -452,7 +452,7 @@ 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);
...@@ -473,7 +473,7 @@ static int mt9m111_set_fmt_cap(struct soc_camera_device *icd, ...@@ -473,7 +473,7 @@ 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)
...@@ -597,8 +597,8 @@ static struct soc_camera_ops mt9m111_ops = { ...@@ -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,
......
...@@ -337,14 +337,14 @@ static unsigned long mt9v022_query_bus_param(struct soc_camera_device *icd) ...@@ -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,7 +400,7 @@ static int mt9v022_set_fmt_cap(struct soc_camera_device *icd, ...@@ -400,7 +400,7 @@ 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)
...@@ -538,8 +538,8 @@ static struct soc_camera_ops mt9v022_ops = { ...@@ -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,
......
...@@ -755,7 +755,7 @@ static int ov772x_set_register(struct soc_camera_device *icd, ...@@ -755,7 +755,7 @@ 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)
{ {
...@@ -778,7 +778,7 @@ static int ov772x_set_fmt_cap(struct soc_camera_device *icd, ...@@ -778,7 +778,7 @@ 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;
...@@ -868,8 +868,8 @@ static struct soc_camera_ops ov772x_ops = { ...@@ -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,
......
...@@ -904,7 +904,7 @@ static int pxa_camera_try_bus_param(struct soc_camera_device *icd, __u32 pixfmt) ...@@ -904,7 +904,7 @@ 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;
...@@ -920,14 +920,14 @@ static int pxa_camera_set_fmt_cap(struct soc_camera_device *icd, ...@@ -920,14 +920,14 @@ 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;
...@@ -960,7 +960,7 @@ static int pxa_camera_try_fmt_cap(struct soc_camera_device *icd, ...@@ -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 = { ...@@ -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,
......
...@@ -450,7 +450,7 @@ static int sh_mobile_ceu_try_bus_param(struct soc_camera_device *icd, ...@@ -450,7 +450,7 @@ 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;
...@@ -466,14 +466,14 @@ static int sh_mobile_ceu_set_fmt_cap(struct soc_camera_device *icd, ...@@ -466,14 +466,14 @@ 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;
...@@ -508,7 +508,7 @@ static int sh_mobile_ceu_try_fmt_cap(struct soc_camera_device *icd, ...@@ -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 = { ...@@ -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,
......
...@@ -73,7 +73,7 @@ static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv, ...@@ -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, ...@@ -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, ...@@ -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;
......
...@@ -79,13 +79,13 @@ soc_camera_platform_query_bus_param(struct soc_camera_device *icd) ...@@ -79,13 +79,13 @@ 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 = { ...@@ -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,
}; };
......
...@@ -66,9 +66,8 @@ struct soc_camera_host_ops { ...@@ -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 { ...@@ -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 *,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册