3 * Turns on serial support when a cord is attached.
7 #include <linux/module.h>
8 #include <linux/init.h>
9 #include <linux/interrupt.h>
10 #include <linux/irq.h>
11 #include <linux/platform_device.h>
12 #include <asm/arch/hardware.h>
13 #include <asm/arch/pxa-regs.h>
14 #include <linux/soc/asic3_base.h>
15 #include "../generic.h"
16 #include <asm/arch/h4000-gpio.h>
17 #include <asm/arch/h4000-asic.h>
19 extern struct platform_device h4000_asic3
;
21 static irqreturn_t
h4000_rs232(int irq
, void *dev_id
, struct pt_regs
*regs
)
23 if (GET_H4000_GPIO(SERIAL_DETECT
))
24 asic3_set_gpio_out_a(&h4000_asic3
.dev
,
25 GPIOA_RS232_ON
, GPIOA_RS232_ON
);
27 asic3_set_gpio_out_a(&h4000_asic3
.dev
, GPIOA_RS232_ON
, 0);
31 static int __init
h4000_serial_init(void)
33 if (request_irq(IRQ_GPIO(GPIO_NR_H4000_SERIAL_DETECT
), &h4000_rs232
,
34 SA_INTERRUPT
, "h4000_rs232", NULL
))
35 printk("request_irq failed for h4000 serial detection\n");
37 set_irq_type(IRQ_GPIO(GPIO_NR_H4000_SERIAL_DETECT
),
39 pxa_gpio_mode(GPIO34_FFRXD_MD
);
40 pxa_gpio_mode(GPIO35_FFCTS_MD
);
41 pxa_gpio_mode(GPIO36_FFDCD_MD
);
42 pxa_gpio_mode(GPIO37_FFDSR_MD
);
43 pxa_gpio_mode(GPIO38_FFRI_MD
);
44 pxa_gpio_mode(GPIO39_FFTXD_MD
);
45 pxa_gpio_mode(GPIO40_FFDTR_MD
);
46 pxa_gpio_mode(GPIO41_FFRTS_MD
);
51 module_init(h4000_serial_init
);
52 MODULE_LICENSE("GPL");