0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef RENESAS_USB_H
0020 #define RENESAS_USB_H
0021 #include <linux/notifier.h>
0022 #include <linux/platform_device.h>
0023 #include <linux/usb/ch9.h>
0024
0025
0026
0027
0028
0029
0030 enum {
0031 USBHS_HOST = 0,
0032 USBHS_GADGET,
0033 USBHS_MAX,
0034 };
0035
0036
0037
0038
0039
0040
0041 struct renesas_usbhs_platform_callback {
0042
0043
0044
0045
0046
0047
0048
0049 int (*hardware_init)(struct platform_device *pdev);
0050
0051
0052
0053
0054
0055
0056
0057 int (*hardware_exit)(struct platform_device *pdev);
0058
0059
0060
0061
0062
0063
0064 int (*power_ctrl)(struct platform_device *pdev,
0065 void __iomem *base, int enable);
0066
0067
0068
0069
0070
0071
0072 int (*phy_reset)(struct platform_device *pdev);
0073
0074
0075
0076
0077
0078
0079 int (*get_id)(struct platform_device *pdev);
0080
0081
0082
0083
0084 int (*get_vbus)(struct platform_device *pdev);
0085
0086
0087
0088
0089
0090
0091 int (*set_vbus)(struct platform_device *pdev, int enable);
0092
0093
0094
0095
0096
0097 int (*notifier)(struct notifier_block *nb, unsigned long event,
0098 void *data);
0099 };
0100
0101
0102
0103
0104
0105
0106
0107
0108 struct renesas_usbhs_driver_pipe_config {
0109 u8 type;
0110 u16 bufsize;
0111 u8 bufnum;
0112 bool double_buf;
0113 };
0114 #define RENESAS_USBHS_PIPE(_type, _size, _num, _double_buf) { \
0115 .type = (_type), \
0116 .bufsize = (_size), \
0117 .bufnum = (_num), \
0118 .double_buf = (_double_buf), \
0119 }
0120
0121 struct renesas_usbhs_driver_param {
0122
0123
0124
0125 struct renesas_usbhs_driver_pipe_config *pipe_configs;
0126 int pipe_size;
0127
0128
0129
0130
0131
0132
0133
0134
0135 int buswait_bwait;
0136
0137
0138
0139
0140
0141
0142 int detection_delay;
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157 int d0_tx_id;
0158 int d0_rx_id;
0159 int d1_tx_id;
0160 int d1_rx_id;
0161 int d2_tx_id;
0162 int d2_rx_id;
0163 int d3_tx_id;
0164 int d3_rx_id;
0165
0166
0167
0168
0169
0170
0171 int pio_dma_border;
0172
0173
0174
0175
0176 u32 has_usb_dmac:1;
0177 u32 runtime_pwctrl:1;
0178 u32 has_cnen:1;
0179 u32 cfifo_byte_addr:1;
0180 #define USBHS_USB_DMAC_XFER_SIZE 32
0181 u32 multi_clks:1;
0182 u32 has_new_pipe_configs:1;
0183 };
0184
0185
0186
0187
0188
0189
0190 struct renesas_usbhs_platform_info {
0191
0192
0193
0194
0195
0196
0197 struct renesas_usbhs_platform_callback platform_callback;
0198
0199
0200
0201
0202
0203
0204 struct renesas_usbhs_driver_param driver_param;
0205 };
0206
0207
0208
0209
0210 #define renesas_usbhs_get_info(pdev)\
0211 ((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data)
0212 #endif