.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 2 | /* |
---|
3 | 3 | * core.h - DesignWare USB3 DRD Core Header |
---|
4 | 4 | * |
---|
5 | | - * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com |
---|
| 5 | + * Copyright (C) 2010-2011 Texas Instruments Incorporated - https://www.ti.com |
---|
6 | 6 | * |
---|
7 | 7 | * Authors: Felipe Balbi <balbi@ti.com>, |
---|
8 | 8 | * Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
---|
.. | .. |
---|
13 | 13 | |
---|
14 | 14 | #include <linux/device.h> |
---|
15 | 15 | #include <linux/spinlock.h> |
---|
| 16 | +#include <linux/mutex.h> |
---|
16 | 17 | #include <linux/ioport.h> |
---|
17 | 18 | #include <linux/list.h> |
---|
18 | 19 | #include <linux/bitops.h> |
---|
.. | .. |
---|
21 | 22 | #include <linux/debugfs.h> |
---|
22 | 23 | #include <linux/wait.h> |
---|
23 | 24 | #include <linux/workqueue.h> |
---|
| 25 | +#include <linux/android_kabi.h> |
---|
24 | 26 | |
---|
25 | 27 | #include <linux/usb/ch9.h> |
---|
26 | 28 | #include <linux/usb/gadget.h> |
---|
27 | 29 | #include <linux/usb/otg.h> |
---|
| 30 | +#include <linux/usb/role.h> |
---|
28 | 31 | #include <linux/ulpi/interface.h> |
---|
29 | 32 | |
---|
30 | 33 | #include <linux/phy/phy.h> |
---|
31 | 34 | |
---|
| 35 | +#include <linux/power_supply.h> |
---|
| 36 | + |
---|
32 | 37 | #define DWC3_MSG_MAX 500 |
---|
33 | 38 | |
---|
34 | 39 | /* Global constants */ |
---|
35 | | -#define DWC3_DISCON_TIMEOUT 1000 /* ms */ |
---|
36 | 40 | #define DWC3_PULL_UP_TIMEOUT 500 /* ms */ |
---|
37 | 41 | #define DWC3_BOUNCE_SIZE 1024 /* size of a superspeed bulk */ |
---|
38 | 42 | #define DWC3_EP0_SETUP_SIZE 512 |
---|
.. | .. |
---|
54 | 58 | #define DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE 3 |
---|
55 | 59 | #define DWC3_DEVICE_EVENT_WAKEUP 4 |
---|
56 | 60 | #define DWC3_DEVICE_EVENT_HIBER_REQ 5 |
---|
57 | | -#define DWC3_DEVICE_EVENT_EOPF 6 |
---|
| 61 | +#define DWC3_DEVICE_EVENT_SUSPEND 6 |
---|
58 | 62 | #define DWC3_DEVICE_EVENT_SOF 7 |
---|
59 | 63 | #define DWC3_DEVICE_EVENT_ERRATIC_ERROR 9 |
---|
60 | 64 | #define DWC3_DEVICE_EVENT_CMD_CMPL 10 |
---|
.. | .. |
---|
69 | 73 | #define DWC3_GEVNTCOUNT_EHB BIT(31) |
---|
70 | 74 | #define DWC3_GSNPSID_MASK 0xffff0000 |
---|
71 | 75 | #define DWC3_GSNPSREV_MASK 0xffff |
---|
| 76 | +#define DWC3_GSNPS_ID(p) (((p) & DWC3_GSNPSID_MASK) >> 16) |
---|
72 | 77 | |
---|
73 | 78 | /* DWC3 registers memory space boundries */ |
---|
74 | 79 | #define DWC3_XHCI_REGS_START 0x0 |
---|
.. | .. |
---|
137 | 142 | #define DWC3_GEVNTCOUNT(n) (0xc40c + ((n) * 0x10)) |
---|
138 | 143 | |
---|
139 | 144 | #define DWC3_GHWPARAMS8 0xc600 |
---|
| 145 | +#define DWC3_GUCTL3 0xc60c |
---|
140 | 146 | #define DWC3_GFLADJ 0xc630 |
---|
| 147 | +#define DWC3_GHWPARAMS9 0xc6e0 |
---|
141 | 148 | |
---|
142 | 149 | /* Device Registers */ |
---|
143 | 150 | #define DWC3_DCFG 0xc700 |
---|
.. | .. |
---|
250 | 257 | #define DWC3_GUCTL_HSTINAUTORETRY BIT(14) |
---|
251 | 258 | |
---|
252 | 259 | /* Global User Control 1 Register */ |
---|
| 260 | +#define DWC3_GUCTL1_DEV_DECOUPLE_L1L2_EVT BIT(31) |
---|
253 | 261 | #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28) |
---|
254 | 262 | #define DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK BIT(26) |
---|
255 | | -#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) |
---|
256 | | -#define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17) |
---|
| 263 | +#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) |
---|
| 264 | +#define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17) |
---|
| 265 | +#define DWC3_GUCTL1_PARKMODE_DISABLE_HS BIT(16) |
---|
257 | 266 | |
---|
258 | 267 | /* Global Status Register */ |
---|
259 | 268 | #define DWC3_GSTS_OTG_IP BIT(10) |
---|
.. | .. |
---|
309 | 318 | |
---|
310 | 319 | /* Global TX Fifo Size Register */ |
---|
311 | 320 | #define DWC31_GTXFIFOSIZ_TXFRAMNUM BIT(15) /* DWC_usb31 only */ |
---|
312 | | -#define DWC31_GTXFIFOSIZ_TXFDEF(n) ((n) & 0x7fff) /* DWC_usb31 only */ |
---|
313 | | -#define DWC3_GTXFIFOSIZ_TXFDEF(n) ((n) & 0xffff) |
---|
| 321 | +#define DWC31_GTXFIFOSIZ_TXFDEP(n) ((n) & 0x7fff) /* DWC_usb31 only */ |
---|
| 322 | +#define DWC3_GTXFIFOSIZ_TXFDEP(n) ((n) & 0xffff) |
---|
314 | 323 | #define DWC3_GTXFIFOSIZ_TXFSTADDR(n) ((n) & 0xffff0000) |
---|
315 | 324 | |
---|
316 | 325 | /* Global RX Fifo Size Register */ |
---|
317 | 326 | #define DWC31_GRXFIFOSIZ_RXFDEP(n) ((n) & 0x7fff) /* DWC_usb31 only */ |
---|
318 | 327 | #define DWC3_GRXFIFOSIZ_RXFDEP(n) ((n) & 0xffff) |
---|
| 328 | +#define DWC3_GRXFIFOSIZ_RXFSTADDR(n) ((n) & 0xffff0000) |
---|
319 | 329 | |
---|
320 | 330 | /* Global Event Size Registers */ |
---|
321 | 331 | #define DWC3_GEVNTSIZ_INTMASK BIT(31) |
---|
.. | .. |
---|
366 | 376 | #define DWC3_GHWPARAMS6_HNPSUPPORT BIT(11) |
---|
367 | 377 | #define DWC3_GHWPARAMS6_SRPSUPPORT BIT(10) |
---|
368 | 378 | #define DWC3_GHWPARAMS6_EN_FPGA BIT(7) |
---|
| 379 | +#define DWC3_GHWPARAMS6_RAM0_DEPTH(n) (((n) >> 16) & 0xffff) |
---|
| 380 | + |
---|
| 381 | +/* DWC_usb32 only */ |
---|
| 382 | +#define DWC3_GHWPARAMS6_MDWIDTH(n) ((n) & (0x3 << 8)) |
---|
369 | 383 | |
---|
370 | 384 | /* Global HWPARAMS7 Register */ |
---|
371 | 385 | #define DWC3_GHWPARAMS7_RAM1_DEPTH(n) ((n) & 0xffff) |
---|
372 | 386 | #define DWC3_GHWPARAMS7_RAM2_DEPTH(n) (((n) >> 16) & 0xffff) |
---|
| 387 | + |
---|
| 388 | +/* Global HWPARAMS9 Register */ |
---|
| 389 | +#define DWC3_GHWPARAMS9_DEV_TXF_FLUSH_BYPASS BIT(0) |
---|
373 | 390 | |
---|
374 | 391 | /* Global Frame Length Adjustment Register */ |
---|
375 | 392 | #define DWC3_GFLADJ_30MHZ_SDBND_SEL BIT(7) |
---|
.. | .. |
---|
378 | 395 | /* Global User Control Register 2 */ |
---|
379 | 396 | #define DWC3_GUCTL2_RST_ACTBITLATER BIT(14) |
---|
380 | 397 | |
---|
| 398 | +/* Global User Control Register 3 */ |
---|
| 399 | +#define DWC3_GUCTL3_SPLITDISABLE BIT(14) |
---|
| 400 | + |
---|
381 | 401 | /* Device Configuration Register */ |
---|
| 402 | +#define DWC3_DCFG_NUMLANES(n) (((n) & 0x3) << 30) /* DWC_usb32 only */ |
---|
| 403 | + |
---|
382 | 404 | #define DWC3_DCFG_DEVADDR(addr) ((addr) << 3) |
---|
383 | 405 | #define DWC3_DCFG_DEVADDR_MASK DWC3_DCFG_DEVADDR(0x7f) |
---|
384 | 406 | |
---|
.. | .. |
---|
393 | 415 | #define DWC3_DCFG_NUMP(n) (((n) >> DWC3_DCFG_NUMP_SHIFT) & 0x1f) |
---|
394 | 416 | #define DWC3_DCFG_NUMP_MASK (0x1f << DWC3_DCFG_NUMP_SHIFT) |
---|
395 | 417 | #define DWC3_DCFG_LPM_CAP BIT(22) |
---|
| 418 | +#define DWC3_DCFG_IGNSTRMPP BIT(23) |
---|
396 | 419 | |
---|
397 | 420 | /* Device Control Register */ |
---|
398 | 421 | #define DWC3_DCTL_RUN_STOP BIT(31) |
---|
.. | .. |
---|
444 | 467 | #define DWC3_DEVTEN_CMDCMPLTEN BIT(10) |
---|
445 | 468 | #define DWC3_DEVTEN_ERRTICERREN BIT(9) |
---|
446 | 469 | #define DWC3_DEVTEN_SOFEN BIT(7) |
---|
447 | | -#define DWC3_DEVTEN_EOPFEN BIT(6) |
---|
| 470 | +#define DWC3_DEVTEN_U3L2L1SUSPEN BIT(6) |
---|
448 | 471 | #define DWC3_DEVTEN_HIBERNATIONREQEVTEN BIT(5) |
---|
449 | 472 | #define DWC3_DEVTEN_WKUPEVTEN BIT(4) |
---|
450 | 473 | #define DWC3_DEVTEN_ULSTCNGEN BIT(3) |
---|
451 | 474 | #define DWC3_DEVTEN_CONNECTDONEEN BIT(2) |
---|
452 | 475 | #define DWC3_DEVTEN_USBRSTEN BIT(1) |
---|
453 | 476 | #define DWC3_DEVTEN_DISCONNEVTEN BIT(0) |
---|
| 477 | + |
---|
| 478 | +#define DWC3_DSTS_CONNLANES(n) (((n) >> 30) & 0x3) /* DWC_usb32 only */ |
---|
454 | 479 | |
---|
455 | 480 | /* Device Status Register */ |
---|
456 | 481 | #define DWC3_DSTS_DCNRD BIT(29) |
---|
.. | .. |
---|
493 | 518 | #define DWC3_DGCMD_SELECTED_FIFO_FLUSH 0x09 |
---|
494 | 519 | #define DWC3_DGCMD_ALL_FIFO_FLUSH 0x0a |
---|
495 | 520 | #define DWC3_DGCMD_SET_ENDPOINT_NRDY 0x0c |
---|
| 521 | +#define DWC3_DGCMD_SET_ENDPOINT_PRIME 0x0d |
---|
496 | 522 | #define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK 0x10 |
---|
497 | 523 | |
---|
498 | 524 | #define DWC3_DGCMD_STATUS(n) (((n) >> 12) & 0x0F) |
---|
.. | .. |
---|
631 | 657 | struct dwc3_event_buffer { |
---|
632 | 658 | void *buf; |
---|
633 | 659 | void *cache; |
---|
634 | | - unsigned length; |
---|
| 660 | + unsigned int length; |
---|
635 | 661 | unsigned int lpos; |
---|
636 | 662 | unsigned int count; |
---|
637 | 663 | unsigned int flags; |
---|
.. | .. |
---|
641 | 667 | dma_addr_t dma; |
---|
642 | 668 | |
---|
643 | 669 | struct dwc3 *dwc; |
---|
| 670 | + |
---|
| 671 | + ANDROID_KABI_RESERVE(1); |
---|
644 | 672 | }; |
---|
645 | 673 | |
---|
646 | 674 | #define DWC3_EP_FLAG_STALLED BIT(0) |
---|
.. | .. |
---|
657 | 685 | * @cancelled_list: list of cancelled requests for this endpoint |
---|
658 | 686 | * @pending_list: list of pending requests for this endpoint |
---|
659 | 687 | * @started_list: list of started requests on this endpoint |
---|
660 | | - * @lock: spinlock for endpoint request queue traversal |
---|
661 | 688 | * @regs: pointer to first endpoint register |
---|
662 | 689 | * @trb_pool: array of transaction buffers |
---|
663 | 690 | * @trb_pool_dma: dma address of @trb_pool |
---|
.. | .. |
---|
685 | 712 | struct list_head pending_list; |
---|
686 | 713 | struct list_head started_list; |
---|
687 | 714 | |
---|
688 | | - spinlock_t lock; |
---|
689 | 715 | void __iomem *regs; |
---|
690 | 716 | |
---|
691 | 717 | struct dwc3_trb *trb_pool; |
---|
.. | .. |
---|
693 | 719 | struct dwc3 *dwc; |
---|
694 | 720 | |
---|
695 | 721 | u32 saved_state; |
---|
696 | | - unsigned flags; |
---|
| 722 | + unsigned int flags; |
---|
697 | 723 | #define DWC3_EP_ENABLED BIT(0) |
---|
698 | 724 | #define DWC3_EP_STALL BIT(1) |
---|
699 | 725 | #define DWC3_EP_WEDGE BIT(2) |
---|
.. | .. |
---|
701 | 727 | #define DWC3_EP_END_TRANSFER_PENDING BIT(4) |
---|
702 | 728 | #define DWC3_EP_PENDING_REQUEST BIT(5) |
---|
703 | 729 | #define DWC3_EP_DELAY_START BIT(6) |
---|
| 730 | +#define DWC3_EP_WAIT_TRANSFER_COMPLETE BIT(7) |
---|
| 731 | +#define DWC3_EP_IGNORE_NEXT_NOSTREAM BIT(8) |
---|
| 732 | +#define DWC3_EP_FORCE_RESTART_STREAM BIT(9) |
---|
| 733 | +#define DWC3_EP_FIRST_STREAM_PRIMED BIT(10) |
---|
| 734 | +#define DWC3_EP_PENDING_CLEAR_STALL BIT(11) |
---|
| 735 | +#define DWC3_EP_TXFIFO_RESIZED BIT(12) |
---|
| 736 | +#define DWC3_EP_DELAY_STOP BIT(13) |
---|
704 | 737 | |
---|
705 | 738 | /* This last one is specific to EP0 */ |
---|
706 | 739 | #define DWC3_EP0_DIR_IN BIT(31) |
---|
.. | .. |
---|
731 | 764 | /* For isochronous START TRANSFER workaround only */ |
---|
732 | 765 | u8 combo_num; |
---|
733 | 766 | int start_cmd_status; |
---|
| 767 | + |
---|
| 768 | + ANDROID_KABI_RESERVE(1); |
---|
| 769 | + ANDROID_KABI_RESERVE(2); |
---|
734 | 770 | }; |
---|
735 | 771 | |
---|
736 | 772 | enum dwc3_phy { |
---|
.. | .. |
---|
829 | 865 | * @hwparams6: GHWPARAMS6 |
---|
830 | 866 | * @hwparams7: GHWPARAMS7 |
---|
831 | 867 | * @hwparams8: GHWPARAMS8 |
---|
| 868 | + * @hwparams9: GHWPARAMS9 |
---|
832 | 869 | */ |
---|
833 | 870 | struct dwc3_hwparams { |
---|
834 | 871 | u32 hwparams0; |
---|
.. | .. |
---|
840 | 877 | u32 hwparams6; |
---|
841 | 878 | u32 hwparams7; |
---|
842 | 879 | u32 hwparams8; |
---|
| 880 | + u32 hwparams9; |
---|
| 881 | + |
---|
| 882 | + ANDROID_KABI_RESERVE(1); |
---|
| 883 | + ANDROID_KABI_RESERVE(2); |
---|
843 | 884 | }; |
---|
844 | 885 | |
---|
845 | 886 | /* HWPARAMS0 */ |
---|
846 | 887 | #define DWC3_MODE(n) ((n) & 0x7) |
---|
847 | 888 | |
---|
848 | | -#define DWC3_MDWIDTH(n) (((n) & 0xff00) >> 8) |
---|
849 | | - |
---|
850 | 889 | /* HWPARAMS1 */ |
---|
851 | 890 | #define DWC3_NUM_INT(n) (((n) & (0x3f << 15)) >> 15) |
---|
| 891 | +#define DWC3_NUM_RAMS(n) (((n) & (0x3 << 21)) >> 21) |
---|
852 | 892 | |
---|
853 | 893 | /* HWPARAMS3 */ |
---|
854 | 894 | #define DWC3_NUM_IN_EPS_MASK (0x1f << 18) |
---|
.. | .. |
---|
888 | 928 | struct scatterlist *sg; |
---|
889 | 929 | struct scatterlist *start_sg; |
---|
890 | 930 | |
---|
891 | | - unsigned num_pending_sgs; |
---|
| 931 | + unsigned int num_pending_sgs; |
---|
892 | 932 | unsigned int num_queued_sgs; |
---|
893 | | - unsigned remaining; |
---|
| 933 | + unsigned int remaining; |
---|
894 | 934 | |
---|
895 | 935 | unsigned int status; |
---|
896 | | -#define DWC3_REQUEST_STATUS_QUEUED 0 |
---|
897 | | -#define DWC3_REQUEST_STATUS_STARTED 1 |
---|
898 | | -#define DWC3_REQUEST_STATUS_CANCELLED 2 |
---|
899 | | -#define DWC3_REQUEST_STATUS_COMPLETED 3 |
---|
900 | | -#define DWC3_REQUEST_STATUS_UNKNOWN -1 |
---|
| 936 | +#define DWC3_REQUEST_STATUS_QUEUED 0 |
---|
| 937 | +#define DWC3_REQUEST_STATUS_STARTED 1 |
---|
| 938 | +#define DWC3_REQUEST_STATUS_DISCONNECTED 2 |
---|
| 939 | +#define DWC3_REQUEST_STATUS_DEQUEUED 3 |
---|
| 940 | +#define DWC3_REQUEST_STATUS_STALLED 4 |
---|
| 941 | +#define DWC3_REQUEST_STATUS_COMPLETED 5 |
---|
| 942 | +#define DWC3_REQUEST_STATUS_UNKNOWN -1 |
---|
901 | 943 | |
---|
902 | 944 | u8 epnum; |
---|
903 | 945 | struct dwc3_trb *trb; |
---|
904 | 946 | dma_addr_t trb_dma; |
---|
905 | 947 | |
---|
906 | | - unsigned num_trbs; |
---|
| 948 | + unsigned int num_trbs; |
---|
907 | 949 | |
---|
908 | | - unsigned needs_extra_trb:1; |
---|
909 | | - unsigned direction:1; |
---|
910 | | - unsigned mapped:1; |
---|
| 950 | + unsigned int needs_extra_trb:1; |
---|
| 951 | + unsigned int direction:1; |
---|
| 952 | + unsigned int mapped:1; |
---|
| 953 | + |
---|
| 954 | + ANDROID_KABI_RESERVE(1); |
---|
| 955 | + ANDROID_KABI_RESERVE(2); |
---|
911 | 956 | }; |
---|
912 | 957 | |
---|
913 | 958 | /* |
---|
.. | .. |
---|
930 | 975 | * @ep0_usb_req: dummy req used while handling STD USB requests |
---|
931 | 976 | * @scratch_addr: dma address of scratchbuf |
---|
932 | 977 | * @ep0_in_setup: one control transfer is completed and enter setup phase |
---|
933 | | - * @discon_done: disconnect event is completed |
---|
934 | 978 | * @lock: for synchronizing |
---|
| 979 | + * @mutex: for mode switching |
---|
935 | 980 | * @dev: pointer to our struct device |
---|
936 | 981 | * @sysdev: pointer to the DMA-capable device |
---|
937 | 982 | * @xhci: pointer to our xHCI child |
---|
.. | .. |
---|
954 | 999 | * @nr_scratch: number of scratch buffers |
---|
955 | 1000 | * @u1u2: only used on revisions <1.83a for workaround |
---|
956 | 1001 | * @maximum_speed: maximum speed requested (mainly for testing purposes) |
---|
957 | | - * @revision: revision register contents |
---|
| 1002 | + * @max_ssp_rate: SuperSpeed Plus maximum signaling rate and lane count |
---|
| 1003 | + * @gadget_max_speed: maximum gadget speed requested |
---|
| 1004 | + * @gadget_ssp_rate: Gadget driver's maximum supported SuperSpeed Plus signaling |
---|
| 1005 | + * rate and lane count. |
---|
| 1006 | + * @ip: controller's ID |
---|
| 1007 | + * @revision: controller's version of an IP |
---|
958 | 1008 | * @version_type: VERSIONTYPE register contents, a sub release of a revision |
---|
959 | 1009 | * @dr_mode: requested mode of operation |
---|
960 | 1010 | * @current_dr_role: current role of operation when in dual-role mode |
---|
.. | .. |
---|
964 | 1014 | * @hsphy_mode: UTMI phy mode, one of following: |
---|
965 | 1015 | * - USBPHY_INTERFACE_MODE_UTMI |
---|
966 | 1016 | * - USBPHY_INTERFACE_MODE_UTMIW |
---|
| 1017 | + * @role_sw: usb_role_switch handle |
---|
| 1018 | + * @role_switch_default_mode: default operation mode of controller while |
---|
| 1019 | + * usb role is USB_ROLE_NONE. |
---|
| 1020 | + * @current_role_sw_mode: current usb role switch mode. |
---|
| 1021 | + * @desired_role_sw_mode: desired usb role switch mode. |
---|
| 1022 | + * @usb_psy: pointer to power supply interface. |
---|
967 | 1023 | * @usb2_phy: pointer to USB2 PHY |
---|
968 | 1024 | * @usb3_phy: pointer to USB3 PHY |
---|
969 | 1025 | * @usb2_generic_phy: pointer to USB2 PHY |
---|
.. | .. |
---|
992 | 1048 | * @rx_max_burst_prd: max periodic ESS receive burst size |
---|
993 | 1049 | * @tx_thr_num_pkt_prd: periodic ESS transmit packet count |
---|
994 | 1050 | * @tx_max_burst_prd: max periodic ESS transmit burst size |
---|
| 1051 | + * @tx_fifo_resize_max_num: max number of fifos allocated during txfifo resize |
---|
995 | 1052 | * @hsphy_interface: "utmi" or "ulpi" |
---|
996 | 1053 | * @connected: true when we're connected to a host, false otherwise |
---|
997 | 1054 | * @delayed_status: true when gadget driver asks for delayed status |
---|
.. | .. |
---|
1002 | 1059 | * @has_lpm_erratum: true when core was configured with LPM Erratum. Note that |
---|
1003 | 1060 | * there's now way for software to detect this in runtime. |
---|
1004 | 1061 | * @is_utmi_l1_suspend: the core asserts output signal |
---|
1005 | | - * 0 - utmi_sleep_n |
---|
1006 | | - * 1 - utmi_l1_suspend_n |
---|
| 1062 | + * 0 - utmi_sleep_n |
---|
| 1063 | + * 1 - utmi_l1_suspend_n |
---|
1007 | 1064 | * @is_fpga: true when we are using the FPGA board |
---|
1008 | 1065 | * @pending_events: true when we have pending IRQs to be handled |
---|
| 1066 | + * @do_fifo_resize: true when txfifo resizing is enabled for dwc3 endpoints |
---|
1009 | 1067 | * @pullups_connected: true when Run/Stop bit is set |
---|
1010 | 1068 | * @setup_packet_pending: true when there's a Setup Packet in FIFO. Workaround |
---|
1011 | 1069 | * @three_stage_setup: set if we perform a three phase setup |
---|
1012 | 1070 | * @dis_start_transfer_quirk: set if start_transfer failure SW workaround is |
---|
1013 | 1071 | * not needed for DWC_usb31 version 1.70a-ea06 and below |
---|
1014 | 1072 | * @usb3_lpm_capable: set if hadrware supports Link Power Management |
---|
1015 | | - * @usb2_lpm_disable: set to disable usb2 lpm |
---|
| 1073 | + * @usb2_lpm_disable: set to disable usb2 lpm for host |
---|
| 1074 | + * @usb2_gadget_lpm_disable: set to disable usb2 lpm for gadget |
---|
1016 | 1075 | * @disable_scramble_quirk: set if we enable the disable scramble quirk |
---|
1017 | 1076 | * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk |
---|
1018 | 1077 | * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk |
---|
.. | .. |
---|
1023 | 1082 | * @rx_detect_poll_quirk: set if we enable rx_detect to polling lfps quirk |
---|
1024 | 1083 | * @dis_u3_susphy_quirk: set if we disable usb3 suspend phy |
---|
1025 | 1084 | * @dis_u2_susphy_quirk: set if we disable usb2 suspend phy |
---|
1026 | | - * @dis_u1u2_quirk: set if we reject transition to U1 or U2 state |
---|
1027 | 1085 | * @dis_enblslpm_quirk: set if we clear enblslpm in GUSB2PHYCFG, |
---|
1028 | 1086 | * disabling the suspend signal to the PHY. |
---|
| 1087 | + * @dis_u1_entry_quirk: set if link entering into U1 state needs to be disabled. |
---|
| 1088 | + * @dis_u2_entry_quirk: set if link entering into U2 state needs to be disabled. |
---|
1029 | 1089 | * @dis_rxdet_inp3_quirk: set if we disable Rx.Detect in P3 |
---|
1030 | 1090 | * @dis_u2_freeclk_exists_quirk : set if we clear u2_freeclk_exists |
---|
1031 | 1091 | * in GUSB2PHYCFG, specify that USB2 PHY doesn't |
---|
.. | .. |
---|
1036 | 1096 | * check during HS transmit. |
---|
1037 | 1097 | * @parkmode_disable_ss_quirk: set if we need to disable all SuperSpeed |
---|
1038 | 1098 | * instances in park mode. |
---|
1039 | | - * @xhci_slow_suspend_quirk: set if need an extraordinary delay to wait |
---|
1040 | | - * for xHC enter the Halted state after the Run/Stop |
---|
1041 | | - * (R/S) bit is cleared to '0'. |
---|
1042 | | - * @xhci_trb_ent_quirk: set if need to enable the Evaluate Next TRB(ENT) |
---|
1043 | | - flag in the TRB data structure to force xHC to |
---|
1044 | | - pre-fetch the next TRB of a TD. |
---|
1045 | | - * @xhci_warm_reset_on_suspend_quirk: set if need to do a warm port reset |
---|
1046 | | - * for xHC USB3 port upon suspend. |
---|
1047 | | - * @dis_u3_autosuspend_quirk: set if the we want to disable usb3 autosuspend |
---|
| 1099 | + * @parkmode_disable_hs_quirk: set if we need to disable all HishSpeed |
---|
| 1100 | + * instances in park mode. |
---|
1048 | 1101 | * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk |
---|
1049 | 1102 | * @tx_de_emphasis: Tx de-emphasis value |
---|
1050 | | - * 0 - -6dB de-emphasis |
---|
1051 | | - * 1 - -3.5dB de-emphasis |
---|
1052 | | - * 2 - No de-emphasis |
---|
1053 | | - * 3 - Reserved |
---|
| 1103 | + * 0 - -6dB de-emphasis |
---|
| 1104 | + * 1 - -3.5dB de-emphasis |
---|
| 1105 | + * 2 - No de-emphasis |
---|
| 1106 | + * 3 - Reserved |
---|
1054 | 1107 | * @dis_metastability_quirk: set to disable metastability quirk. |
---|
1055 | | - * @needs_fifo_resize: set if we want to resize TXFIFO. |
---|
1056 | | - * @fifo_resize_status: true if the TXFIFOs have been resized. |
---|
1057 | | - * @drd_connected: true when usb connected to a host or a device(drd mode), |
---|
1058 | | - * false otherwise. |
---|
1059 | | - * @en_runtime: true when need runtime PM management. For example, RK3399 need |
---|
1060 | | - * reset dwc3 and usb3phy to support typec interface. |
---|
1061 | | - * @uwk_en: true when enable usb wakeup from host resume signal. |
---|
| 1108 | + * @dis_split_quirk: set to disable split boundary. |
---|
1062 | 1109 | * @imod_interval: set the interrupt moderation interval in 250ns |
---|
1063 | | - * increments or 0 to disable. |
---|
| 1110 | + * increments or 0 to disable. |
---|
| 1111 | + * @max_cfg_eps: current max number of IN eps used across all USB configs. |
---|
| 1112 | + * @last_fifo_depth: last fifo depth used to determine next fifo ram start |
---|
| 1113 | + * address. |
---|
| 1114 | + * @num_ep_resized: carries the current number endpoints which have had its tx |
---|
| 1115 | + * fifo resized. |
---|
1064 | 1116 | */ |
---|
1065 | 1117 | struct dwc3 { |
---|
1066 | 1118 | struct work_struct drd_work; |
---|
.. | .. |
---|
1073 | 1125 | dma_addr_t scratch_addr; |
---|
1074 | 1126 | struct dwc3_request ep0_usb_req; |
---|
1075 | 1127 | struct completion ep0_in_setup; |
---|
1076 | | - struct completion discon_done; |
---|
1077 | 1128 | |
---|
1078 | 1129 | /* device lock */ |
---|
1079 | 1130 | spinlock_t lock; |
---|
| 1131 | + |
---|
| 1132 | + /* mode switching lock */ |
---|
| 1133 | + struct mutex mutex; |
---|
1080 | 1134 | |
---|
1081 | 1135 | struct device *dev; |
---|
1082 | 1136 | struct device *sysdev; |
---|
.. | .. |
---|
1087 | 1141 | struct dwc3_event_buffer *ev_buf; |
---|
1088 | 1142 | struct dwc3_ep *eps[DWC3_ENDPOINTS_NUM]; |
---|
1089 | 1143 | |
---|
1090 | | - struct usb_gadget gadget; |
---|
| 1144 | + struct usb_gadget *gadget; |
---|
1091 | 1145 | struct usb_gadget_driver *gadget_driver; |
---|
1092 | 1146 | |
---|
1093 | 1147 | struct clk_bulk_data *clks; |
---|
.. | .. |
---|
1115 | 1169 | struct extcon_dev *edev; |
---|
1116 | 1170 | struct notifier_block edev_nb; |
---|
1117 | 1171 | enum usb_phy_interface hsphy_mode; |
---|
| 1172 | + struct usb_role_switch *role_sw; |
---|
| 1173 | + enum usb_dr_mode role_switch_default_mode; |
---|
| 1174 | +#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI) |
---|
| 1175 | + u32 current_role_sw_mode; |
---|
| 1176 | + u32 desired_role_sw_mode; |
---|
| 1177 | +#endif |
---|
| 1178 | + |
---|
| 1179 | + struct power_supply *usb_psy; |
---|
1118 | 1180 | |
---|
1119 | 1181 | u32 fladj; |
---|
1120 | 1182 | u32 irq_gadget; |
---|
.. | .. |
---|
1125 | 1187 | u32 nr_scratch; |
---|
1126 | 1188 | u32 u1u2; |
---|
1127 | 1189 | u32 maximum_speed; |
---|
| 1190 | + u32 gadget_max_speed; |
---|
| 1191 | + enum usb_ssp_rate max_ssp_rate; |
---|
| 1192 | + enum usb_ssp_rate gadget_ssp_rate; |
---|
1128 | 1193 | |
---|
1129 | | - /* |
---|
1130 | | - * All 3.1 IP version constants are greater than the 3.0 IP |
---|
1131 | | - * version constants. This works for most version checks in |
---|
1132 | | - * dwc3. However, in the future, this may not apply as |
---|
1133 | | - * features may be developed on newer versions of the 3.0 IP |
---|
1134 | | - * that are not in the 3.1 IP. |
---|
1135 | | - */ |
---|
| 1194 | + u32 ip; |
---|
| 1195 | + |
---|
| 1196 | +#define DWC3_IP 0x5533 |
---|
| 1197 | +#define DWC31_IP 0x3331 |
---|
| 1198 | +#define DWC32_IP 0x3332 |
---|
| 1199 | + |
---|
1136 | 1200 | u32 revision; |
---|
1137 | 1201 | |
---|
| 1202 | +#define DWC3_REVISION_ANY 0x0 |
---|
1138 | 1203 | #define DWC3_REVISION_173A 0x5533173a |
---|
1139 | 1204 | #define DWC3_REVISION_175A 0x5533175a |
---|
1140 | 1205 | #define DWC3_REVISION_180A 0x5533180a |
---|
.. | .. |
---|
1159 | 1224 | #define DWC3_REVISION_310A 0x5533310a |
---|
1160 | 1225 | #define DWC3_REVISION_330A 0x5533330a |
---|
1161 | 1226 | |
---|
1162 | | -/* |
---|
1163 | | - * NOTICE: we're using bit 31 as a "is usb 3.1" flag. This is really |
---|
1164 | | - * just so dwc31 revisions are always larger than dwc3. |
---|
1165 | | - */ |
---|
1166 | | -#define DWC3_REVISION_IS_DWC31 0x80000000 |
---|
1167 | | -#define DWC3_USB31_REVISION_110A (0x3131302a | DWC3_REVISION_IS_DWC31) |
---|
1168 | | -#define DWC3_USB31_REVISION_120A (0x3132302a | DWC3_REVISION_IS_DWC31) |
---|
1169 | | -#define DWC3_USB31_REVISION_160A (0x3136302a | DWC3_REVISION_IS_DWC31) |
---|
1170 | | -#define DWC3_USB31_REVISION_170A (0x3137302a | DWC3_REVISION_IS_DWC31) |
---|
| 1227 | +#define DWC31_REVISION_ANY 0x0 |
---|
| 1228 | +#define DWC31_REVISION_110A 0x3131302a |
---|
| 1229 | +#define DWC31_REVISION_120A 0x3132302a |
---|
| 1230 | +#define DWC31_REVISION_160A 0x3136302a |
---|
| 1231 | +#define DWC31_REVISION_170A 0x3137302a |
---|
| 1232 | +#define DWC31_REVISION_180A 0x3138302a |
---|
| 1233 | +#define DWC31_REVISION_190A 0x3139302a |
---|
| 1234 | + |
---|
| 1235 | +#define DWC32_REVISION_ANY 0x0 |
---|
| 1236 | +#define DWC32_REVISION_100A 0x3130302a |
---|
1171 | 1237 | |
---|
1172 | 1238 | u32 version_type; |
---|
1173 | 1239 | |
---|
| 1240 | +#define DWC31_VERSIONTYPE_ANY 0x0 |
---|
1174 | 1241 | #define DWC31_VERSIONTYPE_EA01 0x65613031 |
---|
1175 | 1242 | #define DWC31_VERSIONTYPE_EA02 0x65613032 |
---|
1176 | 1243 | #define DWC31_VERSIONTYPE_EA03 0x65613033 |
---|
.. | .. |
---|
1205 | 1272 | u8 rx_max_burst_prd; |
---|
1206 | 1273 | u8 tx_thr_num_pkt_prd; |
---|
1207 | 1274 | u8 tx_max_burst_prd; |
---|
| 1275 | + u8 tx_fifo_resize_max_num; |
---|
1208 | 1276 | |
---|
1209 | 1277 | const char *hsphy_interface; |
---|
1210 | 1278 | |
---|
.. | .. |
---|
1218 | 1286 | unsigned is_utmi_l1_suspend:1; |
---|
1219 | 1287 | unsigned is_fpga:1; |
---|
1220 | 1288 | unsigned pending_events:1; |
---|
| 1289 | + unsigned do_fifo_resize:1; |
---|
1221 | 1290 | unsigned pullups_connected:1; |
---|
1222 | 1291 | unsigned setup_packet_pending:1; |
---|
1223 | 1292 | unsigned three_stage_setup:1; |
---|
1224 | 1293 | unsigned dis_start_transfer_quirk:1; |
---|
1225 | 1294 | unsigned usb3_lpm_capable:1; |
---|
1226 | 1295 | unsigned usb2_lpm_disable:1; |
---|
| 1296 | + unsigned usb2_gadget_lpm_disable:1; |
---|
1227 | 1297 | |
---|
1228 | 1298 | unsigned disable_scramble_quirk:1; |
---|
1229 | 1299 | unsigned u2exit_lfps_quirk:1; |
---|
.. | .. |
---|
1235 | 1305 | unsigned rx_detect_poll_quirk:1; |
---|
1236 | 1306 | unsigned dis_u3_susphy_quirk:1; |
---|
1237 | 1307 | unsigned dis_u2_susphy_quirk:1; |
---|
1238 | | - unsigned dis_u1u2_quirk:1; |
---|
1239 | 1308 | unsigned dis_enblslpm_quirk:1; |
---|
| 1309 | + unsigned dis_u1_entry_quirk:1; |
---|
| 1310 | + unsigned dis_u2_entry_quirk:1; |
---|
1240 | 1311 | unsigned dis_rxdet_inp3_quirk:1; |
---|
1241 | 1312 | unsigned dis_u2_freeclk_exists_quirk:1; |
---|
1242 | 1313 | unsigned dis_del_phy_power_chg_quirk:1; |
---|
1243 | 1314 | unsigned dis_tx_ipgap_linecheck_quirk:1; |
---|
1244 | 1315 | unsigned parkmode_disable_ss_quirk:1; |
---|
1245 | | - unsigned xhci_slow_suspend_quirk:1; |
---|
1246 | | - unsigned xhci_trb_ent_quirk:1; |
---|
1247 | | - unsigned xhci_warm_reset_on_suspend_quirk:1; |
---|
1248 | | - unsigned dis_u3_autosuspend_quirk:1; |
---|
| 1316 | +#ifdef CONFIG_NO_GKI |
---|
| 1317 | + unsigned parkmode_disable_hs_quirk:1; |
---|
| 1318 | +#endif |
---|
1249 | 1319 | |
---|
1250 | 1320 | unsigned tx_de_emphasis_quirk:1; |
---|
1251 | 1321 | unsigned tx_de_emphasis:2; |
---|
1252 | 1322 | |
---|
1253 | 1323 | unsigned dis_metastability_quirk:1; |
---|
1254 | | - unsigned needs_fifo_resize:1; |
---|
1255 | | - unsigned fifo_resize_status:1; |
---|
1256 | | - unsigned drd_connected:1; |
---|
1257 | | - unsigned en_runtime:1; |
---|
1258 | | - unsigned uwk_en:1; |
---|
| 1324 | + |
---|
| 1325 | + unsigned dis_split_quirk:1; |
---|
| 1326 | + unsigned async_callbacks:1; |
---|
1259 | 1327 | |
---|
1260 | 1328 | u16 imod_interval; |
---|
| 1329 | + |
---|
| 1330 | + int max_cfg_eps; |
---|
| 1331 | + int last_fifo_depth; |
---|
| 1332 | + int num_ep_resized; |
---|
| 1333 | + |
---|
| 1334 | + ANDROID_KABI_RESERVE(1); |
---|
| 1335 | + ANDROID_KABI_RESERVE(2); |
---|
| 1336 | + ANDROID_KABI_RESERVE(3); |
---|
| 1337 | + ANDROID_KABI_RESERVE(4); |
---|
| 1338 | +}; |
---|
| 1339 | + |
---|
| 1340 | +/** |
---|
| 1341 | + * struct dwc3_vendor - contains parameters without modifying the format of DWC3 core |
---|
| 1342 | + * @dwc: contains dwc3 core reference |
---|
| 1343 | + * @clear_stall_protocol: endpoint number that requires a delayed status phase |
---|
| 1344 | + * @softconnect: true when gadget connect is called, false when disconnect runs |
---|
| 1345 | + */ |
---|
| 1346 | +struct dwc3_vendor { |
---|
| 1347 | + struct dwc3 dwc; |
---|
| 1348 | + u8 clear_stall_protocol; |
---|
| 1349 | + unsigned softconnect:1; |
---|
1261 | 1350 | }; |
---|
1262 | 1351 | |
---|
1263 | 1352 | #define INCRX_BURST_MODE 0 |
---|
.. | .. |
---|
1281 | 1370 | #define DWC3_DEPEVT_EPCMDCMPLT 0x07 |
---|
1282 | 1371 | |
---|
1283 | 1372 | /** |
---|
1284 | | - * struct dwc3_event_depvt - Device Endpoint Events |
---|
| 1373 | + * struct dwc3_event_depevt - Device Endpoint Events |
---|
1285 | 1374 | * @one_bit: indicates this is an endpoint event (not used) |
---|
1286 | 1375 | * @endpoint_number: number of the endpoint |
---|
1287 | 1376 | * @endpoint_event: The event we have: |
---|
.. | .. |
---|
1320 | 1409 | #define DEPEVT_STREAMEVT_FOUND 1 |
---|
1321 | 1410 | #define DEPEVT_STREAMEVT_NOTFOUND 2 |
---|
1322 | 1411 | |
---|
| 1412 | +/* Stream event parameter */ |
---|
| 1413 | +#define DEPEVT_STREAM_PRIME 0xfffe |
---|
| 1414 | +#define DEPEVT_STREAM_NOSTREAM 0x0 |
---|
| 1415 | + |
---|
1323 | 1416 | /* Control-only Status */ |
---|
1324 | 1417 | #define DEPEVT_STATUS_CONTROL_DATA 1 |
---|
1325 | 1418 | #define DEPEVT_STATUS_CONTROL_STATUS 2 |
---|
.. | .. |
---|
1346 | 1439 | * 3 - ULStChng |
---|
1347 | 1440 | * 4 - WkUpEvt |
---|
1348 | 1441 | * 5 - Reserved |
---|
1349 | | - * 6 - EOPF |
---|
| 1442 | + * 6 - Suspend (EOPF on revisions 2.10a and prior) |
---|
1350 | 1443 | * 7 - SOF |
---|
1351 | 1444 | * 8 - Reserved |
---|
1352 | 1445 | * 9 - ErrticErr |
---|
.. | .. |
---|
1422 | 1515 | void dwc3_set_mode(struct dwc3 *dwc, u32 mode); |
---|
1423 | 1516 | u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type); |
---|
1424 | 1517 | |
---|
1425 | | -/* check whether we are on the DWC_usb3 core */ |
---|
1426 | | -static inline bool dwc3_is_usb3(struct dwc3 *dwc) |
---|
1427 | | -{ |
---|
1428 | | - return !(dwc->revision & DWC3_REVISION_IS_DWC31); |
---|
1429 | | -} |
---|
| 1518 | +#define DWC3_IP_IS(_ip) \ |
---|
| 1519 | + (dwc->ip == _ip##_IP) |
---|
1430 | 1520 | |
---|
1431 | | -/* check whether we are on the DWC_usb31 core */ |
---|
1432 | | -static inline bool dwc3_is_usb31(struct dwc3 *dwc) |
---|
| 1521 | +#define DWC3_VER_IS(_ip, _ver) \ |
---|
| 1522 | + (DWC3_IP_IS(_ip) && dwc->revision == _ip##_REVISION_##_ver) |
---|
| 1523 | + |
---|
| 1524 | +#define DWC3_VER_IS_PRIOR(_ip, _ver) \ |
---|
| 1525 | + (DWC3_IP_IS(_ip) && dwc->revision < _ip##_REVISION_##_ver) |
---|
| 1526 | + |
---|
| 1527 | +#define DWC3_VER_IS_WITHIN(_ip, _from, _to) \ |
---|
| 1528 | + (DWC3_IP_IS(_ip) && \ |
---|
| 1529 | + dwc->revision >= _ip##_REVISION_##_from && \ |
---|
| 1530 | + (!(_ip##_REVISION_##_to) || \ |
---|
| 1531 | + dwc->revision <= _ip##_REVISION_##_to)) |
---|
| 1532 | + |
---|
| 1533 | +#define DWC3_VER_TYPE_IS_WITHIN(_ip, _ver, _from, _to) \ |
---|
| 1534 | + (DWC3_VER_IS(_ip, _ver) && \ |
---|
| 1535 | + dwc->version_type >= _ip##_VERSIONTYPE_##_from && \ |
---|
| 1536 | + (!(_ip##_VERSIONTYPE_##_to) || \ |
---|
| 1537 | + dwc->version_type <= _ip##_VERSIONTYPE_##_to)) |
---|
| 1538 | + |
---|
| 1539 | +/** |
---|
| 1540 | + * dwc3_mdwidth - get MDWIDTH value in bits |
---|
| 1541 | + * @dwc: pointer to our context structure |
---|
| 1542 | + * |
---|
| 1543 | + * Return MDWIDTH configuration value in bits. |
---|
| 1544 | + */ |
---|
| 1545 | +static inline u32 dwc3_mdwidth(struct dwc3 *dwc) |
---|
1433 | 1546 | { |
---|
1434 | | - return !!(dwc->revision & DWC3_REVISION_IS_DWC31); |
---|
| 1547 | + u32 mdwidth; |
---|
| 1548 | + |
---|
| 1549 | + mdwidth = DWC3_GHWPARAMS0_MDWIDTH(dwc->hwparams.hwparams0); |
---|
| 1550 | + if (DWC3_IP_IS(DWC32)) |
---|
| 1551 | + mdwidth += DWC3_GHWPARAMS6_MDWIDTH(dwc->hwparams.hwparams6); |
---|
| 1552 | + |
---|
| 1553 | + return mdwidth; |
---|
1435 | 1554 | } |
---|
1436 | 1555 | |
---|
1437 | 1556 | bool dwc3_has_imod(struct dwc3 *dwc); |
---|
1438 | 1557 | |
---|
1439 | 1558 | int dwc3_event_buffers_setup(struct dwc3 *dwc); |
---|
1440 | 1559 | void dwc3_event_buffers_cleanup(struct dwc3 *dwc); |
---|
| 1560 | + |
---|
| 1561 | +int dwc3_core_soft_reset(struct dwc3 *dwc); |
---|
1441 | 1562 | |
---|
1442 | 1563 | #if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE) |
---|
1443 | 1564 | int dwc3_host_init(struct dwc3 *dwc); |
---|
.. | .. |
---|
1455 | 1576 | int dwc3_gadget_set_test_mode(struct dwc3 *dwc, int mode); |
---|
1456 | 1577 | int dwc3_gadget_get_link_state(struct dwc3 *dwc); |
---|
1457 | 1578 | int dwc3_gadget_set_link_state(struct dwc3 *dwc, enum dwc3_link_state state); |
---|
1458 | | -int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd, |
---|
| 1579 | +int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd, |
---|
1459 | 1580 | struct dwc3_gadget_ep_cmd_params *params); |
---|
1460 | | -int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param); |
---|
1461 | | -void dwc3_gadget_disable_irq(struct dwc3 *dwc); |
---|
1462 | | -void dwc3_gadget_enable_irq(struct dwc3 *dwc); |
---|
| 1581 | +int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned int cmd, |
---|
| 1582 | + u32 param); |
---|
| 1583 | +void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, bool interrupt); |
---|
| 1584 | +void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc); |
---|
| 1585 | +void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status); |
---|
1463 | 1586 | #else |
---|
1464 | 1587 | static inline int dwc3_gadget_init(struct dwc3 *dwc) |
---|
1465 | 1588 | { return 0; } |
---|
.. | .. |
---|
1473 | 1596 | enum dwc3_link_state state) |
---|
1474 | 1597 | { return 0; } |
---|
1475 | 1598 | |
---|
1476 | | -static inline int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd, |
---|
| 1599 | +static inline int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd, |
---|
1477 | 1600 | struct dwc3_gadget_ep_cmd_params *params) |
---|
1478 | 1601 | { return 0; } |
---|
1479 | 1602 | static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc, |
---|
1480 | 1603 | int cmd, u32 param) |
---|
1481 | 1604 | { return 0; } |
---|
1482 | | -static inline void dwc3_gadget_enable_irq(struct dwc3 *dwc) |
---|
| 1605 | +static inline void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, |
---|
| 1606 | + bool interrupt) |
---|
1483 | 1607 | { } |
---|
1484 | | -static inline void dwc3_gadget_disable_irq(struct dwc3 *dwc) |
---|
| 1608 | +static inline void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc) |
---|
1485 | 1609 | { } |
---|
1486 | 1610 | #endif |
---|
1487 | 1611 | |
---|