misc: max9635: Remove early suspend/resume handlers
authorRebecca Schultz Zavin <rebecca@android.com>
Wed, 25 Aug 2010 20:55:03 +0000 (13:55 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:47 +0000 (16:33 -0700)
Allow userspace to set policy on sensor enable/disable

Change-Id: I901edeaf6ab3bddb79220c4ba7248b8873e6338e
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
drivers/misc/max9635.c

index 1827a0378ef6b620d1e11c8578b6a4a10f677824..c58f4f02f6226c2a896b62e61cea114640c6aafb 100644 (file)
@@ -17,7 +17,6 @@
  */
 
 #include <linux/delay.h>
-#include <linux/earlysuspend.h>
 #include <linux/i2c.h>
 #include <linux/irq.h>
 #include <linux/input.h>
@@ -58,7 +57,6 @@ struct max9635_data {
        struct i2c_client *client;
        struct delayed_work working_queue;
        struct max9635_platform_data *als_pdata;
-       struct early_suspend early_suspend;
        struct max9635_zone_conv max9635_zone_info[255];
        atomic_t enabled;
        int irq;
@@ -82,11 +80,6 @@ struct max9635_reg {
 };
 #endif
 
-#ifdef CONFIG_HAS_EARLYSUSPEND
-static void max9635_early_suspend(struct early_suspend *handler);
-static void max9635_late_resume(struct early_suspend *handler);
-#endif
-
 static uint32_t max9635_debug = 0x00;
 module_param_named(als_debug, max9635_debug, uint, 0664);
 
@@ -580,13 +573,6 @@ static int max9635_probe(struct i2c_client *client,
                goto err_create_registers_file_failed;
        }
 #endif
-
-#ifdef CONFIG_HAS_EARLYSUSPEND
-       als_data->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;
-       als_data->early_suspend.suspend = max9635_early_suspend;
-       als_data->early_suspend.resume = max9635_late_resume;
-       register_early_suspend(&als_data->early_suspend);
-#endif
        disable_irq_nosync(als_data->client->irq);
        schedule_delayed_work(&als_data->working_queue, 0);
 
@@ -655,24 +641,6 @@ static int max9635_resume(struct i2c_client *client)
        return 0;
 }
 
-#ifdef CONFIG_HAS_EARLYSUSPEND
-static void max9635_early_suspend(struct early_suspend *handler)
-{
-       struct max9635_data *als_data;
-
-       als_data = container_of(handler, struct max9635_data, early_suspend);
-       max9635_suspend(als_data->client, PMSG_SUSPEND);
-}
-
-static void max9635_late_resume(struct early_suspend *handler)
-{
-       struct max9635_data *als_data;
-
-       als_data = container_of(handler, struct max9635_data, early_suspend);
-       max9635_resume(als_data->client);
-}
-#endif
-
 static const struct i2c_device_id max9635_id[] = {
        {MAX9635_NAME, 0},
        {}
@@ -681,10 +649,8 @@ static const struct i2c_device_id max9635_id[] = {
 static struct i2c_driver max9635_i2c_driver = {
        .probe = max9635_probe,
        .remove = max9635_remove,
-#ifndef CONFIG_HAS_EARLYSUSPEND
        .suspend = max9635_suspend,
        .resume = max9635_resume,
-#endif
        .id_table = max9635_id,
        .driver = {
           .name = MAX9635_NAME,