Loading Documentation/devicetree/bindings/usb/msm-android-usb.txt +4 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,9 @@ Optional properties : a new LUN as CD-ROM. - qcom,android-usb-uicc-nluns : Number of mass storage LUNs (8 bits) required for the UICC card. - qcom,usb-core-id: Index to refer USB hardware core to bind android gadget driver with UDC if multiple USB peripheral controllers are present. If unspecified, core is set to zero by default. Example Android USB device node : android_usb@fc42b0c8 { compatible = "qcom,android-usb"; Loading @@ -30,4 +33,5 @@ Example Android USB device node : qcom,android-usb-swfi-latency = <1>; qcom,streaming-func = "rndis","mtp"; qcom,android-usb-uicc-nluns = /bits/ 8 <1>; qcom,usb-core-id = <1>; }; drivers/usb/gadget/android.c +13 −4 Original line number Diff line number Diff line Loading @@ -3449,6 +3449,7 @@ static int android_create_device(struct android_dev *dev, u8 usb_core_id) */ snprintf(device_node_name, ANDROID_DEVICE_NODE_NAME_LENGTH, "android%d", usb_core_id); pr_debug("%s(): creating android%d device\n", __func__, usb_core_id); dev->dev = device_create(android_class, NULL, MKDEV(0, 0), NULL, device_node_name); if (IS_ERR(dev->dev)) Loading Loading @@ -3565,6 +3566,7 @@ static int android_probe(struct platform_device *pdev) struct android_dev *android_dev; struct resource *res; int ret = 0, i, len = 0; u32 usb_core_id = 0; if (pdev->dev.of_node) { dev_dbg(&pdev->dev, "device tree enabled\n"); Loading @@ -3577,6 +3579,11 @@ static int android_probe(struct platform_device *pdev) of_property_read_u32(pdev->dev.of_node, "qcom,android-usb-swfi-latency", &pdata->swfi_latency); ret = of_property_read_u32(pdev->dev.of_node, "qcom,usb-core-id", &usb_core_id); if (!ret) pdata->usb_core_id = usb_core_id; len = of_property_count_strings(pdev->dev.of_node, "qcom,streaming-func"); Loading Loading @@ -3657,15 +3664,17 @@ static int android_probe(struct platform_device *pdev) } if (pdata) ret = android_create_device(android_dev, pdata->usb_core_id); else ret = android_create_device(android_dev, 0); android_usb_driver.gadget_driver.usb_core_id = pdata->usb_core_id; ret = android_create_device(android_dev, android_usb_driver.gadget_driver.usb_core_id); if (ret) { pr_err("%s(): android_create_device failed\n", __func__); goto err_dev; } pr_debug("%s(): registering android_usb_driver with core id:%d\n", __func__, android_usb_driver.gadget_driver.usb_core_id); ret = usb_composite_probe(&android_usb_driver); if (ret) { /* Perhaps UDC hasn't probed yet, try again later */ Loading Loading
Documentation/devicetree/bindings/usb/msm-android-usb.txt +4 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,9 @@ Optional properties : a new LUN as CD-ROM. - qcom,android-usb-uicc-nluns : Number of mass storage LUNs (8 bits) required for the UICC card. - qcom,usb-core-id: Index to refer USB hardware core to bind android gadget driver with UDC if multiple USB peripheral controllers are present. If unspecified, core is set to zero by default. Example Android USB device node : android_usb@fc42b0c8 { compatible = "qcom,android-usb"; Loading @@ -30,4 +33,5 @@ Example Android USB device node : qcom,android-usb-swfi-latency = <1>; qcom,streaming-func = "rndis","mtp"; qcom,android-usb-uicc-nluns = /bits/ 8 <1>; qcom,usb-core-id = <1>; };
drivers/usb/gadget/android.c +13 −4 Original line number Diff line number Diff line Loading @@ -3449,6 +3449,7 @@ static int android_create_device(struct android_dev *dev, u8 usb_core_id) */ snprintf(device_node_name, ANDROID_DEVICE_NODE_NAME_LENGTH, "android%d", usb_core_id); pr_debug("%s(): creating android%d device\n", __func__, usb_core_id); dev->dev = device_create(android_class, NULL, MKDEV(0, 0), NULL, device_node_name); if (IS_ERR(dev->dev)) Loading Loading @@ -3565,6 +3566,7 @@ static int android_probe(struct platform_device *pdev) struct android_dev *android_dev; struct resource *res; int ret = 0, i, len = 0; u32 usb_core_id = 0; if (pdev->dev.of_node) { dev_dbg(&pdev->dev, "device tree enabled\n"); Loading @@ -3577,6 +3579,11 @@ static int android_probe(struct platform_device *pdev) of_property_read_u32(pdev->dev.of_node, "qcom,android-usb-swfi-latency", &pdata->swfi_latency); ret = of_property_read_u32(pdev->dev.of_node, "qcom,usb-core-id", &usb_core_id); if (!ret) pdata->usb_core_id = usb_core_id; len = of_property_count_strings(pdev->dev.of_node, "qcom,streaming-func"); Loading Loading @@ -3657,15 +3664,17 @@ static int android_probe(struct platform_device *pdev) } if (pdata) ret = android_create_device(android_dev, pdata->usb_core_id); else ret = android_create_device(android_dev, 0); android_usb_driver.gadget_driver.usb_core_id = pdata->usb_core_id; ret = android_create_device(android_dev, android_usb_driver.gadget_driver.usb_core_id); if (ret) { pr_err("%s(): android_create_device failed\n", __func__); goto err_dev; } pr_debug("%s(): registering android_usb_driver with core id:%d\n", __func__, android_usb_driver.gadget_driver.usb_core_id); ret = usb_composite_probe(&android_usb_driver); if (ret) { /* Perhaps UDC hasn't probed yet, try again later */ Loading