From: Austin, Zhang Date: Mon, 28 May 2012 10:57:53 +0000 (+0800) Subject: make ms5607 driver use tranditional pm path if no-android pm X-Git-Tag: 2.1b_release~104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe56c8abefc0d87b3bfe87476ddd5155b1ebd67f;p=kernel%2Fkernel-mfld-blackbay.git make ms5607 driver use tranditional pm path if no-android pm Signed-off-by: Austin Zhang --- diff --git a/drivers/hwmon/ms5607.c b/drivers/hwmon/ms5607.c index ce4e5df..1297cd3 100644 --- a/drivers/hwmon/ms5607.c +++ b/drivers/hwmon/ms5607.c @@ -55,7 +55,9 @@ struct ms5607_data { struct workqueue_struct *workqueue; struct input_dev *input_dev; +#ifdef CONFIG_HAS_EARLYSUSPEND struct early_suspend es; +#endif int enabled; bool powered; @@ -362,21 +364,31 @@ static void ms5607_early_suspend(struct early_suspend *h) { struct ms5607_data *ms5607 = container_of(h, struct ms5607_data, es); +#else +static void ms5607_first_suspend(struct device *dev) +{ + struct ms5607_data *ms5607 = dev_get_drvdata(dev); +#endif mutex_lock(&ms5607->lock); if (ms5607->enabled) ms5607_disable(ms5607); mutex_unlock(&ms5607->lock); } + +#ifdef CONFIG_HAS_EARLYSUSPEND static void ms5607_late_resume(struct early_suspend *h) { struct ms5607_data *ms5607 = container_of(h, struct ms5607_data, es); - +#else +static void ms5607_last_resume(struct device *dev) +{ + struct ms5607_data *ms5607 = dev_get_drvdata(dev); +#endif mutex_lock(&ms5607->lock); if (ms5607->enabled) ms5607_enable(ms5607); mutex_unlock(&ms5607->lock); } -#endif static int __devinit ms5607_probe(struct i2c_client *client, const struct i2c_device_id *id) @@ -502,11 +514,17 @@ static int __devexit ms5607_remove(struct i2c_client *client) #ifdef CONFIG_PM static int ms5607_resume(struct device *dev) { +#ifndef CONFIG_HAS_EARLYSUSPEND + ms5607_last_resume(dev); +#endif return 0; } static int ms5607_suspend(struct device *dev) { +#ifndef CONFIG_HAS_EARLYSUSPEND + ms5607_first_suspend(dev); +#endif return 0; }