diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2018-06-28 12:20:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-17 13:29:05 -0400 |
commit | 1bb086bc4d4a225f2af8b00e9082f25e6a7efdfa (patch) | |
tree | 99711c2505293cc79a1c09d75767ae6029eaa542 /drivers/media/i2c/tvp5150.c | |
parent | 1569586688a0a82713441bade3e831524da38109 (diff) | |
download | linux-1bb086bc4d4a225f2af8b00e9082f25e6a7efdfa.tar.bz2 |
media: tvp5150: split reset/enable routine
To trigger standard autodetection only the reset part of the routine
is necessary during probe(). Split this out to make it callable on its own.
[m.felsch@pengutronix.de: adapt commit message]
[m.felsch@pengutronix.de: add tvp5150_enable() to tvp5150_s_stream()]
[m.chehab@samsung.com: fix a compilation breakage]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/i2c/tvp5150.c')
-rw-r--r-- | drivers/media/i2c/tvp5150.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 82ecbbfd45f3..fa75b40aa89e 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -802,7 +802,6 @@ static v4l2_std_id tvp5150_read_std(struct v4l2_subdev *sd) static int tvp5150_reset(struct v4l2_subdev *sd, u32 val) { struct tvp5150 *decoder = to_tvp5150(sd); - v4l2_std_id std; /* Initializes TVP5150 to its default values */ tvp5150_write_inittab(sd, tvp5150_init_default); @@ -813,12 +812,20 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val) /* Selects decoder input */ tvp5150_selmux(sd); - /* Initializes TVP5150 to stream enabled values */ - tvp5150_write_inittab(sd, tvp5150_init_enable); - /* Initialize image preferences */ v4l2_ctrl_handler_setup(&decoder->hdl); + return 0; +} + +static int tvp5150_enable(struct v4l2_subdev *sd) +{ + struct tvp5150 *decoder = to_tvp5150(sd); + v4l2_std_id std; + + /* Initializes TVP5150 to stream enabled values */ + tvp5150_write_inittab(sd, tvp5150_init_enable); + if (decoder->norm == V4L2_STD_ALL) std = tvp5150_read_std(sd); else @@ -1105,6 +1112,8 @@ static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable) TVP5150_MISC_CTL_CLOCK_OE; if (enable) { + tvp5150_enable(sd); + /* * Enable the YCbCr and clock outputs. In discrete sync mode * (non-BT.656) additionally enable the the sync outputs. |