public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OLPC: Move CS5536-related constants to cs5535.h
@ 2011-02-10 17:10 Daniel Drake
  2011-02-12  2:50 ` Andres Salomon
  2011-03-10 20:40 ` Andres Salomon
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Drake @ 2011-02-10 17:10 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86; +Cc: linux-kernel, dilinger

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>
---
 arch/x86/platform/olpc/olpc-xo1.c |   26 ++++++++------------------
 include/linux/cs5535.h            |   21 +++++++++++++++++++++
 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 1277756..a2210ca 100644
--- a/arch/x86/platform/olpc/olpc-xo1.c
+++ b/arch/x86/platform/olpc/olpc-xo1.c
@@ -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>
@@ -21,17 +22,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;
 
@@ -40,17 +30,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)
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h
index 6fe2114..e46b8b0 100644
--- a/include/linux/cs5535.h
+++ b/include/linux/cs5535.h
@@ -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
-- 
1.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] OLPC: Move CS5536-related constants to cs5535.h
  2011-02-10 17:10 [PATCH] OLPC: Move CS5536-related constants to cs5535.h Daniel Drake
@ 2011-02-12  2:50 ` Andres Salomon
  2011-03-10 20:40 ` Andres Salomon
  1 sibling, 0 replies; 3+ messages in thread
From: Andres Salomon @ 2011-02-12  2:50 UTC (permalink / raw)
  To: Daniel Drake; +Cc: tglx, mingo, hpa, x86, linux-kernel

Looks good to me.

Acked-by: Andres Salomon <dilinger@queued.net>

On Thu, 10 Feb 2011 17:10:09 +0000 (GMT)
Daniel Drake <dsd@laptop.org> wrote:

> 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>
> ---
>  arch/x86/platform/olpc/olpc-xo1.c |   26 ++++++++------------------
>  include/linux/cs5535.h            |   21 +++++++++++++++++++++
>  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 1277756..a2210ca 100644
> --- a/arch/x86/platform/olpc/olpc-xo1.c
> +++ b/arch/x86/platform/olpc/olpc-xo1.c
> @@ -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>
> @@ -21,17 +22,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;
>  
> @@ -40,17 +30,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)
> diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h
> index 6fe2114..e46b8b0 100644
> --- a/include/linux/cs5535.h
> +++ b/include/linux/cs5535.h
> @@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] OLPC: Move CS5536-related constants to cs5535.h
  2011-02-10 17:10 [PATCH] OLPC: Move CS5536-related constants to cs5535.h Daniel Drake
  2011-02-12  2:50 ` Andres Salomon
@ 2011-03-10 20:40 ` Andres Salomon
  1 sibling, 0 replies; 3+ messages in thread
From: Andres Salomon @ 2011-03-10 20:40 UTC (permalink / raw)
  To: hpa; +Cc: Daniel Drake, tglx, mingo, x86, linux-kernel

Hi folks,

Just a reminder that this patch is still outstanding (at least, i
don't see it in the x86 tip tree; if I missed it, please let me know).
I've already Acked it, can someone please merge or Nack it?  Thanks!


On Thu, 10 Feb 2011 17:10:09 +0000 (GMT) Daniel Drake
<dsd@laptop.org> wrote:

> 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>
> ---
>  arch/x86/platform/olpc/olpc-xo1.c |   26 ++++++++------------------
>  include/linux/cs5535.h            |   21 +++++++++++++++++++++
>  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 1277756..a2210ca 100644
> --- a/arch/x86/platform/olpc/olpc-xo1.c
> +++ b/arch/x86/platform/olpc/olpc-xo1.c
> @@ -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>
> @@ -21,17 +22,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;
>  
> @@ -40,17 +30,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)
> diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h
> index 6fe2114..e46b8b0 100644
> --- a/include/linux/cs5535.h
> +++ b/include/linux/cs5535.h
> @@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-10 20:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-10 17:10 [PATCH] OLPC: Move CS5536-related constants to cs5535.h Daniel Drake
2011-02-12  2:50 ` Andres Salomon
2011-03-10 20:40 ` Andres Salomon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox