Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276861
b: refs/heads/master
c: fbe78dd
h: refs/heads/master
i:
  276859: 1ccc1c0
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Nov 24, 2011
1 parent 675dff6 commit bf6e1a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f83f71fda27650ae43558633be93652577dbc38c
refs/heads/master: fbe78ddde1f217044ed854eff92e4d22112871cb
2 changes: 0 additions & 2 deletions trunk/drivers/media/video/m5mols/m5mols.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ struct m5mols_version {
* @pad: media pad
* @ffmt: current fmt according to resolution type
* @res_type: current resolution type
* @code: current code
* @irq_waitq: waitqueue for the capture
* @work_irq: workqueue for the IRQ
* @flags: state variable for the interrupt handler
Expand Down Expand Up @@ -192,7 +191,6 @@ struct m5mols_info {
struct media_pad pad;
struct v4l2_mbus_framefmt ffmt[M5MOLS_RESTYPE_MAX];
int res_type;
enum v4l2_mbus_pixelcode code;
wait_queue_head_t irq_waitq;
struct work_struct work_irq;
unsigned long flags;
Expand Down
20 changes: 8 additions & 12 deletions trunk/drivers/media/video/m5mols/m5mols_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,6 @@ static int m5mols_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
struct m5mols_info *info = to_m5mols(sd);
struct v4l2_mbus_framefmt *format;

if (fmt->pad != 0)
return -EINVAL;

format = __find_format(info, fh, fmt->which, info->res_type);
if (!format)
return -EINVAL;
Expand All @@ -531,9 +528,6 @@ static int m5mols_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
u32 resolution = 0;
int ret;

if (fmt->pad != 0)
return -EINVAL;

ret = __find_resolution(sd, format, &type, &resolution);
if (ret < 0)
return ret;
Expand All @@ -542,13 +536,14 @@ static int m5mols_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
if (!sfmt)
return 0;

*sfmt = m5mols_default_ffmt[type];
sfmt->width = format->width;
sfmt->height = format->height;

format->code = m5mols_default_ffmt[type].code;
format->colorspace = V4L2_COLORSPACE_JPEG;
format->field = V4L2_FIELD_NONE;

if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
*sfmt = *format;
info->resolution = resolution;
info->code = format->code;
info->res_type = type;
}

Expand Down Expand Up @@ -625,13 +620,14 @@ static int m5mols_start_monitor(struct m5mols_info *info)
static int m5mols_s_stream(struct v4l2_subdev *sd, int enable)
{
struct m5mols_info *info = to_m5mols(sd);
u32 code = info->ffmt[info->res_type].code;

if (enable) {
int ret = -EINVAL;

if (is_code(info->code, M5MOLS_RESTYPE_MONITOR))
if (is_code(code, M5MOLS_RESTYPE_MONITOR))
ret = m5mols_start_monitor(info);
if (is_code(info->code, M5MOLS_RESTYPE_CAPTURE))
if (is_code(code, M5MOLS_RESTYPE_CAPTURE))
ret = m5mols_start_capture(info);

return ret;
Expand Down

0 comments on commit bf6e1a7

Please sign in to comment.