printf: Remove unused 'bprintf'
[drm/drm-misc.git] / include / linux / usb / renesas_usbhs.h
blob67bfcda6c7d2779e31774f91412f9cd8abf4db3b
1 // SPDX-License-Identifier: GPL-1.0+
2 /*
3 * Renesas USB
5 * Copyright (C) 2011 Renesas Solutions Corp.
6 * Copyright (C) 2019 Renesas Electronics Corporation
7 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
8 */
9 #ifndef RENESAS_USB_H
10 #define RENESAS_USB_H
11 #include <linux/notifier.h>
12 #include <linux/platform_device.h>
13 #include <linux/usb/ch9.h>
16 * module type
18 * it will be return value from get_id
20 enum {
21 USBHS_HOST = 0,
22 USBHS_GADGET,
23 USBHS_MAX,
27 * callback functions for platform
29 * These functions are called from driver for platform
31 struct renesas_usbhs_platform_callback {
34 * option:
36 * Hardware init function for platform.
37 * it is called when driver was probed.
39 int (*hardware_init)(struct platform_device *pdev);
42 * option:
44 * Hardware exit function for platform.
45 * it is called when driver was removed
47 int (*hardware_exit)(struct platform_device *pdev);
50 * option:
52 * for board specific clock control
54 int (*power_ctrl)(struct platform_device *pdev,
55 void __iomem *base, int enable);
58 * option:
60 * Phy reset for platform
62 int (*phy_reset)(struct platform_device *pdev);
65 * get USB ID function
66 * - USBHS_HOST
67 * - USBHS_GADGET
69 int (*get_id)(struct platform_device *pdev);
72 * get VBUS status function.
74 int (*get_vbus)(struct platform_device *pdev);
77 * option:
79 * VBUS control is needed for Host
81 int (*set_vbus)(struct platform_device *pdev, int enable);
84 * option:
85 * extcon notifier to set host/peripheral mode.
87 int (*notifier)(struct notifier_block *nb, unsigned long event,
88 void *data);
92 * parameters for renesas usbhs
94 * some register needs USB chip specific parameters.
95 * This struct show it to driver
98 struct renesas_usbhs_driver_pipe_config {
99 u8 type; /* USB_ENDPOINT_XFER_xxx */
100 u16 bufsize;
101 u8 bufnum;
102 bool double_buf;
104 #define RENESAS_USBHS_PIPE(_type, _size, _num, _double_buf) { \
105 .type = (_type), \
106 .bufsize = (_size), \
107 .bufnum = (_num), \
108 .double_buf = (_double_buf), \
111 struct renesas_usbhs_driver_param {
113 * pipe settings
115 struct renesas_usbhs_driver_pipe_config *pipe_configs;
116 int pipe_size; /* pipe_configs array size */
119 * option:
121 * for BUSWAIT :: BWAIT
122 * see
123 * renesas_usbhs/common.c :: usbhsc_set_buswait()
124 * */
125 int buswait_bwait;
128 * option:
130 * delay time from notify_hotplug callback
132 int detection_delay; /* msec */
135 * option:
137 * dma id for dmaengine
138 * The data transfer direction on D0FIFO/D1FIFO should be
139 * fixed for keeping consistency.
140 * So, the platform id settings will be..
141 * .d0_tx_id = xx_TX,
142 * .d1_rx_id = xx_RX,
143 * or
144 * .d1_tx_id = xx_TX,
145 * .d0_rx_id = xx_RX,
147 int d0_tx_id;
148 int d0_rx_id;
149 int d1_tx_id;
150 int d1_rx_id;
151 int d2_tx_id;
152 int d2_rx_id;
153 int d3_tx_id;
154 int d3_rx_id;
157 * option:
159 * pio <--> dma border.
161 int pio_dma_border; /* default is 64byte */
164 * option:
166 u32 has_usb_dmac:1; /* for USB-DMAC */
167 u32 runtime_pwctrl:1;
168 u32 has_cnen:1;
169 u32 cfifo_byte_addr:1; /* CFIFO is byte addressable */
170 #define USBHS_USB_DMAC_XFER_SIZE 32 /* hardcode the xfer size */
171 u32 multi_clks:1;
172 u32 has_new_pipe_configs:1;
176 * option:
178 * platform information for renesas_usbhs driver.
180 struct renesas_usbhs_platform_info {
182 * option:
184 * platform set these functions before
185 * call platform_add_devices if needed
187 struct renesas_usbhs_platform_callback platform_callback;
190 * option:
192 * driver use these param for some register
194 struct renesas_usbhs_driver_param driver_param;
197 #endif /* RENESAS_USB_H */