Пример #1
0
static int __init fserial_probe(struct platform_device *pdev)
{
	struct usb_gadget_fserial_platform_data	*pdata =
					pdev->dev.platform_data;
	int i;

	dev_dbg(&pdev->dev, "%s: probe\n", __func__);

	if (!pdata)
		goto probe_android_register;

	for (i = 0; i < GSERIAL_NO_PORTS; i++) {
		gserial_ports[i].transport = pdata->transport[i];
		gserial_ports[i].port_num = i;

		switch (gserial_ports[i].transport) {
		case USB_GADGET_FSERIAL_TRANSPORT_TTY:
			gserial_ports[i].client_port_num = no_tty_ports;
			no_tty_ports++;
			break;
		case USB_GADGET_FSERIAL_TRANSPORT_SDIO:
			gserial_ports[i].client_port_num = no_sdio_ports;
			no_sdio_ports++;
			break;
		case USB_GADGET_FSERIAL_TRANSPORT_SMD:
			gserial_ports[i].client_port_num = no_smd_ports;
			no_smd_ports++;
			break;
		default:
			pr_err("%s: Un-supported transport transport: %u\n",
					__func__, gserial_ports[i].transport);
			return -ENODEV;
		}

		nr_ports++;
	}

	pr_info("%s:gport:tty_ports:%u sdio_ports:%u "
			"smd_ports:%u nr_ports:%u\n",
			__func__, no_tty_ports, no_sdio_ports,
			no_smd_ports, nr_ports);

probe_android_register:
	android_register_function(&modem_function);
// [START] seunghun.kim : temp_modify for using LG_USB_MODEM on ES3 by f_serial
#ifndef CONFIG_LGE_USB_GADGET_DRIVER
	android_register_function(&nmea_function);
// [START] seunghun.kim : temp_modify for using LG_USB_MODEM on ES3 by f_serial
#endif
#ifdef CONFIG_LGE_USB_TWO_MODEM
	android_register_function(&nmea_function);
// [START] seunghun.kim : temp_modify for using LG_USB_MODEM on ES3 by f_serial
#endif
// [END] seunghun.kim : temp_modify for using LG_USB_MODEM on ES3 by f_serial

	return 0;
}
Пример #2
0
static int __init fserial_probe(struct platform_device *pdev)
{
	struct usb_gadget_fserial_platform_data	*pdata =
					pdev->dev.platform_data;
	int i;

	dev_dbg(&pdev->dev, "%s: probe\n", __func__);

	if (!pdata)
		goto probe_android_register;

	for (i = 0; i < GSERIAL_NO_PORTS; i++) {
		gserial_ports[i].transport = pdata->transport[i];
		gserial_ports[i].port_num = i;

		switch (gserial_ports[i].transport) {
		case USB_GADGET_FSERIAL_TRANSPORT_TTY:
			gserial_ports[i].client_port_num = no_tty_ports;
			no_tty_ports++;
			break;
		case USB_GADGET_FSERIAL_TRANSPORT_SDIO:
			gserial_ports[i].client_port_num = no_sdio_ports;
			no_sdio_ports++;
			break;
		case USB_GADGET_FSERIAL_TRANSPORT_SMD:
			gserial_ports[i].client_port_num = no_smd_ports;
			no_smd_ports++;
			break;
		default:
			pr_err("%s: Un-supported transport transport: %u\n",
					__func__, gserial_ports[i].transport);
			return -ENODEV;
		}

		nr_ports++;
	}

	pr_info("%s:gport:tty_ports:%u sdio_ports:%u "
			"smd_ports:%u nr_ports:%u\n",
			__func__, no_tty_ports, no_sdio_ports,
			no_smd_ports, nr_ports);

probe_android_register:
	android_register_function(&modem_function);
	android_register_function(&nmea_function);

	return 0;
}
Пример #3
0
static int __init init(void)
{
	printk(KERN_INFO "f_accessory init\n");
	android_register_function(&acc_function);
	return 0;
}
Пример #4
0
static int __init init(void)
{
	printk(KERN_INFO "f_mtp init\n");
	android_register_function(&mtp_function);
	return 0;
}