Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124566
b: refs/heads/master
c: 6d75611
h: refs/heads/master
v: v3
  • Loading branch information
Kuninori Morimoto authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent c0d0705 commit a1f78a4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 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: ed922a892e535c14035210b5be328af1f49561c8
refs/heads/master: 6d75611231fb22dbce0019310a9f3dc66918317e
22 changes: 16 additions & 6 deletions trunk/drivers/media/video/tw9910.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,15 +651,16 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,
*/
priv->scale = tw9910_select_norm(icd, rect->width, rect->height);
if (!priv->scale)
return ret;
goto tw9910_set_fmt_error;

/*
* reset hardware
*/
tw9910_reset(priv->client);
ret = tw9910_write_array(priv->client, tw9910_default_regs);
if (ret < 0)
return ret;
goto tw9910_set_fmt_error;

/*
* set bus width
*/
Expand All @@ -669,7 +670,7 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,

ret = tw9910_mask_set(priv->client, OPFORM, LEN, val);
if (ret < 0)
return ret;
goto tw9910_set_fmt_error;

/*
* select MPOUT behavior
Expand Down Expand Up @@ -697,26 +698,35 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,

ret = tw9910_mask_set(priv->client, VBICNTL, RTSEL_MASK, val);
if (ret < 0)
return ret;
goto tw9910_set_fmt_error;

/*
* set scale
*/
ret = tw9910_set_scale(priv->client, priv->scale);
if (ret < 0)
return ret;
goto tw9910_set_fmt_error;

/*
* set cropping
*/
ret = tw9910_set_cropping(priv->client, &tw9910_cropping_ctrl);
if (ret < 0)
return ret;
goto tw9910_set_fmt_error;

/*
* set hsync
*/
ret = tw9910_set_hsync(priv->client, &tw9910_hsync_ctrl);
if (ret < 0)
goto tw9910_set_fmt_error;

return ret;

tw9910_set_fmt_error:

tw9910_reset(priv->client);
priv->scale = NULL;

return ret;
}
Expand Down

0 comments on commit a1f78a4

Please sign in to comment.