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

Merge branches 'pxa-ian' and 'pxa-xm270' into pxa

Conflicts:

MAINTAINERS

authored by

Russell King and committed by
Russell King
a9da4f7e 67f5cd0f

+771 -416
+17 -11
MAINTAINERS
··· 475 475 L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 476 476 S: Maintained 477 477 478 + ARM/COMPULAB CM-X270/EM-X270 MACHINE SUPPORT 479 + P: Mike Rapoport 480 + M: mike@compulab.co.il 481 + L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 482 + S: Maintained 483 + 478 484 ARM/CORGI MACHINE SUPPORT 479 485 P: Richard Purdie 480 486 M: rpurdie@rpsys.net 487 + S: Maintained 488 + 489 + ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) 490 + P: Daniel Ribeiro 491 + M: drwyrm@gmail.com 492 + P: Stefan Schmidt 493 + M: stefan@openezx.org 494 + P: Harald Welte 495 + M: laforge@openezx.org 496 + L: openezx-devel@lists.openezx.org (subscribers-only) 497 + W: http://www.openezx.org/ 481 498 S: Maintained 482 499 483 500 ARM/GLOMATION GESBC9312SX MACHINE SUPPORT ··· 502 485 M: kernel@wantstofly.org 503 486 L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 504 487 S: Maintained 505 - 506 - ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) 507 - P: Daniel Ribeiro 508 - M: drwyrm@gmail.com 509 - P: Stefan Schmidt 510 - M: stefan@openezx.org 511 - P: Harald Welte 512 - M: laforge@openezx.org 513 - L: openezx-devel@lists.openezx.org (subscribers-only) 514 - W: http://www.openezx.org/ 515 - S: Maintained 516 488 517 489 ARM/GUMSTIX MACHINE SUPPORT 518 490 P: Steve Sakoman
+1 -1
arch/arm/common/sa1111.c
··· 627 627 if (!sachip) 628 628 return -ENOMEM; 629 629 630 - sachip->clk = clk_get(me, "GPIO27_CLK"); 630 + sachip->clk = clk_get(me, "SA1111_CLK"); 631 631 if (!sachip->clk) { 632 632 ret = PTR_ERR(sachip->clk); 633 633 goto err_free;
-30
arch/arm/mach-pxa/clock.c
··· 101 101 EXPORT_SYMBOL(clk_get_rate); 102 102 103 103 104 - static void clk_gpio27_enable(struct clk *clk) 105 - { 106 - pxa_gpio_mode(GPIO11_3_6MHz_MD); 107 - } 108 - 109 - static void clk_gpio27_disable(struct clk *clk) 110 - { 111 - } 112 - 113 - static const struct clkops clk_gpio27_ops = { 114 - .enable = clk_gpio27_enable, 115 - .disable = clk_gpio27_disable, 116 - }; 117 - 118 - 119 104 void clk_cken_enable(struct clk *clk) 120 105 { 121 106 CKEN |= 1 << clk->cken; ··· 116 131 .disable = clk_cken_disable, 117 132 }; 118 133 119 - static struct clk common_clks[] = { 120 - { 121 - .name = "GPIO27_CLK", 122 - .ops = &clk_gpio27_ops, 123 - .rate = 3686400, 124 - }, 125 - }; 126 - 127 134 void clks_register(struct clk *clks, size_t num) 128 135 { 129 136 int i; ··· 125 148 list_add(&clks[i].node, &clocks); 126 149 mutex_unlock(&clocks_mutex); 127 150 } 128 - 129 - static int __init clk_init(void) 130 - { 131 - clks_register(common_clks, ARRAY_SIZE(common_clks)); 132 - return 0; 133 - } 134 - arch_initcall(clk_init);
+9
arch/arm/mach-pxa/clock.h
··· 47 47 .other = _other, \ 48 48 } 49 49 50 + #define INIT_CLK(_name, _ops, _rate, _delay, _dev) \ 51 + { \ 52 + .name = _name, \ 53 + .dev = _dev, \ 54 + .ops = _ops, \ 55 + .rate = _rate, \ 56 + .delay = _delay, \ 57 + } 58 + 50 59 extern const struct clkops clk_cken_ops; 51 60 52 61 void clk_cken_enable(struct clk *clk);
+14 -13
arch/arm/mach-pxa/cm-x270-pci.c
··· 5 5 * 6 6 * Bits taken from various places. 7 7 * 8 - * Copyright (C) 2007 Compulab, Ltd. 8 + * Copyright (C) 2007, 2008 Compulab, Ltd. 9 9 * Mike Rapoport <mike@compulab.co.il> 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify ··· 19 19 #include <linux/device.h> 20 20 #include <linux/platform_device.h> 21 21 #include <linux/irq.h> 22 + #include <linux/gpio.h> 22 23 23 24 #include <asm/mach/pci.h> 24 - #include <asm/arch/cm-x270.h> 25 25 #include <asm/arch/pxa-regs.h> 26 - #include <asm/arch/pxa2xx-gpio.h> 27 26 #include <asm/mach-types.h> 28 27 29 28 #include <asm/hardware/it8152.h> 30 29 31 - unsigned long it8152_base_address = CMX270_IT8152_VIRT; 30 + unsigned long it8152_base_address; 31 + static int cmx270_it8152_irq_gpio; 32 32 33 33 /* 34 34 * Only first 64MB of memory can be accessed via PCI. ··· 42 42 unsigned int sz = SZ_64M >> PAGE_SHIFT; 43 43 44 44 if (machine_is_armcore()) { 45 - pr_info("Adjusting zones for CM-x270\n"); 45 + pr_info("Adjusting zones for CM-X270\n"); 46 46 47 47 /* 48 48 * Only adjust if > 64M on current system ··· 60 60 static void cmx270_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 61 61 { 62 62 /* clear our parent irq */ 63 - GEDR(GPIO_IT8152_IRQ) = GPIO_bit(GPIO_IT8152_IRQ); 63 + GEDR(cmx270_it8152_irq_gpio) = GPIO_bit(cmx270_it8152_irq_gpio); 64 64 65 65 it8152_irq_demux(irq, desc); 66 66 } 67 67 68 - void __cmx270_pci_init_irq(void) 68 + void __cmx270_pci_init_irq(int irq_gpio) 69 69 { 70 70 it8152_init_irq(); 71 - pxa_gpio_mode(IRQ_TO_GPIO(GPIO_IT8152_IRQ)); 72 - set_irq_type(IRQ_GPIO(GPIO_IT8152_IRQ), IRQT_RISING); 73 71 74 - set_irq_chained_handler(IRQ_GPIO(GPIO_IT8152_IRQ), 75 - cmx270_it8152_irq_demux); 72 + cmx270_it8152_irq_gpio = irq_gpio; 73 + 74 + set_irq_type(gpio_to_irq(irq_gpio), IRQT_RISING); 75 + 76 + set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx270_it8152_irq_demux); 76 77 } 77 78 78 79 #ifdef CONFIG_PM ··· 116 115 117 116 /* 118 117 Here comes the ugly part. The routing is baseboard specific, 119 - but defining a platform for each possible base of CM-x270 is 120 - unrealistic. Here we keep mapping for ATXBase and SB-x270. 118 + but defining a platform for each possible base of CM-X270 is 119 + unrealistic. Here we keep mapping for ATXBase and SB-X270. 121 120 */ 122 121 /* ATXBASE PCI slot */ 123 122 if (slot == 7)
+7 -7
arch/arm/mach-pxa/cm-x270-pci.h
··· 1 - extern void __cmx270_pci_init_irq(void); 1 + extern void __cmx270_pci_init_irq(int irq_gpio); 2 2 extern void __cmx270_pci_suspend(void); 3 3 extern void __cmx270_pci_resume(void); 4 4 5 5 #ifdef CONFIG_PCI 6 - #define cmx270_pci_init_irq __cmx270_pci_init_irq 7 - #define cmx270_pci_suspend __cmx270_pci_suspend 8 - #define cmx270_pci_resume __cmx270_pci_resume 6 + #define cmx270_pci_init_irq(x) __cmx270_pci_init_irq(x) 7 + #define cmx270_pci_suspend(x) __cmx270_pci_suspend(x) 8 + #define cmx270_pci_resume(x) __cmx270_pci_resume(x) 9 9 #else 10 - #define cmx270_pci_init_irq() do {} while (0) 11 - #define cmx270_pci_suspend() do {} while (0) 12 - #define cmx270_pci_resume() do {} while (0) 10 + #define cmx270_pci_init_irq(x) do {} while (0) 11 + #define cmx270_pci_suspend(x) do {} while (0) 12 + #define cmx270_pci_resume(x) do {} while (0) 13 13 #endif
+287 -120
arch/arm/mach-pxa/cm-x270.c
··· 1 1 /* 2 2 * linux/arch/arm/mach-pxa/cm-x270.c 3 3 * 4 - * Copyright (C) 2007 CompuLab, Ltd. 4 + * Copyright (C) 2007, 2008 CompuLab, Ltd. 5 5 * Mike Rapoport <mike@compulab.co.il> 6 6 * 7 7 * This program is free software; you can redistribute it and/or modify ··· 9 9 * published by the Free Software Foundation. 10 10 */ 11 11 12 - #include <linux/types.h> 13 - #include <linux/pm.h> 14 - #include <linux/fb.h> 15 12 #include <linux/platform_device.h> 16 - #include <linux/irq.h> 17 13 #include <linux/sysdev.h> 18 - #include <linux/io.h> 19 - #include <linux/delay.h> 14 + #include <linux/irq.h> 15 + #include <linux/gpio.h> 20 16 21 17 #include <linux/dm9000.h> 22 18 #include <linux/rtc-v3020.h> 23 - #include <linux/serial_8250.h> 24 - 25 19 #include <video/mbxfb.h> 20 + #include <linux/leds.h> 26 21 27 22 #include <asm/mach/arch.h> 28 23 #include <asm/mach-types.h> 29 24 #include <asm/mach/map.h> 30 25 31 - #include <asm/arch/pxa-regs.h> 32 26 #include <asm/arch/pxa2xx-regs.h> 33 - #include <asm/arch/pxa2xx-gpio.h> 27 + #include <asm/arch/mfp-pxa27x.h> 28 + #include <asm/arch/pxa-regs.h> 34 29 #include <asm/arch/audio.h> 35 30 #include <asm/arch/pxafb.h> 36 31 #include <asm/arch/ohci.h> 37 32 #include <asm/arch/mmc.h> 38 33 #include <asm/arch/bitfield.h> 39 - #include <asm/arch/cm-x270.h> 40 34 41 35 #include <asm/hardware/it8152.h> 42 36 43 37 #include "generic.h" 44 38 #include "cm-x270-pci.h" 45 39 40 + /* virtual addresses for statically mapped regions */ 41 + #define CMX270_VIRT_BASE (0xe8000000) 42 + #define CMX270_IT8152_VIRT (CMX270_VIRT_BASE) 43 + 46 44 #define RTC_PHYS_BASE (PXA_CS1_PHYS + (5 << 22)) 47 45 #define DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22)) 48 46 49 - static struct resource cmx270_dm9k_resource[] = { 47 + /* GPIO IRQ usage */ 48 + #define GPIO10_ETHIRQ (10) 49 + #define GPIO22_IT8152_IRQ (22) 50 + #define GPIO83_MMC_IRQ (83) 51 + #define GPIO95_GFXIRQ (95) 52 + 53 + #define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ) 54 + #define CMX270_IT8152_IRQ IRQ_GPIO(GPIO22_IT8152_IRQ) 55 + #define CMX270_MMC_IRQ IRQ_GPIO(GPIO83_MMC_IRQ) 56 + #define CMX270_GFXIRQ IRQ_GPIO(GPIO95_GFXIRQ) 57 + 58 + /* MMC power enable */ 59 + #define GPIO105_MMC_POWER (105) 60 + 61 + static unsigned long cmx270_pin_config[] = { 62 + /* AC'97 */ 63 + GPIO28_AC97_BITCLK, 64 + GPIO29_AC97_SDATA_IN_0, 65 + GPIO30_AC97_SDATA_OUT, 66 + GPIO31_AC97_SYNC, 67 + GPIO98_AC97_SYSCLK, 68 + GPIO113_AC97_nRESET, 69 + 70 + /* BTUART */ 71 + GPIO42_BTUART_RXD, 72 + GPIO43_BTUART_TXD, 73 + GPIO44_BTUART_CTS, 74 + GPIO45_BTUART_RTS, 75 + 76 + /* STUART */ 77 + GPIO46_STUART_RXD, 78 + GPIO47_STUART_TXD, 79 + 80 + /* MCI controller */ 81 + GPIO32_MMC_CLK, 82 + GPIO112_MMC_CMD, 83 + GPIO92_MMC_DAT_0, 84 + GPIO109_MMC_DAT_1, 85 + GPIO110_MMC_DAT_2, 86 + GPIO111_MMC_DAT_3, 87 + 88 + /* LCD */ 89 + GPIO58_LCD_LDD_0, 90 + GPIO59_LCD_LDD_1, 91 + GPIO60_LCD_LDD_2, 92 + GPIO61_LCD_LDD_3, 93 + GPIO62_LCD_LDD_4, 94 + GPIO63_LCD_LDD_5, 95 + GPIO64_LCD_LDD_6, 96 + GPIO65_LCD_LDD_7, 97 + GPIO66_LCD_LDD_8, 98 + GPIO67_LCD_LDD_9, 99 + GPIO68_LCD_LDD_10, 100 + GPIO69_LCD_LDD_11, 101 + GPIO70_LCD_LDD_12, 102 + GPIO71_LCD_LDD_13, 103 + GPIO72_LCD_LDD_14, 104 + GPIO73_LCD_LDD_15, 105 + GPIO74_LCD_FCLK, 106 + GPIO75_LCD_LCLK, 107 + GPIO76_LCD_PCLK, 108 + GPIO77_LCD_BIAS, 109 + 110 + /* I2C */ 111 + GPIO117_I2C_SCL, 112 + GPIO118_I2C_SDA, 113 + 114 + /* SSP1 */ 115 + GPIO23_SSP1_SCLK, 116 + GPIO24_SSP1_SFRM, 117 + GPIO25_SSP1_TXD, 118 + GPIO26_SSP1_RXD, 119 + 120 + /* SSP2 */ 121 + GPIO19_SSP2_SCLK, 122 + GPIO14_SSP2_SFRM, 123 + GPIO87_SSP2_TXD, 124 + GPIO88_SSP2_RXD, 125 + 126 + /* PC Card */ 127 + GPIO48_nPOE, 128 + GPIO49_nPWE, 129 + GPIO50_nPIOR, 130 + GPIO51_nPIOW, 131 + GPIO85_nPCE_1, 132 + GPIO54_nPCE_2, 133 + GPIO55_nPREG, 134 + GPIO56_nPWAIT, 135 + GPIO57_nIOIS16, 136 + 137 + /* SDRAM and local bus */ 138 + GPIO15_nCS_1, 139 + GPIO78_nCS_2, 140 + GPIO79_nCS_3, 141 + GPIO80_nCS_4, 142 + GPIO33_nCS_5, 143 + GPIO49_nPWE, 144 + GPIO18_RDY, 145 + 146 + /* GPIO */ 147 + GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, 148 + GPIO105_GPIO | MFP_LPM_DRIVE_HIGH, /* MMC/SD power */ 149 + GPIO53_GPIO, /* PC card reset */ 150 + 151 + /* NAND controls */ 152 + GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */ 153 + GPIO89_GPIO, /* NAND Ready/Busy */ 154 + 155 + /* interrupts */ 156 + GPIO10_GPIO, /* DM9000 interrupt */ 157 + GPIO83_GPIO, /* MMC card detect */ 158 + }; 159 + 160 + #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 161 + static struct resource cmx270_dm9000_resource[] = { 50 162 [0] = { 51 163 .start = DM9000_PHYS_BASE, 52 164 .end = DM9000_PHYS_BASE + 4, ··· 176 64 } 177 65 }; 178 66 179 - /* for the moment we limit ourselves to 32bit IO until some 180 - * better IO routines can be written and tested 181 - */ 182 - static struct dm9000_plat_data cmx270_dm9k_platdata = { 67 + static struct dm9000_plat_data cmx270_dm9000_platdata = { 183 68 .flags = DM9000_PLATF_32BITONLY, 184 69 }; 185 70 186 - /* Ethernet device */ 187 - static struct platform_device cmx270_device_dm9k = { 71 + static struct platform_device cmx270_dm9000_device = { 188 72 .name = "dm9000", 189 73 .id = 0, 190 - .num_resources = ARRAY_SIZE(cmx270_dm9k_resource), 191 - .resource = cmx270_dm9k_resource, 74 + .num_resources = ARRAY_SIZE(cmx270_dm9000_resource), 75 + .resource = cmx270_dm9000_resource, 192 76 .dev = { 193 - .platform_data = &cmx270_dm9k_platdata, 77 + .platform_data = &cmx270_dm9000_platdata, 194 78 } 195 79 }; 196 80 197 - /* touchscreen controller */ 81 + static void __init cmx270_init_dm9000(void) 82 + { 83 + platform_device_register(&cmx270_dm9000_device); 84 + } 85 + #else 86 + static inline void cmx270_init_dm9000(void) {} 87 + #endif 88 + 89 + /* UCB1400 touchscreen controller */ 90 + #if defined(CONFIG_TOUCHSCREEN_UCB1400) || defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE) 198 91 static struct platform_device cmx270_ts_device = { 199 92 .name = "ucb1400_ts", 200 93 .id = -1, 201 94 }; 202 95 203 - /* RTC */ 96 + static void __init cmx270_init_touchscreen(void) 97 + { 98 + platform_device_register(&cmx270_ts_device); 99 + } 100 + #else 101 + static inline void cmx270_init_touchscreen(void) {} 102 + #endif 103 + 104 + /* V3020 RTC */ 105 + #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) 204 106 static struct resource cmx270_v3020_resource[] = { 205 107 [0] = { 206 108 .start = RTC_PHYS_BASE, ··· 237 111 } 238 112 }; 239 113 240 - /* 241 - * CM-X270 LEDs 242 - */ 243 - static struct platform_device cmx270_led_device = { 244 - .name = "cm-x270-led", 245 - .id = -1, 114 + static void __init cmx270_init_rtc(void) 115 + { 116 + platform_device_register(&cmx270_rtc_device); 117 + } 118 + #else 119 + static inline void cmx270_init_rtc(void) {} 120 + #endif 121 + 122 + /* CM-X270 LEDs */ 123 + #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 124 + static struct gpio_led cmx270_leds[] = { 125 + [0] = { 126 + .name = "cm-x270:red", 127 + .default_trigger = "nand-disk", 128 + .gpio = 93, 129 + .active_low = 1, 130 + }, 131 + [1] = { 132 + .name = "cm-x270:green", 133 + .default_trigger = "heartbeat", 134 + .gpio = 94, 135 + .active_low = 1, 136 + }, 246 137 }; 247 138 139 + static struct gpio_led_platform_data cmx270_gpio_led_pdata = { 140 + .num_leds = ARRAY_SIZE(cmx270_leds), 141 + .leds = cmx270_leds, 142 + }; 143 + 144 + static struct platform_device cmx270_led_device = { 145 + .name = "leds-gpio", 146 + .id = -1, 147 + .dev = { 148 + .platform_data = &cmx270_gpio_led_pdata, 149 + }, 150 + }; 151 + 152 + static void __init cmx270_init_leds(void) 153 + { 154 + platform_device_register(&cmx270_led_device); 155 + } 156 + #else 157 + static inline void cmx270_init_leds(void) {} 158 + #endif 159 + 248 160 /* 2700G graphics */ 161 + #if defined(CONFIG_FB_MBX) || defined(CONFIG_FB_MBX_MODULE) 249 162 static u64 fb_dma_mask = ~(u64)0; 250 163 251 164 static struct resource cmx270_2700G_resource[] = { 252 165 /* frame buffer memory including ODFB and External SDRAM */ 253 166 [0] = { 254 - .start = MARATHON_PHYS, 255 - .end = MARATHON_PHYS + 0x02000000, 167 + .start = PXA_CS2_PHYS, 168 + .end = PXA_CS2_PHYS + 0x01ffffff, 256 169 .flags = IORESOURCE_MEM, 257 170 }, 258 171 /* Marathon registers */ 259 172 [1] = { 260 - .start = MARATHON_PHYS + 0x03fe0000, 261 - .end = MARATHON_PHYS + 0x03ffffff, 173 + .start = PXA_CS2_PHYS + 0x03fe0000, 174 + .end = PXA_CS2_PHYS + 0x03ffffff, 262 175 .flags = IORESOURCE_MEM, 263 176 }, 264 177 }; ··· 365 200 .id = -1, 366 201 }; 367 202 368 - static u64 ata_dma_mask = ~(u64)0; 203 + static void __init cmx270_init_2700G(void) 204 + { 205 + platform_device_register(&cmx270_2700G); 206 + } 207 + #else 208 + static inline void cmx270_init_2700G(void) {} 209 + #endif 369 210 370 - static struct platform_device cmx270_ata = { 371 - .name = "pata_cm_x270", 372 - .id = -1, 373 - .dev = { 374 - .dma_mask = &ata_dma_mask, 375 - .coherent_dma_mask = 0xffffffff, 376 - }, 377 - }; 378 - 379 - /* platform devices */ 380 - static struct platform_device *platform_devices[] __initdata = { 381 - &cmx270_device_dm9k, 382 - &cmx270_rtc_device, 383 - &cmx270_2700G, 384 - &cmx270_led_device, 385 - &cmx270_ts_device, 386 - &cmx270_ata, 387 - }; 388 - 389 - /* Map PCI companion and IDE/General Purpose CS statically */ 390 - static struct map_desc cmx270_io_desc[] __initdata = { 391 - [0] = { /* IDE/general purpose space */ 392 - .virtual = CMX270_IDE104_VIRT, 393 - .pfn = __phys_to_pfn(CMX270_IDE104_PHYS), 394 - .length = SZ_64M - SZ_8M, 395 - .type = MT_DEVICE 396 - }, 397 - [1] = { /* PCI bridge */ 398 - .virtual = CMX270_IT8152_VIRT, 399 - .pfn = __phys_to_pfn(CMX270_IT8152_PHYS), 400 - .length = SZ_64M, 401 - .type = MT_DEVICE 402 - }, 403 - }; 404 - 211 + #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 405 212 /* 406 213 Display definitions 407 214 keep these for backwards compatibility, although symbolic names (as ··· 583 446 */ 584 447 __setup("monitor=", cmx270_set_display); 585 448 449 + static void __init cmx270_init_display(void) 450 + { 451 + set_pxa_fb_info(cmx270_display); 452 + } 453 + #else 454 + static inline void cmx270_init_display(void) {} 455 + #endif 456 + 586 457 /* PXA27x OHCI controller setup */ 458 + #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 587 459 static int cmx270_ohci_init(struct device *dev) 588 460 { 589 461 /* Set the Power Control Polarity Low */ ··· 607 461 .init = cmx270_ohci_init, 608 462 }; 609 463 464 + static void __init cmx270_init_ohci(void) 465 + { 466 + pxa_set_ohci_info(&cmx270_ohci_platform_data); 467 + } 468 + #else 469 + static inline void cmx270_init_ohci(void) {} 470 + #endif 610 471 472 + #if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE) 611 473 static int cmx270_mci_init(struct device *dev, 612 474 irq_handler_t cmx270_detect_int, 613 475 void *data) 614 476 { 615 477 int err; 616 478 617 - /* 618 - * setup GPIO for PXA27x MMC controller 619 - */ 620 - pxa_gpio_mode(GPIO32_MMCCLK_MD); 621 - pxa_gpio_mode(GPIO112_MMCCMD_MD); 622 - pxa_gpio_mode(GPIO92_MMCDAT0_MD); 623 - pxa_gpio_mode(GPIO109_MMCDAT1_MD); 624 - pxa_gpio_mode(GPIO110_MMCDAT2_MD); 625 - pxa_gpio_mode(GPIO111_MMCDAT3_MD); 479 + err = gpio_request(GPIO105_MMC_POWER, "MMC/SD power"); 480 + if (err) { 481 + dev_warn(dev, "power gpio unavailable\n"); 482 + return err; 483 + } 626 484 627 - /* SB-X270 uses GPIO105 as SD power enable */ 628 - pxa_gpio_mode(105 | GPIO_OUT); 629 - 630 - /* card detect IRQ on GPIO 83 */ 631 - pxa_gpio_mode(IRQ_TO_GPIO(CMX270_MMC_IRQ)); 485 + gpio_direction_output(GPIO105_MMC_POWER, 0); 632 486 633 487 err = request_irq(CMX270_MMC_IRQ, cmx270_detect_int, 634 488 IRQF_DISABLED | IRQF_TRIGGER_FALLING, 635 489 "MMC card detect", data); 636 - if (err) 637 - printk(KERN_ERR "cmx270_mci_init: MMC/SD: can't" 638 - " request MMC card detect IRQ\n"); 490 + if (err) { 491 + gpio_free(GPIO105_MMC_POWER); 492 + dev_err(dev, "cmx270_mci_init: MMC/SD: can't" 493 + " request MMC card detect IRQ\n"); 494 + } 639 495 640 496 return err; 641 497 } ··· 647 499 struct pxamci_platform_data *p_d = dev->platform_data; 648 500 649 501 if ((1 << vdd) & p_d->ocr_mask) { 650 - printk(KERN_DEBUG "%s: on\n", __func__); 651 - GPCR(105) = GPIO_bit(105); 502 + dev_dbg(dev, "power on\n"); 503 + gpio_set_value(GPIO105_MMC_POWER, 0); 652 504 } else { 653 - GPSR(105) = GPIO_bit(105); 654 - printk(KERN_DEBUG "%s: off\n", __func__); 505 + gpio_set_value(GPIO105_MMC_POWER, 1); 506 + dev_dbg(dev, "power off\n"); 655 507 } 656 508 } 657 509 658 510 static void cmx270_mci_exit(struct device *dev, void *data) 659 511 { 660 512 free_irq(CMX270_MMC_IRQ, data); 513 + gpio_free(GPIO105_MMC_POWER); 661 514 } 662 515 663 516 static struct pxamci_platform_data cmx270_mci_platform_data = { ··· 667 518 .setpower = cmx270_mci_setpower, 668 519 .exit = cmx270_mci_exit, 669 520 }; 521 + 522 + static void __init cmx270_init_mmc(void) 523 + { 524 + pxa_set_mci_info(&cmx270_mci_platform_data); 525 + } 526 + #else 527 + static inline void cmx270_init_mmc(void) {} 528 + #endif 670 529 671 530 #ifdef CONFIG_PM 672 531 static unsigned long sleep_save_msc[10]; ··· 737 580 static int __init cmx270_pm_init(void) { return 0; } 738 581 #endif 739 582 583 + #if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE) 584 + static void __init cmx270_init_ac97(void) 585 + { 586 + pxa_set_ac97_info(NULL); 587 + } 588 + #else 589 + static inline void cmx270_init_ac97(void) {} 590 + #endif 591 + 740 592 static void __init cmx270_init(void) 741 593 { 742 594 cmx270_pm_init(); 743 595 744 - set_pxa_fb_info(cmx270_display); 596 + pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config)); 745 597 746 - /* register CM-X270 platform devices */ 747 - platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 748 - pxa_set_ac97_info(NULL); 749 - 750 - /* set MCI and OHCI platform parameters */ 751 - pxa_set_mci_info(&cmx270_mci_platform_data); 752 - pxa_set_ohci_info(&cmx270_ohci_platform_data); 753 - 754 - /* This enables the STUART */ 755 - pxa_gpio_mode(GPIO46_STRXD_MD); 756 - pxa_gpio_mode(GPIO47_STTXD_MD); 757 - 758 - /* This enables the BTUART */ 759 - pxa_gpio_mode(GPIO42_BTRXD_MD); 760 - pxa_gpio_mode(GPIO43_BTTXD_MD); 761 - pxa_gpio_mode(GPIO44_BTCTS_MD); 762 - pxa_gpio_mode(GPIO45_BTRTS_MD); 598 + cmx270_init_dm9000(); 599 + cmx270_init_rtc(); 600 + cmx270_init_display(); 601 + cmx270_init_mmc(); 602 + cmx270_init_ohci(); 603 + cmx270_init_ac97(); 604 + cmx270_init_touchscreen(); 605 + cmx270_init_leds(); 606 + cmx270_init_2700G(); 763 607 } 764 608 765 609 static void __init cmx270_init_irq(void) 766 610 { 767 611 pxa27x_init_irq(); 768 612 769 - 770 - cmx270_pci_init_irq(); 771 - 772 - /* Setup interrupt for dm9000 */ 773 - pxa_gpio_mode(IRQ_TO_GPIO(CMX270_ETHIRQ)); 774 - set_irq_type(CMX270_ETHIRQ, IRQT_RISING); 775 - 776 - /* Setup interrupt for 2700G */ 777 - pxa_gpio_mode(IRQ_TO_GPIO(CMX270_GFXIRQ)); 778 - set_irq_type(CMX270_GFXIRQ, IRQT_FALLING); 613 + cmx270_pci_init_irq(GPIO22_IT8152_IRQ); 779 614 } 615 + 616 + #ifdef CONFIG_PCI 617 + /* Map PCI companion statically */ 618 + static struct map_desc cmx270_io_desc[] __initdata = { 619 + [0] = { /* PCI bridge */ 620 + .virtual = CMX270_IT8152_VIRT, 621 + .pfn = __phys_to_pfn(PXA_CS4_PHYS), 622 + .length = SZ_64M, 623 + .type = MT_DEVICE 624 + }, 625 + }; 780 626 781 627 static void __init cmx270_map_io(void) 782 628 { 783 629 pxa_map_io(); 784 630 iotable_init(cmx270_io_desc, ARRAY_SIZE(cmx270_io_desc)); 785 - } 786 631 632 + it8152_base_address = CMX270_IT8152_VIRT; 633 + } 634 + #else 635 + static void __init cmx270_map_io(void) 636 + { 637 + pxa_map_io(); 638 + } 639 + #endif 787 640 788 641 MACHINE_START(ARMCORE, "Compulab CM-x270") 789 642 .boot_params = 0xa0000100,
+296 -83
arch/arm/mach-pxa/em-x270.c
··· 1 1 /* 2 - * Support for CompuLab EM-x270 platform 2 + * Support for CompuLab EM-X270 platform 3 3 * 4 - * Copyright (C) 2007 CompuLab, Ltd. 4 + * Copyright (C) 2007, 2008 CompuLab, Ltd. 5 5 * Author: Mike Rapoport <mike@compulab.co.il> 6 6 * 7 7 * This program is free software; you can redistribute it and/or modify ··· 14 14 15 15 #include <linux/dm9000.h> 16 16 #include <linux/rtc-v3020.h> 17 - 18 17 #include <linux/mtd/nand.h> 19 18 #include <linux/mtd/partitions.h> 19 + #include <linux/input.h> 20 + #include <linux/gpio_keys.h> 21 + #include <linux/gpio.h> 20 22 21 23 #include <asm/mach-types.h> 22 - 23 24 #include <asm/mach/arch.h> 24 25 26 + #include <asm/arch/mfp-pxa27x.h> 25 27 #include <asm/arch/pxa-regs.h> 26 - #include <asm/arch/pxa2xx-gpio.h> 27 28 #include <asm/arch/pxa27x-udc.h> 28 29 #include <asm/arch/audio.h> 29 30 #include <asm/arch/pxafb.h> 30 31 #include <asm/arch/ohci.h> 31 32 #include <asm/arch/mmc.h> 32 - #include <asm/arch/bitfield.h> 33 + #include <asm/arch/pxa27x_keypad.h> 33 34 34 35 #include "generic.h" 35 36 36 37 /* GPIO IRQ usage */ 37 - #define EM_X270_MMC_PD (105) 38 - #define EM_X270_ETHIRQ IRQ_GPIO(41) 39 - #define EM_X270_MMC_IRQ IRQ_GPIO(13) 38 + #define GPIO41_ETHIRQ (41) 39 + #define GPIO13_MMC_CD (13) 40 + #define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) 41 + #define EM_X270_MMC_CD IRQ_GPIO(GPIO13_MMC_CD) 40 42 41 - static struct resource em_x270_dm9k_resource[] = { 43 + /* NAND control GPIOs */ 44 + #define GPIO11_NAND_CS (11) 45 + #define GPIO56_NAND_RB (56) 46 + 47 + static unsigned long em_x270_pin_config[] = { 48 + /* AC'97 */ 49 + GPIO28_AC97_BITCLK, 50 + GPIO29_AC97_SDATA_IN_0, 51 + GPIO30_AC97_SDATA_OUT, 52 + GPIO31_AC97_SYNC, 53 + GPIO98_AC97_SYSCLK, 54 + GPIO113_AC97_nRESET, 55 + 56 + /* BTUART */ 57 + GPIO42_BTUART_RXD, 58 + GPIO43_BTUART_TXD, 59 + GPIO44_BTUART_CTS, 60 + GPIO45_BTUART_RTS, 61 + 62 + /* STUART */ 63 + GPIO46_STUART_RXD, 64 + GPIO47_STUART_TXD, 65 + 66 + /* MCI controller */ 67 + GPIO32_MMC_CLK, 68 + GPIO112_MMC_CMD, 69 + GPIO92_MMC_DAT_0, 70 + GPIO109_MMC_DAT_1, 71 + GPIO110_MMC_DAT_2, 72 + GPIO111_MMC_DAT_3, 73 + 74 + /* LCD */ 75 + GPIO58_LCD_LDD_0, 76 + GPIO59_LCD_LDD_1, 77 + GPIO60_LCD_LDD_2, 78 + GPIO61_LCD_LDD_3, 79 + GPIO62_LCD_LDD_4, 80 + GPIO63_LCD_LDD_5, 81 + GPIO64_LCD_LDD_6, 82 + GPIO65_LCD_LDD_7, 83 + GPIO66_LCD_LDD_8, 84 + GPIO67_LCD_LDD_9, 85 + GPIO68_LCD_LDD_10, 86 + GPIO69_LCD_LDD_11, 87 + GPIO70_LCD_LDD_12, 88 + GPIO71_LCD_LDD_13, 89 + GPIO72_LCD_LDD_14, 90 + GPIO73_LCD_LDD_15, 91 + GPIO74_LCD_FCLK, 92 + GPIO75_LCD_LCLK, 93 + GPIO76_LCD_PCLK, 94 + GPIO77_LCD_BIAS, 95 + 96 + /* QCI */ 97 + GPIO84_CIF_FV, 98 + GPIO25_CIF_LV, 99 + GPIO53_CIF_MCLK, 100 + GPIO54_CIF_PCLK, 101 + GPIO81_CIF_DD_0, 102 + GPIO55_CIF_DD_1, 103 + GPIO51_CIF_DD_2, 104 + GPIO50_CIF_DD_3, 105 + GPIO52_CIF_DD_4, 106 + GPIO48_CIF_DD_5, 107 + GPIO17_CIF_DD_6, 108 + GPIO12_CIF_DD_7, 109 + 110 + /* I2C */ 111 + GPIO117_I2C_SCL, 112 + GPIO118_I2C_SDA, 113 + 114 + /* Keypad */ 115 + GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, 116 + GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, 117 + GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, 118 + GPIO34_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, 119 + GPIO39_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, 120 + GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, 121 + GPIO91_KP_MKIN_6 | WAKEUP_ON_LEVEL_HIGH, 122 + GPIO36_KP_MKIN_7 | WAKEUP_ON_LEVEL_HIGH, 123 + GPIO103_KP_MKOUT_0, 124 + GPIO104_KP_MKOUT_1, 125 + GPIO105_KP_MKOUT_2, 126 + GPIO106_KP_MKOUT_3, 127 + GPIO107_KP_MKOUT_4, 128 + GPIO108_KP_MKOUT_5, 129 + GPIO96_KP_MKOUT_6, 130 + GPIO22_KP_MKOUT_7, 131 + 132 + /* SSP1 */ 133 + GPIO26_SSP1_RXD, 134 + GPIO23_SSP1_SCLK, 135 + GPIO24_SSP1_SFRM, 136 + GPIO57_SSP1_TXD, 137 + 138 + /* SSP2 */ 139 + GPIO19_SSP2_SCLK, 140 + GPIO14_SSP2_SFRM, 141 + GPIO89_SSP2_TXD, 142 + GPIO88_SSP2_RXD, 143 + 144 + /* SDRAM and local bus */ 145 + GPIO15_nCS_1, 146 + GPIO78_nCS_2, 147 + GPIO79_nCS_3, 148 + GPIO80_nCS_4, 149 + GPIO49_nPWE, 150 + GPIO18_RDY, 151 + 152 + /* GPIO */ 153 + GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, 154 + 155 + /* power controls */ 156 + GPIO20_GPIO | MFP_LPM_DRIVE_LOW, /* GPRS_PWEN */ 157 + GPIO115_GPIO | MFP_LPM_DRIVE_LOW, /* WLAN_PWEN */ 158 + 159 + /* NAND controls */ 160 + GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */ 161 + GPIO56_GPIO, /* NAND Ready/Busy */ 162 + 163 + /* interrupts */ 164 + GPIO13_GPIO, /* MMC card detect */ 165 + GPIO41_GPIO, /* DM9000 interrupt */ 166 + }; 167 + 168 + #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 169 + static struct resource em_x270_dm9000_resource[] = { 42 170 [0] = { 43 171 .start = PXA_CS2_PHYS, 44 172 .end = PXA_CS2_PHYS + 3, ··· 184 56 } 185 57 }; 186 58 187 - /* for the moment we limit ourselves to 32bit IO until some 188 - * better IO routines can be written and tested 189 - */ 190 - static struct dm9000_plat_data em_x270_dm9k_platdata = { 59 + static struct dm9000_plat_data em_x270_dm9000_platdata = { 191 60 .flags = DM9000_PLATF_32BITONLY, 192 61 }; 193 62 194 - /* Ethernet device */ 195 - static struct platform_device em_x270_dm9k = { 63 + static struct platform_device em_x270_dm9000 = { 196 64 .name = "dm9000", 197 65 .id = 0, 198 - .num_resources = ARRAY_SIZE(em_x270_dm9k_resource), 199 - .resource = em_x270_dm9k_resource, 66 + .num_resources = ARRAY_SIZE(em_x270_dm9000_resource), 67 + .resource = em_x270_dm9000_resource, 200 68 .dev = { 201 - .platform_data = &em_x270_dm9k_platdata, 69 + .platform_data = &em_x270_dm9000_platdata, 202 70 } 203 71 }; 204 72 205 - /* WM9712 touchscreen controller. Hopefully the driver will make it to 206 - * the mainstream sometime */ 207 - static struct platform_device em_x270_ts = { 208 - .name = "wm97xx-ts", 209 - .id = -1, 210 - }; 73 + static void __init em_x270_init_dm9000(void) 74 + { 75 + platform_device_register(&em_x270_dm9000); 76 + } 77 + #else 78 + static inline void em_x270_init_dm9000(void) {} 79 + #endif 211 80 212 - /* RTC */ 81 + /* V3020 RTC */ 82 + #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) 213 83 static struct resource em_x270_v3020_resource[] = { 214 84 [0] = { 215 85 .start = PXA_CS4_PHYS, ··· 230 104 } 231 105 }; 232 106 233 - /* NAND flash */ 234 - #define GPIO_NAND_CS (11) 235 - #define GPIO_NAND_RB (56) 107 + static void __init em_x270_init_rtc(void) 108 + { 109 + platform_device_register(&em_x270_rtc); 110 + } 111 + #else 112 + static inline void em_x270_init_rtc(void) {} 113 + #endif 236 114 115 + /* NAND flash */ 116 + #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) 237 117 static inline void nand_cs_on(void) 238 118 { 239 - GPCR(GPIO_NAND_CS) = GPIO_bit(GPIO_NAND_CS); 119 + gpio_set_value(GPIO11_NAND_CS, 0); 240 120 } 241 121 242 122 static void nand_cs_off(void) 243 123 { 244 124 dsb(); 245 125 246 - GPSR(GPIO_NAND_CS) = GPIO_bit(GPIO_NAND_CS); 126 + gpio_set_value(GPIO11_NAND_CS, 1); 247 127 } 248 128 249 129 /* hardware specific access to control-lines */ ··· 289 157 { 290 158 dsb(); 291 159 292 - return GPLR(GPIO_NAND_RB) & GPIO_bit(GPIO_NAND_RB); 160 + return gpio_get_value(GPIO56_NAND_RB); 293 161 } 294 162 295 163 static struct mtd_partition em_x270_partition_info[] = { ··· 342 210 } 343 211 }; 344 212 345 - /* platform devices */ 346 - static struct platform_device *platform_devices[] __initdata = { 347 - &em_x270_dm9k, 348 - &em_x270_ts, 349 - &em_x270_rtc, 350 - &em_x270_nand, 351 - }; 213 + static void __init em_x270_init_nand(void) 214 + { 215 + int err; 352 216 217 + err = gpio_request(GPIO11_NAND_CS, "NAND CS"); 218 + if (err) { 219 + pr_warning("EM-X270: failed to request NAND CS gpio\n"); 220 + return; 221 + } 222 + 223 + gpio_direction_output(GPIO11_NAND_CS, 1); 224 + 225 + err = gpio_request(GPIO56_NAND_RB, "NAND R/B"); 226 + if (err) { 227 + pr_warning("EM-X270: failed to request NAND R/B gpio\n"); 228 + gpio_free(GPIO11_NAND_CS); 229 + return; 230 + } 231 + 232 + gpio_direction_input(GPIO56_NAND_RB); 233 + 234 + platform_device_register(&em_x270_nand); 235 + } 236 + #else 237 + static inline void em_x270_init_nand(void) {} 238 + #endif 353 239 354 240 /* PXA27x OHCI controller setup */ 241 + #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 355 242 static int em_x270_ohci_init(struct device *dev) 356 243 { 357 244 /* Set the Power Control Polarity Low */ ··· 388 237 .init = em_x270_ohci_init, 389 238 }; 390 239 240 + static void __init em_x270_init_ohci(void) 241 + { 242 + pxa_set_ohci_info(&em_x270_ohci_platform_data); 243 + } 244 + #else 245 + static inline void em_x270_init_ohci(void) {} 246 + #endif 391 247 248 + /* MCI controller setup */ 249 + #if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE) 392 250 static int em_x270_mci_init(struct device *dev, 393 251 irq_handler_t em_x270_detect_int, 394 252 void *data) 395 253 { 396 - int err; 397 - 398 - /* setup GPIO for PXA27x MMC controller */ 399 - pxa_gpio_mode(GPIO32_MMCCLK_MD); 400 - pxa_gpio_mode(GPIO112_MMCCMD_MD); 401 - pxa_gpio_mode(GPIO92_MMCDAT0_MD); 402 - pxa_gpio_mode(GPIO109_MMCDAT1_MD); 403 - pxa_gpio_mode(GPIO110_MMCDAT2_MD); 404 - pxa_gpio_mode(GPIO111_MMCDAT3_MD); 405 - 406 - /* EM-X270 uses GPIO13 as SD power enable */ 407 - pxa_gpio_mode(EM_X270_MMC_PD | GPIO_OUT); 408 - 409 - err = request_irq(EM_X270_MMC_IRQ, em_x270_detect_int, 410 - IRQF_DISABLED | IRQF_TRIGGER_FALLING, 411 - "MMC card detect", data); 254 + int err = request_irq(EM_X270_MMC_CD, em_x270_detect_int, 255 + IRQF_DISABLED | IRQF_TRIGGER_FALLING, 256 + "MMC card detect", data); 412 257 if (err) { 413 258 printk(KERN_ERR "%s: can't request MMC card detect IRQ: %d\n", 414 259 __func__, err); ··· 426 279 427 280 static void em_x270_mci_exit(struct device *dev, void *data) 428 281 { 429 - free_irq(EM_X270_MMC_IRQ, data); 282 + int irq = gpio_to_irq(GPIO13_MMC_CD); 283 + free_irq(irq, data); 430 284 } 431 285 432 286 static struct pxamci_platform_data em_x270_mci_platform_data = { ··· 437 289 .exit = em_x270_mci_exit, 438 290 }; 439 291 292 + static void __init em_x270_init_mmc(void) 293 + { 294 + pxa_set_mci_info(&em_x270_mci_platform_data); 295 + } 296 + #else 297 + static inline void em_x270_init_mmc(void) {} 298 + #endif 299 + 440 300 /* LCD 480x640 */ 301 + #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 441 302 static struct pxafb_mode_info em_x270_lcd_mode = { 442 303 .pixclock = 50000, 443 304 .bpp = 16, ··· 464 307 static struct pxafb_mach_info em_x270_lcd = { 465 308 .modes = &em_x270_lcd_mode, 466 309 .num_modes = 1, 467 - .cmap_inverse = 0, 468 - .cmap_static = 0, 469 - .lccr0 = LCCR0_PAS, 470 - .lccr3 = LCCR3_PixClkDiv(0x01) | LCCR3_Acb(0xff), 310 + .lcd_conn = LCD_COLOR_TFT_16BPP, 471 311 }; 312 + static void __init em_x270_init_lcd(void) 313 + { 314 + set_pxa_fb_info(&em_x270_lcd); 315 + } 316 + #else 317 + static inline void em_x270_init_lcd(void) {} 318 + #endif 319 + 320 + #if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE) 321 + static void __init em_x270_init_ac97(void) 322 + { 323 + pxa_set_ac97_info(NULL); 324 + } 325 + #else 326 + static inline void em_x270_init_ac97(void) {} 327 + #endif 328 + 329 + #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) 330 + static unsigned int em_x270_matrix_keys[] = { 331 + KEY(0, 0, KEY_A), KEY(1, 0, KEY_UP), KEY(2, 1, KEY_B), 332 + KEY(0, 2, KEY_LEFT), KEY(1, 1, KEY_ENTER), KEY(2, 0, KEY_RIGHT), 333 + KEY(0, 1, KEY_C), KEY(1, 2, KEY_DOWN), KEY(2, 2, KEY_D), 334 + }; 335 + 336 + struct pxa27x_keypad_platform_data em_x270_keypad_info = { 337 + /* code map for the matrix keys */ 338 + .matrix_key_rows = 3, 339 + .matrix_key_cols = 3, 340 + .matrix_key_map = em_x270_matrix_keys, 341 + .matrix_key_map_size = ARRAY_SIZE(em_x270_matrix_keys), 342 + }; 343 + 344 + static void __init em_x270_init_keypad(void) 345 + { 346 + pxa_set_keypad_info(&em_x270_keypad_info); 347 + } 348 + #else 349 + static inline void em_x270_init_keypad(void) {} 350 + #endif 351 + 352 + #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 353 + static struct gpio_keys_button gpio_keys_button[] = { 354 + [0] = { 355 + .desc = "sleep/wakeup", 356 + .code = KEY_SUSPEND, 357 + .type = EV_PWR, 358 + .gpio = 1, 359 + .wakeup = 1, 360 + }, 361 + }; 362 + 363 + static struct gpio_keys_platform_data em_x270_gpio_keys_data = { 364 + .buttons = gpio_keys_button, 365 + .nbuttons = 1, 366 + }; 367 + 368 + static struct platform_device em_x270_gpio_keys = { 369 + .name = "gpio-keys", 370 + .id = -1, 371 + .dev = { 372 + .platform_data = &em_x270_gpio_keys_data, 373 + }, 374 + }; 375 + 376 + static void __init em_x270_init_gpio_keys(void) 377 + { 378 + platform_device_register(&em_x270_gpio_keys); 379 + } 380 + #else 381 + static inline void em_x270_init_gpio_keys(void) {} 382 + #endif 472 383 473 384 static void __init em_x270_init(void) 474 385 { 475 - /* setup LCD */ 476 - set_pxa_fb_info(&em_x270_lcd); 386 + pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_pin_config)); 477 387 478 - /* register EM-X270 platform devices */ 479 - platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 480 - pxa_set_ac97_info(NULL); 481 - 482 - /* set MCI and OHCI platform parameters */ 483 - pxa_set_mci_info(&em_x270_mci_platform_data); 484 - pxa_set_ohci_info(&em_x270_ohci_platform_data); 485 - 486 - /* setup STUART GPIOs */ 487 - pxa_gpio_mode(GPIO46_STRXD_MD); 488 - pxa_gpio_mode(GPIO47_STTXD_MD); 489 - 490 - /* setup BTUART GPIOs */ 491 - pxa_gpio_mode(GPIO42_BTRXD_MD); 492 - pxa_gpio_mode(GPIO43_BTTXD_MD); 493 - pxa_gpio_mode(GPIO44_BTCTS_MD); 494 - pxa_gpio_mode(GPIO45_BTRTS_MD); 495 - 496 - /* Setup interrupt for dm9000 */ 497 - set_irq_type(EM_X270_ETHIRQ, IRQT_RISING); 388 + em_x270_init_dm9000(); 389 + em_x270_init_rtc(); 390 + em_x270_init_nand(); 391 + em_x270_init_lcd(); 392 + em_x270_init_mmc(); 393 + em_x270_init_ohci(); 394 + em_x270_init_keypad(); 395 + em_x270_init_gpio_keys(); 396 + em_x270_init_ac97(); 498 397 } 499 398 500 - MACHINE_START(EM_X270, "Compulab EM-x270") 399 + MACHINE_START(EM_X270, "Compulab EM-X270") 501 400 .boot_params = 0xa0000100, 502 401 .phys_io = 0x40000000, 503 402 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
+55 -4
arch/arm/mach-pxa/pxa25x.c
··· 109 109 .getrate = clk_pxa25x_lcd_getrate, 110 110 }; 111 111 112 + static unsigned long gpio12_config_32k[] = { 113 + GPIO12_32KHz, 114 + }; 115 + 116 + static unsigned long gpio12_config_gpio[] = { 117 + GPIO12_GPIO, 118 + }; 119 + 120 + static void clk_gpio12_enable(struct clk *clk) 121 + { 122 + pxa2xx_mfp_config(gpio12_config_32k, 1); 123 + } 124 + 125 + static void clk_gpio12_disable(struct clk *clk) 126 + { 127 + pxa2xx_mfp_config(gpio12_config_gpio, 1); 128 + } 129 + 130 + static const struct clkops clk_pxa25x_gpio12_ops = { 131 + .enable = clk_gpio12_enable, 132 + .disable = clk_gpio12_disable, 133 + }; 134 + 135 + static unsigned long gpio11_config_3m6[] = { 136 + GPIO11_3_6MHz, 137 + }; 138 + 139 + static unsigned long gpio11_config_gpio[] = { 140 + GPIO11_GPIO, 141 + }; 142 + 143 + static void clk_gpio11_enable(struct clk *clk) 144 + { 145 + pxa2xx_mfp_config(gpio11_config_3m6, 1); 146 + } 147 + 148 + static void clk_gpio11_disable(struct clk *clk) 149 + { 150 + pxa2xx_mfp_config(gpio11_config_gpio, 1); 151 + } 152 + 153 + static const struct clkops clk_pxa25x_gpio11_ops = { 154 + .enable = clk_gpio11_enable, 155 + .disable = clk_gpio11_disable, 156 + }; 157 + 112 158 /* 113 159 * 3.6864MHz -> OST, GPIO, SSP, PWM, PLLs (95.842MHz, 147.456MHz) 114 160 * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz ··· 174 128 INIT_CKEN("UARTCLK", BTUART, 14745600, 1, &pxa_device_btuart.dev), 175 129 INIT_CKEN("UARTCLK", STUART, 14745600, 1, NULL), 176 130 INIT_CKEN("UDCCLK", USB, 47923000, 5, &pxa25x_device_udc.dev), 131 + INIT_CLK("GPIO11_CLK", &clk_pxa25x_gpio11_ops, 3686400, 0, NULL), 132 + INIT_CLK("GPIO12_CLK", &clk_pxa25x_gpio12_ops, 32768, 0, NULL), 177 133 INIT_CKEN("MMCCLK", MMC, 19169000, 0, &pxa_device_mci.dev), 178 134 INIT_CKEN("I2CCLK", I2C, 31949000, 0, &pxa_device_i2c.dev), 179 135 ··· 193 145 INIT_CKEN("FICPCLK", FICP, 47923000, 0, NULL), 194 146 }; 195 147 196 - static struct clk gpio7_clk = INIT_CKOTHER("GPIO7_CK", &pxa25x_clks[4], NULL); 148 + static struct clk pxa2xx_clk_aliases[] = { 149 + INIT_CKOTHER("GPIO7_CLK", &pxa25x_clks[4], NULL), 150 + INIT_CKOTHER("SA1111_CLK", &pxa25x_clks[5], NULL), 151 + }; 197 152 198 153 #ifdef CONFIG_PM 199 154 ··· 344 293 int i, ret = 0; 345 294 346 295 /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ 347 - if (cpu_is_pxa25x()) 296 + if (cpu_is_pxa255()) 348 297 clks_register(&pxa25x_hwuart_clk, 1); 349 298 350 299 if (cpu_is_pxa21x() || cpu_is_pxa25x()) { ··· 368 317 } 369 318 370 319 /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ 371 - if (cpu_is_pxa25x()) 320 + if (cpu_is_pxa255()) 372 321 ret = platform_device_register(&pxa_device_hwuart); 373 322 374 - clks_register(&gpio7_clk, 1); 323 + clks_register(pxa2xx_clk_aliases, ARRAY_SIZE(pxa2xx_clk_aliases)); 375 324 376 325 return ret; 377 326 }
+1 -1
arch/arm/mach-sa1100/clock.c
··· 103 103 } 104 104 105 105 static struct clk clk_gpio27 = { 106 - .name = "GPIO27_CLK", 106 + .name = "SA1111_CLK", 107 107 .rate = 3686400, 108 108 .enable = clk_gpio27_enable, 109 109 .disable = clk_gpio27_disable,
+47 -32
drivers/mtd/nand/cmx270_nand.c
··· 20 20 21 21 #include <linux/mtd/nand.h> 22 22 #include <linux/mtd/partitions.h> 23 + #include <linux/gpio.h> 23 24 24 25 #include <asm/io.h> 25 26 #include <asm/irq.h> 27 + #include <asm/mach-types.h> 26 28 27 29 #include <asm/arch/hardware.h> 28 30 #include <asm/arch/pxa-regs.h> 29 31 30 32 #define GPIO_NAND_CS (11) 31 33 #define GPIO_NAND_RB (89) 32 - 33 - /* This macro needed to ensure in-order operation of GPIO and local 34 - * bus. Without both asm command and dummy uncached read there're 35 - * states when NAND access is broken. I've looked for such macro(s) in 36 - * include/asm-arm but found nothing approptiate. 37 - * dmac_clean_range is close, but is makes cache invalidation 38 - * unnecessary here and it cannot be used in module 39 - */ 40 - #define DRAIN_WB() \ 41 - do { \ 42 - unsigned char dummy; \ 43 - asm volatile ("mcr p15, 0, r0, c7, c10, 4":::"r0"); \ 44 - dummy=*((unsigned char*)UNCACHED_ADDR); \ 45 - } while(0) 46 34 47 35 /* MTD structure for CM-X270 board */ 48 36 static struct mtd_info *cmx270_nand_mtd; ··· 91 103 92 104 static inline void nand_cs_on(void) 93 105 { 94 - GPCR(GPIO_NAND_CS) = GPIO_bit(GPIO_NAND_CS); 106 + gpio_set_value(GPIO_NAND_CS, 0); 95 107 } 96 108 97 109 static void nand_cs_off(void) 98 110 { 99 - DRAIN_WB(); 111 + dsb(); 100 112 101 - GPSR(GPIO_NAND_CS) = GPIO_bit(GPIO_NAND_CS); 113 + gpio_set_value(GPIO_NAND_CS, 1); 102 114 } 103 115 104 116 /* ··· 110 122 struct nand_chip* this = mtd->priv; 111 123 unsigned int nandaddr = (unsigned int)this->IO_ADDR_W; 112 124 113 - DRAIN_WB(); 125 + dsb(); 114 126 115 127 if (ctrl & NAND_CTRL_CHANGE) { 116 128 if ( ctrl & NAND_ALE ) ··· 127 139 nand_cs_off(); 128 140 } 129 141 130 - DRAIN_WB(); 142 + dsb(); 131 143 this->IO_ADDR_W = (void __iomem*)nandaddr; 132 144 if (dat != NAND_CMD_NONE) 133 145 writel((dat << 16), this->IO_ADDR_W); 134 146 135 - DRAIN_WB(); 147 + dsb(); 136 148 } 137 149 138 150 /* ··· 140 152 */ 141 153 static int cmx270_device_ready(struct mtd_info *mtd) 142 154 { 143 - DRAIN_WB(); 155 + dsb(); 144 156 145 - return (GPLR(GPIO_NAND_RB) & GPIO_bit(GPIO_NAND_RB)); 157 + return (gpio_get_value(GPIO_NAND_RB)); 146 158 } 147 159 148 160 /* ··· 156 168 int mtd_parts_nb = 0; 157 169 int ret; 158 170 171 + if (!machine_is_armcore()) 172 + return -ENODEV; 173 + 174 + ret = gpio_request(GPIO_NAND_CS, "NAND CS"); 175 + if (ret) { 176 + pr_warning("CM-X270: failed to request NAND CS gpio\n"); 177 + return ret; 178 + } 179 + 180 + gpio_direction_output(GPIO_NAND_CS, 1); 181 + 182 + ret = gpio_request(GPIO_NAND_RB, "NAND R/B"); 183 + if (ret) { 184 + pr_warning("CM-X270: failed to request NAND R/B gpio\n"); 185 + goto err_gpio_request; 186 + } 187 + 188 + gpio_direction_input(GPIO_NAND_RB); 189 + 159 190 /* Allocate memory for MTD device structure and private data */ 160 191 cmx270_nand_mtd = kzalloc(sizeof(struct mtd_info) + 161 192 sizeof(struct nand_chip), 162 193 GFP_KERNEL); 163 194 if (!cmx270_nand_mtd) { 164 - printk("Unable to allocate CM-X270 NAND MTD device structure.\n"); 165 - return -ENOMEM; 195 + pr_debug("Unable to allocate CM-X270 NAND MTD device structure.\n"); 196 + ret = -ENOMEM; 197 + goto err_kzalloc; 166 198 } 167 199 168 200 cmx270_nand_io = ioremap(PXA_CS1_PHYS, 12); 169 201 if (!cmx270_nand_io) { 170 - printk("Unable to ioremap NAND device\n"); 202 + pr_debug("Unable to ioremap NAND device\n"); 171 203 ret = -EINVAL; 172 - goto err1; 204 + goto err_ioremap; 173 205 } 174 206 175 207 /* Get pointer to private data */ ··· 217 209 218 210 /* Scan to find existence of the device */ 219 211 if (nand_scan (cmx270_nand_mtd, 1)) { 220 - printk(KERN_NOTICE "No NAND device\n"); 212 + pr_notice("No NAND device\n"); 221 213 ret = -ENXIO; 222 - goto err2; 214 + goto err_scan; 223 215 } 224 216 225 217 #ifdef CONFIG_MTD_CMDLINE_PARTS ··· 237 229 } 238 230 239 231 /* Register the partitions */ 240 - printk(KERN_NOTICE "Using %s partition definition\n", part_type); 232 + pr_notice("Using %s partition definition\n", part_type); 241 233 ret = add_mtd_partitions(cmx270_nand_mtd, mtd_parts, mtd_parts_nb); 242 234 if (ret) 243 - goto err2; 235 + goto err_scan; 244 236 245 237 /* Return happy */ 246 238 return 0; 247 239 248 - err2: 240 + err_scan: 249 241 iounmap(cmx270_nand_io); 250 - err1: 242 + err_ioremap: 251 243 kfree(cmx270_nand_mtd); 244 + err_kzalloc: 245 + gpio_free(GPIO_NAND_RB); 246 + err_gpio_request: 247 + gpio_free(GPIO_NAND_CS); 252 248 253 249 return ret; 254 250 ··· 266 254 { 267 255 /* Release resources, unregister device */ 268 256 nand_release(cmx270_nand_mtd); 257 + 258 + gpio_free(GPIO_NAND_RB); 259 + gpio_free(GPIO_NAND_CS); 269 260 270 261 iounmap(cmx270_nand_io); 271 262
+25 -64
drivers/pcmcia/pxa2xx_cm_x270.c
··· 5 5 * it under the terms of the GNU General Public License version 2 as 6 6 * published by the Free Software Foundation. 7 7 * 8 - * Compulab Ltd., 2003, 2007 8 + * Compulab Ltd., 2003, 2007, 2008 9 9 * Mike Rapoport <mike@compulab.co.il> 10 10 * 11 11 */ 12 12 13 - #include <linux/kernel.h> 14 - #include <linux/sched.h> 15 13 #include <linux/platform_device.h> 16 14 #include <linux/irq.h> 17 15 #include <linux/delay.h> 16 + #include <linux/gpio.h> 18 17 19 - #include <pcmcia/ss.h> 20 - #include <asm/hardware.h> 21 18 #include <asm/mach-types.h> 22 - 23 19 #include <asm/arch/pxa-regs.h> 24 - #include <asm/arch/pxa2xx-gpio.h> 25 - #include <asm/arch/cm-x270.h> 26 20 27 21 #include "soc_common.h" 28 22 23 + #define GPIO_PCMCIA_S0_CD_VALID (84) 24 + #define GPIO_PCMCIA_S0_RDYINT (82) 25 + #define GPIO_PCMCIA_RESET (53) 26 + 27 + #define PCMCIA_S0_CD_VALID IRQ_GPIO(GPIO_PCMCIA_S0_CD_VALID) 28 + #define PCMCIA_S0_RDYINT IRQ_GPIO(GPIO_PCMCIA_S0_RDYINT) 29 + 30 + 29 31 static struct pcmcia_irqs irqs[] = { 30 32 { 0, PCMCIA_S0_CD_VALID, "PCMCIA0 CD" }, 31 - { 1, PCMCIA_S1_CD_VALID, "PCMCIA1 CD" }, 32 33 }; 33 34 34 35 static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 35 36 { 36 - GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) | 37 - GPIO_bit(GPIO49_nPWE) | 38 - GPIO_bit(GPIO50_nPIOR) | 39 - GPIO_bit(GPIO51_nPIOW) | 40 - GPIO_bit(GPIO85_nPCE_1) | 41 - GPIO_bit(GPIO54_nPCE_2); 37 + int ret = gpio_request(GPIO_PCMCIA_RESET, "PCCard reset"); 38 + if (ret) 39 + return ret; 40 + gpio_direction_output(GPIO_PCMCIA_RESET, 0); 42 41 43 - pxa_gpio_mode(GPIO48_nPOE_MD); 44 - pxa_gpio_mode(GPIO49_nPWE_MD); 45 - pxa_gpio_mode(GPIO50_nPIOR_MD); 46 - pxa_gpio_mode(GPIO51_nPIOW_MD); 47 - pxa_gpio_mode(GPIO85_nPCE_1_MD); 48 - pxa_gpio_mode(GPIO54_nPCE_2_MD); 49 - pxa_gpio_mode(GPIO55_nPREG_MD); 50 - pxa_gpio_mode(GPIO56_nPWAIT_MD); 51 - pxa_gpio_mode(GPIO57_nIOIS16_MD); 42 + skt->irq = PCMCIA_S0_RDYINT; 43 + ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 44 + if (!ret) 45 + gpio_free(GPIO_PCMCIA_RESET); 52 46 53 - /* Reset signal */ 54 - pxa_gpio_mode(GPIO53_nPCE_2 | GPIO_OUT); 55 - GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); 56 - 57 - set_irq_type(PCMCIA_S0_CD_VALID, IRQ_TYPE_EDGE_BOTH); 58 - set_irq_type(PCMCIA_S1_CD_VALID, IRQ_TYPE_EDGE_BOTH); 59 - 60 - /* irq's for slots: */ 61 - set_irq_type(PCMCIA_S0_RDYINT, IRQ_TYPE_EDGE_FALLING); 62 - set_irq_type(PCMCIA_S1_RDYINT, IRQ_TYPE_EDGE_FALLING); 63 - 64 - skt->irq = (skt->nr == 0) ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT; 65 - return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 47 + return ret; 66 48 } 67 49 68 50 static void cmx270_pcmcia_shutdown(struct soc_pcmcia_socket *skt) 69 51 { 70 52 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); 71 - 72 - set_irq_type(IRQ_TO_GPIO(PCMCIA_S0_CD_VALID), IRQ_TYPE_NONE); 73 - set_irq_type(IRQ_TO_GPIO(PCMCIA_S1_CD_VALID), IRQ_TYPE_NONE); 74 - 75 - set_irq_type(IRQ_TO_GPIO(PCMCIA_S0_RDYINT), IRQ_TYPE_NONE); 76 - set_irq_type(IRQ_TO_GPIO(PCMCIA_S1_RDYINT), IRQ_TYPE_NONE); 53 + gpio_free(GPIO_PCMCIA_RESET); 77 54 } 78 55 79 56 80 57 static void cmx270_pcmcia_socket_state(struct soc_pcmcia_socket *skt, 81 58 struct pcmcia_state *state) 82 59 { 83 - state->detect = (PCC_DETECT(skt->nr) == 0) ? 1 : 0; 84 - state->ready = (PCC_READY(skt->nr) == 0) ? 0 : 1; 60 + state->detect = (gpio_get_value(GPIO_PCMCIA_S0_CD_VALID) == 0) ? 1 : 0; 61 + state->ready = (gpio_get_value(GPIO_PCMCIA_S0_RDYINT) == 0) ? 0 : 1; 85 62 state->bvd1 = 1; 86 63 state->bvd2 = 1; 87 64 state->vs_3v = 0; ··· 70 93 static int cmx270_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, 71 94 const socket_state_t *state) 72 95 { 73 - GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); 74 - pxa_gpio_mode(GPIO49_nPWE | GPIO_OUT); 75 - 76 96 switch (skt->nr) { 77 97 case 0: 78 98 if (state->flags & SS_RESET) { 79 - GPCR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); 80 - GPSR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); 99 + gpio_set_value(GPIO_PCMCIA_RESET, 1); 81 100 udelay(10); 82 - GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); 83 - GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); 84 - } 85 - break; 86 - case 1: 87 - if (state->flags & SS_RESET) { 88 - GPCR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); 89 - GPSR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); 90 - udelay(10); 91 - GPCR(GPIO53_nPCE_2) = GPIO_bit(GPIO53_nPCE_2); 92 - GPSR(GPIO49_nPWE) = GPIO_bit(GPIO49_nPWE); 101 + gpio_set_value(GPIO_PCMCIA_RESET, 0); 93 102 } 94 103 break; 95 104 } 96 - 97 - pxa_gpio_mode(GPIO49_nPWE_MD); 98 105 99 106 return 0; 100 107 } ··· 100 139 .configure_socket = cmx270_pcmcia_configure_socket, 101 140 .socket_init = cmx270_pcmcia_socket_init, 102 141 .socket_suspend = cmx270_pcmcia_socket_suspend, 103 - .nr = 2, 142 + .nr = 1, 104 143 }; 105 144 106 145 static struct platform_device *cmx270_pcmcia_device;
-50
include/asm-arm/arch-pxa/cm-x270.h
··· 1 - /* 2 - * linux/include/asm/arch-pxa/cm-x270.h 3 - * 4 - * Copyright Compulab Ltd., 2003, 2007 5 - * Mike Rapoport <mike@compulab.co.il> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 11 - 12 - 13 - /* CM-x270 device physical addresses */ 14 - #define CMX270_CS1_PHYS (PXA_CS1_PHYS) 15 - #define MARATHON_PHYS (PXA_CS2_PHYS) 16 - #define CMX270_IDE104_PHYS (PXA_CS3_PHYS) 17 - #define CMX270_IT8152_PHYS (PXA_CS4_PHYS) 18 - 19 - /* Statically mapped regions */ 20 - #define CMX270_VIRT_BASE (0xe8000000) 21 - #define CMX270_IT8152_VIRT (CMX270_VIRT_BASE) 22 - #define CMX270_IDE104_VIRT (CMX270_IT8152_VIRT + SZ_64M) 23 - 24 - /* GPIO related definitions */ 25 - #define GPIO_IT8152_IRQ (22) 26 - 27 - #define IRQ_GPIO_IT8152_IRQ IRQ_GPIO(GPIO_IT8152_IRQ) 28 - #define PME_IRQ IRQ_GPIO(0) 29 - #define CMX270_IDE_IRQ IRQ_GPIO(100) 30 - #define CMX270_GPIRQ1 IRQ_GPIO(101) 31 - #define CMX270_TOUCHIRQ IRQ_GPIO(96) 32 - #define CMX270_ETHIRQ IRQ_GPIO(10) 33 - #define CMX270_GFXIRQ IRQ_GPIO(95) 34 - #define CMX270_NANDIRQ IRQ_GPIO(89) 35 - #define CMX270_MMC_IRQ IRQ_GPIO(83) 36 - 37 - /* PCMCIA related definitions */ 38 - #define PCC_DETECT(x) (GPLR(84 - (x)) & GPIO_bit(84 - (x))) 39 - #define PCC_READY(x) (GPLR(82 - (x)) & GPIO_bit(82 - (x))) 40 - 41 - #define PCMCIA_S0_CD_VALID IRQ_GPIO(84) 42 - #define PCMCIA_S0_CD_VALID_EDGE GPIO_BOTH_EDGES 43 - 44 - #define PCMCIA_S1_CD_VALID IRQ_GPIO(83) 45 - #define PCMCIA_S1_CD_VALID_EDGE GPIO_BOTH_EDGES 46 - 47 - #define PCMCIA_S0_RDYINT IRQ_GPIO(82) 48 - #define PCMCIA_S1_RDYINT IRQ_GPIO(81) 49 - 50 - #define PCMCIA_RESET_GPIO 53
+12
include/asm-arm/arch-pxa/hardware.h
··· 69 69 _id == 0x212; \ 70 70 }) 71 71 72 + #define __cpu_is_pxa255(id) \ 73 + ({ \ 74 + unsigned int _id = (id) >> 4 & 0xfff; \ 75 + _id == 0x2d0; \ 76 + }) 77 + 72 78 #define __cpu_is_pxa25x(id) \ 73 79 ({ \ 74 80 unsigned int _id = (id) >> 4 & 0xfff; \ ··· 82 76 }) 83 77 #else 84 78 #define __cpu_is_pxa21x(id) (0) 79 + #define __cpu_is_pxa255(id) (0) 85 80 #define __cpu_is_pxa25x(id) (0) 86 81 #endif 87 82 ··· 129 122 #define cpu_is_pxa21x() \ 130 123 ({ \ 131 124 __cpu_is_pxa21x(read_cpuid_id()); \ 125 + }) 126 + 127 + #define cpu_is_pxa255() \ 128 + ({ \ 129 + __cpu_is_pxa255(read_cpuid_id()); \ 132 130 }) 133 131 134 132 #define cpu_is_pxa25x() \