summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-dbgcap.h
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2020-07-23 17:45:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-23 17:05:29 +0200
commit6ae6470bfa330d0b8892e02888bf5dac2272c28d (patch)
tree334242ee5eb63fe82db59b5048172c05d4441062 /drivers/usb/host/xhci-dbgcap.h
parent4521f16139409cdf9462c7325d43454462cff6c3 (diff)
downloadlwn-6ae6470bfa330d0b8892e02888bf5dac2272c28d.tar.gz
lwn-6ae6470bfa330d0b8892e02888bf5dac2272c28d.zip
xhci: dbc: Add a operations structure to access driver functions
Don't call dbctty driver functions directly from dbc core code. Introduce a new dbc_driver structure that contains function pointers for disconnect and configure operations. The driver (ttydbc) must provide these opeations when creating a dbc. Name the structure dbc_driver instead of dbc_ops as we plan to add more driver configureable values here, such as vid and pid. Decouples dbc and dbctty. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200723144530.9992-26-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-dbgcap.h')
-rw-r--r--drivers/usb/host/xhci-dbgcap.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-dbgcap.h b/drivers/usb/host/xhci-dbgcap.h
index e4c7c9279ea8..5018b32fc742 100644
--- a/drivers/usb/host/xhci-dbgcap.h
+++ b/drivers/usb/host/xhci-dbgcap.h
@@ -112,6 +112,11 @@ struct dbc_port {
bool registered;
};
+struct dbc_driver {
+ int (*configure)(struct xhci_dbc *dbc);
+ void (*disconnect)(struct xhci_dbc *dbc);
+};
+
struct xhci_dbc {
spinlock_t lock; /* device access */
struct device *dev;
@@ -133,6 +138,7 @@ struct xhci_dbc {
struct dbc_ep eps[2];
struct dbc_port port;
+ const struct dbc_driver *driver;
};
struct dbc_request {
@@ -192,8 +198,6 @@ int xhci_dbc_init(struct xhci_hcd *xhci);
void xhci_dbc_exit(struct xhci_hcd *xhci);
int xhci_dbc_tty_probe(struct xhci_hcd *xhci);
void xhci_dbc_tty_remove(struct xhci_dbc *dbc);
-int xhci_dbc_tty_register_device(struct xhci_dbc *dbc);
-void xhci_dbc_tty_unregister_device(struct xhci_dbc *dbc);
struct dbc_request *dbc_alloc_request(struct xhci_dbc *dbc,
unsigned int direction,
gfp_t flags);