diff options
| author | Manu Gautam <mgautam@codeaurora.org> | 2017-02-10 14:48:49 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-27 22:00:16 -0700 |
| commit | d2cce3278ce7bfa08f2beae5136614b50c33e2e6 (patch) | |
| tree | d6b0496234b7acb2148c5a51e39d71a6ea2a02f6 | |
| parent | 9a663991cde724ccfedd76907bc5e74f83e32e4b (diff) | |
usb: misc: ks_bridge: Add support for 9025/901D PIDs
9025/901D PIDs support multiple interfaces but for ramdump
collection device enumerates with same PID and exposes only one
interface-0. Which otherwise is used for DIAG.
Allow driver to claim this interface and exposes following
misc-dev that can be used by userspace to access device
using sahara protocol: /dev/ks_usb_bridge.
CRs-fixed: 2009286
Change-Id: Ic09dae8f1685f8c7cf5386aed44ae9464620feeb
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
| -rw-r--r-- | drivers/usb/misc/ks_bridge.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/usb/misc/ks_bridge.c b/drivers/usb/misc/ks_bridge.c index 07212940d129..fdc9094e48c1 100644 --- a/drivers/usb/misc/ks_bridge.c +++ b/drivers/usb/misc/ks_bridge.c @@ -47,6 +47,8 @@ static enum bus_id str_to_busid(const char *name) return BUS_HSIC; if (!strncasecmp("msm_ehci_host.0", name, BUSNAME_LEN)) return BUS_USB; + if (!strncasecmp("xhci-hcd.0.auto", name, BUSNAME_LEN)) + return BUS_USB; return BUS_UNDEF; } @@ -457,6 +459,10 @@ static struct ksb_dev_info ksb_efs_usb_dev = { static const struct usb_device_id ksb_usb_ids[] = { { USB_DEVICE_INTERFACE_NUMBER(0x5c6, 0x9008, 0), .driver_info = (unsigned long)&ksb_fboot_dev, }, + { USB_DEVICE_INTERFACE_NUMBER(0x5c6, 0x9025, 0), + .driver_info = (unsigned long)&ksb_fboot_dev, }, + { USB_DEVICE_INTERFACE_NUMBER(0x5c6, 0x901D, 0), + .driver_info = (unsigned long)&ksb_fboot_dev, }, { USB_DEVICE_INTERFACE_NUMBER(0x5c6, 0x9048, 2), .driver_info = (unsigned long)&ksb_efs_hsic_dev, }, { USB_DEVICE_INTERFACE_NUMBER(0x5c6, 0x904C, 2), @@ -659,7 +665,7 @@ static void ksb_start_rx_work(struct work_struct *w) static int ksb_usb_probe(struct usb_interface *ifc, const struct usb_device_id *id) { - __u8 ifc_num; + __u8 ifc_num, ifc_count; struct usb_host_interface *ifc_desc; struct usb_endpoint_descriptor *ep_desc; int i; @@ -674,6 +680,7 @@ ksb_usb_probe(struct usb_interface *ifc, const struct usb_device_id *id) ifc_num = ifc->cur_altsetting->desc.bInterfaceNumber; udev = interface_to_usbdev(ifc); + ifc_count = udev->actconfig->desc.bNumInterfaces; fbdev = mdev = (struct ksb_dev_info *)id->driver_info; bus_id = str_to_busid(udev->bus->bus_name); @@ -684,6 +691,12 @@ ksb_usb_probe(struct usb_interface *ifc, const struct usb_device_id *id) } switch (id->idProduct) { + case 0x9025: + case 0x901D: + dev_dbg(&udev->dev, "ifc_count: %u\n", ifc_count); + if (ifc_count > 1) + return -ENODEV; + /* fall-through */ case 0x9008: ksb = __ksb[bus_id]; mdev = &fbdev[bus_id]; |
