Lines Matching refs:bdc
17 static int bdc_issue_cmd(struct bdc *bdc, u32 cmd_sc, u32 param0, in bdc_issue_cmd() argument
24 bdc_writel(bdc->regs, BDC_CMDPAR0, param0); in bdc_issue_cmd()
25 bdc_writel(bdc->regs, BDC_CMDPAR1, param1); in bdc_issue_cmd()
26 bdc_writel(bdc->regs, BDC_CMDPAR2, param2); in bdc_issue_cmd()
31 bdc_writel(bdc->regs, BDC_CMDSC, cmd_sc | BDC_CMD_CWS | BDC_CMD_SRD); in bdc_issue_cmd()
33 temp = bdc_readl(bdc->regs, BDC_CMDSC); in bdc_issue_cmd()
34 dev_dbg_ratelimited(bdc->dev, "cmdsc=%x", temp); in bdc_issue_cmd()
37 dev_dbg(bdc->dev, in bdc_issue_cmd()
44 dev_err(bdc->dev, in bdc_issue_cmd()
51 static int bdc_submit_cmd(struct bdc *bdc, u32 cmd_sc, in bdc_submit_cmd() argument
57 temp = bdc_readl(bdc->regs, BDC_CMDSC); in bdc_submit_cmd()
58 dev_dbg(bdc->dev, in bdc_submit_cmd()
64 dev_err(bdc->dev, "command processor busy: %x\n", cmd_status); in bdc_submit_cmd()
67 ret = bdc_issue_cmd(bdc, cmd_sc, param0, param1, param2); in bdc_submit_cmd()
70 dev_dbg(bdc->dev, "command completed successfully\n"); in bdc_submit_cmd()
75 dev_err(bdc->dev, "command parameter error\n"); in bdc_submit_cmd()
80 dev_err(bdc->dev, "Invalid device/ep state\n"); in bdc_submit_cmd()
85 dev_err(bdc->dev, "Command failed?\n"); in bdc_submit_cmd()
90 dev_err(bdc->dev, "BDC Internal error\n"); in bdc_submit_cmd()
95 dev_err(bdc->dev, in bdc_submit_cmd()
101 dev_dbg(bdc->dev, "Unknown command completion code:%x\n", ret); in bdc_submit_cmd()
108 int bdc_dconfig_ep(struct bdc *bdc, struct bdc_ep *ep) in bdc_dconfig_ep() argument
113 dev_dbg(bdc->dev, "%s ep->ep_num =%d cmd_sc=%x\n", __func__, in bdc_dconfig_ep()
116 return bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); in bdc_dconfig_ep()
122 struct bdc *bdc = ep->bdc; in ep_bd_list_reinit() local
128 dev_dbg(bdc->dev, "%s ep:%p bd:%p\n", __func__, ep, bd); in ep_bd_list_reinit()
134 int bdc_config_ep(struct bdc *bdc, struct bdc_ep *ep) in bdc_config_ep() argument
150 dev_dbg(bdc->dev, "%s: param0=%08x param1=%08x", in bdc_config_ep()
160 switch (bdc->gadget.speed) { in bdc_config_ep()
202 dev_err(bdc->dev, "UNKNOWN speed ERR\n"); in bdc_config_ep()
208 dev_dbg(bdc->dev, "cmd_sc=%x param2=%08x\n", cmd_sc, param2); in bdc_config_ep()
209 ret = bdc_submit_cmd(bdc, cmd_sc, param0, param1, param2); in bdc_config_ep()
211 dev_err(bdc->dev, "command failed :%x\n", ret); in bdc_config_ep()
223 int bdc_ep_bla(struct bdc *bdc, struct bdc_ep *ep, dma_addr_t dma_addr) in bdc_ep_bla() argument
228 dev_dbg(bdc->dev, "%s: add=%08llx\n", __func__, in bdc_ep_bla()
236 dev_dbg(bdc->dev, "cmd_sc=%x\n", cmd_sc); in bdc_ep_bla()
238 return bdc_submit_cmd(bdc, cmd_sc, param0, param1, 0); in bdc_ep_bla()
242 int bdc_address_device(struct bdc *bdc, u32 add) in bdc_address_device() argument
247 dev_dbg(bdc->dev, "%s: add=%d\n", __func__, add); in bdc_address_device()
251 return bdc_submit_cmd(bdc, cmd_sc, 0, 0, param2); in bdc_address_device()
255 int bdc_function_wake_fh(struct bdc *bdc, u8 intf) in bdc_function_wake_fh() argument
261 dev_dbg(bdc->dev, "%s intf=%d\n", __func__, intf); in bdc_function_wake_fh()
264 param0 |= (bdc->dev_addr << 25); in bdc_function_wake_fh()
267 dev_dbg(bdc->dev, "param0=%08x param1=%08x\n", param0, param1); in bdc_function_wake_fh()
269 return bdc_submit_cmd(bdc, cmd_sc, param0, param1, 0); in bdc_function_wake_fh()
273 int bdc_function_wake(struct bdc *bdc, u8 intf) in bdc_function_wake() argument
278 dev_dbg(bdc->dev, "%s intf=%d", __func__, intf); in bdc_function_wake()
282 return bdc_submit_cmd(bdc, cmd_sc, 0, 0, param2); in bdc_function_wake()
286 int bdc_ep_set_stall(struct bdc *bdc, int epnum) in bdc_ep_set_stall() argument
290 dev_dbg(bdc->dev, "%s epnum=%d\n", __func__, epnum); in bdc_ep_set_stall()
294 return bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); in bdc_ep_set_stall()
298 int bdc_ep_clear_stall(struct bdc *bdc, int epnum) in bdc_ep_clear_stall() argument
304 dev_dbg(bdc->dev, "%s: epnum=%d\n", __func__, epnum); in bdc_ep_clear_stall()
305 ep = bdc->bdc_ep_array[epnum]; in bdc_ep_clear_stall()
313 ret = bdc_ep_set_stall(bdc, epnum); in bdc_ep_clear_stall()
325 ret = bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); in bdc_ep_clear_stall()
327 dev_err(bdc->dev, "command failed:%x\n", ret); in bdc_ep_clear_stall()
330 bdc_notify_xfr(bdc, epnum); in bdc_ep_clear_stall()
336 int bdc_stop_ep(struct bdc *bdc, int epnum) in bdc_stop_ep() argument
342 ep = bdc->bdc_ep_array[epnum]; in bdc_stop_ep()
343 dev_dbg(bdc->dev, "%s: ep:%s ep->flags:%08x\n", __func__, in bdc_stop_ep()
347 dev_err(bdc->dev, "stop endpoint called for disabled ep\n"); in bdc_stop_ep()
357 ret = bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); in bdc_stop_ep()
359 dev_err(bdc->dev, in bdc_stop_ep()
365 bdc_dump_epsts(bdc); in bdc_stop_ep()