6/22/2012

How to add another usb COM port in android/LE build?

Question:
How to add another usb COM port in android/LE build? I need another port for AT command

Answer:
You can modify serial.c in drivers/usb/function to add another tty instance and also modify board-xxx.c to add a usb function.

Detail:
change in serial.c
1. Change "instances=2", to "instance=MAX_INSTANCES", and change MAX_INSTANCES to 3
2. Add a new member in char *a[] = {"modem", "nmea"}
3. Change usb_function_serial[2] to usb_function_serial[MAX_INSTANCES]

change in board-xxxx.c(i.e. board-halibut.c for 7200a, board-7x27.c for 7x27),
1. add a new function map in usb_functions_map[]
2. add a new product_id for your new composition in usb_func_composition[] and set the bit for your new serial port.

Then you can see a new /dev/ttyHSUSB2.
you can use port_bridge to bridge this port to a spare smd port. see solution 00012899 about smd channel

No comments:

Post a Comment