1 Index: linux-2.6.21.7/arch/arm/mach-at91/at91rm9200_devices.c
2 ===================================================================
3 --- linux-2.6.21.7.orig/arch/arm/mach-at91/at91rm9200_devices.c
4 +++ linux-2.6.21.7/arch/arm/mach-at91/at91rm9200_devices.c
5 @@ -840,9 +840,9 @@ static inline void configure_usart3_pins
6 at91_set_B_periph(AT91_PIN_PA6, 0); /* RXD3 */
7 at91_set_B_periph(AT91_PIN_PB0, 0); /* RTS3 */
8 at91_set_B_periph(AT91_PIN_PB1, 0); /* CTS3 */
9 - at91_set_gpio_output(AT91_PIN_PB29, 1); /* DTR0 */
10 - at91_set_gpio_output(AT91_PIN_PB2, 1); /* RI0 */
11 - at91_set_gpio_input(AT91_PIN_PA24, 1); /* DCD0 */
12 + at91_set_gpio_output(AT91_PIN_PB29, 1); /* DTR3 */
13 + at91_set_gpio_output(AT91_PIN_PB2, 1); /* RI3 */
14 + at91_set_gpio_input(AT91_PIN_PA24, 1); /* DCD3 */
15 at91_set_deglitch(AT91_PIN_PA24, 1);
18 Index: linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
19 ===================================================================
20 --- linux-2.6.21.7.orig/arch/arm/mach-at91/board-vlink.c
21 +++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
22 @@ -126,6 +126,7 @@ static struct spi_board_info vlink_spi_d
24 static void __init vlink_board_init(void)
28 at91_add_device_serial();
30 @@ -147,6 +148,10 @@ static void __init vlink_board_init(void
31 // at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
32 at91_add_device_mmc(0, &vlink_mmc_data);
34 +// Set VLink version PIN as an input with pull up (V1.5 = GND)
35 + at91_set_gpio_input(AT91_PIN_PC2, 1);
36 + v100 = at91_get_gpio_value(AT91_PIN_PC2);
39 // at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
41 @@ -164,10 +169,16 @@ static void __init vlink_board_init(void
43 if (at91_get_gpio_value(AT91_PIN_PB8)) {
44 at91_set_gpio_output(AT91_PIN_PB11, 0);
45 - at91_set_gpio_output(AT91_PIN_PB9, 1);
47 + at91_set_gpio_output(AT91_PIN_PB9, 1);
49 + at91_set_gpio_output(AT91_PIN_PC13, 1);
51 at91_set_gpio_output(AT91_PIN_PB11, 1);
52 - at91_set_gpio_output(AT91_PIN_PB9, 0);
54 + at91_set_gpio_output(AT91_PIN_PB9, 0);
56 + at91_set_gpio_output(AT91_PIN_PC13, 0);
59 at91_set_gpio_output(AT91_PIN_PB10, 1); // ENBSC2
60 @@ -182,7 +193,18 @@ static void __init vlink_board_init(void
61 at91_set_gpio_input(AT91_PIN_PB27, 1); // UDB_CNX
62 at91_set_gpio_output(AT91_PIN_PB28, 1); // UDB_PUP
63 at91_set_multi_drive(AT91_PIN_PB28, 1); // Set to multi-drive
68 + at91_set_gpio_input (AT91_PIN_PC12, 1); // SD Card present
71 + { // DO special things for V1.5
72 + at91_set_gpio_output(AT91_PIN_PB9 , 0); // USB suspend
73 + at91_set_gpio_input (AT91_PIN_PC10, 1); // SD Card present
74 + at91_set_gpio_output(AT91_PIN_PC11, 0); // USB Vin CTRL for modules onboard
75 + at91_set_gpio_output(AT91_PIN_PC12, 0); // SIM control
79 MACHINE_START(VLINK, "FDL VersaLink")
80 Index: linux-2.6.21.7/drivers/char/vlink_giu.c
81 ===================================================================
82 --- linux-2.6.21.7.orig/drivers/char/vlink_giu.c
83 +++ linux-2.6.21.7/drivers/char/vlink_giu.c
84 @@ -41,8 +41,7 @@ static int major; /* default is dynamic
85 module_param(major, int, 0);
86 MODULE_PARM_DESC(major, "Major device number");
88 -#define VIO_NR_DEVS 96
90 +#define VIO_NR_DEVS 96
94 @@ -50,6 +49,53 @@ struct vio_dev {
95 struct vio_dev *vio_devices;
96 static struct class *vio_class;
99 +#define MAX_VIO_NAMES 24
108 +VIO_NAMES VioName[MAX_VIO_NAMES] = { //Port,PIN, V100 , V150
109 + {'A',19,"port1DTR" ,"port1DTR"},
110 + {'A',24,"port2DTR" ,"port2DTR"},
111 + {'B',8, "jigOn" ,"jigOn"} ,
112 + {'B',9, "enbSC3" ,"usbSUSPND"},
113 + {'B',10,"enbSC2" ,"enbSC2"},
114 + {'B',11,"enbSC1" ,"enbSC1"},
115 + {'B',12,"gsmONOFF" ,"gsmONOFF"},
116 + {'B',14,"ledBAP1" ,"ledBAP1"},
117 + {'B',15,"ledBBP1" ,"ledBBP1"},
118 + {'B',16,"ledBAP2" ,"ledBAP2"},
119 + {'B',17,"ledBBP2" ,"ledBBP2"},
120 + {'B',27,"udpCNX" ,"udpCNX"},
121 + {'B',28,"udpPUP" ,"udpPUP"},
122 + {'B',29,"port2DCD" ,"port2DCD"},
123 + {'C',2, "vlVer100" ,"vlVer150"},
124 + {'C',7, "ledFAP1" ,"ledFAP1"},
125 + {'C',8, "ledFBP1" ,"ledFBP1"},
126 + {'C',10,"vioC10" ,"sdCardON"},
127 + {'C',11,"vioC11" ,"vusbCTRL"},
128 + {'C',12,"sdCardON" ,"simCTRL"},
129 + {'C',13,"vioC13" ,"enbSC3"},
130 + {'C',14,"ledFBP2" ,"ledFBP2"},
131 + {'C',15,"ledFAP2" ,"ledFAP2"},
134 +/* {'B',18,"gsmRIO" ,"gsmRIO"},
135 + {'B',20,"gsmTX" ,"gsmTX"},
136 + {'B',21,"gsmRX" ,"gsmRX"},
137 + {'B',22,"gsmPIND" ,"gsmPIND"},
138 + {'B',23,"gsmDCD" ,"gsmDCD"},
139 + {'B',24,"gsmCTS" ,"gsmCTS"},
140 + {'B',25,"gsmDSR" ,"gsmDSR"},
141 + {'B',26,"gsmRTS" ,"gsmRTS"},*/
142 +static void lookupPINName(char version100, char *devName, char port, char pin);
145 static ssize_t gpio_read(struct file *file, char __user *buf, size_t len,
148 @@ -160,6 +206,8 @@ static int vio_probe(struct platform_dev
156 vdev = MKDEV(major, 0);
157 @@ -185,6 +233,7 @@ static int vio_probe(struct platform_dev
159 return PTR_ERR(vio_class);
161 + vlinkV100 = at91_get_gpio_value(AT91_PIN_PC2); // Denotes V1.5 if ground
163 vio_devices = kmalloc(VIO_NR_DEVS * sizeof(struct vio_dev), GFP_KERNEL);
165 @@ -198,8 +247,10 @@ static int vio_probe(struct platform_dev
166 int iodev = at91_is_pin_gpio(PIN_BASE + i*32 + j);
168 vio_setup_cdev(&vio_devices[i*32 + j], i*32 + j);
169 - class_device_create(vio_class, NULL, MKDEV(major, i*32 + j), NULL,
170 - "vio%c%d", i + 'A', j);
171 + // Lookup name of vio to create
172 + lookupPINName(vlinkV100, devName, i, j);
173 + class_device_create(vio_class, NULL, MKDEV(major, i*32 + j), NULL, devName);
174 +// "vio%c%d", i + 'A', j);
178 @@ -212,6 +263,29 @@ fail:
182 +static void lookupPINName(char version100, char *devName, char port, char pin)
189 + if (i >= MAX_VIO_NAMES)
191 + if (VioName[i].port == port+'A' && VioName[i].pin == pin)
193 + printk(KERN_ERR "vio++: %c%d=%s\n",VioName[i].port,VioName[i].pin,VioName[i].name150);
195 + strcpy(devName, VioName[i].name100);
197 + strcpy(devName, VioName[i].name150);
202 + sprintf(devName, "vio%c%d", port + 'A', pin);
205 static struct platform_device *vio_platform_device;
207 static struct platform_driver vio_driver = {