[i2c] [PATCH] TSL2550: power management added.
Jean Delvare
khali at linux-fr.org
Fri Oct 26 22:50:56 CEST 2007
Hi Rodolfo,
On Fri, 26 Oct 2007 12:43:04 +0200, Rodolfo Giometti wrote:
> Signed-off-by: Rodolfo Giometti <giometti at linux.it>
> ---
> drivers/i2c/chips/tsl2550.c | 21 +++++++++++++++++++++
> 1 files changed, 21 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
> index 3de4b19..ba1b7b7 100644
> --- a/drivers/i2c/chips/tsl2550.c
> +++ b/drivers/i2c/chips/tsl2550.c
> @@ -432,11 +432,32 @@ 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)
> +{
> + tsl2550_set_power_state(client, 0);
> +}
> +
> +static int tsl2550_resume(struct i2c_client *client)
> +{
> + tsl2550_set_power_state(client, 1);
> +}
> +
> +#else
> +
> +#define tsl2550_suspend NULL
> +#define tsl2550_resume NULL
> +
> +#endif /* CONFIG_PM */
> +
> 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),
> };
CC [M] drivers/i2c/chips/tsl2550.o
drivers/i2c/chips/tsl2550.c: In function ‘tsl2550_resume’:
drivers/i2c/chips/tsl2550.c:445: warning: control reaches end of non-void function
drivers/i2c/chips/tsl2550.c: In function ‘tsl2550_suspend’:
drivers/i2c/chips/tsl2550.c:440: warning: control reaches end of non-void function
--
Jean Delvare
More information about the i2c
mailing list