Lines Matching refs:bdc

22 static int bdc_issue_cmd(struct bdc *bdc, u32 cmd_sc, u32 param0,  in bdc_issue_cmd()  argument
29 bdc_writel(bdc->regs, BDC_CMDPAR0, param0); in bdc_issue_cmd()
30 bdc_writel(bdc->regs, BDC_CMDPAR1, param1); in bdc_issue_cmd()
31 bdc_writel(bdc->regs, BDC_CMDPAR2, param2); in bdc_issue_cmd()
36 bdc_writel(bdc->regs, BDC_CMDSC, cmd_sc | BDC_CMD_CWS | BDC_CMD_SRD); in bdc_issue_cmd()
38 temp = bdc_readl(bdc->regs, BDC_CMDSC); in bdc_issue_cmd()
39 dev_dbg_ratelimited(bdc->dev, "cmdsc=%x", temp); in bdc_issue_cmd()
42 dev_dbg(bdc->dev, in bdc_issue_cmd()
49 dev_err(bdc->dev, in bdc_issue_cmd()
56 static int bdc_submit_cmd(struct bdc *bdc, u32 cmd_sc, in bdc_submit_cmd() argument
63 temp = bdc_readl(bdc->regs, BDC_CMDSC); in bdc_submit_cmd()
64 dev_dbg(bdc->dev, in bdc_submit_cmd()
70 dev_err(bdc->dev, "command processor busy: %x\n", cmd_status); in bdc_submit_cmd()
73 ret = bdc_issue_cmd(bdc, cmd_sc, param0, param1, param2); in bdc_submit_cmd()
76 dev_dbg(bdc->dev, "command completed successfully\n"); in bdc_submit_cmd()
81 dev_err(bdc->dev, "command parameter error\n"); in bdc_submit_cmd()
86 dev_err(bdc->dev, "Invalid device/ep state\n"); in bdc_submit_cmd()
91 dev_err(bdc->dev, "Command failed?\n"); in bdc_submit_cmd()
96 dev_err(bdc->dev, "BDC Internal error\n"); in bdc_submit_cmd()
102 dev_err(bdc->dev, in bdc_submit_cmd()
109 dev_dbg(bdc->dev, "Unknown command completion code:%x\n", ret); in bdc_submit_cmd()
116 int bdc_dconfig_ep(struct bdc *bdc, struct bdc_ep *ep) in bdc_dconfig_ep() argument
121 dev_dbg(bdc->dev, "%s ep->ep_num =%d cmd_sc=%x\n", __func__, in bdc_dconfig_ep()
124 return bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); in bdc_dconfig_ep()
130 struct bdc *bdc = ep->bdc; in ep_bd_list_reinit() local
136 dev_dbg(bdc->dev, "%s ep:%p bd:%p\n", __func__, ep, bd); in ep_bd_list_reinit()
142 int bdc_config_ep(struct bdc *bdc, struct bdc_ep *ep) in bdc_config_ep() argument
158 dev_dbg(bdc->dev, "%s: param0=%08x param1=%08x", in bdc_config_ep()
168 switch (bdc->gadget.speed) { in bdc_config_ep()
210 dev_err(bdc->dev, "UNKNOWN speed ERR\n"); in bdc_config_ep()
216 dev_dbg(bdc->dev, "cmd_sc=%x param2=%08x\n", cmd_sc, param2); in bdc_config_ep()
217 ret = bdc_submit_cmd(bdc, cmd_sc, param0, param1, param2); in bdc_config_ep()
219 dev_err(bdc->dev, "command failed :%x\n", ret); in bdc_config_ep()
231 int bdc_ep_bla(struct bdc *bdc, struct bdc_ep *ep, dma_addr_t dma_addr) in bdc_ep_bla() argument
236 dev_dbg(bdc->dev, "%s: add=%08llx\n", __func__, in bdc_ep_bla()
244 dev_dbg(bdc->dev, "cmd_sc=%x\n", cmd_sc); in bdc_ep_bla()
246 return bdc_submit_cmd(bdc, cmd_sc, param0, param1, 0); in bdc_ep_bla()
250 int bdc_address_device(struct bdc *bdc, u32 add) in bdc_address_device() argument
255 dev_dbg(bdc->dev, "%s: add=%d\n", __func__, add); in bdc_address_device()
259 return bdc_submit_cmd(bdc, cmd_sc, 0, 0, param2); in bdc_address_device()
263 int bdc_function_wake_fh(struct bdc *bdc, u8 intf) in bdc_function_wake_fh() argument
269 dev_dbg(bdc->dev, "%s intf=%d\n", __func__, intf); in bdc_function_wake_fh()
272 param0 |= (bdc->dev_addr << 25); in bdc_function_wake_fh()
275 dev_dbg(bdc->dev, "param0=%08x param1=%08x\n", param0, param1); in bdc_function_wake_fh()
277 return bdc_submit_cmd(bdc, cmd_sc, param0, param1, 0); in bdc_function_wake_fh()
281 int bdc_function_wake(struct bdc *bdc, u8 intf) in bdc_function_wake() argument
286 dev_dbg(bdc->dev, "%s intf=%d", __func__, intf); in bdc_function_wake()
290 return bdc_submit_cmd(bdc, cmd_sc, 0, 0, param2); in bdc_function_wake()
294 int bdc_ep_set_stall(struct bdc *bdc, int epnum) in bdc_ep_set_stall() argument
298 dev_dbg(bdc->dev, "%s epnum=%d\n", __func__, epnum); in bdc_ep_set_stall()
302 return bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); in bdc_ep_set_stall()
306 int bdc_ep_clear_stall(struct bdc *bdc, int epnum) in bdc_ep_clear_stall() argument
312 dev_dbg(bdc->dev, "%s: epnum=%d\n", __func__, epnum); in bdc_ep_clear_stall()
313 ep = bdc->bdc_ep_array[epnum]; in bdc_ep_clear_stall()
321 ret = bdc_ep_set_stall(bdc, epnum); in bdc_ep_clear_stall()
333 ret = bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); in bdc_ep_clear_stall()
335 dev_err(bdc->dev, "command failed:%x\n", ret); in bdc_ep_clear_stall()
338 bdc_notify_xfr(bdc, epnum); in bdc_ep_clear_stall()
344 int bdc_stop_ep(struct bdc *bdc, int epnum) in bdc_stop_ep() argument
350 ep = bdc->bdc_ep_array[epnum]; in bdc_stop_ep()
351 dev_dbg(bdc->dev, "%s: ep:%s ep->flags:%08x\n", __func__, in bdc_stop_ep()
355 dev_err(bdc->dev, "stop endpoint called for disabled ep\n"); in bdc_stop_ep()
365 ret = bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); in bdc_stop_ep()
367 dev_err(bdc->dev, in bdc_stop_ep()
373 bdc_dump_epsts(bdc); in bdc_stop_ep()