diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-26 22:35:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-26 22:35:49 -0400 |
commit | 13557b5d8477cc978b4ef08424f69789858670d0 (patch) | |
tree | b4c26fe1b530d7bcc3e6da9aec1e74a1f0eb1bea | |
parent | 4bc5d3bbdc945670bf716bf44b43ad4c42cd5e49 (diff) | |
parent | 93fb9127cb63a3246b32d48fa273010764687862 (diff) |
Merge tag 'fixes-for-v4.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
Felipe writes:
usb: fixes for v4.1-rc5
A few late important fixes which have been pending
on mailing list due to my vacations.
The important fixes are a fix for DEPCMD and DGCMD
status bitfields on DWC3, a couple fixes for Renesas
USB Controller, one of which prevents a broken DT
binding from reaching v4.1-final, and an old fix for
s3c2410-udc where pullup logic was reversed.
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 6 | ||||
-rw-r--r-- | drivers/usb/dwc3/core.h | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/function/f_fs.c | 15 | ||||
-rw-r--r-- | drivers/usb/gadget/function/f_midi.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/function/f_uac1.c | 5 | ||||
-rw-r--r-- | drivers/usb/gadget/legacy/g_ffs.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/s3c2410_udc.c | 2 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 14 | ||||
-rw-r--r-- | drivers/usb/phy/phy-ab8500-usb.c | 6 | ||||
-rw-r--r-- | drivers/usb/phy/phy-tahvo.c | 3 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 38 |
11 files changed, 68 insertions, 37 deletions
diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt index dc2a18f0b3a1..ddbe304beb21 100644 --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt | |||
@@ -15,10 +15,8 @@ Optional properties: | |||
15 | - phys: phandle + phy specifier pair | 15 | - phys: phandle + phy specifier pair |
16 | - phy-names: must be "usb" | 16 | - phy-names: must be "usb" |
17 | - dmas: Must contain a list of references to DMA specifiers. | 17 | - dmas: Must contain a list of references to DMA specifiers. |
18 | - dma-names : Must contain a list of DMA names: | 18 | - dma-names : named "ch%d", where %d is the channel number ranging from zero |
19 | - tx0 ... tx<n> | 19 | to the number of channels (DnFIFOs) minus one. |
20 | - rx0 ... rx<n> | ||
21 | - This <n> means DnFIFO in USBHS module. | ||
22 | 20 | ||
23 | Example: | 21 | Example: |
24 | usbhs: usb@e6590000 { | 22 | usbhs: usb@e6590000 { |
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index fdab715a0631..c0eafa6fd403 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h | |||
@@ -339,7 +339,7 @@ | |||
339 | #define DWC3_DGCMD_SET_ENDPOINT_NRDY 0x0c | 339 | #define DWC3_DGCMD_SET_ENDPOINT_NRDY 0x0c |
340 | #define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK 0x10 | 340 | #define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK 0x10 |
341 | 341 | ||
342 | #define DWC3_DGCMD_STATUS(n) (((n) >> 15) & 1) | 342 | #define DWC3_DGCMD_STATUS(n) (((n) >> 12) & 0x0F) |
343 | #define DWC3_DGCMD_CMDACT (1 << 10) | 343 | #define DWC3_DGCMD_CMDACT (1 << 10) |
344 | #define DWC3_DGCMD_CMDIOC (1 << 8) | 344 | #define DWC3_DGCMD_CMDIOC (1 << 8) |
345 | 345 | ||
@@ -355,7 +355,7 @@ | |||
355 | #define DWC3_DEPCMD_PARAM_SHIFT 16 | 355 | #define DWC3_DEPCMD_PARAM_SHIFT 16 |
356 | #define DWC3_DEPCMD_PARAM(x) ((x) << DWC3_DEPCMD_PARAM_SHIFT) | 356 | #define DWC3_DEPCMD_PARAM(x) ((x) << DWC3_DEPCMD_PARAM_SHIFT) |
357 | #define DWC3_DEPCMD_GET_RSC_IDX(x) (((x) >> DWC3_DEPCMD_PARAM_SHIFT) & 0x7f) | 357 | #define DWC3_DEPCMD_GET_RSC_IDX(x) (((x) >> DWC3_DEPCMD_PARAM_SHIFT) & 0x7f) |
358 | #define DWC3_DEPCMD_STATUS(x) (((x) >> 15) & 1) | 358 | #define DWC3_DEPCMD_STATUS(x) (((x) >> 12) & 0x0F) |
359 | #define DWC3_DEPCMD_HIPRI_FORCERM (1 << 11) | 359 | #define DWC3_DEPCMD_HIPRI_FORCERM (1 << 11) |
360 | #define DWC3_DEPCMD_CMDACT (1 << 10) | 360 | #define DWC3_DEPCMD_CMDACT (1 << 10) |
361 | #define DWC3_DEPCMD_CMDIOC (1 << 8) | 361 | #define DWC3_DEPCMD_CMDIOC (1 << 8) |
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 6bdb57069044..3507f880eb74 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c | |||
@@ -315,7 +315,6 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf, | |||
315 | return ret; | 315 | return ret; |
316 | } | 316 | } |
317 | 317 | ||
318 | set_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags); | ||
319 | return len; | 318 | return len; |
320 | } | 319 | } |
321 | break; | 320 | break; |
@@ -847,7 +846,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) | |||
847 | ret = ep->status; | 846 | ret = ep->status; |
848 | if (io_data->read && ret > 0) { | 847 | if (io_data->read && ret > 0) { |
849 | ret = copy_to_iter(data, ret, &io_data->data); | 848 | ret = copy_to_iter(data, ret, &io_data->data); |
850 | if (unlikely(iov_iter_count(&io_data->data))) | 849 | if (!ret) |
851 | ret = -EFAULT; | 850 | ret = -EFAULT; |
852 | } | 851 | } |
853 | } | 852 | } |
@@ -1463,8 +1462,7 @@ static void ffs_data_clear(struct ffs_data *ffs) | |||
1463 | { | 1462 | { |
1464 | ENTER(); | 1463 | ENTER(); |
1465 | 1464 | ||
1466 | if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags)) | 1465 | ffs_closed(ffs); |
1467 | ffs_closed(ffs); | ||
1468 | 1466 | ||
1469 | BUG_ON(ffs->gadget); | 1467 | BUG_ON(ffs->gadget); |
1470 | 1468 | ||
@@ -3422,9 +3420,13 @@ static int ffs_ready(struct ffs_data *ffs) | |||
3422 | ffs_obj->desc_ready = true; | 3420 | ffs_obj->desc_ready = true; |
3423 | ffs_obj->ffs_data = ffs; | 3421 | ffs_obj->ffs_data = ffs; |
3424 | 3422 | ||
3425 | if (ffs_obj->ffs_ready_callback) | 3423 | if (ffs_obj->ffs_ready_callback) { |
3426 | ret = ffs_obj->ffs_ready_callback(ffs); | 3424 | ret = ffs_obj->ffs_ready_callback(ffs); |
3425 | if (ret) | ||
3426 | goto done; | ||
3427 | } | ||
3427 | 3428 | ||
3429 | set_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags); | ||
3428 | done: | 3430 | done: |
3429 | ffs_dev_unlock(); | 3431 | ffs_dev_unlock(); |
3430 | return ret; | 3432 | return ret; |
@@ -3443,7 +3445,8 @@ static void ffs_closed(struct ffs_data *ffs) | |||
3443 | 3445 | ||
3444 | ffs_obj->desc_ready = false; | 3446 | ffs_obj->desc_ready = false; |
3445 | 3447 | ||
3446 | if (ffs_obj->ffs_closed_callback) | 3448 | if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags) && |
3449 | ffs_obj->ffs_closed_callback) | ||
3447 | ffs_obj->ffs_closed_callback(ffs); | 3450 | ffs_obj->ffs_closed_callback(ffs); |
3448 | 3451 | ||
3449 | if (!ffs_obj->opts || ffs_obj->opts->no_configfs | 3452 | if (!ffs_obj->opts || ffs_obj->opts->no_configfs |
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index 259b656c0b3e..6316aa5b1c49 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c | |||
@@ -973,7 +973,13 @@ static ssize_t f_midi_opts_id_show(struct f_midi_opts *opts, char *page) | |||
973 | int result; | 973 | int result; |
974 | 974 | ||
975 | mutex_lock(&opts->lock); | 975 | mutex_lock(&opts->lock); |
976 | result = strlcpy(page, opts->id, PAGE_SIZE); | 976 | if (opts->id) { |
977 | result = strlcpy(page, opts->id, PAGE_SIZE); | ||
978 | } else { | ||
979 | page[0] = 0; | ||
980 | result = 0; | ||
981 | } | ||
982 | |||
977 | mutex_unlock(&opts->lock); | 983 | mutex_unlock(&opts->lock); |
978 | 984 | ||
979 | return result; | 985 | return result; |
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index 9719abfb6145..7856b3394494 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c | |||
@@ -588,7 +588,10 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt) | |||
588 | 588 | ||
589 | if (intf == 1) { | 589 | if (intf == 1) { |
590 | if (alt == 1) { | 590 | if (alt == 1) { |
591 | config_ep_by_speed(cdev->gadget, f, out_ep); | 591 | err = config_ep_by_speed(cdev->gadget, f, out_ep); |
592 | if (err) | ||
593 | return err; | ||
594 | |||
592 | usb_ep_enable(out_ep); | 595 | usb_ep_enable(out_ep); |
593 | out_ep->driver_data = audio; | 596 | out_ep->driver_data = audio; |
594 | audio->copy_buf = f_audio_buffer_alloc(audio_buf_size); | 597 | audio->copy_buf = f_audio_buffer_alloc(audio_buf_size); |
diff --git a/drivers/usb/gadget/legacy/g_ffs.c b/drivers/usb/gadget/legacy/g_ffs.c index 7b9ef7e257d2..e821931c965c 100644 --- a/drivers/usb/gadget/legacy/g_ffs.c +++ b/drivers/usb/gadget/legacy/g_ffs.c | |||
@@ -304,8 +304,10 @@ static int functionfs_ready_callback(struct ffs_data *ffs) | |||
304 | gfs_registered = true; | 304 | gfs_registered = true; |
305 | 305 | ||
306 | ret = usb_composite_probe(&gfs_driver); | 306 | ret = usb_composite_probe(&gfs_driver); |
307 | if (unlikely(ret < 0)) | 307 | if (unlikely(ret < 0)) { |
308 | ++missing_funcs; | ||
308 | gfs_registered = false; | 309 | gfs_registered = false; |
310 | } | ||
309 | 311 | ||
310 | return ret; | 312 | return ret; |
311 | } | 313 | } |
diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index b808951491cc..99fd9a5667df 100644 --- a/drivers/usb/gadget/udc/s3c2410_udc.c +++ b/drivers/usb/gadget/udc/s3c2410_udc.c | |||
@@ -1487,7 +1487,7 @@ static int s3c2410_udc_pullup(struct usb_gadget *gadget, int is_on) | |||
1487 | 1487 | ||
1488 | dprintk(DEBUG_NORMAL, "%s()\n", __func__); | 1488 | dprintk(DEBUG_NORMAL, "%s()\n", __func__); |
1489 | 1489 | ||
1490 | s3c2410_udc_set_pullup(udc, is_on ? 0 : 1); | 1490 | s3c2410_udc_set_pullup(udc, is_on); |
1491 | return 0; | 1491 | return 0; |
1492 | } | 1492 | } |
1493 | 1493 | ||
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 3789b08ef67b..6dca3d794ced 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -2021,13 +2021,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
2021 | if (musb->ops->quirks) | 2021 | if (musb->ops->quirks) |
2022 | musb->io.quirks = musb->ops->quirks; | 2022 | musb->io.quirks = musb->ops->quirks; |
2023 | 2023 | ||
2024 | /* At least tusb6010 has it's own offsets.. */ | 2024 | /* Most devices use indexed offset or flat offset */ |
2025 | if (musb->ops->ep_offset) | ||
2026 | musb->io.ep_offset = musb->ops->ep_offset; | ||
2027 | if (musb->ops->ep_select) | ||
2028 | musb->io.ep_select = musb->ops->ep_select; | ||
2029 | |||
2030 | /* ..and some devices use indexed offset or flat offset */ | ||
2031 | if (musb->io.quirks & MUSB_INDEXED_EP) { | 2025 | if (musb->io.quirks & MUSB_INDEXED_EP) { |
2032 | musb->io.ep_offset = musb_indexed_ep_offset; | 2026 | musb->io.ep_offset = musb_indexed_ep_offset; |
2033 | musb->io.ep_select = musb_indexed_ep_select; | 2027 | musb->io.ep_select = musb_indexed_ep_select; |
@@ -2036,6 +2030,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) | |||
2036 | musb->io.ep_select = musb_flat_ep_select; | 2030 | musb->io.ep_select = musb_flat_ep_select; |
2037 | } | 2031 | } |
2038 | 2032 | ||
2033 | /* At least tusb6010 has its own offsets */ | ||
2034 | if (musb->ops->ep_offset) | ||
2035 | musb->io.ep_offset = musb->ops->ep_offset; | ||
2036 | if (musb->ops->ep_select) | ||
2037 | musb->io.ep_select = musb->ops->ep_select; | ||
2038 | |||
2039 | if (musb->ops->fifo_mode) | 2039 | if (musb->ops->fifo_mode) |
2040 | fifo_mode = musb->ops->fifo_mode; | 2040 | fifo_mode = musb->ops->fifo_mode; |
2041 | else | 2041 | else |
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 7225d526df04..03ab0c699f74 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c | |||
@@ -1179,7 +1179,7 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev, | |||
1179 | } | 1179 | } |
1180 | err = devm_request_threaded_irq(&pdev->dev, irq, NULL, | 1180 | err = devm_request_threaded_irq(&pdev->dev, irq, NULL, |
1181 | ab8500_usb_link_status_irq, | 1181 | ab8500_usb_link_status_irq, |
1182 | IRQF_NO_SUSPEND | IRQF_SHARED, | 1182 | IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT, |
1183 | "usb-link-status", ab); | 1183 | "usb-link-status", ab); |
1184 | if (err < 0) { | 1184 | if (err < 0) { |
1185 | dev_err(ab->dev, "request_irq failed for link status irq\n"); | 1185 | dev_err(ab->dev, "request_irq failed for link status irq\n"); |
@@ -1195,7 +1195,7 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev, | |||
1195 | } | 1195 | } |
1196 | err = devm_request_threaded_irq(&pdev->dev, irq, NULL, | 1196 | err = devm_request_threaded_irq(&pdev->dev, irq, NULL, |
1197 | ab8500_usb_disconnect_irq, | 1197 | ab8500_usb_disconnect_irq, |
1198 | IRQF_NO_SUSPEND | IRQF_SHARED, | 1198 | IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT, |
1199 | "usb-id-fall", ab); | 1199 | "usb-id-fall", ab); |
1200 | if (err < 0) { | 1200 | if (err < 0) { |
1201 | dev_err(ab->dev, "request_irq failed for ID fall irq\n"); | 1201 | dev_err(ab->dev, "request_irq failed for ID fall irq\n"); |
@@ -1211,7 +1211,7 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev, | |||
1211 | } | 1211 | } |
1212 | err = devm_request_threaded_irq(&pdev->dev, irq, NULL, | 1212 | err = devm_request_threaded_irq(&pdev->dev, irq, NULL, |
1213 | ab8500_usb_disconnect_irq, | 1213 | ab8500_usb_disconnect_irq, |
1214 | IRQF_NO_SUSPEND | IRQF_SHARED, | 1214 | IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT, |
1215 | "usb-vbus-fall", ab); | 1215 | "usb-vbus-fall", ab); |
1216 | if (err < 0) { | 1216 | if (err < 0) { |
1217 | dev_err(ab->dev, "request_irq failed for Vbus fall irq\n"); | 1217 | dev_err(ab->dev, "request_irq failed for Vbus fall irq\n"); |
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c index 845f658276b1..2b28443d07b9 100644 --- a/drivers/usb/phy/phy-tahvo.c +++ b/drivers/usb/phy/phy-tahvo.c | |||
@@ -401,7 +401,8 @@ static int tahvo_usb_probe(struct platform_device *pdev) | |||
401 | dev_set_drvdata(&pdev->dev, tu); | 401 | dev_set_drvdata(&pdev->dev, tu); |
402 | 402 | ||
403 | tu->irq = platform_get_irq(pdev, 0); | 403 | tu->irq = platform_get_irq(pdev, 0); |
404 | ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt, 0, | 404 | ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt, |
405 | IRQF_ONESHOT, | ||
405 | "tahvo-vbus", tu); | 406 | "tahvo-vbus", tu); |
406 | if (ret) { | 407 | if (ret) { |
407 | dev_err(&pdev->dev, "could not register tahvo-vbus irq: %d\n", | 408 | dev_err(&pdev->dev, "could not register tahvo-vbus irq: %d\n", |
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 8597cf9cfceb..c0f5c652d272 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -611,6 +611,8 @@ struct usbhs_pkt_handle usbhs_fifo_pio_push_handler = { | |||
611 | static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) | 611 | static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) |
612 | { | 612 | { |
613 | struct usbhs_pipe *pipe = pkt->pipe; | 613 | struct usbhs_pipe *pipe = pkt->pipe; |
614 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | ||
615 | struct usbhs_fifo *fifo = usbhsf_get_cfifo(priv); | ||
614 | 616 | ||
615 | if (usbhs_pipe_is_busy(pipe)) | 617 | if (usbhs_pipe_is_busy(pipe)) |
616 | return 0; | 618 | return 0; |
@@ -624,6 +626,9 @@ static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) | |||
624 | usbhs_pipe_data_sequence(pipe, pkt->sequence); | 626 | usbhs_pipe_data_sequence(pipe, pkt->sequence); |
625 | pkt->sequence = -1; /* -1 sequence will be ignored */ | 627 | pkt->sequence = -1; /* -1 sequence will be ignored */ |
626 | 628 | ||
629 | if (usbhs_pipe_is_dcp(pipe)) | ||
630 | usbhsf_fifo_clear(pipe, fifo); | ||
631 | |||
627 | usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length); | 632 | usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length); |
628 | usbhs_pipe_enable(pipe); | 633 | usbhs_pipe_enable(pipe); |
629 | usbhs_pipe_running(pipe, 1); | 634 | usbhs_pipe_running(pipe, 1); |
@@ -673,7 +678,14 @@ static int usbhsf_pio_try_pop(struct usbhs_pkt *pkt, int *is_done) | |||
673 | *is_done = 1; | 678 | *is_done = 1; |
674 | usbhsf_rx_irq_ctrl(pipe, 0); | 679 | usbhsf_rx_irq_ctrl(pipe, 0); |
675 | usbhs_pipe_running(pipe, 0); | 680 | usbhs_pipe_running(pipe, 0); |
676 | usbhs_pipe_disable(pipe); /* disable pipe first */ | 681 | /* |
682 | * If function mode, since this controller is possible to enter | ||
683 | * Control Write status stage at this timing, this driver | ||
684 | * should not disable the pipe. If such a case happens, this | ||
685 | * controller is not able to complete the status stage. | ||
686 | */ | ||
687 | if (!usbhs_mod_is_host(priv) && !usbhs_pipe_is_dcp(pipe)) | ||
688 | usbhs_pipe_disable(pipe); /* disable pipe first */ | ||
677 | } | 689 | } |
678 | 690 | ||
679 | /* | 691 | /* |
@@ -1227,15 +1239,21 @@ static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo, | |||
1227 | { | 1239 | { |
1228 | char name[16]; | 1240 | char name[16]; |
1229 | 1241 | ||
1230 | snprintf(name, sizeof(name), "tx%d", channel); | 1242 | /* |
1231 | fifo->tx_chan = dma_request_slave_channel_reason(dev, name); | 1243 | * To avoid complex handing for DnFIFOs, the driver uses each |
1232 | if (IS_ERR(fifo->tx_chan)) | 1244 | * DnFIFO as TX or RX direction (not bi-direction). |
1233 | fifo->tx_chan = NULL; | 1245 | * So, the driver uses odd channels for TX, even channels for RX. |
1234 | 1246 | */ | |
1235 | snprintf(name, sizeof(name), "rx%d", channel); | 1247 | snprintf(name, sizeof(name), "ch%d", channel); |
1236 | fifo->rx_chan = dma_request_slave_channel_reason(dev, name); | 1248 | if (channel & 1) { |
1237 | if (IS_ERR(fifo->rx_chan)) | 1249 | fifo->tx_chan = dma_request_slave_channel_reason(dev, name); |
1238 | fifo->rx_chan = NULL; | 1250 | if (IS_ERR(fifo->tx_chan)) |
1251 | fifo->tx_chan = NULL; | ||
1252 | } else { | ||
1253 | fifo->rx_chan = dma_request_slave_channel_reason(dev, name); | ||
1254 | if (IS_ERR(fifo->rx_chan)) | ||
1255 | fifo->rx_chan = NULL; | ||
1256 | } | ||
1239 | } | 1257 | } |
1240 | 1258 | ||
1241 | static void usbhsf_dma_init(struct usbhs_priv *priv, struct usbhs_fifo *fifo, | 1259 | static void usbhsf_dma_init(struct usbhs_priv *priv, struct usbhs_fifo *fifo, |