Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176847
b: refs/heads/master
c: 06f292e
h: refs/heads/master
i:
  176845: 5ec6446
  176843: 60b7708
  176839: 8b452e3
  176831: 24b7220
v: v3
  • Loading branch information
Kuninori Morimoto authored and Mauro Carvalho Chehab committed Dec 16, 2009
1 parent 180a8ac commit ad3dd40
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 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: 88a67c51dfc649c18fc8828970cb4fd09d1871b5
refs/heads/master: 06f292e4806fcec2e7b2356c41241f5b6c4e3afb
43 changes: 30 additions & 13 deletions trunk/drivers/media/video/tw9910.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@
/* 1 : non-auto */
#define VSCTL 0x08 /* 1 : Vertical out ctrl by DVALID */
/* 0 : Vertical out ctrl by HACTIVE and DVALID */
#define OEN 0x04 /* Output Enable together with TRI_SEL. */
#define OEN_TRI_SEL_MASK 0x07
#define OEN_TRI_SEL_ALL_ON 0x00 /* Enable output for Rev0/Rev1 */
#define OEN_TRI_SEL_ALL_OFF_r0 0x06 /* All tri-stated for Rev0 */
#define OEN_TRI_SEL_ALL_OFF_r1 0x07 /* All tri-stated for Rev1 */

/* OUTCTR1 */
#define VSP_LO 0x00 /* 0 : VS pin output polarity is active low */
Expand Down Expand Up @@ -236,7 +239,6 @@ struct tw9910_priv {

static const struct regval_list tw9910_default_regs[] =
{
{ OPFORM, 0x00 },
{ OUTCTR1, VSP_LO | VSSL_VVALID | HSP_HI | HSSL_HSYNC },
ENDMARKER,
};
Expand Down Expand Up @@ -519,20 +521,35 @@ static int tw9910_s_stream(struct v4l2_subdev *sd, int enable)
struct i2c_client *client = sd->priv;
struct tw9910_priv *priv = to_tw9910(client);

if (!enable)
return 0;
u8 val;

if (!priv->scale) {
dev_err(&client->dev, "norm select error\n");
return -EPERM;
}
if (!enable) {
switch (priv->revision) {
case 0:
val = OEN_TRI_SEL_ALL_OFF_r0;
break;
case 1:
val = OEN_TRI_SEL_ALL_OFF_r1;
break;
default:
dev_err(&client->dev, "un-supported revision\n");
return -EINVAL;
}
} else {
val = OEN_TRI_SEL_ALL_ON;

dev_dbg(&client->dev, "%s %dx%d\n",
priv->scale->name,
priv->scale->width,
priv->scale->height);
if (!priv->scale) {
dev_err(&client->dev, "norm select error\n");
return -EPERM;
}

return 0;
dev_dbg(&client->dev, "%s %dx%d\n",
priv->scale->name,
priv->scale->width,
priv->scale->height);
}

return tw9910_mask_set(client, OPFORM, OEN_TRI_SEL_MASK, val);
}

static int tw9910_set_bus_param(struct soc_camera_device *icd,
Expand Down

0 comments on commit ad3dd40

Please sign in to comment.