1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ISP1760_HCD_H_
3 #define _ISP1760_HCD_H_
5 #include <linux/spinlock.h>
14 * - 32 blocks @ 256 bytes
15 * - 20 blocks @ 1024 bytes
16 * - 4 blocks @ 8192 bytes
19 #define BLOCK_1_NUM 32
20 #define BLOCK_2_NUM 20
23 #define BLOCK_1_SIZE 256
24 #define BLOCK_2_SIZE 1024
25 #define BLOCK_3_SIZE 8192
26 #define BLOCKS (BLOCK_1_NUM + BLOCK_2_NUM + BLOCK_3_NUM)
27 #define MAX_PAYLOAD_SIZE BLOCK_3_SIZE
28 #define PAYLOAD_AREA_SIZE 0xf000
30 struct isp1760_slotinfo {
31 struct isp1760_qh *qh;
32 struct isp1760_qtd *qtd;
33 unsigned long timestamp;
36 /* chip memory management */
37 struct isp1760_memory_chunk {
43 enum isp1760_queue_head_types {
51 #ifdef CONFIG_USB_ISP1760_HCD
56 struct isp1760_slotinfo atl_slots[32];
58 struct isp1760_slotinfo int_slots[32];
60 struct isp1760_memory_chunk memory_pool[BLOCKS];
61 struct list_head qh_list[QH_END];
63 /* periodic schedule support */
64 #define DEFAULT_I_TDPS 1024
65 unsigned periodic_size;
67 unsigned long reset_done;
68 unsigned long next_statechange;
72 #ifdef CONFIG_USB_ISP1760_HCD
73 int isp1760_hcd_register(struct isp1760_hcd *priv, void __iomem *regs,
74 struct resource *mem, int irq, unsigned long irqflags,
76 void isp1760_hcd_unregister(struct isp1760_hcd *priv);
78 int isp1760_init_kmem_once(void);
79 void isp1760_deinit_kmem_cache(void);
81 static inline int isp1760_hcd_register(struct isp1760_hcd *priv,
82 void __iomem *regs, struct resource *mem,
83 int irq, unsigned long irqflags,
89 static inline void isp1760_hcd_unregister(struct isp1760_hcd *priv)
93 static inline int isp1760_init_kmem_once(void)
98 static inline void isp1760_deinit_kmem_cache(void)
103 #endif /* _ISP1760_HCD_H_ */