Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
2319b9c
Documentation
LICENSES
arch
block
certs
crypto
drivers
accel
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
cdx
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma-buf
dma
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband
input
interconnect
iommu
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
pcmcia
peci
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
ufs
uio
usb
atm
c67x00
cdns3
Kconfig
Makefile
cdns3-debug.h
cdns3-ep0.c
cdns3-gadget.c
cdns3-gadget.h
cdns3-imx.c
cdns3-pci-wrap.c
cdns3-plat.c
cdns3-starfive.c
cdns3-ti.c
cdns3-trace.c
cdns3-trace.h
cdnsp-debug.h
cdnsp-ep0.c
cdnsp-gadget.c
cdnsp-gadget.h
cdnsp-mem.c
cdnsp-pci.c
cdnsp-ring.c
cdnsp-trace.c
cdnsp-trace.h
core.c
core.h
drd.c
drd.h
gadget-export.h
host-export.h
host.c
chipidea
class
common
core
dwc2
dwc3
early
fotg210
gadget
host
image
isp1760
misc
mon
mtu3
musb
phy
renesas_usbhs
roles
serial
storage
typec
usbip
Kconfig
Makefile
usb-skeleton.c
vdpa
vfio
vhost
video
virt
virtio
vlynq
w1
watchdog
xen
zorro
Kconfig
Makefile
fs
include
init
io_uring
ipc
kernel
lib
mm
net
rust
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
drivers
/
usb
/
cdns3
/
core.h
Blame
Blame
Latest commit
Xiaolei Wang
and
Greg Kroah-Hartman
usb: cdns3: Put the cdns set active part outside the spin lock
Jul 25, 2023
2319b9c
·
Jul 25, 2023
History
History
139 lines (128 loc) · 4.36 KB
Breadcrumbs
linux
/
drivers
/
usb
/
cdns3
/
core.h
Top
File metadata and controls
Code
Blame
139 lines (128 loc) · 4.36 KB
Raw
/* SPDX-License-Identifier: GPL-2.0 */ /* * Cadence USBSS and USBSSP DRD Header File. * * Copyright (C) 2017-2018 NXP * Copyright (C) 2018-2019 Cadence. * * Authors: Peter Chen <peter.chen@nxp.com> * Pawel Laszczak <pawell@cadence.com> */ #ifndef __LINUX_CDNS3_CORE_H #define __LINUX_CDNS3_CORE_H #include <linux/usb/otg.h> #include <linux/usb/role.h> struct cdns; /** * struct cdns_role_driver - host/gadget role driver * @start: start this role * @stop: stop this role * @suspend: suspend callback for this role * @resume: resume callback for this role * @irq: irq handler for this role * @name: role name string (host/gadget) * @state: current state */ struct cdns_role_driver { int (*start)(struct cdns *cdns); void (*stop)(struct cdns *cdns); int (*suspend)(struct cdns *cdns, bool do_wakeup); int (*resume)(struct cdns *cdns, bool hibernated); const char *name; #define CDNS_ROLE_STATE_INACTIVE 0 #define CDNS_ROLE_STATE_ACTIVE 1 int state; }; #define CDNS_XHCI_RESOURCES_NUM 2 struct cdns3_platform_data { int (*platform_suspend)(struct device *dev, bool suspend, bool wakeup); unsigned long quirks; #define CDNS3_DEFAULT_PM_RUNTIME_ALLOW BIT(0) }; /** * struct cdns - Representation of Cadence USB3 DRD controller. * @dev: pointer to Cadence device struct * @xhci_regs: pointer to base of xhci registers * @xhci_res: the resource for xhci * @dev_regs: pointer to base of dev registers * @otg_res: the resource for otg * @otg_v0_regs: pointer to base of v0 otg registers * @otg_v1_regs: pointer to base of v1 otg registers * @otg_cdnsp_regs: pointer to base of CDNSP otg registers * @otg_regs: pointer to base of otg registers * @otg_irq_regs: pointer to interrupt registers * @otg_irq: irq number for otg controller * @dev_irq: irq number for device controller * @wakeup_irq: irq number for wakeup event, it is optional * @roles: array of supported roles for this controller * @role: current role * @host_dev: the child host device pointer for cdns core * @gadget_dev: the child gadget device pointer * @usb2_phy: pointer to USB2 PHY * @usb3_phy: pointer to USB3 PHY * @mutex: the mutex for concurrent code at driver * @dr_mode: supported mode of operation it can be only Host, only Device * or OTG mode that allow to switch between Device and Host mode. * This field based on firmware setting, kernel configuration * and hardware configuration. * @role_sw: pointer to role switch object. * @in_lpm: indicate the controller is in low power mode * @wakeup_pending: wakeup interrupt pending * @pdata: platform data from glue layer * @lock: spinlock structure * @xhci_plat_data: xhci private data structure pointer * @gadget_init: pointer to gadget initialization function */ struct cdns { struct device *dev; void __iomem *xhci_regs; struct resource xhci_res[CDNS_XHCI_RESOURCES_NUM]; struct cdns3_usb_regs __iomem *dev_regs; struct resource otg_res; struct cdns3_otg_legacy_regs __iomem *otg_v0_regs; struct cdns3_otg_regs __iomem *otg_v1_regs; struct cdnsp_otg_regs __iomem *otg_cdnsp_regs; struct cdns_otg_common_regs __iomem *otg_regs; struct cdns_otg_irq_regs __iomem *otg_irq_regs; #define CDNS3_CONTROLLER_V0 0 #define CDNS3_CONTROLLER_V1 1 #define CDNSP_CONTROLLER_V2 2 u32 version; bool phyrst_a_enable; int otg_irq; int dev_irq; int wakeup_irq; struct cdns_role_driver *roles[USB_ROLE_DEVICE + 1]; enum usb_role role; struct platform_device *host_dev; void *gadget_dev; struct phy *usb2_phy; struct phy *usb3_phy; /* mutext used in workqueue*/ struct mutex mutex; enum usb_dr_mode dr_mode; struct usb_role_switch *role_sw; bool in_lpm; bool wakeup_pending; struct cdns3_platform_data *pdata; spinlock_t lock; struct xhci_plat_priv *xhci_plat_data; int (*gadget_init)(struct cdns *cdns); }; int cdns_hw_role_switch(struct cdns *cdns); int cdns_init(struct cdns *cdns); int cdns_remove(struct cdns *cdns); #ifdef CONFIG_PM_SLEEP int cdns_resume(struct cdns *cdns); int cdns_suspend(struct cdns *cdns); void cdns_set_active(struct cdns *cdns, u8 set_active); #else /* CONFIG_PM_SLEEP */ static inline int cdns_resume(struct cdns *cdns) { return 0; } static inline int cdns_set_active(struct cdns *cdns, u8 set_active) { return 0; } static inline int cdns_suspend(struct cdns *cdns) { return 0; } #endif /* CONFIG_PM_SLEEP */ #endif /* __LINUX_CDNS3_CORE_H */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
You can’t perform that action at this time.