aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/cm-x300.c38
-rw-r--r--arch/arm/mach-pxa/irq.c11
-rw-r--r--arch/arm/mach-pxa/palmtc.c8
-rw-r--r--arch/arm/mach-pxa/spitz.c78
4 files changed, 95 insertions, 40 deletions
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index aac2cda60e0..102916f1e46 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -43,10 +43,10 @@
43 43
44#define CM_X300_ETH_PHYS 0x08000010 44#define CM_X300_ETH_PHYS 0x08000010
45 45
46#define GPIO82_MMC2_IRQ (82) 46#define GPIO82_MMC_IRQ (82)
47#define GPIO85_MMC2_WP (85) 47#define GPIO85_MMC_WP (85)
48 48
49#define CM_X300_MMC2_IRQ IRQ_GPIO(GPIO82_MMC2_IRQ) 49#define CM_X300_MMC_IRQ IRQ_GPIO(GPIO82_MMC_IRQ)
50 50
51#define GPIO95_RTC_CS (95) 51#define GPIO95_RTC_CS (95)
52#define GPIO96_RTC_WR (96) 52#define GPIO96_RTC_WR (96)
@@ -292,37 +292,37 @@ static inline void cm_x300_init_nand(void) {}
292#endif 292#endif
293 293
294#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE) 294#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE)
295/* The first MMC slot of CM-X300 is hardwired to Libertas card and has 295static struct pxamci_platform_data cm_x300_mci_platform_data = {
296 .detect_delay = 20,
297 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
298 .gpio_card_detect = GPIO82_MMC_IRQ,
299 .gpio_card_ro = GPIO85_MMC_WP,
300 .gpio_power = -1,
301};
302
303/* The second MMC slot of CM-X300 is hardwired to Libertas card and has
296 no detection/ro pins */ 304 no detection/ro pins */
297static int cm_x300_mci_init(struct device *dev, 305static int cm_x300_mci2_init(struct device *dev,
298 irq_handler_t cm_x300_detect_int, 306 irq_handler_t cm_x300_detect_int,
299 void *data) 307 void *data)
300{ 308{
301 return 0; 309 return 0;
302} 310}
303 311
304static void cm_x300_mci_exit(struct device *dev, void *data) 312static void cm_x300_mci2_exit(struct device *dev, void *data)
305{ 313{
306} 314}
307 315
308static struct pxamci_platform_data cm_x300_mci_platform_data = { 316static struct pxamci_platform_data cm_x300_mci2_platform_data = {
309 .detect_delay = 20, 317 .detect_delay = 20,
310 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, 318 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
311 .init = cm_x300_mci_init, 319 .init = cm_x300_mci2_init,
312 .exit = cm_x300_mci_exit, 320 .exit = cm_x300_mci2_exit,
313 .gpio_card_detect = -1, 321 .gpio_card_detect = -1,
314 .gpio_card_ro = -1, 322 .gpio_card_ro = -1,
315 .gpio_power = -1, 323 .gpio_power = -1,
316}; 324};
317 325
318static struct pxamci_platform_data cm_x300_mci2_platform_data = {
319 .detect_delay = 20,
320 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
321 .gpio_card_detect = GPIO82_MMC2_IRQ,
322 .gpio_card_ro = GPIO85_MMC2_WP,
323 .gpio_power = -1,
324};
325
326static void __init cm_x300_init_mmc(void) 326static void __init cm_x300_init_mmc(void)
327{ 327{
328 pxa_set_mci_info(&cm_x300_mci_platform_data); 328 pxa_set_mci_info(&cm_x300_mci_platform_data);
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index d694ce28966..6112af431fa 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -25,6 +25,8 @@
25 25
26#include "generic.h" 26#include "generic.h"
27 27
28#define MAX_INTERNAL_IRQS 128
29
28#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) 30#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f)
29#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR)) 31#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR))
30#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR)) 32#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR))
@@ -122,6 +124,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
122{ 124{
123 int irq, i; 125 int irq, i;
124 126
127 BUG_ON(irq_nr > MAX_INTERNAL_IRQS);
128
125 pxa_internal_irq_nr = irq_nr; 129 pxa_internal_irq_nr = irq_nr;
126 130
127 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) { 131 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) {
@@ -149,7 +153,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
149} 153}
150 154
151#ifdef CONFIG_PM 155#ifdef CONFIG_PM
152static unsigned long saved_icmr[2]; 156static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
157static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
153 158
154static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) 159static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
155{ 160{
@@ -159,6 +164,8 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
159 saved_icmr[i] = _ICMR(irq); 164 saved_icmr[i] = _ICMR(irq);
160 _ICMR(irq) = 0; 165 _ICMR(irq) = 0;
161 } 166 }
167 for (i = 0; i < pxa_internal_irq_nr; i++)
168 saved_ipr[i] = IPR(i);
162 169
163 return 0; 170 return 0;
164} 171}
@@ -171,6 +178,8 @@ static int pxa_irq_resume(struct sys_device *dev)
171 _ICMR(irq) = saved_icmr[i]; 178 _ICMR(irq) = saved_icmr[i];
172 _ICLR(irq) = 0; 179 _ICLR(irq) = 0;
173 } 180 }
181 for (i = 0; i < pxa_internal_irq_nr; i++)
182 IPR(i) = saved_ipr[i];
174 183
175 ICCR = 1; 184 ICCR = 1;
176 return 0; 185 return 0;
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index bb2cc0dd44e..0b92291a58f 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -292,10 +292,10 @@ const static unsigned int palmtc_keypad_col_gpios[] = {
292 292
293static struct matrix_keypad_platform_data palmtc_keypad_platform_data = { 293static struct matrix_keypad_platform_data palmtc_keypad_platform_data = {
294 .keymap_data = &palmtc_keymap_data, 294 .keymap_data = &palmtc_keymap_data,
295 .col_gpios = palmtc_keypad_row_gpios, 295 .row_gpios = palmtc_keypad_row_gpios,
296 .num_col_gpios = 12, 296 .num_row_gpios = ARRAY_SIZE(palmtc_keypad_row_gpios),
297 .row_gpios = palmtc_keypad_col_gpios, 297 .col_gpios = palmtc_keypad_col_gpios,
298 .num_row_gpios = 4, 298 .num_col_gpios = ARRAY_SIZE(palmtc_keypad_col_gpios),
299 .active_low = 1, 299 .active_low = 1,
300 300
301 .debounce_ms = 20, 301 .debounce_ms = 20,
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index ee8d6038ce8..3da45d05174 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/gpio_keys.h>
18#include <linux/gpio.h> 19#include <linux/gpio.h>
19#include <linux/leds.h> 20#include <linux/leds.h>
20#include <linux/mtd/physmap.h> 21#include <linux/mtd/physmap.h>
@@ -375,6 +376,43 @@ static struct platform_device spitzkbd_device = {
375}; 376};
376 377
377 378
379static struct gpio_keys_button spitz_gpio_keys[] = {
380 {
381 .type = EV_PWR,
382 .code = KEY_SUSPEND,
383 .gpio = SPITZ_GPIO_ON_KEY,
384 .desc = "On/Off",
385 .wakeup = 1,
386 },
387 /* Two buttons detecting the lid state */
388 {
389 .type = EV_SW,
390 .code = 0,
391 .gpio = SPITZ_GPIO_SWA,
392 .desc = "Display Down",
393 },
394 {
395 .type = EV_SW,
396 .code = 1,
397 .gpio = SPITZ_GPIO_SWB,
398 .desc = "Lid Closed",
399 },
400};
401
402static struct gpio_keys_platform_data spitz_gpio_keys_platform_data = {
403 .buttons = spitz_gpio_keys,
404 .nbuttons = ARRAY_SIZE(spitz_gpio_keys),
405};
406
407static struct platform_device spitz_gpio_keys_device = {
408 .name = "gpio-keys",
409 .id = -1,
410 .dev = {
411 .platform_data = &spitz_gpio_keys_platform_data,
412 },
413};
414
415
378/* 416/*
379 * Spitz LEDs 417 * Spitz LEDs
380 */ 418 */
@@ -689,6 +727,7 @@ static struct platform_device sharpsl_rom_device = {
689static struct platform_device *devices[] __initdata = { 727static struct platform_device *devices[] __initdata = {
690 &spitzscoop_device, 728 &spitzscoop_device,
691 &spitzkbd_device, 729 &spitzkbd_device,
730 &spitz_gpio_keys_device,
692 &spitzled_device, 731 &spitzled_device,
693 &sharpsl_nand_device, 732 &sharpsl_nand_device,
694 &sharpsl_rom_device, 733 &sharpsl_rom_device,
@@ -740,11 +779,34 @@ static void __init common_init(void)
740 pxa_set_i2c_info(NULL); 779 pxa_set_i2c_info(NULL);
741} 780}
742 781
782#if defined(CONFIG_MACH_AKITA) || defined(CONFIG_MACH_BORZOI)
783static struct nand_bbt_descr sharpsl_akita_bbt = {
784 .options = 0,
785 .offs = 4,
786 .len = 1,
787 .pattern = scan_ff_pattern
788};
789
790static struct nand_ecclayout akita_oobinfo = {
791 .eccbytes = 24,
792 .eccpos = {
793 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11,
794 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
795 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37},
796 .oobfree = {{0x08, 0x09}}
797};
798#endif
799
743#if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI) 800#if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI)
744static void __init spitz_init(void) 801static void __init spitz_init(void)
745{ 802{
746 spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON; 803 spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON;
747 804
805 if (machine_is_borzoi()) {
806 sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt;
807 sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo;
808 }
809
748 platform_scoop_config = &spitz_pcmcia_config; 810 platform_scoop_config = &spitz_pcmcia_config;
749 811
750 common_init(); 812 common_init();
@@ -769,22 +831,6 @@ static struct i2c_board_info akita_i2c_board_info[] = {
769 }, 831 },
770}; 832};
771 833
772static struct nand_bbt_descr sharpsl_akita_bbt = {
773 .options = 0,
774 .offs = 4,
775 .len = 1,
776 .pattern = scan_ff_pattern
777};
778
779static struct nand_ecclayout akita_oobinfo = {
780 .eccbytes = 24,
781 .eccpos = {
782 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11,
783 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
784 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37},
785 .oobfree = {{0x08, 0x09}}
786};
787
788static void __init akita_init(void) 834static void __init akita_init(void)
789{ 835{
790 spitz_ficp_platform_data.gpio_pwdown = AKITA_GPIO_IR_ON; 836 spitz_ficp_platform_data.gpio_pwdown = AKITA_GPIO_IR_ON;