If it is in there maybe they gave it a open source license and we can use it? if not maybe we can learn from it and write a new one. assume the source is there.
Attached the f-tmc.c file I saw in the GPL sources: AFG_hdg2000b\src\linux-3.2.35\drivers\usb\gadget\f-tmc.c
Plus the USB declaration in mach-hantek2416.c where you find the PID/VID of the USB TMC port, those you can see in Agilent connection expert:
...
#ifdef CONFIG_HK_USBD_ANDROID
//android gadget
#include <linux/usb/android_composite.h>
static char *usb_functions_ums[] = {
"mass_storage",
};
static char *usb_functions_serial[] = {
"serial",
};
static char *usb_functions_tmc[] = {
"tmc",
};
#define PRODUCT_ID (0x505b)
static struct android_usb_product usb_products[] =
{
{
.product_id = PRODUCT_ID,
.num_functions = ARRAY_SIZE(usb_functions_tmc),
.functions = usb_functions_tmc,
},
{
.product_id = PRODUCT_ID,
.num_functions = ARRAY_SIZE(usb_functions_serial),
.functions = usb_functions_serial,
},
{
.product_id = 0x0ff9,
.num_functions = ARRAY_SIZE(usb_functions_ums),
.functions = usb_functions_ums,
},
};
static char *usb_functions_all[] =
{
"tmc",
"serial",
"mass_storage",
};
static struct android_usb_platform_data android_usb_pdata =
{
.vendor_id = 0x049f,
.product_id = PRODUCT_ID,
.version = 0x0100,
.product_name = "hdg",
.manufacturer_name = "hantek",
.serial_number = "HTG10000522222",
.num_products = ARRAY_SIZE(usb_products),
.products = usb_products,
.num_functions = ARRAY_SIZE(usb_functions_all),
.functions = usb_functions_all,
.update_pid_and_serial_num = NULL,
//.usb_id_pin_gpio = ELITE_GPIO_USB_ID1,
.fserial_init_string = "tty:serial",
.nluns = 3,
};
static struct platform_device android_usb_device = {
.name = "android_usb",
.id = -1,
.dev = {
.platform_data = &android_usb_pdata,
},
};
#endif
...