aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/abituguru.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index 35ad1b032726..e5cb0fdab9b1 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -1354,13 +1354,39 @@ LEAVE_UPDATE:
1354 return NULL; 1354 return NULL;
1355} 1355}
1356 1356
1357#ifdef CONFIG_PM
1358static int abituguru_suspend(struct platform_device *pdev, pm_message_t state)
1359{
1360 struct abituguru_data *data = platform_get_drvdata(pdev);
1361 /* make sure all communications with the uguru are done and no new
1362 ones are started */
1363 mutex_lock(&data->update_lock);
1364 return 0;
1365}
1366
1367static int abituguru_resume(struct platform_device *pdev)
1368{
1369 struct abituguru_data *data = platform_get_drvdata(pdev);
1370 /* See if the uGuru is still ready */
1371 if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT)
1372 data->uguru_ready = 0;
1373 mutex_unlock(&data->update_lock);
1374 return 0;
1375}
1376#else
1377#define abituguru_suspend NULL
1378#define abituguru_resume NULL
1379#endif /* CONFIG_PM */
1380
1357static struct platform_driver abituguru_driver = { 1381static struct platform_driver abituguru_driver = {
1358 .driver = { 1382 .driver = {
1359 .owner = THIS_MODULE, 1383 .owner = THIS_MODULE,
1360 .name = ABIT_UGURU_NAME, 1384 .name = ABIT_UGURU_NAME,
1361 }, 1385 },
1362 .probe = abituguru_probe, 1386 .probe = abituguru_probe,
1363 .remove = __devexit_p(abituguru_remove), 1387 .remove = __devexit_p(abituguru_remove),
1388 .suspend = abituguru_suspend,
1389 .resume = abituguru_resume,
1364}; 1390};
1365 1391
1366static int __init abituguru_detect(void) 1392static int __init abituguru_detect(void)