diff options
Diffstat (limited to 'arch/arm/mach-w90x900/mfp.c')
-rw-r--r-- | arch/arm/mach-w90x900/mfp.c | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/arch/arm/mach-w90x900/mfp.c b/arch/arm/mach-w90x900/mfp.c index fb7fb627b1a5..9dd74612bb87 100644 --- a/arch/arm/mach-w90x900/mfp.c +++ b/arch/arm/mach-w90x900/mfp.c | |||
@@ -26,10 +26,8 @@ | |||
26 | #define REG_MFSEL (W90X900_VA_GCR + 0xC) | 26 | #define REG_MFSEL (W90X900_VA_GCR + 0xC) |
27 | 27 | ||
28 | #define GPSELF (0x01 << 1) | 28 | #define GPSELF (0x01 << 1) |
29 | |||
30 | #define GPSELC (0x03 << 2) | 29 | #define GPSELC (0x03 << 2) |
31 | #define ENKPI (0x02 << 2) | 30 | #define GPSELD (0x0f << 4) |
32 | #define ENNAND (0x01 << 2) | ||
33 | 31 | ||
34 | #define GPSELEI0 (0x01 << 26) | 32 | #define GPSELEI0 (0x01 << 26) |
35 | #define GPSELEI1 (0x01 << 27) | 33 | #define GPSELEI1 (0x01 << 27) |
@@ -37,11 +35,16 @@ | |||
37 | #define GPIOG0TO1 (0x03 << 14) | 35 | #define GPIOG0TO1 (0x03 << 14) |
38 | #define GPIOG2TO3 (0x03 << 16) | 36 | #define GPIOG2TO3 (0x03 << 16) |
39 | #define GPIOG22TO23 (0x03 << 22) | 37 | #define GPIOG22TO23 (0x03 << 22) |
38 | #define GPIOG18TO20 (0x07 << 18) | ||
40 | 39 | ||
41 | #define ENSPI (0x0a << 14) | 40 | #define ENSPI (0x0a << 14) |
42 | #define ENI2C0 (0x01 << 14) | 41 | #define ENI2C0 (0x01 << 14) |
43 | #define ENI2C1 (0x01 << 16) | 42 | #define ENI2C1 (0x01 << 16) |
44 | #define ENAC97 (0x02 << 22) | 43 | #define ENAC97 (0x02 << 22) |
44 | #define ENSD1 (0x02 << 18) | ||
45 | #define ENSD0 (0x0a << 4) | ||
46 | #define ENKPI (0x02 << 2) | ||
47 | #define ENNAND (0x01 << 2) | ||
45 | 48 | ||
46 | static DEFINE_MUTEX(mfp_mutex); | 49 | static DEFINE_MUTEX(mfp_mutex); |
47 | 50 | ||
@@ -127,16 +130,19 @@ void mfp_set_groupi(struct device *dev) | |||
127 | } | 130 | } |
128 | EXPORT_SYMBOL(mfp_set_groupi); | 131 | EXPORT_SYMBOL(mfp_set_groupi); |
129 | 132 | ||
130 | void mfp_set_groupg(struct device *dev) | 133 | void mfp_set_groupg(struct device *dev, const char *subname) |
131 | { | 134 | { |
132 | unsigned long mfpen; | 135 | unsigned long mfpen; |
133 | const char *dev_id; | 136 | const char *dev_id; |
134 | 137 | ||
135 | BUG_ON(!dev); | 138 | BUG_ON((!dev) && (!subname)); |
136 | 139 | ||
137 | mutex_lock(&mfp_mutex); | 140 | mutex_lock(&mfp_mutex); |
138 | 141 | ||
139 | dev_id = dev_name(dev); | 142 | if (subname != NULL) |
143 | dev_id = subname; | ||
144 | else | ||
145 | dev_id = dev_name(dev); | ||
140 | 146 | ||
141 | mfpen = __raw_readl(REG_MFSEL); | 147 | mfpen = __raw_readl(REG_MFSEL); |
142 | 148 | ||
@@ -152,6 +158,9 @@ void mfp_set_groupg(struct device *dev) | |||
152 | } else if (strcmp(dev_id, "nuc900-audio") == 0) { | 158 | } else if (strcmp(dev_id, "nuc900-audio") == 0) { |
153 | mfpen &= ~(GPIOG22TO23); | 159 | mfpen &= ~(GPIOG22TO23); |
154 | mfpen |= ENAC97;/*enable AC97*/ | 160 | mfpen |= ENAC97;/*enable AC97*/ |
161 | } else if (strcmp(dev_id, "nuc900-mmc-port1") == 0) { | ||
162 | mfpen &= ~(GPIOG18TO20); | ||
163 | mfpen |= (ENSD1 | 0x01);/*enable sd1*/ | ||
155 | } else { | 164 | } else { |
156 | mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/ | 165 | mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/ |
157 | } | 166 | } |
@@ -162,3 +171,30 @@ void mfp_set_groupg(struct device *dev) | |||
162 | } | 171 | } |
163 | EXPORT_SYMBOL(mfp_set_groupg); | 172 | EXPORT_SYMBOL(mfp_set_groupg); |
164 | 173 | ||
174 | void mfp_set_groupd(struct device *dev, const char *subname) | ||
175 | { | ||
176 | unsigned long mfpen; | ||
177 | const char *dev_id; | ||
178 | |||
179 | BUG_ON((!dev) && (!subname)); | ||
180 | |||
181 | mutex_lock(&mfp_mutex); | ||
182 | |||
183 | if (subname != NULL) | ||
184 | dev_id = subname; | ||
185 | else | ||
186 | dev_id = dev_name(dev); | ||
187 | |||
188 | mfpen = __raw_readl(REG_MFSEL); | ||
189 | |||
190 | if (strcmp(dev_id, "nuc900-mmc-port0") == 0) { | ||
191 | mfpen &= ~GPSELD;/*enable sd0*/ | ||
192 | mfpen |= ENSD0; | ||
193 | } else | ||
194 | mfpen &= (~GPSELD); | ||
195 | |||
196 | __raw_writel(mfpen, REG_MFSEL); | ||
197 | |||
198 | mutex_unlock(&mfp_mutex); | ||
199 | } | ||
200 | EXPORT_SYMBOL(mfp_set_groupd); | ||