1 #ifndef _ISP1760_HCD_H_
2 #define _ISP1760_HCD_H_
4 #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
31 * Device flags that can vary from board to board. All of these
32 * indicate the most "atypical" case, so that a devflags of 0 is
33 * a sane default configuration.
35 #define ISP1760_FLAG_BUS_WIDTH_16 0x00000002 /* 16-bit data bus width */
36 #define ISP1760_FLAG_OTG_EN 0x00000004 /* Port 1 supports OTG */
37 #define ISP1760_FLAG_ANALOG_OC 0x00000008 /* Analog overcurrent */
38 #define ISP1760_FLAG_DACK_POL_HIGH 0x00000010 /* DACK active high */
39 #define ISP1760_FLAG_DREQ_POL_HIGH 0x00000020 /* DREQ active high */
40 #define ISP1760_FLAG_ISP1761 0x00000040 /* Chip is ISP1761 */
41 #define ISP1760_FLAG_INTR_POL_HIGH 0x00000080 /* Interrupt polarity active high */
42 #define ISP1760_FLAG_INTR_EDGE_TRIG 0x00000100 /* Interrupt edge triggered */
44 struct isp1760_slotinfo {
45 struct isp1760_qh *qh;
46 struct isp1760_qtd *qtd;
47 unsigned long timestamp;
50 /* chip memory management */
51 struct isp1760_memory_chunk {
57 enum isp1760_queue_head_types {
69 struct isp1760_slotinfo atl_slots[32];
71 struct isp1760_slotinfo int_slots[32];
73 struct isp1760_memory_chunk memory_pool[BLOCKS];
74 struct list_head qh_list[QH_END];
76 /* periodic schedule support */
77 #define DEFAULT_I_TDPS 1024
78 unsigned periodic_size;
80 unsigned long reset_done;
81 unsigned long next_statechange;
82 unsigned int devflags;
84 struct gpio_desc *rst_gpio;
87 int isp1760_hcd_register(struct isp1760_hcd *priv, void __iomem *regs,
88 struct resource *mem, int irq, unsigned long irqflags,
89 struct device *dev, unsigned int devflags);
90 void isp1760_hcd_unregister(struct isp1760_hcd *priv);
92 int isp1760_init_kmem_once(void);
93 void isp1760_deinit_kmem_cache(void);
95 #endif /* _ISP1760_HCD_H_ */