mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 04:44:46 +00:00
usb: dwc3: Fix not calling dev_xxx with a device
This logs with the device from struct dwc3. Some files also need to include dm.h so fields in udevice can be accessed. Signed-off-by: Sean Anderson <seanga2@gmail.com> Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
parent
046ade8103
commit
df5eabcbf7
3 changed files with 21 additions and 18 deletions
|
@ -592,7 +592,7 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
|
||||||
dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
|
dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
|
||||||
ret = dwc3_gadget_init(dwc);
|
ret = dwc3_gadget_init(dwc);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "failed to initialize gadget\n");
|
dev_err(dwc->dev, "failed to initialize gadget\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -600,7 +600,7 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
|
||||||
dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
|
dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
|
||||||
ret = dwc3_host_init(dwc);
|
ret = dwc3_host_init(dwc);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "failed to initialize host\n");
|
dev_err(dwc->dev, "failed to initialize host\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -608,18 +608,19 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
|
||||||
dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
|
dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
|
||||||
ret = dwc3_host_init(dwc);
|
ret = dwc3_host_init(dwc);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "failed to initialize host\n");
|
dev_err(dwc->dev, "failed to initialize host\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = dwc3_gadget_init(dwc);
|
ret = dwc3_gadget_init(dwc);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "failed to initialize gadget\n");
|
dev_err(dwc->dev, "failed to initialize gadget\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(dev, "Unsupported mode of operation %d\n", dwc->dr_mode);
|
dev_err(dwc->dev,
|
||||||
|
"Unsupported mode of operation %d\n", dwc->dr_mode);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -768,7 +769,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev)
|
||||||
|
|
||||||
ret = dwc3_core_init(dwc);
|
ret = dwc3_core_init(dwc);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "failed to initialize core\n");
|
dev_err(dwc->dev, "failed to initialize core\n");
|
||||||
goto err0;
|
goto err0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -974,7 +975,7 @@ int dwc3_init(struct dwc3 *dwc)
|
||||||
|
|
||||||
ret = dwc3_core_init(dwc);
|
ret = dwc3_core_init(dwc);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(dev, "failed to initialize core\n");
|
dev_err(dwc->dev, "failed to initialize core\n");
|
||||||
goto core_fail;
|
goto core_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <cpu_func.h>
|
#include <cpu_func.h>
|
||||||
|
#include <dm.h>
|
||||||
#include <dm/device_compat.h>
|
#include <dm/device_compat.h>
|
||||||
#include <linux/bug.h>
|
#include <linux/bug.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <cpu_func.h>
|
#include <cpu_func.h>
|
||||||
#include <log.h>
|
#include <log.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <dm.h>
|
||||||
#include <dm/device_compat.h>
|
#include <dm/device_compat.h>
|
||||||
#include <dm/devres.h>
|
#include <dm/devres.h>
|
||||||
#include <linux/bug.h>
|
#include <linux/bug.h>
|
||||||
|
@ -633,7 +634,7 @@ static int dwc3_gadget_ep_enable(struct usb_ep *ep,
|
||||||
strlcat(dep->name, "-int", sizeof(dep->name));
|
strlcat(dep->name, "-int", sizeof(dep->name));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(dwc->dev, "invalid endpoint transfer type\n");
|
dev_err(dep->dwc->dev, "invalid endpoint transfer type\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock_irqsave(&dwc->lock, flags);
|
spin_lock_irqsave(&dwc->lock, flags);
|
||||||
|
@ -708,10 +709,9 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
|
||||||
{
|
{
|
||||||
struct dwc3_trb *trb;
|
struct dwc3_trb *trb;
|
||||||
|
|
||||||
dev_vdbg(dwc->dev, "%s: req %p dma %08llx length %d%s%s\n",
|
dev_vdbg(dep->dwc->dev, "%s: req %p dma %08llx length %d%s%s\n",
|
||||||
dep->name, req, (unsigned long long)dma,
|
dep->name, req, (unsigned long long)dma,
|
||||||
length, last ? " last" : "",
|
length, last ? " last" : "", chain ? " chain" : "");
|
||||||
chain ? " chain" : "");
|
|
||||||
|
|
||||||
|
|
||||||
trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK];
|
trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK];
|
||||||
|
@ -1074,20 +1074,21 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
|
||||||
|
|
||||||
spin_lock_irqsave(&dwc->lock, flags);
|
spin_lock_irqsave(&dwc->lock, flags);
|
||||||
if (!dep->endpoint.desc) {
|
if (!dep->endpoint.desc) {
|
||||||
dev_dbg(dwc->dev, "trying to queue request %p to disabled %s\n",
|
dev_dbg(dep->dwc->dev,
|
||||||
request, ep->name);
|
"trying to queue request %p to disabled %s\n", request,
|
||||||
|
ep->name);
|
||||||
ret = -ESHUTDOWN;
|
ret = -ESHUTDOWN;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req->dep != dep) {
|
if (req->dep != dep) {
|
||||||
WARN(true, "request %p belongs to '%s'\n",
|
WARN(true, "request %p belongs to '%s'\n", request,
|
||||||
request, req->dep->name);
|
req->dep->name);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_vdbg(dwc->dev, "queing request %p to %s length %d\n",
|
dev_vdbg(dep->dwc->dev, "queing request %p to %s length %d\n",
|
||||||
request, ep->name, request->length);
|
request, ep->name, request->length);
|
||||||
|
|
||||||
ret = __dwc3_gadget_ep_queue(dep, req);
|
ret = __dwc3_gadget_ep_queue(dep, req);
|
||||||
|
|
Loading…
Add table
Reference in a new issue