Skip to content

Commit 78de920

Browse files
dheitmuellergregkh
authored andcommitted
cx88: Fix regression in initial video standard setting
commit 4e0973a upstream. Setting initial standard at the top of cx8800_initdev would cause the first call to cx88_set_tvnorm() to return without programming any registers (leaving the driver saying it's set to NTSC but the hardware isn't programmed). Even worse, any subsequent attempt to explicitly set it to NTSC-M will return success but actually fail to program the underlying registers unless first changing the standard to something other than NTSC-M. Set the initial standard later in the process, and make sure the field is zero at the beginning to ensure that the call always goes through. This regression was introduced in the following commit: commit ccd6f1d ("[media] cx88: move width, height and field to core struct") Author: Hans Verkuil <[email protected]> [media] cx88: move width, height and field to core struct Signed-off-by: Devin Heitmueller <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5c7c179 commit 78de920

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

drivers/media/pci/cx88/cx88-cards.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3691,7 +3691,14 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
36913691
core->nr = nr;
36923692
sprintf(core->name, "cx88[%d]", core->nr);
36933693

3694-
core->tvnorm = V4L2_STD_NTSC_M;
3694+
/*
3695+
* Note: Setting initial standard here would cause first call to
3696+
* cx88_set_tvnorm() to return without programming any registers. Leave
3697+
* it blank for at this point and it will get set later in
3698+
* cx8800_initdev()
3699+
*/
3700+
core->tvnorm = 0;
3701+
36953702
core->width = 320;
36963703
core->height = 240;
36973704
core->field = V4L2_FIELD_INTERLACED;

drivers/media/pci/cx88/cx88-video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
14291429

14301430
/* initial device configuration */
14311431
mutex_lock(&core->lock);
1432-
cx88_set_tvnorm(core, core->tvnorm);
1432+
cx88_set_tvnorm(core, V4L2_STD_NTSC_M);
14331433
v4l2_ctrl_handler_setup(&core->video_hdl);
14341434
v4l2_ctrl_handler_setup(&core->audio_hdl);
14351435
cx88_video_mux(core, 0);

0 commit comments

Comments
 (0)