diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-19 08:50:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-19 08:50:38 -0400 |
commit | 50ee9339c7347c2b16fa79d43777f72e9f41ef5a (patch) | |
tree | ce09aa147e5c8bb74c72c46cebfdbffeece6678f /include | |
parent | f0e615c3cb72b42191b558c130409335812621d8 (diff) | |
parent | 98346f7db014614a4814eb60639f651f8bbc591d (diff) |
Merge 2.6.39-rc4 into usb-next
This is needed to help resolve some xhci issues and other minor
differences.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb/gadget.h | 4 | ||||
-rw-r--r-- | include/linux/usb/renesas_usbhs.h | 149 |
2 files changed, 151 insertions, 2 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index e538172c0f64..dd1571db55e7 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -890,8 +890,8 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v) | |||
890 | /* utility wrapping a simple endpoint selection policy */ | 890 | /* utility wrapping a simple endpoint selection policy */ |
891 | 891 | ||
892 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, | 892 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
893 | struct usb_endpoint_descriptor *) __devinit; | 893 | struct usb_endpoint_descriptor *); |
894 | 894 | ||
895 | extern void usb_ep_autoconfig_reset(struct usb_gadget *) __devinit; | 895 | extern void usb_ep_autoconfig_reset(struct usb_gadget *); |
896 | 896 | ||
897 | #endif /* __LINUX_USB_GADGET_H */ | 897 | #endif /* __LINUX_USB_GADGET_H */ |
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h new file mode 100644 index 000000000000..565bca3aa440 --- /dev/null +++ b/include/linux/usb/renesas_usbhs.h | |||
@@ -0,0 +1,149 @@ | |||
1 | /* | ||
2 | * Renesas USB | ||
3 | * | ||
4 | * Copyright (C) 2011 Renesas Solutions Corp. | ||
5 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
15 | * | ||
16 | */ | ||
17 | #ifndef RENESAS_USB_H | ||
18 | #define RENESAS_USB_H | ||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/usb/ch9.h> | ||
21 | |||
22 | /* | ||
23 | * module type | ||
24 | * | ||
25 | * it will be return value from get_id | ||
26 | */ | ||
27 | enum { | ||
28 | USBHS_HOST = 0, | ||
29 | USBHS_GADGET, | ||
30 | USBHS_MAX, | ||
31 | }; | ||
32 | |||
33 | /* | ||
34 | * callback functions table for driver | ||
35 | * | ||
36 | * These functions are called from platform for driver. | ||
37 | * Callback function's pointer will be set before | ||
38 | * renesas_usbhs_platform_callback :: hardware_init was called | ||
39 | */ | ||
40 | struct renesas_usbhs_driver_callback { | ||
41 | int (*notify_hotplug)(struct platform_device *pdev); | ||
42 | }; | ||
43 | |||
44 | /* | ||
45 | * callback functions for platform | ||
46 | * | ||
47 | * These functions are called from driver for platform | ||
48 | */ | ||
49 | struct renesas_usbhs_platform_callback { | ||
50 | |||
51 | /* | ||
52 | * option: | ||
53 | * | ||
54 | * Hardware init function for platform. | ||
55 | * it is called when driver was probed. | ||
56 | */ | ||
57 | int (*hardware_init)(struct platform_device *pdev); | ||
58 | |||
59 | /* | ||
60 | * option: | ||
61 | * | ||
62 | * Hardware exit function for platform. | ||
63 | * it is called when driver was removed | ||
64 | */ | ||
65 | void (*hardware_exit)(struct platform_device *pdev); | ||
66 | |||
67 | /* | ||
68 | * option: | ||
69 | * | ||
70 | * Phy reset for platform | ||
71 | */ | ||
72 | void (*phy_reset)(struct platform_device *pdev); | ||
73 | |||
74 | /* | ||
75 | * get USB ID function | ||
76 | * - USBHS_HOST | ||
77 | * - USBHS_GADGET | ||
78 | */ | ||
79 | int (*get_id)(struct platform_device *pdev); | ||
80 | |||
81 | /* | ||
82 | * get VBUS status function. | ||
83 | */ | ||
84 | int (*get_vbus)(struct platform_device *pdev); | ||
85 | }; | ||
86 | |||
87 | /* | ||
88 | * parameters for renesas usbhs | ||
89 | * | ||
90 | * some register needs USB chip specific parameters. | ||
91 | * This struct show it to driver | ||
92 | */ | ||
93 | struct renesas_usbhs_driver_param { | ||
94 | /* | ||
95 | * pipe settings | ||
96 | */ | ||
97 | u32 *pipe_type; /* array of USB_ENDPOINT_XFER_xxx (from ep0) */ | ||
98 | int pipe_size; /* pipe_type array size */ | ||
99 | |||
100 | /* | ||
101 | * option: | ||
102 | * | ||
103 | * for BUSWAIT :: BWAIT | ||
104 | * */ | ||
105 | int buswait_bwait; | ||
106 | }; | ||
107 | |||
108 | /* | ||
109 | * option: | ||
110 | * | ||
111 | * platform information for renesas_usbhs driver. | ||
112 | */ | ||
113 | struct renesas_usbhs_platform_info { | ||
114 | /* | ||
115 | * option: | ||
116 | * | ||
117 | * platform set these functions before | ||
118 | * call platform_add_devices if needed | ||
119 | */ | ||
120 | struct renesas_usbhs_platform_callback platform_callback; | ||
121 | |||
122 | /* | ||
123 | * driver set these callback functions pointer. | ||
124 | * platform can use it on callback functions | ||
125 | */ | ||
126 | struct renesas_usbhs_driver_callback driver_callback; | ||
127 | |||
128 | /* | ||
129 | * option: | ||
130 | * | ||
131 | * driver use these param for some register | ||
132 | */ | ||
133 | struct renesas_usbhs_driver_param driver_param; | ||
134 | }; | ||
135 | |||
136 | /* | ||
137 | * macro for platform | ||
138 | */ | ||
139 | #define renesas_usbhs_get_info(pdev)\ | ||
140 | ((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data) | ||
141 | |||
142 | #define renesas_usbhs_call_notify_hotplug(pdev) \ | ||
143 | ({ \ | ||
144 | struct renesas_usbhs_driver_callback *dc; \ | ||
145 | dc = &(renesas_usbhs_get_info(pdev)->driver_callback); \ | ||
146 | if (dc) \ | ||
147 | dc->notify_hotplug(pdev); \ | ||
148 | }) | ||
149 | #endif /* RENESAS_USB_H */ | ||