From 0d0f6bbd64d3dd82c50c9a4d91c200b791d8c029 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 28 Aug 2006 14:42:24 +0200 Subject: [PATCH] --- yaml --- r: 36729 b: refs/heads/master c: 360b9ab220aedaf346380fc2344729d9acc3b075 h: refs/heads/master i: 36727: 3ebff3bc142733c43627b5fb0fc514347dddb54c v: v3 --- [refs] | 2 +- trunk/drivers/hwmon/abituguru.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index db8014b19df1..279d3f207ebd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b17ebc9402040959690b5a2c4e1cfb1e6d4fb206 +refs/heads/master: 360b9ab220aedaf346380fc2344729d9acc3b075 diff --git a/trunk/drivers/hwmon/abituguru.c b/trunk/drivers/hwmon/abituguru.c index 35ad1b032726..e5cb0fdab9b1 100644 --- a/trunk/drivers/hwmon/abituguru.c +++ b/trunk/drivers/hwmon/abituguru.c @@ -1354,13 +1354,39 @@ static struct abituguru_data *abituguru_update_device(struct device *dev) return NULL; } +#ifdef CONFIG_PM +static int abituguru_suspend(struct platform_device *pdev, pm_message_t state) +{ + struct abituguru_data *data = platform_get_drvdata(pdev); + /* make sure all communications with the uguru are done and no new + ones are started */ + mutex_lock(&data->update_lock); + return 0; +} + +static int abituguru_resume(struct platform_device *pdev) +{ + struct abituguru_data *data = platform_get_drvdata(pdev); + /* See if the uGuru is still ready */ + if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT) + data->uguru_ready = 0; + mutex_unlock(&data->update_lock); + return 0; +} +#else +#define abituguru_suspend NULL +#define abituguru_resume NULL +#endif /* CONFIG_PM */ + static struct platform_driver abituguru_driver = { .driver = { .owner = THIS_MODULE, .name = ABIT_UGURU_NAME, }, - .probe = abituguru_probe, - .remove = __devexit_p(abituguru_remove), + .probe = abituguru_probe, + .remove = __devexit_p(abituguru_remove), + .suspend = abituguru_suspend, + .resume = abituguru_resume, }; static int __init abituguru_detect(void)