]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - arch/tile/include/gxio/usb_host.h
UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers
[mirror_ubuntu-bionic-kernel.git] / arch / tile / include / gxio / usb_host.h
1 /*
2 * Copyright 2012 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14 #ifndef _GXIO_USB_H_
15 #define _GXIO_USB_H_
16
17 #include <gxio/common.h>
18
19 #include <hv/drv_usb_host_intf.h>
20 #include <hv/iorpc.h>
21
22 /*
23 *
24 * An API for manipulating general-purpose I/O pins.
25 */
26
27 /*
28 *
29 * The USB shim allows access to the processor's Universal Serial Bus
30 * connections.
31 */
32
33 /* A context object used to manage USB hardware resources. */
34 typedef struct {
35
36 /* File descriptor for calling up to the hypervisor. */
37 int fd;
38
39 /* The VA at which our MMIO registers are mapped. */
40 char *mmio_base;
41 } gxio_usb_host_context_t;
42
43 /* Initialize a USB context.
44 *
45 * A properly initialized context must be obtained before any of the other
46 * gxio_usb_host routines may be used.
47 *
48 * @param context Pointer to a gxio_usb_host_context_t, which will be
49 * initialized by this routine, if it succeeds.
50 * @param usb_index Index of the USB shim to use.
51 * @param is_ehci Nonzero to use the EHCI interface; zero to use the OHCI
52 * intereface.
53 * @return Zero if the context was successfully initialized, else a
54 * GXIO_ERR_xxx error code.
55 */
56 extern int gxio_usb_host_init(gxio_usb_host_context_t * context, int usb_index,
57 int is_ehci);
58
59 /* Destroy a USB context.
60 *
61 * Once destroyed, a context may not be used with any gxio_usb_host routines
62 * other than gxio_usb_host_init(). After this routine returns, no further
63 * interrupts or signals requested on this context will be delivered. The
64 * state and configuration of the pins which had been attached to this
65 * context are unchanged by this operation.
66 *
67 * @param context Pointer to a gxio_usb_host_context_t.
68 * @return Zero if the context was successfully destroyed, else a
69 * GXIO_ERR_xxx error code.
70 */
71 extern int gxio_usb_host_destroy(gxio_usb_host_context_t * context);
72
73 /* Retrieve the address of the shim's MMIO registers.
74 *
75 * @param context Pointer to a properly initialized gxio_usb_host_context_t.
76 * @return The address of the shim's MMIO registers.
77 */
78 extern void *gxio_usb_host_get_reg_start(gxio_usb_host_context_t * context);
79
80 /* Retrieve the length of the shim's MMIO registers.
81 *
82 * @param context Pointer to a properly initialized gxio_usb_host_context_t.
83 * @return The length of the shim's MMIO registers.
84 */
85 extern size_t gxio_usb_host_get_reg_len(gxio_usb_host_context_t * context);
86
87 #endif /* _GXIO_USB_H_ */