Thread (89 messages) 89 messages, 8 authors, 2017-01-20

Re: [PATCH v10 13/14] usb: gadget: udc: adapt to OTG core

From: Peter Chen <hidden>
Date: 2016-06-13 07:26:31
Also in: linux-omap, lkml

On Mon, Jun 13, 2016 at 10:14:31AM +0300, Roger Quadros wrote:
On 12/06/16 14:36, Peter Chen wrote:
quoted
On Fri, Jun 10, 2016 at 04:07:22PM +0300, Roger Quadros wrote:
quoted
 
+/**
+ * usb_otg_add_gadget_udc - adds a new gadget to the udc class driver list
+ * @parent: the parent device to this udc. Usually the controller
+ * driver's device.
It seems it should be udc device
Parent and udc->dev are not the same right?
Sure, udc's parent is otg device.
I guess i'll omit the second statement to avoid confusion. So.

@parent: the parent device to this udc.
Where you call below APIs? It seems to be a udc driver, right?
So, when you try to get "otg-controller" from the node, this node
should be udc.

/**
 * usb_otg_add_gadget_udc - adds a new gadget to the udc class driver list
 * @parent: the parent device to this udc. Usually the controller
 * driver's device.
 * @gadget: the gadget to be added to the list
 * @otg_dev: the OTG controller device
 *
 * If otg_dev is NULL then device tree node is checked
 * for OTG controller via the otg-controller property.
 * Returns zero on success, negative errno otherwise.
 */
int usb_otg_add_gadget_udc(struct device *parent, struct usb_gadget *gadget,
			   struct device *otg_dev)
{
	if (!otg_dev) {
		gadget->otg_dev = of_usb_get_otg(parent->of_node);
		if (!gadget->otg_dev)
			return -ENODEV;
	} else {
		gadget->otg_dev = otg_dev;
	}

	return usb_add_gadget_udc_release(parent, gadget, NULL);
}
EXPORT_SYMBOL_GPL(usb_otg_add_gadget_udc);
-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help