aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/corgi.c
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2008-08-26 21:32:48 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-23 17:04:35 -0400
commit9ae808d8b1d8a99832798a6699b4cb7f51bfc872 (patch)
treebdc0d6ac427fa39cdafbce05dbedee77a26ff1bd /arch/arm/mach-pxa/corgi.c
parent9d7087527f51c4eb7f30f0a9a3ad514e76bde3fd (diff)
[ARM] pxa/corgi: convert to use new MFP API
Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/corgi.c')
-rw-r--r--arch/arm/mach-pxa/corgi.c95
1 files changed, 58 insertions, 37 deletions
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 6aff30615b30..14155fc49a12 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -38,7 +38,7 @@
38 38
39#include <mach/pxa-regs.h> 39#include <mach/pxa-regs.h>
40#include <mach/pxa2xx-regs.h> 40#include <mach/pxa2xx-regs.h>
41#include <mach/pxa2xx-gpio.h> 41#include <mach/mfp-pxa25x.h>
42#include <mach/i2c.h> 42#include <mach/i2c.h>
43#include <mach/irda.h> 43#include <mach/irda.h>
44#include <mach/mmc.h> 44#include <mach/mmc.h>
@@ -53,6 +53,61 @@
53#include "devices.h" 53#include "devices.h"
54#include "sharpsl.h" 54#include "sharpsl.h"
55 55
56static unsigned long corgi_pin_config[] __initdata = {
57 /* Static Memory I/O */
58 GPIO78_nCS_2, /* w100fb */
59 GPIO80_nCS_4, /* scoop */
60
61 /* SSP1 */
62 GPIO23_SSP1_SCLK,
63 GPIO25_SSP1_TXD,
64 GPIO26_SSP1_RXD,
65 GPIO24_GPIO, /* CORGI_GPIO_ADS7846_CS - SFRM as chip select */
66
67 /* I2S */
68 GPIO28_I2S_BITCLK_OUT,
69 GPIO29_I2S_SDATA_IN,
70 GPIO30_I2S_SDATA_OUT,
71 GPIO31_I2S_SYNC,
72 GPIO32_I2S_SYSCLK,
73
74 /* Infra-Red */
75 GPIO47_FICP_TXD,
76 GPIO46_FICP_RXD,
77
78 /* FFUART */
79 GPIO40_FFUART_DTR,
80 GPIO41_FFUART_RTS,
81 GPIO39_FFUART_TXD,
82 GPIO37_FFUART_DSR,
83 GPIO34_FFUART_RXD,
84 GPIO35_FFUART_CTS,
85
86 /* PC Card */
87 GPIO48_nPOE,
88 GPIO49_nPWE,
89 GPIO50_nPIOR,
90 GPIO51_nPIOW,
91 GPIO52_nPCE_1,
92 GPIO53_nPCE_2,
93 GPIO54_nPSKTSEL,
94 GPIO55_nPREG,
95 GPIO56_nPWAIT,
96 GPIO57_nIOIS16,
97
98 /* MMC */
99 GPIO6_MMC_CLK,
100 GPIO8_MMC_CS0,
101
102 /* GPIO */
103 GPIO9_GPIO, /* CORGI_GPIO_nSD_DETECT */
104 GPIO7_GPIO, /* CORGI_GPIO_nSD_WP */
105 GPIO33_GPIO, /* CORGI_GPIO_SD_PWR */
106 GPIO22_GPIO, /* CORGI_GPIO_IR_ON */
107 GPIO44_GPIO, /* CORGI_GPIO_HSYNC */
108
109 GPIO1_GPIO | WAKEUP_ON_EDGE_RISE,
110};
56 111
57/* 112/*
58 * Corgi SCOOP Device 113 * Corgi SCOOP Device
@@ -80,27 +135,6 @@ struct platform_device corgiscoop_device = {
80 .resource = corgi_scoop_resources, 135 .resource = corgi_scoop_resources,
81}; 136};
82 137
83static void corgi_pcmcia_init(void)
84{
85 /* Setup default state of GPIO outputs
86 before we enable them as outputs. */
87 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
88 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
89 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
90 GPIO_bit(GPIO53_nPCE_2);
91
92 pxa_gpio_mode(GPIO48_nPOE_MD);
93 pxa_gpio_mode(GPIO49_nPWE_MD);
94 pxa_gpio_mode(GPIO50_nPIOR_MD);
95 pxa_gpio_mode(GPIO51_nPIOW_MD);
96 pxa_gpio_mode(GPIO55_nPREG_MD);
97 pxa_gpio_mode(GPIO56_nPWAIT_MD);
98 pxa_gpio_mode(GPIO57_nIOIS16_MD);
99 pxa_gpio_mode(GPIO52_nPCE_1_MD);
100 pxa_gpio_mode(GPIO53_nPCE_2_MD);
101 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
102}
103
104static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = { 138static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
105{ 139{
106 .dev = &corgiscoop_device.dev, 140 .dev = &corgiscoop_device.dev,
@@ -113,7 +147,6 @@ static struct scoop_pcmcia_dev corgi_pcmcia_scoop[] = {
113static struct scoop_pcmcia_config corgi_pcmcia_config = { 147static struct scoop_pcmcia_config corgi_pcmcia_config = {
114 .devs = &corgi_pcmcia_scoop[0], 148 .devs = &corgi_pcmcia_scoop[0],
115 .num_devs = 1, 149 .num_devs = 1,
116 .pcmcia_init = corgi_pcmcia_init,
117}; 150};
118 151
119EXPORT_SYMBOL(corgiscoop_device); 152EXPORT_SYMBOL(corgiscoop_device);
@@ -412,10 +445,6 @@ static int corgi_mci_init(struct device *dev, irq_handler_t corgi_detect_int, vo
412{ 445{
413 int err; 446 int err;
414 447
415 /* setup GPIO for PXA25x MMC controller */
416 pxa_gpio_mode(GPIO6_MMCCLK_MD);
417 pxa_gpio_mode(GPIO8_MMCCS0_MD);
418
419 err = gpio_request(CORGI_GPIO_nSD_DETECT, "nSD_DETECT"); 448 err = gpio_request(CORGI_GPIO_nSD_DETECT, "nSD_DETECT");
420 if (err) 449 if (err)
421 goto err_out; 450 goto err_out;
@@ -558,20 +587,12 @@ static void __init corgi_init(void)
558 pm_power_off = corgi_poweroff; 587 pm_power_off = corgi_poweroff;
559 arm_pm_restart = corgi_restart; 588 arm_pm_restart = corgi_restart;
560 589
561 /* setup sleep mode values */
562 PWER = 0x00000002;
563 PFER = 0x00000000;
564 PRER = 0x00000002;
565 PGSR0 = 0x0158C000;
566 PGSR1 = 0x00FF0080;
567 PGSR2 = 0x0001C004;
568 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ 590 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
569 PCFR |= PCFR_OPDE; 591 PCFR |= PCFR_OPDE;
570 592
571 corgi_ssp_set_machinfo(&corgi_ssp_machinfo); 593 pxa2xx_mfp_config(ARRAY_AND_SIZE(corgi_pin_config));
572 594
573 pxa_gpio_mode(CORGI_GPIO_IR_ON | GPIO_OUT); 595 corgi_ssp_set_machinfo(&corgi_ssp_machinfo);
574 pxa_gpio_mode(CORGI_GPIO_HSYNC | GPIO_IN);
575 596
576 pxa_set_udc_info(&udc_info); 597 pxa_set_udc_info(&udc_info);
577 pxa_set_mci_info(&corgi_mci_platform_data); 598 pxa_set_mci_info(&corgi_mci_platform_data);