diff options
Diffstat (limited to 'arch/arm/mach-pxa/viper.c')
-rw-r--r-- | arch/arm/mach-pxa/viper.c | 51 |
1 files changed, 36 insertions, 15 deletions
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index d33c232b686c..e90114a7e246 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c | |||
@@ -27,12 +27,14 @@ | |||
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/fs.h> | 28 | #include <linux/fs.h> |
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <linux/slab.h> | ||
30 | #include <linux/interrupt.h> | 31 | #include <linux/interrupt.h> |
31 | #include <linux/major.h> | 32 | #include <linux/major.h> |
32 | #include <linux/module.h> | 33 | #include <linux/module.h> |
33 | #include <linux/pm.h> | 34 | #include <linux/pm.h> |
34 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
35 | #include <linux/gpio.h> | 36 | #include <linux/gpio.h> |
37 | #include <linux/jiffies.h> | ||
36 | #include <linux/i2c-gpio.h> | 38 | #include <linux/i2c-gpio.h> |
37 | #include <linux/serial_8250.h> | 39 | #include <linux/serial_8250.h> |
38 | #include <linux/smc91x.h> | 40 | #include <linux/smc91x.h> |
@@ -47,6 +49,7 @@ | |||
47 | #include <mach/pxafb.h> | 49 | #include <mach/pxafb.h> |
48 | #include <plat/i2c.h> | 50 | #include <plat/i2c.h> |
49 | #include <mach/regs-uart.h> | 51 | #include <mach/regs-uart.h> |
52 | #include <mach/arcom-pcmcia.h> | ||
50 | #include <mach/viper.h> | 53 | #include <mach/viper.h> |
51 | 54 | ||
52 | #include <asm/setup.h> | 55 | #include <asm/setup.h> |
@@ -76,14 +79,28 @@ static void viper_icr_clear_bit(unsigned int bit) | |||
76 | } | 79 | } |
77 | 80 | ||
78 | /* This function is used from the pcmcia module to reset the CF */ | 81 | /* This function is used from the pcmcia module to reset the CF */ |
79 | void viper_cf_rst(int state) | 82 | static void viper_cf_reset(int state) |
80 | { | 83 | { |
81 | if (state) | 84 | if (state) |
82 | viper_icr_set_bit(VIPER_ICR_CF_RST); | 85 | viper_icr_set_bit(VIPER_ICR_CF_RST); |
83 | else | 86 | else |
84 | viper_icr_clear_bit(VIPER_ICR_CF_RST); | 87 | viper_icr_clear_bit(VIPER_ICR_CF_RST); |
85 | } | 88 | } |
86 | EXPORT_SYMBOL(viper_cf_rst); | 89 | |
90 | static struct arcom_pcmcia_pdata viper_pcmcia_info = { | ||
91 | .cd_gpio = VIPER_CF_CD_GPIO, | ||
92 | .rdy_gpio = VIPER_CF_RDY_GPIO, | ||
93 | .pwr_gpio = VIPER_CF_POWER_GPIO, | ||
94 | .reset = viper_cf_reset, | ||
95 | }; | ||
96 | |||
97 | static struct platform_device viper_pcmcia_device = { | ||
98 | .name = "viper-pcmcia", | ||
99 | .id = -1, | ||
100 | .dev = { | ||
101 | .platform_data = &viper_pcmcia_info, | ||
102 | }, | ||
103 | }; | ||
87 | 104 | ||
88 | /* | 105 | /* |
89 | * The CPLD version register was not present on VIPER boards prior to | 106 | * The CPLD version register was not present on VIPER boards prior to |
@@ -266,7 +283,7 @@ static void viper_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
266 | do { | 283 | do { |
267 | /* we're in a chained irq handler, | 284 | /* we're in a chained irq handler, |
268 | * so ack the interrupt by hand */ | 285 | * so ack the interrupt by hand */ |
269 | GEDR(VIPER_CPLD_GPIO) = GPIO_bit(VIPER_CPLD_GPIO); | 286 | desc->chip->ack(irq); |
270 | 287 | ||
271 | if (likely(pending)) { | 288 | if (likely(pending)) { |
272 | irq = viper_bit_to_irq(__ffs(pending)); | 289 | irq = viper_bit_to_irq(__ffs(pending)); |
@@ -301,15 +318,6 @@ static void __init viper_init_irq(void) | |||
301 | set_irq_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO), | 318 | set_irq_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO), |
302 | viper_irq_handler); | 319 | viper_irq_handler); |
303 | set_irq_type(gpio_to_irq(VIPER_CPLD_GPIO), IRQ_TYPE_EDGE_BOTH); | 320 | set_irq_type(gpio_to_irq(VIPER_CPLD_GPIO), IRQ_TYPE_EDGE_BOTH); |
304 | |||
305 | #ifndef CONFIG_SERIAL_PXA | ||
306 | /* | ||
307 | * 8250 doesn't support IRQ_TYPE being passed as part | ||
308 | * of the plat_serial8250_port structure... | ||
309 | */ | ||
310 | set_irq_type(gpio_to_irq(VIPER_UARTA_GPIO), IRQ_TYPE_EDGE_RISING); | ||
311 | set_irq_type(gpio_to_irq(VIPER_UARTB_GPIO), IRQ_TYPE_EDGE_RISING); | ||
312 | #endif | ||
313 | } | 321 | } |
314 | 322 | ||
315 | /* Flat Panel */ | 323 | /* Flat Panel */ |
@@ -373,7 +381,7 @@ err_request_bckl: | |||
373 | return ret; | 381 | return ret; |
374 | } | 382 | } |
375 | 383 | ||
376 | static int viper_backlight_notify(int brightness) | 384 | static int viper_backlight_notify(struct device *dev, int brightness) |
377 | { | 385 | { |
378 | gpio_set_value(VIPER_LCD_EN_GPIO, !!brightness); | 386 | gpio_set_value(VIPER_LCD_EN_GPIO, !!brightness); |
379 | gpio_set_value(VIPER_BCKLIGHT_EN_GPIO, !!brightness); | 387 | gpio_set_value(VIPER_BCKLIGHT_EN_GPIO, !!brightness); |
@@ -447,7 +455,7 @@ static struct i2c_gpio_platform_data i2c_bus_data = { | |||
447 | .sda_pin = VIPER_RTC_I2C_SDA_GPIO, | 455 | .sda_pin = VIPER_RTC_I2C_SDA_GPIO, |
448 | .scl_pin = VIPER_RTC_I2C_SCL_GPIO, | 456 | .scl_pin = VIPER_RTC_I2C_SCL_GPIO, |
449 | .udelay = 10, | 457 | .udelay = 10, |
450 | .timeout = 100, | 458 | .timeout = HZ, |
451 | }; | 459 | }; |
452 | 460 | ||
453 | static struct platform_device i2c_bus_device = { | 461 | static struct platform_device i2c_bus_device = { |
@@ -539,6 +547,7 @@ static struct plat_serial8250_port serial_platform_data[] = { | |||
539 | { | 547 | { |
540 | .mapbase = VIPER_UARTA_PHYS, | 548 | .mapbase = VIPER_UARTA_PHYS, |
541 | .irq = gpio_to_irq(VIPER_UARTA_GPIO), | 549 | .irq = gpio_to_irq(VIPER_UARTA_GPIO), |
550 | .irqflags = IRQF_TRIGGER_RISING, | ||
542 | .uartclk = 1843200, | 551 | .uartclk = 1843200, |
543 | .regshift = 1, | 552 | .regshift = 1, |
544 | .iotype = UPIO_MEM, | 553 | .iotype = UPIO_MEM, |
@@ -548,6 +557,7 @@ static struct plat_serial8250_port serial_platform_data[] = { | |||
548 | { | 557 | { |
549 | .mapbase = VIPER_UARTB_PHYS, | 558 | .mapbase = VIPER_UARTB_PHYS, |
550 | .irq = gpio_to_irq(VIPER_UARTB_GPIO), | 559 | .irq = gpio_to_irq(VIPER_UARTB_GPIO), |
560 | .irqflags = IRQF_TRIGGER_RISING, | ||
551 | .uartclk = 1843200, | 561 | .uartclk = 1843200, |
552 | .regshift = 1, | 562 | .regshift = 1, |
553 | .iotype = UPIO_MEM, | 563 | .iotype = UPIO_MEM, |
@@ -692,6 +702,7 @@ static struct platform_device *viper_devs[] __initdata = { | |||
692 | &viper_mtd_devices[0], | 702 | &viper_mtd_devices[0], |
693 | &viper_mtd_devices[1], | 703 | &viper_mtd_devices[1], |
694 | &viper_backlight_device, | 704 | &viper_backlight_device, |
705 | &viper_pcmcia_device, | ||
695 | }; | 706 | }; |
696 | 707 | ||
697 | static mfp_cfg_t viper_pin_config[] __initdata = { | 708 | static mfp_cfg_t viper_pin_config[] __initdata = { |
@@ -702,6 +713,12 @@ static mfp_cfg_t viper_pin_config[] __initdata = { | |||
702 | GPIO80_nCS_4, | 713 | GPIO80_nCS_4, |
703 | GPIO33_nCS_5, | 714 | GPIO33_nCS_5, |
704 | 715 | ||
716 | /* AC97 */ | ||
717 | GPIO28_AC97_BITCLK, | ||
718 | GPIO29_AC97_SDATA_IN_0, | ||
719 | GPIO30_AC97_SDATA_OUT, | ||
720 | GPIO31_AC97_SYNC, | ||
721 | |||
705 | /* FP Backlight */ | 722 | /* FP Backlight */ |
706 | GPIO9_GPIO, /* VIPER_BCKLIGHT_EN_GPIO */ | 723 | GPIO9_GPIO, /* VIPER_BCKLIGHT_EN_GPIO */ |
707 | GPIO10_GPIO, /* VIPER_LCD_EN_GPIO */ | 724 | GPIO10_GPIO, /* VIPER_LCD_EN_GPIO */ |
@@ -763,7 +780,7 @@ static void __init viper_tpm_init(void) | |||
763 | .sda_pin = VIPER_TPM_I2C_SDA_GPIO, | 780 | .sda_pin = VIPER_TPM_I2C_SDA_GPIO, |
764 | .scl_pin = VIPER_TPM_I2C_SCL_GPIO, | 781 | .scl_pin = VIPER_TPM_I2C_SCL_GPIO, |
765 | .udelay = 10, | 782 | .udelay = 10, |
766 | .timeout = 100, | 783 | .timeout = HZ, |
767 | }; | 784 | }; |
768 | char *errstr; | 785 | char *errstr; |
769 | 786 | ||
@@ -908,6 +925,10 @@ static void __init viper_init(void) | |||
908 | 925 | ||
909 | pxa2xx_mfp_config(ARRAY_AND_SIZE(viper_pin_config)); | 926 | pxa2xx_mfp_config(ARRAY_AND_SIZE(viper_pin_config)); |
910 | 927 | ||
928 | pxa_set_ffuart_info(NULL); | ||
929 | pxa_set_btuart_info(NULL); | ||
930 | pxa_set_stuart_info(NULL); | ||
931 | |||
911 | /* Wake-up serial console */ | 932 | /* Wake-up serial console */ |
912 | viper_init_serial_gpio(); | 933 | viper_init_serial_gpio(); |
913 | 934 | ||