aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cs5535.h
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@collabora.co.uk>2009-12-14 21:00:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-15 11:53:28 -0500
commitf060f27007b393bac6e50ee6fc26d8505acf6fe4 (patch)
treefd83b0c9550814dfb5fc6a726ce7b5eb1baaa6f3 /include/linux/cs5535.h
parent2e8c12436f540d3c40137ebf10268803dc972f6a (diff)
cs5535: move VSA2 checks into linux/cs5535.h
Signed-off-by: Andres Salomon <dilinger@collabora.co.uk> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: john stultz <johnstul@us.ibm.com> Cc: Chris Ball <cjb@laptop.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/cs5535.h')
-rw-r--r--include/linux/cs5535.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h
index 39e93e8ed95d..eb34108a608b 100644
--- a/include/linux/cs5535.h
+++ b/include/linux/cs5535.h
@@ -36,6 +36,38 @@
36#define LBAR_ACPI_SIZE 0x40 36#define LBAR_ACPI_SIZE 0x40
37#define LBAR_PMS_SIZE 0x80 37#define LBAR_PMS_SIZE 0x80
38 38
39/* VSA2 magic values */
40#define VSA_VRC_INDEX 0xAC1C
41#define VSA_VRC_DATA 0xAC1E
42#define VSA_VR_UNLOCK 0xFC53 /* unlock virtual register */
43#define VSA_VR_SIGNATURE 0x0003
44#define VSA_VR_MEM_SIZE 0x0200
45#define AMD_VSA_SIG 0x4132 /* signature is ascii 'VSA2' */
46#define GSW_VSA_SIG 0x534d /* General Software signature */
47
48#include <linux/io.h>
49
50static inline int cs5535_has_vsa2(void)
51{
52 static int has_vsa2 = -1;
53
54 if (has_vsa2 == -1) {
55 uint16_t val;
56
57 /*
58 * The VSA has virtual registers that we can query for a
59 * signature.
60 */
61 outw(VSA_VR_UNLOCK, VSA_VRC_INDEX);
62 outw(VSA_VR_SIGNATURE, VSA_VRC_INDEX);
63
64 val = inw(VSA_VRC_DATA);
65 has_vsa2 = (val == AMD_VSA_SIG || val == GSW_VSA_SIG);
66 }
67
68 return has_vsa2;
69}
70
39/* GPIOs */ 71/* GPIOs */
40#define GPIO_OUTPUT_VAL 0x00 72#define GPIO_OUTPUT_VAL 0x00
41#define GPIO_OUTPUT_ENABLE 0x04 73#define GPIO_OUTPUT_ENABLE 0x04