Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260297
b: refs/heads/master
c: 7a0d4fc
h: refs/heads/master
i:
  260295: 0be00dd
v: v3
  • Loading branch information
Daniel Drake authored and H. Peter Anvin committed Jul 6, 2011
1 parent e46a901 commit ac9f4a6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f70d8ef4745349000dc599b6873a8b866289c694
refs/heads/master: 7a0d4fcf6d4b80b30503fd2701eeef1883e11404
26 changes: 8 additions & 18 deletions trunk/arch/x86/platform/olpc/olpc-xo1.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* (at your option) any later version.
*/

#include <linux/cs5535.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
Expand All @@ -22,17 +23,6 @@

#define DRV_NAME "olpc-xo1"

/* PMC registers (PMS block) */
#define PM_SCLK 0x10
#define PM_IN_SLPCTL 0x20
#define PM_WKXD 0x34
#define PM_WKD 0x30
#define PM_SSC 0x54

/* PM registers (ACPI block) */
#define PM1_CNT 0x08
#define PM_GPE0_STS 0x18

static unsigned long acpi_base;
static unsigned long pms_base;

Expand All @@ -41,17 +31,17 @@ static void xo1_power_off(void)
printk(KERN_INFO "OLPC XO-1 power off sequence...\n");

/* Enable all of these controls with 0 delay */
outl(0x40000000, pms_base + PM_SCLK);
outl(0x40000000, pms_base + PM_IN_SLPCTL);
outl(0x40000000, pms_base + PM_WKXD);
outl(0x40000000, pms_base + PM_WKD);
outl(0x40000000, pms_base + CS5536_PM_SCLK);
outl(0x40000000, pms_base + CS5536_PM_IN_SLPCTL);
outl(0x40000000, pms_base + CS5536_PM_WKXD);
outl(0x40000000, pms_base + CS5536_PM_WKD);

/* Clear status bits (possibly unnecessary) */
outl(0x0002ffff, pms_base + PM_SSC);
outl(0xffffffff, acpi_base + PM_GPE0_STS);
outl(0x0002ffff, pms_base + CS5536_PM_SSC);
outl(0xffffffff, acpi_base + CS5536_PM_GPE0_STS);

/* Write SLP_EN bit to start the machinery */
outl(0x00002000, acpi_base + PM1_CNT);
outl(0x00002000, acpi_base + CS5536_PM1_CNT);
}

static int __devinit olpc_xo1_probe(struct platform_device *pdev)
Expand Down
21 changes: 21 additions & 0 deletions trunk/include/linux/cs5535.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@
#define LBAR_ACPI_SIZE 0x40
#define LBAR_PMS_SIZE 0x80

/*
* PMC registers (PMS block)
* It is only safe to access these registers as dword accesses.
* See CS5536 Specification Update erratas 17 & 18
*/
#define CS5536_PM_SCLK 0x10
#define CS5536_PM_IN_SLPCTL 0x20
#define CS5536_PM_WKXD 0x34
#define CS5536_PM_WKD 0x30
#define CS5536_PM_SSC 0x54

/*
* PM registers (ACPI block)
* It is only safe to access these registers as dword accesses.
* See CS5536 Specification Update erratas 17 & 18
*/
#define CS5536_PM1_STS 0x00
#define CS5536_PM1_EN 0x02
#define CS5536_PM1_CNT 0x08
#define CS5536_PM_GPE0_STS 0x18

/* VSA2 magic values */
#define VSA_VRC_INDEX 0xAC1C
#define VSA_VRC_DATA 0xAC1E
Expand Down

0 comments on commit ac9f4a6

Please sign in to comment.