aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-06-25 12:34:09 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-07-06 17:44:23 -0400
commit7a0d4fcf6d4b80b30503fd2701eeef1883e11404 (patch)
tree45d95b7d9ce6f8ebb3b1fffeb42b563b6a6667c7
parentf70d8ef4745349000dc599b6873a8b866289c694 (diff)
x86, olpc: Move CS5536-related constants to cs5535.h
Move these definitions into the relevant header file. This was requested in the review of the upcoming XO-1 suspend/resume code. Signed-off-by: Daniel Drake <dsd@laptop.org> Link: http://lkml.kernel.org/r/1309019658-1712-3-git-send-email-dsd@laptop.org Acked-by: Andres Salomon <dilinger@queued.net> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/platform/olpc/olpc-xo1.c26
-rw-r--r--include/linux/cs5535.h21
2 files changed, 29 insertions, 18 deletions
diff --git a/arch/x86/platform/olpc/olpc-xo1.c b/arch/x86/platform/olpc/olpc-xo1.c
index ab81fb271760..a63e9488979f 100644
--- a/arch/x86/platform/olpc/olpc-xo1.c
+++ b/arch/x86/platform/olpc/olpc-xo1.c
@@ -12,6 +12,7 @@
12 * (at your option) any later version. 12 * (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/cs5535.h>
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/platform_device.h> 17#include <linux/platform_device.h>
17#include <linux/pm.h> 18#include <linux/pm.h>
@@ -22,17 +23,6 @@
22 23
23#define DRV_NAME "olpc-xo1" 24#define DRV_NAME "olpc-xo1"
24 25
25/* PMC registers (PMS block) */
26#define PM_SCLK 0x10
27#define PM_IN_SLPCTL 0x20
28#define PM_WKXD 0x34
29#define PM_WKD 0x30
30#define PM_SSC 0x54
31
32/* PM registers (ACPI block) */
33#define PM1_CNT 0x08
34#define PM_GPE0_STS 0x18
35
36static unsigned long acpi_base; 26static unsigned long acpi_base;
37static unsigned long pms_base; 27static unsigned long pms_base;
38 28
@@ -41,17 +31,17 @@ static void xo1_power_off(void)
41 printk(KERN_INFO "OLPC XO-1 power off sequence...\n"); 31 printk(KERN_INFO "OLPC XO-1 power off sequence...\n");
42 32
43 /* Enable all of these controls with 0 delay */ 33 /* Enable all of these controls with 0 delay */
44 outl(0x40000000, pms_base + PM_SCLK); 34 outl(0x40000000, pms_base + CS5536_PM_SCLK);
45 outl(0x40000000, pms_base + PM_IN_SLPCTL); 35 outl(0x40000000, pms_base + CS5536_PM_IN_SLPCTL);
46 outl(0x40000000, pms_base + PM_WKXD); 36 outl(0x40000000, pms_base + CS5536_PM_WKXD);
47 outl(0x40000000, pms_base + PM_WKD); 37 outl(0x40000000, pms_base + CS5536_PM_WKD);
48 38
49 /* Clear status bits (possibly unnecessary) */ 39 /* Clear status bits (possibly unnecessary) */
50 outl(0x0002ffff, pms_base + PM_SSC); 40 outl(0x0002ffff, pms_base + CS5536_PM_SSC);
51 outl(0xffffffff, acpi_base + PM_GPE0_STS); 41 outl(0xffffffff, acpi_base + CS5536_PM_GPE0_STS);
52 42
53 /* Write SLP_EN bit to start the machinery */ 43 /* Write SLP_EN bit to start the machinery */
54 outl(0x00002000, acpi_base + PM1_CNT); 44 outl(0x00002000, acpi_base + CS5536_PM1_CNT);
55} 45}
56 46
57static int __devinit olpc_xo1_probe(struct platform_device *pdev) 47static int __devinit olpc_xo1_probe(struct platform_device *pdev)
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h
index 6fe2114f8ad2..e46b8b0f9057 100644
--- a/include/linux/cs5535.h
+++ b/include/linux/cs5535.h
@@ -49,6 +49,27 @@
49#define LBAR_ACPI_SIZE 0x40 49#define LBAR_ACPI_SIZE 0x40
50#define LBAR_PMS_SIZE 0x80 50#define LBAR_PMS_SIZE 0x80
51 51
52/*
53 * PMC registers (PMS block)
54 * It is only safe to access these registers as dword accesses.
55 * See CS5536 Specification Update erratas 17 & 18
56 */
57#define CS5536_PM_SCLK 0x10
58#define CS5536_PM_IN_SLPCTL 0x20
59#define CS5536_PM_WKXD 0x34
60#define CS5536_PM_WKD 0x30
61#define CS5536_PM_SSC 0x54
62
63/*
64 * PM registers (ACPI block)
65 * It is only safe to access these registers as dword accesses.
66 * See CS5536 Specification Update erratas 17 & 18
67 */
68#define CS5536_PM1_STS 0x00
69#define CS5536_PM1_EN 0x02
70#define CS5536_PM1_CNT 0x08
71#define CS5536_PM_GPE0_STS 0x18
72
52/* VSA2 magic values */ 73/* VSA2 magic values */
53#define VSA_VRC_INDEX 0xAC1C 74#define VSA_VRC_INDEX 0xAC1C
54#define VSA_VRC_DATA 0xAC1E 75#define VSA_VRC_DATA 0xAC1E