diff options
author | Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com> | 2011-01-19 18:57:46 +0530 |
---|---|---|
committer | Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> | 2011-01-20 12:10:57 +0100 |
commit | 8411d372a8db49f6b576b19f510bf008c4d80330 (patch) | |
tree | 8d611f0b2d418eb692d9ed5ca8bc953d4eaf3159 /drivers/input | |
parent | f886346dfa990e956824110184e31e1963df76a9 (diff) |
[ANDROID]:bu21013: Disable vaux1 regulator during backlight off
Disable the BU21013 touch screen vaux1 regulator during
backlight off by implementing the early suspend.
ST-Ericsson Id: ER 318551
Change-Id: I8aea7beb8e17ad1d335904752824030973d5ec07
Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/12972
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/bu21013_ts.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index 109fe386e93..aa22a5b4805 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c @@ -5,6 +5,7 @@ */ #include <linux/kernel.h> +#include <linux/earlysuspend.h> #include <linux/delay.h> #include <linux/interrupt.h> #include <linux/i2c.h> @@ -148,6 +149,7 @@ * @factor_x: x scale factor * @factor_y: y scale factor * @tpclk: pointer to clock structure + * @early_suspend: early_suspend structure variable * * Touch panel device data structure */ @@ -165,10 +167,16 @@ struct bu21013_ts_data { unsigned int factor_x; unsigned int factor_y; struct clk *tpclk; + struct early_suspend early_suspend; }; static int bu21013_init_chip(struct bu21013_ts_data *data, bool on_ext_clk); +#ifdef CONFIG_HAS_EARLYSUSPEND +static void bu21013_ts_early_suspend(struct early_suspend *data); +static void bu21013_ts_late_resume(struct early_suspend *data); +#endif + /** * bu21013_ext_clk() - enable/disable the external clock * @pdata: touch screen data @@ -738,6 +746,13 @@ static int __devinit bu21013_probe(struct i2c_client *client, goto err_sysfs_create; } +#ifdef CONFIG_HAS_EARLYSUSPEND + bu21013_data->early_suspend.level = + EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1; + bu21013_data->early_suspend.suspend = bu21013_ts_early_suspend; + bu21013_data->early_suspend.resume = bu21013_ts_late_resume; + register_early_suspend(&bu21013_data->early_suspend); +#endif return retval; err_sysfs_create: @@ -800,7 +815,7 @@ static int __devexit bu21013_remove(struct i2c_client *client) return 0; } -#ifdef CONFIG_PM +#if !defined(CONFIG_HAS_EARLYSUSPEND) && defined(CONFIG_PM) /** * bu21013_suspend() - suspend the touch screen controller * @dev: pointer to device structure @@ -835,6 +850,26 @@ static const struct dev_pm_ops bu21013_dev_pm_ops = { .suspend = bu21013_suspend, .resume = bu21013_resume, }; + +#else +static void bu21013_ts_early_suspend(struct early_suspend *data) +{ + struct bu21013_ts_data *bu21013_data = + container_of(data, struct bu21013_ts_data, early_suspend); + bu21013_disable(bu21013_data); +} + +static void bu21013_ts_late_resume(struct early_suspend *data) +{ + struct bu21013_ts_data *bu21013_data = + container_of(data, struct bu21013_ts_data, early_suspend); + struct i2c_client *client = bu21013_data->client; + int retval; + + retval = bu21013_enable(bu21013_data); + if (retval < 0) + dev_err(&client->dev, "bu21013 enable failed\n"); +} #endif static const struct i2c_device_id bu21013_id[] = { @@ -847,7 +882,7 @@ static struct i2c_driver bu21013_driver = { .driver = { .name = DRIVER_TP, .owner = THIS_MODULE, -#ifdef CONFIG_PM +#if !defined(CONFIG_HAS_EARLYSUSPEND) && defined(CONFIG_PM) .pm = &bu21013_dev_pm_ops, #endif }, |