123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
#ifndef RENESAS_USB_H
#define RENESAS_USB_H
#include <linux/notifier.h>
#include <linux/platform_device.h>
#include <linux/usb/ch9.h>
enum {
USBHS_HOST = 0,
USBHS_GADGET,
USBHS_MAX,
};
struct renesas_usbhs_platform_callback {
int (*hardware_init)(struct platform_device *pdev);
int (*hardware_exit)(struct platform_device *pdev);
int (*power_ctrl)(struct platform_device *pdev,
void __iomem *base, int enable);
int (*phy_reset)(struct platform_device *pdev);
int (*get_id)(struct platform_device *pdev);
int (*get_vbus)(struct platform_device *pdev);
int (*set_vbus)(struct platform_device *pdev, int enable);
int (*notifier)(struct notifier_block *nb, unsigned long event,
void *data);
};
struct renesas_usbhs_driver_pipe_config {
u8 type;
u16 bufsize;
u8 bufnum;
bool double_buf;
};
#define RENESAS_USBHS_PIPE(_type, _size, _num, _double_buf) { \
.type = (_type), \
.bufsize = (_size), \
.bufnum = (_num), \
.double_buf = (_double_buf), \
}
struct renesas_usbhs_driver_param {
struct renesas_usbhs_driver_pipe_config *pipe_configs;
int pipe_size;
int buswait_bwait;
int detection_delay;
int d0_tx_id;
int d0_rx_id;
int d1_tx_id;
int d1_rx_id;
int d2_tx_id;
int d2_rx_id;
int d3_tx_id;
int d3_rx_id;
int pio_dma_border;
u32 has_usb_dmac:1;
u32 runtime_pwctrl:1;
u32 has_cnen:1;
u32 cfifo_byte_addr:1;
#define USBHS_USB_DMAC_XFER_SIZE 32 /* hardcode the xfer size */
u32 multi_clks:1;
u32 has_new_pipe_configs:1;
};
struct renesas_usbhs_platform_info {
struct renesas_usbhs_platform_callback platform_callback;
struct renesas_usbhs_driver_param driver_param;
};
#endif /* RENESAS_USB_H */