diff options
author | Jochen Friedrich <jochen@scram.de> | 2011-08-18 16:50:31 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-10-17 04:12:42 -0400 |
commit | de0bc0d1b008d1240c03a0bac4f5534f995ab802 (patch) | |
tree | 3f3b230d3ff6d3d1f27ceb5525867228668f44c2 /arch/arm/mach-sa1100/include/mach/simpad.h | |
parent | f24dec9fdafadca53bf9db460da2cbbbfccdb584 (diff) |
ARM: 7024/1: simpad: Cleanup CS3 accessors.
- prepend CS3 accessors by simpad_ to indicate they
are specific to simpad devices.
- use spinlock to protect shadow register.
- implement 8 read-only pins.
- use readl/writel macros so barriers are used where
necessary.
- register CS3 as GPIO controller with 24 pins
(16 output only and 8 input only).
- fix PCMCIA driver to access the read-only pins
rather than the shadow register for status bits.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100/include/mach/simpad.h')
-rw-r--r-- | arch/arm/mach-sa1100/include/mach/simpad.h | 81 |
1 files changed, 58 insertions, 23 deletions
diff --git a/arch/arm/mach-sa1100/include/mach/simpad.h b/arch/arm/mach-sa1100/include/mach/simpad.h index 231550da7db..db28118103e 100644 --- a/arch/arm/mach-sa1100/include/mach/simpad.h +++ b/arch/arm/mach-sa1100/include/mach/simpad.h | |||
@@ -61,32 +61,67 @@ | |||
61 | #define SIMPAD_UCB1X00_GPIO_HEADSET (SIMPAD_UCB1X00_GPIO_BASE + 8) | 61 | #define SIMPAD_UCB1X00_GPIO_HEADSET (SIMPAD_UCB1X00_GPIO_BASE + 8) |
62 | #define SIMPAD_UCB1X00_GPIO_SPEAKER (SIMPAD_UCB1X00_GPIO_BASE + 9) | 62 | #define SIMPAD_UCB1X00_GPIO_SPEAKER (SIMPAD_UCB1X00_GPIO_BASE + 9) |
63 | 63 | ||
64 | // CS3 Latch is write only, a shadow is necessary | 64 | /*--- CS3 Latch ---*/ |
65 | #define SIMPAD_CS3_GPIO_BASE (GPIO_MAX + 11) | ||
66 | #define SIMPAD_CS3_VCC_5V_EN (SIMPAD_CS3_GPIO_BASE) | ||
67 | #define SIMPAD_CS3_VCC_3V_EN (SIMPAD_CS3_GPIO_BASE + 1) | ||
68 | #define SIMPAD_CS3_EN1 (SIMPAD_CS3_GPIO_BASE + 2) | ||
69 | #define SIMPAD_CS3_EN0 (SIMPAD_CS3_GPIO_BASE + 3) | ||
70 | #define SIMPAD_CS3_DISPLAY_ON (SIMPAD_CS3_GPIO_BASE + 4) | ||
71 | #define SIMPAD_CS3_PCMCIA_BUFF_DIS (SIMPAD_CS3_GPIO_BASE + 5) | ||
72 | #define SIMPAD_CS3_MQ_RESET (SIMPAD_CS3_GPIO_BASE + 6) | ||
73 | #define SIMPAD_CS3_PCMCIA_RESET (SIMPAD_CS3_GPIO_BASE + 7) | ||
74 | #define SIMPAD_CS3_DECT_POWER_ON (SIMPAD_CS3_GPIO_BASE + 8) | ||
75 | #define SIMPAD_CS3_IRDA_SD (SIMPAD_CS3_GPIO_BASE + 9) | ||
76 | #define SIMPAD_CS3_RS232_ON (SIMPAD_CS3_GPIO_BASE + 10) | ||
77 | #define SIMPAD_CS3_SD_MEDIAQ (SIMPAD_CS3_GPIO_BASE + 11) | ||
78 | #define SIMPAD_CS3_LED2_ON (SIMPAD_CS3_GPIO_BASE + 12) | ||
79 | #define SIMPAD_CS3_IRDA_MODE (SIMPAD_CS3_GPIO_BASE + 13) | ||
80 | #define SIMPAD_CS3_ENABLE_5V (SIMPAD_CS3_GPIO_BASE + 14) | ||
81 | #define SIMPAD_CS3_RESET_SIMCARD (SIMPAD_CS3_GPIO_BASE + 15) | ||
82 | |||
83 | #define SIMPAD_CS3_PCMCIA_BVD1 (SIMPAD_CS3_GPIO_BASE + 16) | ||
84 | #define SIMPAD_CS3_PCMCIA_BVD2 (SIMPAD_CS3_GPIO_BASE + 17) | ||
85 | #define SIMPAD_CS3_PCMCIA_VS1 (SIMPAD_CS3_GPIO_BASE + 18) | ||
86 | #define SIMPAD_CS3_PCMCIA_VS2 (SIMPAD_CS3_GPIO_BASE + 19) | ||
87 | #define SIMPAD_CS3_LOCK_IND (SIMPAD_CS3_GPIO_BASE + 20) | ||
88 | #define SIMPAD_CS3_CHARGING_STATE (SIMPAD_CS3_GPIO_BASE + 21) | ||
89 | #define SIMPAD_CS3_PCMCIA_SHORT (SIMPAD_CS3_GPIO_BASE + 22) | ||
90 | #define SIMPAD_CS3_GPIO_23 (SIMPAD_CS3_GPIO_BASE + 23) | ||
65 | 91 | ||
66 | #define CS3BUSTYPE unsigned volatile long | ||
67 | #define CS3_BASE 0xf1000000 | 92 | #define CS3_BASE 0xf1000000 |
68 | 93 | ||
69 | #define VCC_5V_EN 0x0001 // For 5V PCMCIA | 94 | long simpad_get_cs3_ro(void); |
70 | #define VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA | 95 | long simpad_get_cs3_shadow(void); |
71 | #define EN1 0x0004 // This is only for EPROM's | 96 | void simpad_set_cs3_bit(int value); |
72 | #define EN0 0x0008 // Both should be enable for 3.3V or 5V | 97 | void simpad_clear_cs3_bit(int value); |
73 | #define DISPLAY_ON 0x0010 | 98 | |
74 | #define PCMCIA_BUFF_DIS 0x0020 | 99 | #define VCC_5V_EN 0x0001 /* For 5V PCMCIA */ |
75 | #define MQ_RESET 0x0040 | 100 | #define VCC_3V_EN 0x0002 /* FOR 3.3V PCMCIA */ |
76 | #define PCMCIA_RESET 0x0080 | 101 | #define EN1 0x0004 /* This is only for EPROM's */ |
77 | #define DECT_POWER_ON 0x0100 | 102 | #define EN0 0x0008 /* Both should be enable for 3.3V or 5V */ |
78 | #define IRDA_SD 0x0200 // Shutdown for powersave | 103 | #define DISPLAY_ON 0x0010 |
79 | #define RS232_ON 0x0400 | 104 | #define PCMCIA_BUFF_DIS 0x0020 |
80 | #define SD_MEDIAQ 0x0800 // Shutdown for powersave | 105 | #define MQ_RESET 0x0040 |
81 | #define LED2_ON 0x1000 | 106 | #define PCMCIA_RESET 0x0080 |
82 | #define IRDA_MODE 0x2000 // Fast/Slow IrDA mode | 107 | #define DECT_POWER_ON 0x0100 |
83 | #define ENABLE_5V 0x4000 // Enable 5V circuit | 108 | #define IRDA_SD 0x0200 /* Shutdown for powersave */ |
84 | #define RESET_SIMCARD 0x8000 | 109 | #define RS232_ON 0x0400 |
85 | 110 | #define SD_MEDIAQ 0x0800 /* Shutdown for powersave */ | |
86 | #define RS232_ENABLE 0x0440 | 111 | #define LED2_ON 0x1000 |
87 | #define PCMCIAMASK 0x402f | 112 | #define IRDA_MODE 0x2000 /* Fast/Slow IrDA mode */ |
88 | 113 | #define ENABLE_5V 0x4000 /* Enable 5V circuit */ | |
89 | 114 | #define RESET_SIMCARD 0x8000 | |
115 | |||
116 | #define PCMCIA_BVD1 0x01 | ||
117 | #define PCMCIA_BVD2 0x02 | ||
118 | #define PCMCIA_VS1 0x04 | ||
119 | #define PCMCIA_VS2 0x08 | ||
120 | #define LOCK_IND 0x10 | ||
121 | #define CHARGING_STATE 0x20 | ||
122 | #define PCMCIA_SHORT 0x40 | ||
123 | |||
124 | /*--- Battery ---*/ | ||
90 | struct simpad_battery { | 125 | struct simpad_battery { |
91 | unsigned char ac_status; /* line connected yes/no */ | 126 | unsigned char ac_status; /* line connected yes/no */ |
92 | unsigned char status; /* battery loading yes/no */ | 127 | unsigned char status; /* battery loading yes/no */ |