Skip to content

Commit 70da92e

Browse files
Kuninori MorimotoMauro Carvalho Chehab
authored andcommitted
V4L/DVB (13669): tw9910: Add sync polarity support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent c1d7b06 commit 70da92e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎drivers/media/video/tw9910.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,21 @@ static int tw9910_set_bus_param(struct soc_camera_device *icd,
512512
{
513513
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
514514
struct i2c_client *client = sd->priv;
515+
u8 val = VSSL_VVALID | HSSL_DVALID;
515516

516517
/*
517518
* set OUTCTR1
519+
*
520+
* We use VVALID and DVALID signals to control VSYNC and HSYNC
521+
* outputs, in this mode their polarity is inverted.
518522
*/
519-
return i2c_smbus_write_byte_data(client, OUTCTR1,
520-
VSSL_VVALID | HSSL_DVALID);
523+
if (flags & SOCAM_HSYNC_ACTIVE_LOW)
524+
val |= HSP_HI;
525+
526+
if (flags & SOCAM_VSYNC_ACTIVE_LOW)
527+
val |= VSP_HI;
528+
529+
return i2c_smbus_write_byte_data(client, OUTCTR1, val);
521530
}
522531

523532
static unsigned long tw9910_query_bus_param(struct soc_camera_device *icd)
@@ -527,6 +536,7 @@ static unsigned long tw9910_query_bus_param(struct soc_camera_device *icd)
527536
struct soc_camera_link *icl = to_soc_camera_link(icd);
528537
unsigned long flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_MASTER |
529538
SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_HIGH |
539+
SOCAM_VSYNC_ACTIVE_LOW | SOCAM_HSYNC_ACTIVE_LOW |
530540
SOCAM_DATA_ACTIVE_HIGH | priv->info->buswidth;
531541

532542
return soc_camera_apply_sensor_flags(icl, flags);

0 commit comments

Comments
 (0)