]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-pxa/pxa27x.c
Merge branch 'next-s3c64xx-regs' of git://aeryn.fluff.org.uk/bjdooks/linux into devel
[linux-2.6-omap-h63xx.git] / arch / arm / mach-pxa / pxa27x.c
index 3e4ab2279c99b31c0a9b1c009d55543dc4a93fff..a425ec71e657cb5bd9ed55beb228bf2523b2b653 100644 (file)
@@ -21,9 +21,8 @@
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <mach/irqs.h>
-#include <mach/pxa-regs.h>
-#include <mach/pxa2xx-regs.h>
-#include <mach/mfp-pxa27x.h>
+#include <mach/gpio.h>
+#include <mach/pxa27x.h>
 #include <mach/reset.h>
 #include <mach/ohci.h>
 #include <mach/pm.h>
@@ -144,40 +143,59 @@ static const struct clkops clk_pxa27x_lcd_ops = {
        .getrate        = clk_pxa27x_lcd_getrate,
 };
 
-static struct clk pxa27x_clks[] = {
-       INIT_CK("LCDCLK", LCD,    &clk_pxa27x_lcd_ops, &pxa_device_fb.dev),
-       INIT_CK("CAMCLK", CAMERA, &clk_pxa27x_lcd_ops, NULL),
-
-       INIT_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
-       INIT_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
-       INIT_CKEN("UARTCLK", STUART, 14857000, 1, NULL),
-
-       INIT_CKEN("I2SCLK",  I2S,  14682000, 0, &pxa_device_i2s.dev),
-       INIT_CKEN("I2CCLK",  I2C,  32842000, 0, &pxa_device_i2c.dev),
-       INIT_CKEN("UDCCLK",  USB,  48000000, 5, &pxa27x_device_udc.dev),
-       INIT_CKEN("MMCCLK",  MMC,  19500000, 0, &pxa_device_mci.dev),
-       INIT_CKEN("FICPCLK", FICP, 48000000, 0, &pxa_device_ficp.dev),
-
-       INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev),
-       INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev),
-       INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev),
-
-       INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
-       INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
-       INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev),
-       INIT_CKEN("PWMCLK", PWM0, 13000000, 0, &pxa27x_device_pwm0.dev),
-       INIT_CKEN("PWMCLK", PWM1, 13000000, 0, &pxa27x_device_pwm1.dev),
-
-       INIT_CKEN("AC97CLK",     AC97,     24576000, 0, NULL),
-       INIT_CKEN("AC97CONFCLK", AC97CONF, 24576000, 0, NULL),
-
-       /*
-       INIT_CKEN("MSLCLK",  MSL,  48000000, 0, NULL),
-       INIT_CKEN("USIMCLK", USIM, 48000000, 0, NULL),
-       INIT_CKEN("MSTKCLK", MEMSTK, 19500000, 0, NULL),
-       INIT_CKEN("IMCLK",   IM,   0, 0, NULL),
-       INIT_CKEN("MEMCLK",  MEMC, 0, 0, NULL),
-       */
+static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops);
+static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops);
+static DEFINE_CKEN(pxa27x_ffuart, FFUART, 14857000, 1);
+static DEFINE_CKEN(pxa27x_btuart, BTUART, 14857000, 1);
+static DEFINE_CKEN(pxa27x_stuart, STUART, 14857000, 1);
+static DEFINE_CKEN(pxa27x_i2s, I2S, 14682000, 0);
+static DEFINE_CKEN(pxa27x_i2c, I2C, 32842000, 0);
+static DEFINE_CKEN(pxa27x_usb, USB, 48000000, 5);
+static DEFINE_CKEN(pxa27x_mmc, MMC, 19500000, 0);
+static DEFINE_CKEN(pxa27x_ficp, FICP, 48000000, 0);
+static DEFINE_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0);
+static DEFINE_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0);
+static DEFINE_CKEN(pxa27x_keypad, KEYPAD, 32768, 0);
+static DEFINE_CKEN(pxa27x_ssp1, SSP1, 13000000, 0);
+static DEFINE_CKEN(pxa27x_ssp2, SSP2, 13000000, 0);
+static DEFINE_CKEN(pxa27x_ssp3, SSP3, 13000000, 0);
+static DEFINE_CKEN(pxa27x_pwm0, PWM0, 13000000, 0);
+static DEFINE_CKEN(pxa27x_pwm1, PWM1, 13000000, 0);
+static DEFINE_CKEN(pxa27x_ac97, AC97, 24576000, 0);
+static DEFINE_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0);
+static DEFINE_CKEN(pxa27x_msl, MSL, 48000000, 0);
+static DEFINE_CKEN(pxa27x_usim, USIM, 48000000, 0);
+static DEFINE_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0);
+static DEFINE_CKEN(pxa27x_im, IM, 0, 0);
+static DEFINE_CKEN(pxa27x_memc, MEMC, 0, 0);
+
+static struct clk_lookup pxa27x_clkregs[] = {
+       INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL),
+       INIT_CLKREG(&clk_pxa27x_camera, "pxa27x-camera.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_ffuart, "pxa2xx-uart.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_btuart, "pxa2xx-uart.1", NULL),
+       INIT_CLKREG(&clk_pxa27x_stuart, "pxa2xx-uart.2", NULL),
+       INIT_CLKREG(&clk_pxa27x_i2s, "pxa2xx-i2s", NULL),
+       INIT_CLKREG(&clk_pxa27x_i2c, "pxa2xx-i2c.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_usb, "pxa27x-udc", NULL),
+       INIT_CLKREG(&clk_pxa27x_mmc, "pxa2xx-mci.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_stuart, "pxa2xx-ir", "UARTCLK"),
+       INIT_CLKREG(&clk_pxa27x_ficp, "pxa2xx-ir", "FICPCLK"),
+       INIT_CLKREG(&clk_pxa27x_usbhost, "pxa27x-ohci", NULL),
+       INIT_CLKREG(&clk_pxa27x_pwri2c, "pxa2xx-i2c.1", NULL),
+       INIT_CLKREG(&clk_pxa27x_keypad, "pxa27x-keypad", NULL),
+       INIT_CLKREG(&clk_pxa27x_ssp1, "pxa27x-ssp.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_ssp2, "pxa27x-ssp.1", NULL),
+       INIT_CLKREG(&clk_pxa27x_ssp3, "pxa27x-ssp.2", NULL),
+       INIT_CLKREG(&clk_pxa27x_pwm0, "pxa27x-pwm.0", NULL),
+       INIT_CLKREG(&clk_pxa27x_pwm1, "pxa27x-pwm.1", NULL),
+       INIT_CLKREG(&clk_pxa27x_ac97, NULL, "AC97CLK"),
+       INIT_CLKREG(&clk_pxa27x_ac97conf, NULL, "AC97CONFCLK"),
+       INIT_CLKREG(&clk_pxa27x_msl, NULL, "MSLCLK"),
+       INIT_CLKREG(&clk_pxa27x_usim, NULL, "USIMCLK"),
+       INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"),
+       INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"),
+       INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"),
 };
 
 #ifdef CONFIG_PM
@@ -313,38 +331,18 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on)
 void __init pxa27x_init_irq(void)
 {
        pxa_init_irq(34, pxa27x_set_wake);
-       pxa_init_gpio(128, pxa27x_set_wake);
+       pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake);
 }
 
 /*
  * device registration specific to PXA27x.
  */
-
-static struct resource i2c_power_resources[] = {
-       {
-               .start  = 0x40f00180,
-               .end    = 0x40f001a3,
-               .flags  = IORESOURCE_MEM,
-       }, {
-               .start  = IRQ_PWRI2C,
-               .end    = IRQ_PWRI2C,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-struct platform_device pxa27x_device_i2c_power = {
-       .name           = "pxa2xx-i2c",
-       .id             = 1,
-       .resource       = i2c_power_resources,
-       .num_resources  = ARRAY_SIZE(i2c_power_resources),
-};
-
 void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 {
        local_irq_disable();
        PCFR |= PCFR_PI2CEN;
        local_irq_enable();
-       pxa27x_device_i2c_power.dev.platform_data = info;
+       pxa_register_device(&pxa27x_device_i2c_power, info);
 }
 
 static struct platform_device *devices[] __initdata = {
@@ -353,8 +351,8 @@ static struct platform_device *devices[] __initdata = {
        &pxa_device_btuart,
        &pxa_device_stuart,
        &pxa_device_i2s,
+       &sa1100_device_rtc,
        &pxa_device_rtc,
-       &pxa27x_device_i2c_power,
        &pxa27x_device_ssp1,
        &pxa27x_device_ssp2,
        &pxa27x_device_ssp3,
@@ -380,9 +378,9 @@ static int __init pxa27x_init(void)
 
                reset_status = RCSR;
 
-               clks_register(pxa27x_clks, ARRAY_SIZE(pxa27x_clks));
+               clks_register(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs));
 
-               if ((ret = pxa_init_dma(32)))
+               if ((ret = pxa_init_dma(IRQ_DMA, 32)))
                        return ret;
 
                pxa27x_init_pm();