Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] 4960/1: Rewrite tosa pin configuration to use MFP tables.

Clean up all pins configuration to use currently proposed MFP table
schema.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Acked-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Dmitry Baryshkov and committed by
Russell King
2cb47342 64c1dd3b

+109 -42
+109 -42
arch/arm/mach-pxa/tosa.c
··· 32 32 #include <asm/system.h> 33 33 #include <asm/arch/pxa-regs.h> 34 34 #include <asm/arch/pxa2xx-regs.h> 35 - #include <asm/arch/pxa2xx-gpio.h> 35 + #include <asm/arch/mfp-pxa25x.h> 36 36 #include <asm/arch/irda.h> 37 37 #include <asm/arch/mmc.h> 38 38 #include <asm/arch/udc.h> ··· 47 47 48 48 #include "generic.h" 49 49 #include "devices.h" 50 + 51 + static unsigned long tosa_pin_config[] = { 52 + GPIO78_nCS_2, /* Scoop */ 53 + GPIO80_nCS_4, /* tg6393xb */ 54 + GPIO33_nCS_5, /* Scoop */ 55 + 56 + // GPIO76 CARD_VCC_ON1 57 + 58 + GPIO19_GPIO, /* Reset out */ 59 + GPIO1_RST | WAKEUP_ON_EDGE_FALL, 60 + 61 + GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* WAKE_UP */ 62 + GPIO2_GPIO | WAKEUP_ON_EDGE_BOTH, /* AC_IN */ 63 + GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* RECORD */ 64 + GPIO4_GPIO | WAKEUP_ON_EDGE_FALL, /* SYNC */ 65 + GPIO20_GPIO, /* EAR_IN */ 66 + GPIO22_GPIO, /* On */ 67 + 68 + GPIO5_GPIO, /* USB_IN */ 69 + GPIO32_GPIO, /* Pen IRQ */ 70 + 71 + GPIO7_GPIO, /* Jacket Detect */ 72 + GPIO14_GPIO, /* BAT0_CRG */ 73 + GPIO12_GPIO, /* BAT1_CRG */ 74 + GPIO17_GPIO, /* BAT0_LOW */ 75 + GPIO84_GPIO, /* BAT1_LOW */ 76 + GPIO38_GPIO, /* BAT_LOCK */ 77 + 78 + GPIO11_3_6MHz, 79 + GPIO15_GPIO, /* TC6393XB IRQ */ 80 + GPIO18_RDY, 81 + GPIO27_GPIO, /* LCD Sync */ 82 + 83 + /* MMC */ 84 + GPIO6_MMC_CLK, 85 + GPIO8_MMC_CS0, 86 + GPIO9_GPIO, /* Detect */ 87 + // GPIO10 nSD_INT 88 + 89 + /* CF */ 90 + GPIO13_GPIO, /* CD_IRQ */ 91 + GPIO21_GPIO, /* Main Slot IRQ */ 92 + GPIO36_GPIO, /* Jacket Slot IRQ */ 93 + GPIO48_nPOE, 94 + GPIO49_nPWE, 95 + GPIO50_nPIOR, 96 + GPIO51_nPIOW, 97 + GPIO52_nPCE_1, 98 + GPIO53_nPCE_2, 99 + GPIO54_nPSKTSEL, 100 + GPIO55_nPREG, 101 + GPIO56_nPWAIT, 102 + GPIO57_nIOIS16, 103 + 104 + /* AC97 */ 105 + GPIO31_AC97_SYNC, 106 + GPIO30_AC97_SDATA_OUT, 107 + GPIO28_AC97_BITCLK, 108 + GPIO29_AC97_SDATA_IN_0, 109 + // GPIO79 nAUD_IRQ 110 + 111 + /* FFUART */ 112 + GPIO34_FFUART_RXD, 113 + GPIO35_FFUART_CTS, 114 + GPIO37_FFUART_DSR, 115 + GPIO39_FFUART_TXD, 116 + GPIO40_FFUART_DTR, 117 + GPIO41_FFUART_RTS, 118 + 119 + /* BTUART */ 120 + GPIO42_BTUART_RXD, 121 + GPIO43_BTUART_TXD, 122 + GPIO44_BTUART_CTS, 123 + GPIO45_BTUART_RTS, 124 + 125 + /* IrDA */ 126 + GPIO46_STUART_RXD, 127 + GPIO47_STUART_TXD, 128 + 129 + /* Keybd */ 130 + GPIO58_GPIO, 131 + GPIO59_GPIO, 132 + GPIO60_GPIO, 133 + GPIO61_GPIO, 134 + GPIO62_GPIO, 135 + GPIO63_GPIO, 136 + GPIO64_GPIO, 137 + GPIO65_GPIO, 138 + GPIO66_GPIO, 139 + GPIO67_GPIO, 140 + GPIO68_GPIO, 141 + GPIO69_GPIO, 142 + GPIO70_GPIO, 143 + GPIO71_GPIO, 144 + GPIO72_GPIO, 145 + GPIO73_GPIO, 146 + GPIO74_GPIO, 147 + GPIO75_GPIO, 148 + 149 + /* SPI */ 150 + GPIO81_SSP2_CLK_OUT, 151 + GPIO82_SSP2_FRM_OUT, 152 + GPIO83_SSP2_TXD, 153 + }; 50 154 51 155 /* 52 156 * SCOOP Device ··· 223 119 }, 224 120 }; 225 121 226 - static void tosa_pcmcia_init(void) 227 - { 228 - /* Setup default state of GPIO outputs 229 - before we enable them as outputs. */ 230 - GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) | 231 - GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) | 232 - GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) | 233 - GPIO_bit(GPIO53_nPCE_2); 234 - 235 - pxa_gpio_mode(GPIO48_nPOE_MD); 236 - pxa_gpio_mode(GPIO49_nPWE_MD); 237 - pxa_gpio_mode(GPIO50_nPIOR_MD); 238 - pxa_gpio_mode(GPIO51_nPIOW_MD); 239 - pxa_gpio_mode(GPIO55_nPREG_MD); 240 - pxa_gpio_mode(GPIO56_nPWAIT_MD); 241 - pxa_gpio_mode(GPIO57_nIOIS16_MD); 242 - pxa_gpio_mode(GPIO52_nPCE_1_MD); 243 - pxa_gpio_mode(GPIO53_nPCE_2_MD); 244 - pxa_gpio_mode(GPIO54_pSKTSEL_MD); 245 - } 246 - 247 122 static struct scoop_pcmcia_config tosa_pcmcia_config = { 248 123 .devs = &tosa_pcmcia_scoop[0], 249 124 .num_devs = 2, 250 - .pcmcia_init = tosa_pcmcia_init, 251 125 }; 252 126 253 127 /* ··· 257 175 static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void *data) 258 176 { 259 177 int err; 260 - 261 - /* setup GPIO for PXA25x MMC controller */ 262 - pxa_gpio_mode(GPIO6_MMCCLK_MD); 263 - pxa_gpio_mode(GPIO8_MMCCS0_MD); 264 - pxa_gpio_mode(TOSA_GPIO_nSD_DETECT | GPIO_IN); 265 178 266 179 tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250); 267 180 ··· 305 228 { 306 229 if (mode & IR_OFF) { 307 230 reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN); 308 - pxa_gpio_mode(GPIO47_STTXD|GPIO_DFLT_LOW); 309 - pxa_gpio_mode(GPIO47_STTXD|GPIO_OUT); 310 231 } else { 311 - pxa_gpio_mode(GPIO47_STTXD_MD); 312 232 set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN); 313 233 } 314 234 } ··· 401 327 402 328 static void __init tosa_init(void) 403 329 { 330 + pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config)); 331 + gpio_set_wake(MFP_PIN_GPIO1, 1); 332 + /* We can't pass to gpio-keys since it will drop the Reset altfunc */ 333 + 404 334 pm_power_off = tosa_poweroff; 405 335 arm_pm_restart = tosa_restart; 406 336 407 - pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN); 408 - pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN); 409 - pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN); 410 - 411 - /* setup sleep mode values */ 412 - PWER = 0x00000002; 413 - PFER = 0x00000000; 414 - PRER = 0x00000002; 415 - PGSR0 = 0x00000000; 416 - PGSR1 = 0x00FF0002; 417 - PGSR2 = 0x00014000; 418 337 PCFR |= PCFR_OPDE; 419 338 420 339 /* enable batt_fault */