4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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.
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
19 #include <linux/platform_device.h>
20 #include <linux/usb/ch9.h>
25 * it will be return value from get_id
34 * callback functions table for driver
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
40 struct renesas_usbhs_driver_callback
{
41 int (*notify_hotplug
)(struct platform_device
*pdev
);
45 * callback functions for platform
47 * These functions are called from driver for platform
49 struct renesas_usbhs_platform_callback
{
54 * Hardware init function for platform.
55 * it is called when driver was probed.
57 int (*hardware_init
)(struct platform_device
*pdev
);
62 * Hardware exit function for platform.
63 * it is called when driver was removed
65 void (*hardware_exit
)(struct platform_device
*pdev
);
70 * Phy reset for platform
72 void (*phy_reset
)(struct platform_device
*pdev
);
79 int (*get_id
)(struct platform_device
*pdev
);
82 * get VBUS status function.
84 int (*get_vbus
)(struct platform_device
*pdev
);
89 * VBUS control is needed for Host
91 int (*set_vbus
)(struct platform_device
*pdev
, int enable
);
95 * parameters for renesas usbhs
97 * some register needs USB chip specific parameters.
98 * This struct show it to driver
100 struct renesas_usbhs_driver_param
{
104 u32
*pipe_type
; /* array of USB_ENDPOINT_XFER_xxx (from ep0) */
105 int pipe_size
; /* pipe_type array size */
110 * for BUSWAIT :: BWAIT
112 * renesas_usbhs/common.c :: usbhsc_set_buswait()
119 * delay time from notify_hotplug callback
126 * dma id for dmaengine
136 * pio <--> dma border.
138 int pio_dma_border
; /* default is 64byte */
143 u32 has_otg
:1; /* for controlling PWEN/EXTLP */
149 * platform information for renesas_usbhs driver.
151 struct renesas_usbhs_platform_info
{
155 * platform set these functions before
156 * call platform_add_devices if needed
158 struct renesas_usbhs_platform_callback platform_callback
;
161 * driver set these callback functions pointer.
162 * platform can use it on callback functions
164 struct renesas_usbhs_driver_callback driver_callback
;
169 * driver use these param for some register
171 struct renesas_usbhs_driver_param driver_param
;
177 #define renesas_usbhs_get_info(pdev)\
178 ((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data)
180 #define renesas_usbhs_call_notify_hotplug(pdev) \
182 struct renesas_usbhs_driver_callback *dc; \
183 dc = &(renesas_usbhs_get_info(pdev)->driver_callback); \
184 if (dc && dc->notify_hotplug) \
185 dc->notify_hotplug(pdev); \
187 #endif /* RENESAS_USB_H */