V4L/DVB (8818): gspca: Reinitialize the device on resume.
[safe/jmp/linux-2.6] / drivers / media / video / mt9m001.c
index 26cb276..554d229 100644 (file)
 #include <linux/slab.h>
 #include <linux/i2c.h>
 #include <linux/log2.h>
+#include <linux/gpio.h>
 
 #include <media/v4l2-common.h>
 #include <media/v4l2-chip-ident.h>
 #include <media/soc_camera.h>
 
-#ifdef CONFIG_MT9M001_PCA9536_SWITCH
-#include <asm/gpio.h>
-#endif
-
 /* mt9m001 i2c address 0x5d
  * The platform has to define i2c_board_info
  * and call i2c_register_board_info() */
@@ -123,7 +120,7 @@ static int mt9m001_init(struct soc_camera_device *icd)
        int ret;
 
        /* Disable chip, synchronous option update */
-       dev_dbg(icd->vdev->dev, "%s\n", __func__);
+       dev_dbg(icd->vdev->parent, "%s\n", __func__);
 
        ret = reg_write(icd, MT9M001_RESET, 1);
        if (ret >= 0)
@@ -372,7 +369,7 @@ static int mt9m001_set_register(struct soc_camera_device *icd,
 }
 #endif
 
-const struct v4l2_queryctrl mt9m001_controls[] = {
+static const struct v4l2_queryctrl mt9m001_controls[] = {
        {
                .id             = V4L2_CID_VFLIP,
                .type           = V4L2_CTRL_TYPE_BOOLEAN,
@@ -697,12 +694,19 @@ static int mt9m001_remove(struct i2c_client *client)
        return 0;
 }
 
+static const struct i2c_device_id mt9m001_id[] = {
+       { "mt9m001", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, mt9m001_id);
+
 static struct i2c_driver mt9m001_i2c_driver = {
        .driver = {
                .name = "mt9m001",
        },
        .probe          = mt9m001_probe,
        .remove         = mt9m001_remove,
+       .id_table       = mt9m001_id,
 };
 
 static int __init mt9m001_mod_init(void)