usb: gadget: ci13xxx_udc: Set usb_core_id if exists
Read usb_core_id from platfrom data.
Change-Id: Ie2b57a12b2d97668efd097e0c55be630e98cc209
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index f82c2fe..18f0721 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -3334,6 +3334,8 @@
void __iomem *regs)
{
struct ci13xxx *udc;
+ struct ci13xxx_platform_data *pdata =
+ (struct ci13xxx_platform_data *)(dev->platform_data);
int retval = 0, i;
trace("%p, %p, %p", dev, regs, driver->name);
@@ -3362,6 +3364,9 @@
INIT_LIST_HEAD(&udc->gadget.ep_list);
udc->gadget.ep0 = NULL;
+ if (pdata)
+ udc->gadget.usb_core_id = pdata->usb_core_id;
+
dev_set_name(&udc->gadget.dev, "gadget");
udc->gadget.dev.dma_mask = dev->dma_mask;
udc->gadget.dev.coherent_dma_mask = dev->coherent_dma_mask;
diff --git a/drivers/usb/gadget/ci13xxx_udc.h b/drivers/usb/gadget/ci13xxx_udc.h
index a189b45..6527b76 100644
--- a/drivers/usb/gadget/ci13xxx_udc.h
+++ b/drivers/usb/gadget/ci13xxx_udc.h
@@ -158,6 +158,11 @@
struct usb_phy *transceiver; /* Transceiver struct */
};
+struct ci13xxx_platform_data {
+ u8 usb_core_id;
+ void *prv_data;
+};
+
/******************************************************************************
* REGISTERS
*****************************************************************************/