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>
This commit is contained in:
Ido Shayevitz
2012-06-26 15:21:09 +03:00
committed by Stephen Boyd
parent fbf38f2c9b
commit bdaa38477e
2 changed files with 10 additions and 0 deletions

View File

@@ -3332,6 +3332,8 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
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);
@@ -3360,6 +3362,9 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
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;

View File

@@ -158,6 +158,11 @@ struct ci13xxx {
struct usb_phy *transceiver; /* Transceiver struct */
};
struct ci13xxx_platform_data {
u8 usb_core_id;
void *prv_data;
};
/******************************************************************************
* REGISTERS
*****************************************************************************/