diff options
Diffstat (limited to 'arch/arm/mach-pxa/cm-x270.c')
| -rw-r--r-- | arch/arm/mach-pxa/cm-x270.c | 83 |
1 files changed, 44 insertions, 39 deletions
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c index eea78b6c2bc5..a9926bb75922 100644 --- a/arch/arm/mach-pxa/cm-x270.c +++ b/arch/arm/mach-pxa/cm-x270.c | |||
| @@ -71,26 +71,7 @@ static unsigned long cmx270_pin_config[] = { | |||
| 71 | GPIO111_MMC_DAT_3, | 71 | GPIO111_MMC_DAT_3, |
| 72 | 72 | ||
| 73 | /* LCD */ | 73 | /* LCD */ |
| 74 | GPIO58_LCD_LDD_0, | 74 | GPIOxx_LCD_TFT_16BPP, |
| 75 | GPIO59_LCD_LDD_1, | ||
| 76 | GPIO60_LCD_LDD_2, | ||
| 77 | GPIO61_LCD_LDD_3, | ||
| 78 | GPIO62_LCD_LDD_4, | ||
| 79 | GPIO63_LCD_LDD_5, | ||
| 80 | GPIO64_LCD_LDD_6, | ||
| 81 | GPIO65_LCD_LDD_7, | ||
| 82 | GPIO66_LCD_LDD_8, | ||
| 83 | GPIO67_LCD_LDD_9, | ||
| 84 | GPIO68_LCD_LDD_10, | ||
| 85 | GPIO69_LCD_LDD_11, | ||
| 86 | GPIO70_LCD_LDD_12, | ||
| 87 | GPIO71_LCD_LDD_13, | ||
| 88 | GPIO72_LCD_LDD_14, | ||
| 89 | GPIO73_LCD_LDD_15, | ||
| 90 | GPIO74_LCD_FCLK, | ||
| 91 | GPIO75_LCD_LCLK, | ||
| 92 | GPIO76_LCD_PCLK, | ||
| 93 | GPIO77_LCD_BIAS, | ||
| 94 | 75 | ||
| 95 | /* I2C */ | 76 | /* I2C */ |
| 96 | GPIO117_I2C_SCL, | 77 | GPIO117_I2C_SCL, |
| @@ -195,33 +176,57 @@ static struct resource cmx270_2700G_resource[] = { | |||
| 195 | }, | 176 | }, |
| 196 | }; | 177 | }; |
| 197 | 178 | ||
| 198 | static unsigned long save_lcd_regs[10]; | 179 | static unsigned long cmx270_marathon_on[] = { |
| 180 | GPIO58_GPIO, | ||
| 181 | GPIO59_GPIO, | ||
| 182 | GPIO60_GPIO, | ||
| 183 | GPIO61_GPIO, | ||
| 184 | GPIO62_GPIO, | ||
| 185 | GPIO63_GPIO, | ||
| 186 | GPIO64_GPIO, | ||
| 187 | GPIO65_GPIO, | ||
| 188 | GPIO66_GPIO, | ||
| 189 | GPIO67_GPIO, | ||
| 190 | GPIO68_GPIO, | ||
| 191 | GPIO69_GPIO, | ||
| 192 | GPIO70_GPIO, | ||
| 193 | GPIO71_GPIO, | ||
| 194 | GPIO72_GPIO, | ||
| 195 | GPIO73_GPIO, | ||
| 196 | GPIO74_GPIO, | ||
| 197 | GPIO75_GPIO, | ||
| 198 | GPIO76_GPIO, | ||
| 199 | GPIO77_GPIO, | ||
| 200 | }; | ||
| 201 | |||
| 202 | static unsigned long cmx270_marathon_off[] = { | ||
| 203 | GPIOxx_LCD_TFT_16BPP, | ||
| 204 | }; | ||
| 199 | 205 | ||
| 200 | static int cmx270_marathon_probe(struct fb_info *fb) | 206 | static int cmx270_marathon_probe(struct fb_info *fb) |
| 201 | { | 207 | { |
| 202 | /* save PXA-270 pin settings before enabling 2700G */ | 208 | int gpio, err; |
| 203 | save_lcd_regs[0] = GPDR1; | 209 | |
| 204 | save_lcd_regs[1] = GPDR2; | 210 | for (gpio = 58; gpio <= 77; gpio++) { |
| 205 | save_lcd_regs[2] = GAFR1_U; | 211 | err = gpio_request(gpio, "LCD"); |
| 206 | save_lcd_regs[3] = GAFR2_L; | 212 | if (err) |
| 207 | save_lcd_regs[4] = GAFR2_U; | 213 | return err; |
| 208 | 214 | gpio_direction_input(gpio); | |
| 209 | /* Disable PXA-270 on-chip controller driving pins */ | 215 | } |
| 210 | GPDR1 &= ~(0xfc000000); | 216 | |
| 211 | GPDR2 &= ~(0x00c03fff); | 217 | pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_on)); |
| 212 | GAFR1_U &= ~(0xfff00000); | ||
| 213 | GAFR2_L &= ~(0x0fffffff); | ||
| 214 | GAFR2_U &= ~(0x0000f000); | ||
| 215 | return 0; | 218 | return 0; |
| 216 | } | 219 | } |
| 217 | 220 | ||
| 218 | static int cmx270_marathon_remove(struct fb_info *fb) | 221 | static int cmx270_marathon_remove(struct fb_info *fb) |
| 219 | { | 222 | { |
| 220 | GPDR1 = save_lcd_regs[0]; | 223 | int gpio; |
| 221 | GPDR2 = save_lcd_regs[1]; | 224 | |
| 222 | GAFR1_U = save_lcd_regs[2]; | 225 | pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_off)); |
| 223 | GAFR2_L = save_lcd_regs[3]; | 226 | |
| 224 | GAFR2_U = save_lcd_regs[4]; | 227 | for (gpio = 58; gpio <= 77; gpio++) |
| 228 | gpio_free(gpio); | ||
| 229 | |||
| 225 | return 0; | 230 | return 0; |
| 226 | } | 231 | } |
| 227 | 232 | ||
