[media] adv7180: fix querystd() method for no input signal
authorVladimir Barinov <vladimir.barinov@cogentembedded.com>
Thu, 11 Apr 2013 21:06:46 +0000 (18:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 14 Apr 2013 23:05:05 +0000 (20:05 -0300)
When the input signal is not detected querystd() method should return
V4L2_STD_UNKNOWN instead of previously latched analog video standard.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/i2c/adv7180.c

index 34f39d3b3e3ee4e4bb75c445f273e74aff12ffd0..afd561ab190d50a09789b6adafa92c38bb8294a4 100644 (file)
@@ -135,6 +135,10 @@ struct adv7180_state {
 
 static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
 {
+       /* in case V4L2_IN_ST_NO_SIGNAL */
+       if (!(status1 & ADV7180_STATUS1_IN_LOCK))
+               return V4L2_STD_UNKNOWN;
+
        switch (status1 & ADV7180_STATUS1_AUTOD_MASK) {
        case ADV7180_STATUS1_AUTOD_NTSM_M_J:
                return V4L2_STD_NTSC;