struct usb_gadget *gadget = &udc->gadget;
int n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
return 0;
}
struct usb_gadget_driver *driver = udc->driver;
int n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
dev_err(dev, "[%s] EINVAL\n", __func__);
return 0;
unsigned long flags;
unsigned i, j, n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(dev->parent, "%p\n", buf);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(dev->parent, "[%s] EINVAL\n", __func__);
return 0;
}
{
unsigned tty;
- dbg_trace("[%s] %p, %d\n", __func__, buf, count);
+ trace(dev->parent, "[%s] %p, %d\n", __func__, buf, count);
if (attr == NULL || buf == NULL) {
dev_err(dev, "[%s] EINVAL\n", __func__);
goto done;
u32 intr;
unsigned i, j, n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
return 0;
}
unsigned long flags;
unsigned en, bit;
- dbg_trace("[%s] %p, %d\n", __func__, buf, count);
+ trace(udc->dev, "%p, %d\n", buf, count);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "EINVAL\n");
goto done;
}
if (sscanf(buf, "%u %u", &en, &bit) != 2 || en > 1) {
- dev_err(dev, "<1|0> <bit>: enable|disable interrupt");
+ dev_err(udc->dev, "<1|0> <bit>: enable|disable interrupt\n");
goto done;
}
unsigned long flags;
unsigned mode;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "EINVAL\n");
return 0;
}
unsigned long flags;
unsigned mode;
- dbg_trace("[%s] %p, %d\n", __func__, buf, count);
+ trace(udc->dev, "%p, %d\n", buf, count);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
goto done;
}
if (sscanf(buf, "%u", &mode) != 1) {
- dev_err(dev, "<mode>: set port test mode");
+ dev_err(udc->dev, "<mode>: set port test mode");
goto done;
}
spin_lock_irqsave(&udc->lock, flags);
if (hw_port_test_set(udc, mode))
- dev_err(dev, "invalid mode\n");
+ dev_err(udc->dev, "invalid mode\n");
spin_unlock_irqrestore(&udc->lock, flags);
done:
unsigned long flags;
unsigned i, j, n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
return 0;
}
u32 *dump;
unsigned i, k, n = 0;
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
return 0;
}
dump = kmalloc(sizeof(u32) * DUMP_ENTRIES, GFP_KERNEL);
if (!dump) {
- dev_err(dev, "%s: out of memory\n", __func__);
+ dev_err(udc->dev, "%s: out of memory\n", __func__);
return 0;
}
struct ci13xxx *udc = container_of(dev, struct ci13xxx, gadget.dev);
unsigned long addr, data, flags;
- dbg_trace("[%s] %p, %d\n", __func__, buf, count);
+ trace(udc->dev, "%p, %d\n", buf, count);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
goto done;
}
if (sscanf(buf, "%li %li", &addr, &data) != 2) {
- dev_err(dev, "<addr> <data>: write data to register address");
+ dev_err(udc->dev,
+ "<addr> <data>: write data to register address\n");
goto done;
}
spin_lock_irqsave(&udc->lock, flags);
if (hw_register_write(udc, addr, data))
- dev_err(dev, "invalid address range\n");
+ dev_err(udc->dev, "invalid address range\n");
spin_unlock_irqrestore(&udc->lock, flags);
done:
struct ci13xxx_req *req = NULL;
unsigned i, j, n = 0, qSize = sizeof(struct ci13xxx_td)/sizeof(u32);
- dbg_trace("[%s] %p\n", __func__, buf);
+ trace(udc->dev, "%p\n", buf);
if (attr == NULL || buf == NULL) {
- dev_err(dev, "[%s] EINVAL\n", __func__);
+ dev_err(udc->dev, "[%s] EINVAL\n", __func__);
return 0;
}
int ret = 0;
unsigned length = mReq->req.length;
- trace("%p, %p", mEp, mReq);
+ trace(udc->dev, "%p, %p", mEp, mReq);
/* don't queue twice */
if (mReq->req.status == -EALREADY)
*/
static int _hardware_dequeue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
{
- trace("%p, %p", mEp, mReq);
+ trace(mEp->udc->dev, "%p, %p", mEp, mReq);
if (mReq->req.status != -EALREADY)
return -EINVAL;
__releases(mEp->lock)
__acquires(mEp->lock)
{
- trace("%p", mEp);
+ trace(mEp->udc->dev, "%p", mEp);
if (mEp == NULL)
return -EINVAL;
struct ci13xxx *udc = container_of(gadget, struct ci13xxx, gadget);
unsigned long flags;
- trace("%p", gadget);
+ trace(udc->dev, "%p", gadget);
if (gadget == NULL)
return -EINVAL;
{
int retval;
- trace("%p", udc);
-
- if (udc == NULL) {
- pr_err("EINVAL\n");
- return;
- }
+ trace(udc->dev, "%p", udc);
dbg_event(0xFF, "BUS RST", 0);
done:
if (retval)
- pr_err("error: %i\n", retval);
+ dev_err(udc->dev, "error: %i\n", retval);
}
/**
*/
static void isr_get_status_complete(struct usb_ep *ep, struct usb_request *req)
{
- trace("%p, %p", ep, req);
+ trace(NULL, "%p, %p", ep, req);
- if (ep == NULL || req == NULL) {
- pr_err("EINVAL\n");
+ if (ep == NULL || req == NULL)
return;
- }
kfree(req->buf);
usb_ep_free_request(ep, req);
gfp_t gfp_flags = GFP_ATOMIC;
int dir, num, retval;
- trace("%p, %p", mEp, setup);
+ trace(udc->dev, "%p, %p", mEp, setup);
if (mEp == NULL || setup == NULL)
return -EINVAL;
struct ci13xxx *udc = req->context;
unsigned long flags;
- trace("%p, %p", ep, req);
+ trace(udc->dev, "%p, %p", ep, req);
spin_lock_irqsave(&udc->lock, flags);
if (udc->test_mode)
int retval;
struct ci13xxx_ep *mEp;
- trace("%p", udc);
+ trace(udc->dev, "%p", udc);
mEp = (udc->ep0_dir == TX) ? udc->ep0out : udc->ep0in;
udc->status->context = udc;
struct ci13xxx_ep *mEpTemp = mEp;
int uninitialized_var(retval);
- trace("%p", mEp);
+ trace(mEp->udc->dev, "%p", mEp);
if (list_empty(&mEp->qh.queue))
return -EINVAL;
unsigned i;
u8 tmode = 0;
- trace("%p", udc);
-
- if (udc == NULL) {
- pr_err("EINVAL\n");
- return;
- }
+ trace(udc->dev, "%p", udc);
for (i = 0; i < udc->hw_ep_max; i++) {
struct ci13xxx_ep *mEp = &udc->ci13xxx_ep[i];
"ERROR", err);
spin_unlock(&udc->lock);
if (usb_ep_set_halt(&mEp->ep))
- dev_err(&udc->gadget.dev,
+ dev_err(udc->dev,
"error: ep_set_halt\n");
spin_lock(&udc->lock);
}
continue;
if (i != 0) {
- dev_warn(&udc->gadget.dev,
- "ctrl traffic received at endpoint\n");
+ dev_warn(udc->dev, "ctrl traffic at endpoint %d\n", i);
continue;
}
spin_unlock(&udc->lock);
if (usb_ep_set_halt(&mEp->ep))
- dev_err(&udc->gadget.dev,
- "error: ep_set_halt\n");
+ dev_err(udc->dev, "error: ep_set_halt\n");
spin_lock(&udc->lock);
}
}
int retval = 0;
unsigned long flags;
- trace("%p, %p", ep, desc);
+ trace(mEp->udc->dev, "%p, %p", ep, desc);
if (ep == NULL || desc == NULL)
return -EINVAL;
mEp->ep.desc = desc;
if (!list_empty(&mEp->qh.queue))
- warn("enabling a non-empty endpoint!");
+ dev_warn(mEp->udc->dev, "enabling a non-empty endpoint!\n");
mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX;
mEp->num = usb_endpoint_num(desc);
int direction, retval = 0;
unsigned long flags;
- trace("%p", ep);
+ trace(mEp->udc->dev, "%p", ep);
if (ep == NULL)
return -EINVAL;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
struct ci13xxx_req *mReq = NULL;
- trace("%p, %i", ep, gfp_flags);
+ trace(mEp->udc->dev, "%p, %i", ep, gfp_flags);
- if (ep == NULL) {
- pr_err("EINVAL\n");
+ if (ep == NULL)
return NULL;
- }
mReq = kzalloc(sizeof(struct ci13xxx_req), gfp_flags);
if (mReq != NULL) {
struct ci13xxx_req *mReq = container_of(req, struct ci13xxx_req, req);
unsigned long flags;
- trace("%p, %p", ep, req);
+ trace(mEp->udc->dev, "%p, %p", ep, req);
if (ep == NULL || req == NULL) {
- pr_err("EINVAL\n");
return;
} else if (!list_empty(&mReq->queue)) {
- pr_err("EBUSY\n");
+ dev_err(mEp->udc->dev, "freeing queued request\n");
return;
}
int retval = 0;
unsigned long flags;
- trace("%p, %p, %X", ep, req, gfp_flags);
+ trace(mEp->udc->dev, "%p, %p, %X", ep, req, gfp_flags);
if (ep == NULL || req == NULL || mEp->ep.desc == NULL)
return -EINVAL;
if (!list_empty(&mEp->qh.queue)) {
_ep_nuke(mEp);
retval = -EOVERFLOW;
- warn("endpoint ctrl %X nuked", _usb_addr(mEp));
+ dev_warn(mEp->udc->dev, "endpoint ctrl %X nuked\n",
+ _usb_addr(mEp));
}
}
/* first nuke then test link, e.g. previous status has not sent */
if (!list_empty(&mReq->queue)) {
retval = -EBUSY;
- pr_err("request already in queue\n");
+ dev_err(mEp->udc->dev, "request already in queue\n");
goto done;
}
if (req->length > 4 * CI13XXX_PAGE_SIZE) {
req->length = 4 * CI13XXX_PAGE_SIZE;
retval = -EMSGSIZE;
- warn("request length truncated");
+ dev_warn(mEp->udc->dev, "request length truncated\n");
}
dbg_queue(_usb_addr(mEp), req, retval);
struct ci13xxx_req *mReq = container_of(req, struct ci13xxx_req, req);
unsigned long flags;
- trace("%p, %p", ep, req);
+ trace(mEp->udc->dev, "%p, %p", ep, req);
if (ep == NULL || req == NULL || mReq->req.status != -EALREADY ||
mEp->ep.desc == NULL || list_empty(&mReq->queue) ||
int direction, retval = 0;
unsigned long flags;
- trace("%p, %i", ep, value);
+ trace(mEp->udc->dev, "%p, %i", ep, value);
if (ep == NULL || mEp->ep.desc == NULL)
return -EINVAL;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
unsigned long flags;
- trace("%p", ep);
+ trace(mEp->udc->dev, "%p", ep);
if (ep == NULL || mEp->ep.desc == NULL)
return -EINVAL;
struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
unsigned long flags;
- trace("%p", ep);
+ trace(mEp->udc->dev, "%p", ep);
if (ep == NULL) {
- pr_err("%02X: -EINVAL\n", _usb_addr(mEp));
+ dev_err(mEp->udc->dev, "%02X: -EINVAL\n", _usb_addr(mEp));
return;
}
unsigned long flags;
int ret = 0;
- trace();
+ trace(udc->dev, "");
spin_lock_irqsave(&udc->lock, flags);
if (!udc->remote_wakeup) {
ret = -EOPNOTSUPP;
- trace("remote wakeup feature is not enabled\n");
+ trace(udc->dev, "remote wakeup feature is not enabled\n");
goto out;
}
if (!hw_read(udc, OP_PORTSC, PORTSC_SUSP)) {
ret = -EINVAL;
- trace("port is not suspended\n");
+ trace(udc->dev, "port is not suspended\n");
goto out;
}
hw_write(udc, OP_PORTSC, PORTSC_FPR, PORTSC_FPR);
int i, j;
int retval = -ENOMEM;
- trace("%p", driver);
+ trace(udc->dev, "%p", driver);
if (driver == NULL ||
bind == NULL ||
spin_lock_irqsave(&udc->lock, flags);
- info("hw_ep_max = %d", udc->hw_ep_max);
+ dev_info(udc->dev, "hw_ep_max = %d\n", udc->hw_ep_max);
udc->gadget.dev.driver = NULL;
struct ci13xxx *udc = _udc;
unsigned long i, flags;
- trace("%p", driver);
+ trace(udc->dev, "%p", driver);
if (driver == NULL ||
driver->unbind == NULL ||
irqreturn_t retval;
u32 intr;
- trace();
+ trace(udc ? udc->dev : NULL, "");
if (udc == NULL) {
- pr_err("ENODEV\n");
+ dev_err(udc->dev, "ENODEV");
return IRQ_HANDLED;
}
*/
static void udc_release(struct device *dev)
{
- trace("%p", dev);
-
- if (dev == NULL)
- pr_err("EINVAL\n");
+ trace(dev->parent, "%p", dev);
}
/**
struct ci13xxx *udc;
int retval = 0;
- trace("%p, %p, %p", dev, regs, driver->name);
+ trace(dev, "%p, %p, %p", dev, regs, driver->name);
if (dev == NULL || regs == NULL || driver == NULL ||
driver->name == NULL)
udc->gadget.dev.parent = dev;
udc->gadget.dev.release = udc_release;
+ udc->dev = dev;
+
retval = hw_device_init(udc, regs, driver->capoffset);
if (retval < 0)
goto free_udc;
{
struct ci13xxx *udc = _udc;
- if (udc == NULL) {
- pr_err("EINVAL\n");
+ if (udc == NULL)
return;
- }
+
usb_del_gadget_udc(&udc->gadget);
if (udc->transceiver) {