V4L/DVB (11414): gspca - m5602-mt9m111: Move v4l2 controls to main sensor file.
authorErik Andr?n <erik.andren@gmail.com>
Tue, 30 Dec 2008 20:06:55 +0000 (17:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 7 Apr 2009 00:44:40 +0000 (21:44 -0300)
Move over the v4l2 controls to the sensor specific source file.
Remove the now redundant sensor struct member.

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/m5602/m5602_mt9m111.c
drivers/media/video/gspca/m5602/m5602_mt9m111.h
drivers/media/video/gspca/m5602/m5602_ov9650.c
drivers/media/video/gspca/m5602/m5602_ov9650.h
drivers/media/video/gspca/m5602/m5602_po1030.c
drivers/media/video/gspca/m5602/m5602_po1030.h
drivers/media/video/gspca/m5602/m5602_s5k4aa.c
drivers/media/video/gspca/m5602/m5602_s5k4aa.h
drivers/media/video/gspca/m5602/m5602_s5k83a.c
drivers/media/video/gspca/m5602/m5602_s5k83a.h
drivers/media/video/gspca/m5602/m5602_sensor.h

index 5b57fb1eb4d0de7514dcfe5d4b915a20fd60173c..7d3f9e348ef4d5b6a576da145611da5d367e1c24 100644 (file)
@@ -31,6 +31,48 @@ static struct v4l2_pix_format mt9m111_modes[] = {
        }
 };
 
+const static struct ctrl mt9m111_ctrls[] = {
+       {
+               {
+                       .id             = V4L2_CID_VFLIP,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "vertical flip",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0
+               },
+               .set = mt9m111_set_vflip,
+               .get = mt9m111_get_vflip
+       }, {
+               {
+                       .id             = V4L2_CID_HFLIP,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "horizontal flip",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0
+               },
+               .set = mt9m111_set_hflip,
+               .get = mt9m111_get_hflip
+       }, {
+               {
+                       .id             = V4L2_CID_GAIN,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "gain",
+                       .minimum        = 0,
+                       .maximum        = (INITIAL_MAX_GAIN - 1) * 2 * 2 * 2,
+                       .step           = 1,
+                       .default_value  = DEFAULT_GAIN,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = mt9m111_set_gain,
+               .get = mt9m111_get_gain
+       }
+};
+
+
 static void mt9m111_dump_registers(struct sd *sd);
 
 int mt9m111_probe(struct sd *sd)
@@ -77,7 +119,7 @@ int mt9m111_probe(struct sd *sd)
 sensor_found:
        sd->gspca_dev.cam.cam_mode = mt9m111_modes;
        sd->gspca_dev.cam.nmodes = ARRAY_SIZE(mt9m111_modes);
-       sd->desc->ctrls = mt9m111.ctrls;
+       sd->desc->ctrls = mt9m111_ctrls;
        sd->desc->nctrls = ARRAY_SIZE(mt9m111_ctrls);
        return 0;
 }
index ff3809f28e41c9bc8abefb27b0783fe6ae21325b..cb04d8fefedaabc6e6737d27a6a7b4f4423afb15 100644 (file)
@@ -94,47 +94,6 @@ int mt9m111_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
 int mt9m111_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
 int mt9m111_set_gain(struct gspca_dev *gspca_dev, __s32 val);
 
-const static struct ctrl mt9m111_ctrls[] = {
-       {
-               {
-                       .id             = V4L2_CID_VFLIP,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "vertical flip",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0
-               },
-               .set = mt9m111_set_vflip,
-               .get = mt9m111_get_vflip
-       }, {
-               {
-                       .id             = V4L2_CID_HFLIP,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "horizontal flip",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0
-               },
-               .set = mt9m111_set_hflip,
-               .get = mt9m111_get_hflip
-       }, {
-               {
-                       .id             = V4L2_CID_GAIN,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "gain",
-                       .minimum        = 0,
-                       .maximum        = (INITIAL_MAX_GAIN - 1) * 2 * 2 * 2,
-                       .step           = 1,
-                       .default_value  = DEFAULT_GAIN,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = mt9m111_set_gain,
-               .get = mt9m111_get_gain
-       }
-};
-
 static struct m5602_sensor mt9m111 = {
        .name = "MT9M111",
 
index 130a29c7c532d7fe8549b198b0ceb4c80df5a4fd..d1ca2556769a2b2408b63783c65aede6abdb9d57 100644 (file)
@@ -68,6 +68,108 @@ static
        { }
 };
 
+const static struct ctrl ov9650_ctrls[] = {
+       {
+               {
+                       .id             = V4L2_CID_EXPOSURE,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "exposure",
+                       .minimum        = 0x00,
+                       .maximum        = 0xffff,
+                       .step           = 0x1,
+                       .default_value  = EXPOSURE_DEFAULT,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = ov9650_set_exposure,
+               .get = ov9650_get_exposure
+       }, {
+               {
+                       .id             = V4L2_CID_GAIN,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "gain",
+                       .minimum        = 0x00,
+                       .maximum        = 0x3ff,
+                       .step           = 0x1,
+                       .default_value  = GAIN_DEFAULT,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = ov9650_set_gain,
+               .get = ov9650_get_gain
+       }, {
+               {
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "red balance",
+                       .minimum        = 0x00,
+                       .maximum        = 0xff,
+                       .step           = 0x1,
+                       .default_value  = RED_GAIN_DEFAULT,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = ov9650_set_red_balance,
+               .get = ov9650_get_red_balance
+       }, {
+               {
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "blue balance",
+                       .minimum        = 0x00,
+                       .maximum        = 0xff,
+                       .step           = 0x1,
+                       .default_value  = BLUE_GAIN_DEFAULT,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = ov9650_set_blue_balance,
+               .get = ov9650_get_blue_balance
+       }, {
+               {
+                       .id             = V4L2_CID_HFLIP,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "horizontal flip",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0
+               },
+               .set = ov9650_set_hflip,
+               .get = ov9650_get_hflip
+       }, {
+               {
+                       .id             = V4L2_CID_VFLIP,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "vertical flip",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0
+               },
+               .set = ov9650_set_vflip,
+               .get = ov9650_get_vflip
+       }, {
+               {
+                       .id             = V4L2_CID_AUTO_WHITE_BALANCE,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "auto white balance",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0
+               },
+               .set = ov9650_set_auto_white_balance,
+               .get = ov9650_get_auto_white_balance
+       }, {
+               {
+                       .id             = V4L2_CID_AUTOGAIN,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "auto gain control",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0
+               },
+               .set = ov9650_set_auto_gain,
+               .get = ov9650_get_auto_gain
+       }
+};
+
 static struct v4l2_pix_format ov9650_modes[] = {
        {
                176,
@@ -154,12 +256,9 @@ int ov9650_probe(struct sd *sd)
        return -ENODEV;
 
 sensor_found:
-//     sd->gspca_dev.cam.cam_mode = ov9650.modes;
-//     sd->gspca_dev.cam.nmodes = ov9650.nmodes;
        sd->gspca_dev.cam.cam_mode = ov9650_modes;
        sd->gspca_dev.cam.nmodes = ARRAY_SIZE(ov9650_modes);
-
-       sd->desc->ctrls = ov9650.ctrls;
+       sd->desc->ctrls = ov9650_ctrls;
        sd->desc->nctrls = ARRAY_SIZE(ov9650_ctrls);
        return 0;
 }
index fb8fe56c4f102c3303d5fc2565fbee704b97087a..6bfe7a9c8414ec9b66d48217075c0d55a4f2e572 100644 (file)
@@ -156,108 +156,6 @@ int ov9650_set_auto_white_balance(struct gspca_dev *gspca_dev, __s32 val);
 int ov9650_get_auto_gain(struct gspca_dev *gspca_dev, __s32 *val);
 int ov9650_set_auto_gain(struct gspca_dev *gspca_dev, __s32 val);
 
-static struct ctrl ov9650_ctrls[] = {
-       {
-               {
-                       .id             = V4L2_CID_EXPOSURE,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "exposure",
-                       .minimum        = 0x00,
-                       .maximum        = 0xffff,
-                       .step           = 0x1,
-                       .default_value  = EXPOSURE_DEFAULT,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = ov9650_set_exposure,
-               .get = ov9650_get_exposure
-       }, {
-               {
-                       .id             = V4L2_CID_GAIN,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "gain",
-                       .minimum        = 0x00,
-                       .maximum        = 0x3ff,
-                       .step           = 0x1,
-                       .default_value  = GAIN_DEFAULT,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = ov9650_set_gain,
-               .get = ov9650_get_gain
-       }, {
-               {
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "red balance",
-                       .minimum        = 0x00,
-                       .maximum        = 0xff,
-                       .step           = 0x1,
-                       .default_value  = RED_GAIN_DEFAULT,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = ov9650_set_red_balance,
-               .get = ov9650_get_red_balance
-       }, {
-               {
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "blue balance",
-                       .minimum        = 0x00,
-                       .maximum        = 0xff,
-                       .step           = 0x1,
-                       .default_value  = BLUE_GAIN_DEFAULT,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = ov9650_set_blue_balance,
-               .get = ov9650_get_blue_balance
-       }, {
-               {
-                       .id             = V4L2_CID_HFLIP,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "horizontal flip",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0
-               },
-               .set = ov9650_set_hflip,
-               .get = ov9650_get_hflip
-       }, {
-               {
-                       .id             = V4L2_CID_VFLIP,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "vertical flip",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0
-               },
-               .set = ov9650_set_vflip,
-               .get = ov9650_get_vflip
-       }, {
-               {
-                       .id             = V4L2_CID_AUTO_WHITE_BALANCE,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "auto white balance",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0
-               },
-               .set = ov9650_set_auto_white_balance,
-               .get = ov9650_get_auto_white_balance
-       }, {
-               {
-                       .id             = V4L2_CID_AUTOGAIN,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "auto gain control",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0
-               },
-               .set = ov9650_set_auto_gain,
-               .get = ov9650_get_auto_gain
-       }
-};
-
 static struct m5602_sensor ov9650 = {
        .name = "OV9650",
        .i2c_slave_id = 0x60,
@@ -267,7 +165,6 @@ static struct m5602_sensor ov9650 = {
        .start = ov9650_start,
        .stop = ov9650_stop,
        .power_down = ov9650_power_down,
-       .ctrls = ov9650_ctrls
 };
 
 static const unsigned char preinit_ov9650[][3] =
index 716b359e7a90660828fc1f57004fa9c668885ff1..eaddf488bad1033d1bd7ed8f3f5190317919f925 100644 (file)
@@ -31,6 +31,86 @@ static struct v4l2_pix_format po1030_modes[] = {
        }
 };
 
+const static struct ctrl po1030_ctrls[] = {
+       {
+               {
+                       .id             = V4L2_CID_GAIN,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "gain",
+                       .minimum        = 0x00,
+                       .maximum        = 0x4f,
+                       .step           = 0x1,
+                       .default_value  = PO1030_GLOBAL_GAIN_DEFAULT,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = po1030_set_gain,
+               .get = po1030_get_gain
+       }, {
+               {
+                       .id             = V4L2_CID_EXPOSURE,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "exposure",
+                       .minimum        = 0x00,
+                       .maximum        = 0x02ff,
+                       .step           = 0x1,
+                       .default_value  = PO1030_EXPOSURE_DEFAULT,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = po1030_set_exposure,
+               .get = po1030_get_exposure
+       }, {
+               {
+                       .id             = V4L2_CID_RED_BALANCE,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "red balance",
+                       .minimum        = 0x00,
+                       .maximum        = 0xff,
+                       .step           = 0x1,
+                       .default_value  = PO1030_RED_GAIN_DEFAULT,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = po1030_set_red_balance,
+               .get = po1030_get_red_balance
+       }, {
+               {
+                       .id             = V4L2_CID_BLUE_BALANCE,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "blue balance",
+                       .minimum        = 0x00,
+                       .maximum        = 0xff,
+                       .step           = 0x1,
+                       .default_value  = PO1030_BLUE_GAIN_DEFAULT,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = po1030_set_blue_balance,
+               .get = po1030_get_blue_balance
+       }, {
+               {
+                       .id             = V4L2_CID_HFLIP,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "horizontal flip",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0,
+               },
+               .set = po1030_set_hflip,
+               .get = po1030_get_hflip
+       }, {
+               {
+                       .id             = V4L2_CID_VFLIP,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "vertical flip",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0,
+               },
+               .set = po1030_set_vflip,
+               .get = po1030_get_vflip
+       }
+};
+
 static void po1030_dump_registers(struct sd *sd);
 
 int po1030_probe(struct sd *sd)
@@ -74,7 +154,7 @@ int po1030_probe(struct sd *sd)
 sensor_found:
        sd->gspca_dev.cam.cam_mode = po1030_modes;
        sd->gspca_dev.cam.nmodes = ARRAY_SIZE(po1030_modes);
-       sd->desc->ctrls = po1030.ctrls;
+       sd->desc->ctrls = po1030_ctrls;
        sd->desc->nctrls = ARRAY_SIZE(po1030_ctrls);
        return 0;
 }
index b28ab2e85a546ab8a9ff556746998b44384e1fa4..e68ae88965a0a535796761d659babfa512abb28f 100644 (file)
@@ -141,86 +141,6 @@ int po1030_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
 int po1030_get_vflip(struct gspca_dev *gspca_dev, __s32 *val);
 int po1030_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
 
-static struct ctrl po1030_ctrls[] = {
-       {
-               {
-                       .id             = V4L2_CID_GAIN,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "gain",
-                       .minimum        = 0x00,
-                       .maximum        = 0x4f,
-                       .step           = 0x1,
-                       .default_value  = PO1030_GLOBAL_GAIN_DEFAULT,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = po1030_set_gain,
-               .get = po1030_get_gain
-       }, {
-               {
-                       .id             = V4L2_CID_EXPOSURE,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "exposure",
-                       .minimum        = 0x00,
-                       .maximum        = 0x02ff,
-                       .step           = 0x1,
-                       .default_value  = PO1030_EXPOSURE_DEFAULT,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = po1030_set_exposure,
-               .get = po1030_get_exposure
-       }, {
-               {
-                       .id             = V4L2_CID_RED_BALANCE,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "red balance",
-                       .minimum        = 0x00,
-                       .maximum        = 0xff,
-                       .step           = 0x1,
-                       .default_value  = PO1030_RED_GAIN_DEFAULT,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = po1030_set_red_balance,
-               .get = po1030_get_red_balance
-       }, {
-               {
-                       .id             = V4L2_CID_BLUE_BALANCE,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "blue balance",
-                       .minimum        = 0x00,
-                       .maximum        = 0xff,
-                       .step           = 0x1,
-                       .default_value  = PO1030_BLUE_GAIN_DEFAULT,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = po1030_set_blue_balance,
-               .get = po1030_get_blue_balance
-       }, {
-               {
-                       .id             = V4L2_CID_HFLIP,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "horizontal flip",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0,
-               },
-               .set = po1030_set_hflip,
-               .get = po1030_get_hflip
-       }, {
-               {
-                       .id             = V4L2_CID_VFLIP,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "vertical flip",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0,
-               },
-               .set = po1030_set_vflip,
-               .get = po1030_get_vflip
-       }
-};
-
 static struct m5602_sensor po1030 = {
        .name = "PO1030",
 
@@ -230,8 +150,6 @@ static struct m5602_sensor po1030 = {
        .probe = po1030_probe,
        .init = po1030_init,
        .power_down = po1030_power_down,
-
-       .ctrls = po1030_ctrls,
 };
 
 static const unsigned char preinit_po1030[][3] =
index 40ef9ae764827ff1973f78591799ff75e3d520d8..4306d596056db72a66587a8da4ad25a22b35d46a 100644 (file)
@@ -64,6 +64,62 @@ static struct v4l2_pix_format s5k4aa_modes[] = {
        }
 };
 
+const static struct ctrl s5k4aa_ctrls[] = {
+       {
+               {
+                       .id             = V4L2_CID_VFLIP,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "vertical flip",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0
+               },
+               .set = s5k4aa_set_vflip,
+               .get = s5k4aa_get_vflip
+
+       }, {
+               {
+                       .id             = V4L2_CID_HFLIP,
+                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name           = "horizontal flip",
+                       .minimum        = 0,
+                       .maximum        = 1,
+                       .step           = 1,
+                       .default_value  = 0
+               },
+               .set = s5k4aa_set_hflip,
+               .get = s5k4aa_get_hflip
+
+       }, {
+               {
+                       .id             = V4L2_CID_GAIN,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "Gain",
+                       .minimum        = 0,
+                       .maximum        = 127,
+                       .step           = 1,
+                       .default_value  = 0xa0,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = s5k4aa_set_gain,
+               .get = s5k4aa_get_gain
+       }, {
+               {
+                       .id             = V4L2_CID_EXPOSURE,
+                       .type           = V4L2_CTRL_TYPE_INTEGER,
+                       .name           = "Exposure",
+                       .minimum        = 13,
+                       .maximum        = 0xfff,
+                       .step           = 1,
+                       .default_value  = 0x100,
+                       .flags          = V4L2_CTRL_FLAG_SLIDER
+               },
+               .set = s5k4aa_set_exposure,
+               .get = s5k4aa_get_exposure
+       }
+};
+
 static void s5k4aa_dump_registers(struct sd *sd);
 
 int s5k4aa_probe(struct sd *sd)
@@ -131,7 +187,7 @@ int s5k4aa_probe(struct sd *sd)
 sensor_found:
        sd->gspca_dev.cam.cam_mode = s5k4aa_modes;
        sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k4aa_modes);
-       sd->desc->ctrls = s5k4aa.ctrls;
+       sd->desc->ctrls = s5k4aa_ctrls;
        sd->desc->nctrls = ARRAY_SIZE(s5k4aa_ctrls);
        return 0;
 }
index 0f0c6dff1eef215294144f16c76a4ec80c1e733e..ec96c8e052a863f1e082a20d8987369a032bdb34 100644 (file)
@@ -77,61 +77,6 @@ int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
 int s5k4aa_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
 int s5k4aa_set_gain(struct gspca_dev *gspca_dev, __s32 val);
 
-static struct ctrl s5k4aa_ctrls[] = {
-       {
-               {
-                       .id             = V4L2_CID_VFLIP,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "vertical flip",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0
-               },
-               .set = s5k4aa_set_vflip,
-               .get = s5k4aa_get_vflip
-
-       }, {
-               {
-                       .id             = V4L2_CID_HFLIP,
-                       .type           = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name           = "horizontal flip",
-                       .minimum        = 0,
-                       .maximum        = 1,
-                       .step           = 1,
-                       .default_value  = 0
-               },
-               .set = s5k4aa_set_hflip,
-               .get = s5k4aa_get_hflip
-
-       }, {
-               {
-                       .id             = V4L2_CID_GAIN,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "Gain",
-                       .minimum        = 0,
-                       .maximum        = 127,
-                       .step           = 1,
-                       .default_value  = 0xa0,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = s5k4aa_set_gain,
-               .get = s5k4aa_get_gain
-       }, {
-               {
-                       .id             = V4L2_CID_EXPOSURE,
-                       .type           = V4L2_CTRL_TYPE_INTEGER,
-                       .name           = "Exposure",
-                       .minimum        = 13,
-                       .maximum        = 0xfff,
-                       .step           = 1,
-                       .default_value  = 0x100,
-                       .flags          = V4L2_CTRL_FLAG_SLIDER
-               },
-               .set = s5k4aa_set_exposure,
-               .get = s5k4aa_get_exposure
-       }
-};
 
 static struct m5602_sensor s5k4aa = {
        .name = "S5K4AA",
@@ -141,7 +86,6 @@ static struct m5602_sensor s5k4aa = {
        .power_down = s5k4aa_power_down,
        .i2c_slave_id = 0x5a,
        .i2c_regW = 2,
-       .ctrls = s5k4aa_ctrls,
 };
 
 static const unsigned char preinit_s5k4aa[][4] =
index fcc8c3752c75de2a5792413787833836ab4db6bc..42c86aa4dc8d073ca9931a6b256101f0dbcc85c8 100644 (file)
@@ -32,6 +32,74 @@ static struct v4l2_pix_format s5k83a_modes[] = {
        }
 };
 
+const static struct ctrl s5k83a_ctrls[] = {
+       {
+               {
+                       .id = V4L2_CID_BRIGHTNESS,
+                       .type = V4L2_CTRL_TYPE_INTEGER,
+                       .name = "brightness",
+                       .minimum = 0x00,
+                       .maximum = 0xff,
+                       .step = 0x01,
+                       .default_value = S5K83A_DEFAULT_BRIGHTNESS,
+                       .flags = V4L2_CTRL_FLAG_SLIDER
+               },
+                       .set = s5k83a_set_brightness,
+                       .get = s5k83a_get_brightness
+
+       }, {
+               {
+                       .id = V4L2_CID_WHITENESS,
+                       .type = V4L2_CTRL_TYPE_INTEGER,
+                       .name = "whiteness",
+                       .minimum = 0x00,
+                       .maximum = 0xff,
+                       .step = 0x01,
+                       .default_value = S5K83A_DEFAULT_WHITENESS,
+                       .flags = V4L2_CTRL_FLAG_SLIDER
+               },
+                       .set = s5k83a_set_whiteness,
+                       .get = s5k83a_get_whiteness,
+       }, {
+               {
+                       .id = V4L2_CID_GAIN,
+                       .type = V4L2_CTRL_TYPE_INTEGER,
+                       .name = "gain",
+                       .minimum = 0x00,
+                       .maximum = S5K83A_MAXIMUM_GAIN,
+                       .step = 0x01,
+                       .default_value = S5K83A_DEFAULT_GAIN,
+                       .flags = V4L2_CTRL_FLAG_SLIDER
+               },
+                       .set = s5k83a_set_gain,
+                       .get = s5k83a_get_gain
+       }, {
+               {
+                       .id         = V4L2_CID_HFLIP,
+                       .type       = V4L2_CTRL_TYPE_BOOLEAN,
+                       .name       = "horizontal flip",
+                       .minimum    = 0,
+                       .maximum    = 1,
+                       .step       = 1,
+                       .default_value  = 0
+               },
+                       .set = s5k83a_set_hflip,
+                       .get = s5k83a_get_hflip
+       }, {
+               {
+                .id         = V4L2_CID_VFLIP,
+               .type       = V4L2_CTRL_TYPE_BOOLEAN,
+               .name       = "vertical flip",
+               .minimum    = 0,
+               .maximum    = 1,
+               .step       = 1,
+               .default_value  = 0
+               },
+               .set = s5k83a_set_vflip,
+               .get = s5k83a_get_vflip
+       }
+};
+
 static void s5k83a_dump_registers(struct sd *sd);
 
 int s5k83a_probe(struct sd *sd)
@@ -79,7 +147,7 @@ int s5k83a_probe(struct sd *sd)
 sensor_found:
        sd->gspca_dev.cam.cam_mode = s5k83a_modes;
        sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k83a_modes);
-       sd->desc->ctrls = s5k83a.ctrls;
+       sd->desc->ctrls = s5k83a_ctrls;
        sd->desc->nctrls = ARRAY_SIZE(s5k83a_ctrls);
        return 0;
 }
index d56eb4c5ee312003fc9822c74ecb33835424f32e..9b9450fbd3dc66d664ef3aa0b3b7666646cb63a8 100644 (file)
@@ -61,74 +61,6 @@ int s5k83a_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
 int s5k83a_get_hflip(struct gspca_dev *gspca_dev, __s32 *val);
 int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
 
-static struct ctrl s5k83a_ctrls[] = {
-       {
-               {
-                       .id = V4L2_CID_BRIGHTNESS,
-                       .type = V4L2_CTRL_TYPE_INTEGER,
-                       .name = "brightness",
-                       .minimum = 0x00,
-                       .maximum = 0xff,
-                       .step = 0x01,
-                       .default_value = S5K83A_DEFAULT_BRIGHTNESS,
-                       .flags = V4L2_CTRL_FLAG_SLIDER
-               },
-                       .set = s5k83a_set_brightness,
-                       .get = s5k83a_get_brightness
-
-       }, {
-               {
-                       .id = V4L2_CID_WHITENESS,
-                       .type = V4L2_CTRL_TYPE_INTEGER,
-                       .name = "whiteness",
-                       .minimum = 0x00,
-                       .maximum = 0xff,
-                       .step = 0x01,
-                       .default_value = S5K83A_DEFAULT_WHITENESS,
-                       .flags = V4L2_CTRL_FLAG_SLIDER
-               },
-                       .set = s5k83a_set_whiteness,
-                       .get = s5k83a_get_whiteness,
-       }, {
-               {
-                       .id = V4L2_CID_GAIN,
-                       .type = V4L2_CTRL_TYPE_INTEGER,
-                       .name = "gain",
-                       .minimum = 0x00,
-                       .maximum = S5K83A_MAXIMUM_GAIN,
-                       .step = 0x01,
-                       .default_value = S5K83A_DEFAULT_GAIN,
-                       .flags = V4L2_CTRL_FLAG_SLIDER
-               },
-                       .set = s5k83a_set_gain,
-                       .get = s5k83a_get_gain
-       }, {
-               {
-                       .id         = V4L2_CID_HFLIP,
-                       .type       = V4L2_CTRL_TYPE_BOOLEAN,
-                       .name       = "horizontal flip",
-                       .minimum    = 0,
-                       .maximum    = 1,
-                       .step       = 1,
-                       .default_value  = 0
-               },
-                       .set = s5k83a_set_hflip,
-                       .get = s5k83a_get_hflip
-       }, {
-               {
-                .id         = V4L2_CID_VFLIP,
-               .type       = V4L2_CTRL_TYPE_BOOLEAN,
-               .name       = "vertical flip",
-               .minimum    = 0,
-               .maximum    = 1,
-               .step       = 1,
-               .default_value  = 0
-               },
-               .set = s5k83a_set_vflip,
-               .get = s5k83a_get_vflip
-       }
-};
-
 static struct m5602_sensor s5k83a = {
        .name = "S5K83A",
        .probe = s5k83a_probe,
@@ -138,7 +70,6 @@ static struct m5602_sensor s5k83a = {
        .power_down = s5k83a_power_down,
        .i2c_slave_id = 0x5a,
        .i2c_regW = 2,
-       .ctrls = s5k83a_ctrls,
 };
 
 static const unsigned char preinit_s5k83a[][4] =
index 3fd92d370d0a788285c78abf88c49c061e8460d0..b3e82af650662ef8a59722cbc155ee4780ca0161 100644 (file)
@@ -64,8 +64,6 @@ struct m5602_sensor {
 
        /* Performs a power down sequence */
        int (*power_down)(struct sd *sd);
-
-       const struct ctrl *ctrls;
 };
 
 #endif