]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/chips/tsl2550.c
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-omap-h63xx.git] / drivers / i2c / chips / tsl2550.c
index 3de4b19ba08f3861876c41be08983ef0cc68d446..1a9cc135219f4a5ea613c8da9819676cf19da0f4 100644 (file)
@@ -364,7 +364,8 @@ static int tsl2550_init_client(struct i2c_client *client)
  */
 
 static struct i2c_driver tsl2550_driver;
-static int __devinit tsl2550_probe(struct i2c_client *client)
+static int __devinit tsl2550_probe(struct i2c_client *client,
+                                  const struct i2c_device_id *id)
 {
        struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
        struct tsl2550_data *data;
@@ -432,13 +433,41 @@ static int __devexit tsl2550_remove(struct i2c_client *client)
        return 0;
 }
 
+#ifdef CONFIG_PM
+
+static int tsl2550_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+       return tsl2550_set_power_state(client, 0);
+}
+
+static int tsl2550_resume(struct i2c_client *client)
+{
+       return tsl2550_set_power_state(client, 1);
+}
+
+#else
+
+#define tsl2550_suspend                NULL
+#define tsl2550_resume         NULL
+
+#endif /* CONFIG_PM */
+
+static const struct i2c_device_id tsl2550_id[] = {
+       { "tsl2550", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, tsl2550_id);
+
 static struct i2c_driver tsl2550_driver = {
        .driver = {
                .name   = TSL2550_DRV_NAME,
                .owner  = THIS_MODULE,
        },
+       .suspend = tsl2550_suspend,
+       .resume = tsl2550_resume,
        .probe  = tsl2550_probe,
        .remove = __devexit_p(tsl2550_remove),
+       .id_table = tsl2550_id,
 };
 
 static int __init tsl2550_init(void)