Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273672
b: refs/heads/master
c: 5476ea8
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Nov 3, 2011
1 parent 2e537c3 commit d056ad4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 51 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: 1067247f56c5a9325332148c0dea42a2aa7e718f
refs/heads/master: 5476ea8d67b9e2b258c1c9ce6620e69bf13ecf0f
53 changes: 3 additions & 50 deletions trunk/drivers/media/video/tw9910.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ static const struct tw9910_scale_ctrl *tw9910_select_norm(struct soc_camera_devi
}

/*
* soc_camera_ops function
* subdevice operations
*/
static int tw9910_s_stream(struct v4l2_subdev *sd, int enable)
{
Expand Down Expand Up @@ -495,44 +495,6 @@ static int tw9910_s_stream(struct v4l2_subdev *sd, int enable)
return tw9910_power(client, enable);
}

static int tw9910_set_bus_param(struct soc_camera_device *icd,
unsigned long flags)
{
struct soc_camera_link *icl = to_soc_camera_link(icd);
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
struct i2c_client *client = v4l2_get_subdevdata(sd);
u8 val = VSSL_VVALID | HSSL_DVALID;

flags = soc_camera_apply_sensor_flags(icl, flags);

/*
* set OUTCTR1
*
* We use VVALID and DVALID signals to control VSYNC and HSYNC
* outputs, in this mode their polarity is inverted.
*/
if (flags & SOCAM_HSYNC_ACTIVE_LOW)
val |= HSP_HI;

if (flags & SOCAM_VSYNC_ACTIVE_LOW)
val |= VSP_HI;

return i2c_smbus_write_byte_data(client, OUTCTR1, val);
}

static unsigned long tw9910_query_bus_param(struct soc_camera_device *icd)
{
struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
struct tw9910_priv *priv = to_tw9910(client);
struct soc_camera_link *icl = to_soc_camera_link(icd);
unsigned long flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_MASTER |
SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_HIGH |
SOCAM_VSYNC_ACTIVE_LOW | SOCAM_HSYNC_ACTIVE_LOW |
SOCAM_DATA_ACTIVE_HIGH | priv->info->buswidth;

return soc_camera_apply_sensor_flags(icl, flags);
}

static int tw9910_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
{
int ret = -EINVAL;
Expand Down Expand Up @@ -840,11 +802,6 @@ static int tw9910_video_probe(struct soc_camera_device *icd,
return 0;
}

static struct soc_camera_ops tw9910_ops = {
.set_bus_param = tw9910_set_bus_param,
.query_bus_param = tw9910_query_bus_param,
};

static struct v4l2_subdev_core_ops tw9910_subdev_core_ops = {
.g_chip_ident = tw9910_g_chip_ident,
.s_std = tw9910_s_std,
Expand Down Expand Up @@ -964,24 +921,20 @@ static int tw9910_probe(struct i2c_client *client,

v4l2_i2c_subdev_init(&priv->subdev, client, &tw9910_subdev_ops);

icd->ops = &tw9910_ops;
icd->ops = NULL;
icd->iface = icl->bus_id;

ret = tw9910_video_probe(icd, client);
if (ret) {
icd->ops = NULL;
if (ret)
kfree(priv);
}

return ret;
}

static int tw9910_remove(struct i2c_client *client)
{
struct tw9910_priv *priv = to_tw9910(client);
struct soc_camera_device *icd = client->dev.platform_data;

icd->ops = NULL;
kfree(priv);
return 0;
}
Expand Down

0 comments on commit d056ad4

Please sign in to comment.