-15
arch/x86/platform/olpc/olpc-xo1-pm.c
-15
arch/x86/platform/olpc/olpc-xo1-pm.c
···
52
static int xo1_power_state_enter(suspend_state_t pm_state)
53
{
54
unsigned long saved_sci_mask;
55
-
int r;
56
57
/* Only STR is supported */
58
if (pm_state != PM_SUSPEND_MEM)
59
return -EINVAL;
60
-
61
-
r = olpc_ec_cmd(EC_SET_SCI_INHIBIT, NULL, 0, NULL, 0);
62
-
if (r)
63
-
return r;
64
65
/*
66
* Save SCI mask (this gets lost since PM1_EN is used as a mask for
···
71
72
/* Restore SCI mask (using dword access to CS5536_PM1_EN) */
73
outl(saved_sci_mask, acpi_base + CS5536_PM1_STS);
74
-
75
-
/* Tell the EC to stop inhibiting SCIs */
76
-
olpc_ec_cmd(EC_SET_SCI_INHIBIT_RELEASE, NULL, 0, NULL, 0);
77
-
78
-
/*
79
-
* Tell the wireless module to restart USB communication.
80
-
* Must be done twice.
81
-
*/
82
-
olpc_ec_cmd(EC_WAKE_UP_WLAN, NULL, 0, NULL, 0);
83
-
olpc_ec_cmd(EC_WAKE_UP_WLAN, NULL, 0, NULL, 0);
84
85
return 0;
86
}
···
52
static int xo1_power_state_enter(suspend_state_t pm_state)
53
{
54
unsigned long saved_sci_mask;
55
56
/* Only STR is supported */
57
if (pm_state != PM_SUSPEND_MEM)
58
return -EINVAL;
59
60
/*
61
* Save SCI mask (this gets lost since PM1_EN is used as a mask for
···
76
77
/* Restore SCI mask (using dword access to CS5536_PM1_EN) */
78
outl(saved_sci_mask, acpi_base + CS5536_PM1_STS);
79
80
return 0;
81
}
+36
-7
arch/x86/platform/olpc/olpc.c
+36
-7
arch/x86/platform/olpc/olpc.c
···
263
}
264
EXPORT_SYMBOL_GPL(olpc_ec_sci_query);
265
266
-
static int olpc_ec_suspend(struct platform_device *pdev)
267
-
{
268
-
return olpc_ec_mask_write(ec_wakeup_mask);
269
-
}
270
-
271
static bool __init check_ofw_architecture(struct device_node *root)
272
{
273
const char *olpc_arch;
···
334
335
return 0;
336
}
337
338
static struct olpc_ec_driver ec_xo1_driver = {
339
-
.suspend = olpc_ec_suspend,
340
.probe = olpc_xo1_ec_probe,
341
.ec_cmd = olpc_xo1_ec_cmd,
342
};
···
380
return 0;
381
382
/* register the XO-1 and 1.5-specific EC handler */
383
-
olpc_ec_driver_register(&ec_xo1_driver, NULL);
384
platform_device_register_simple("olpc-ec", -1, NULL, 0);
385
386
/* assume B1 and above models always have a DCON */
···
263
}
264
EXPORT_SYMBOL_GPL(olpc_ec_sci_query);
265
266
static bool __init check_ofw_architecture(struct device_node *root)
267
{
268
const char *olpc_arch;
···
339
340
return 0;
341
}
342
+
static int olpc_xo1_ec_suspend(struct platform_device *pdev)
343
+
{
344
+
olpc_ec_mask_write(ec_wakeup_mask);
345
+
346
+
/*
347
+
* Squelch SCIs while suspended. This is a fix for
348
+
* <http://dev.laptop.org/ticket/1835>.
349
+
*/
350
+
return olpc_ec_cmd(EC_SET_SCI_INHIBIT, NULL, 0, NULL, 0);
351
+
}
352
+
353
+
static int olpc_xo1_ec_resume(struct platform_device *pdev)
354
+
{
355
+
/* Tell the EC to stop inhibiting SCIs */
356
+
olpc_ec_cmd(EC_SET_SCI_INHIBIT_RELEASE, NULL, 0, NULL, 0);
357
+
358
+
/*
359
+
* Tell the wireless module to restart USB communication.
360
+
* Must be done twice.
361
+
*/
362
+
olpc_ec_cmd(EC_WAKE_UP_WLAN, NULL, 0, NULL, 0);
363
+
olpc_ec_cmd(EC_WAKE_UP_WLAN, NULL, 0, NULL, 0);
364
+
365
+
return 0;
366
+
}
367
368
static struct olpc_ec_driver ec_xo1_driver = {
369
+
.probe = olpc_xo1_ec_probe,
370
+
.suspend = olpc_xo1_ec_suspend,
371
+
.resume = olpc_xo1_ec_resume,
372
+
.ec_cmd = olpc_xo1_ec_cmd,
373
+
};
374
+
375
+
static struct olpc_ec_driver ec_xo1_5_driver = {
376
.probe = olpc_xo1_ec_probe,
377
.ec_cmd = olpc_xo1_ec_cmd,
378
};
···
354
return 0;
355
356
/* register the XO-1 and 1.5-specific EC handler */
357
+
if (olpc_platform_info.boardrev < olpc_board_pre(0xd0)) /* XO-1 */
358
+
olpc_ec_driver_register(&ec_xo1_driver, NULL);
359
+
else
360
+
olpc_ec_driver_register(&ec_xo1_5_driver, NULL);
361
platform_device_register_simple("olpc-ec", -1, NULL, 0);
362
363
/* assume B1 and above models always have a DCON */