V4L/DVB (11076): au0828: make g_chip_ident call work properly
authorDevin Heitmueller <dheitmueller@linuxtv.org>
Wed, 11 Mar 2009 06:00:58 +0000 (03:00 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:26 +0000 (12:43 -0300)
Make the g_chip_ident call work for the au0828/au8522.  Discovered when testing
with the v4l2_compliance tool

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
[mchehab@redhat.com: fix merge conflict, due to a path change for analog demod]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/au8522_decoder.c
drivers/media/video/au0828/au0828-video.c
include/media/v4l2-chip-ident.h

index e2927c145cd80412004fe5c60a9d09ba7c71d6aa..564636389baeaeea7f41d6f6cf3fe28c5820e448 100644 (file)
@@ -636,6 +636,7 @@ static int au8522_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
                break;
        }
 
+       qc->type = 0;
        return -EINVAL;
 }
 
index 0dd138370b62a34afb7170164d1efc20c1b2a1c8..ce80882d45e2d7fd8ae2c0baa8976b6e97974c54 100644 (file)
@@ -1348,7 +1348,15 @@ static int vidioc_g_chip_ident(struct file *file, void *priv,
        chip->ident = V4L2_IDENT_NONE;
        chip->revision = 0;
 
+       if (v4l2_chip_match_host(&chip->match)) {
+               chip->ident = V4L2_IDENT_AU0828;
+               return 0;
+       }
+
        au0828_call_i2c_clients(dev, VIDIOC_DBG_G_CHIP_IDENT, chip);
+       if (chip->ident == V4L2_IDENT_NONE)
+               return -EINVAL;
+
        return 0;
 }
 
index 43684f105fd821a1b75bc2f984f0ed913cbbb651..ca2aa6d7e386c4a4bf3263f794ee95e4b2285c22 100644 (file)
@@ -70,6 +70,9 @@ enum {
        V4L2_IDENT_CX23416 = 416,
        V4L2_IDENT_CX23418 = 418,
 
+       /* module au0828 */
+       V4L2_IDENT_AU0828 = 828,
+
        /* module indycam: just ident 2000 */
        V4L2_IDENT_INDYCAM = 2000,