This source file includes following definitions.
- mic_mmio_read
- mic_mmio_write
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef _MIC_CARD_DEVICE_H_
16 #define _MIC_CARD_DEVICE_H_
17
18 #include <linux/workqueue.h>
19 #include <linux/io.h>
20 #include <linux/interrupt.h>
21 #include <linux/mic_bus.h>
22 #include "../bus/scif_bus.h"
23 #include "../bus/vop_bus.h"
24
25
26
27
28
29
30 struct mic_intr_info {
31 u32 num_intr;
32 };
33
34
35
36
37
38
39
40 struct mic_irq_info {
41 int *irq_usage_count;
42 };
43
44
45
46
47
48
49 struct mic_device {
50 struct mic_mw mmio;
51 };
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 struct mic_driver {
71 char name[20];
72 struct dentry *dbg_dir;
73 struct device *dev;
74 void __iomem *dp;
75 struct mic_device mdev;
76 struct work_struct hotplug_work;
77 struct mic_irq_info irq_info;
78 struct mic_intr_info intr_info;
79 struct mbus_device *dma_mbdev;
80 struct dma_chan *dma_ch[MIC_MAX_DMA_CHAN];
81 int num_dma_ch;
82 struct scif_hw_dev *scdev;
83 struct vop_device *vpdev;
84 };
85
86
87
88
89 struct mic_irq;
90
91
92
93
94
95
96
97
98 static inline u32 mic_mmio_read(struct mic_mw *mw, u32 offset)
99 {
100 return ioread32(mw->va + offset);
101 }
102
103
104
105
106
107
108
109
110
111 static inline void
112 mic_mmio_write(struct mic_mw *mw, u32 val, u32 offset)
113 {
114 iowrite32(val, mw->va + offset);
115 }
116
117 int mic_driver_init(struct mic_driver *mdrv);
118 void mic_driver_uninit(struct mic_driver *mdrv);
119 int mic_next_card_db(void);
120 struct mic_irq *
121 mic_request_card_irq(irq_handler_t handler, irq_handler_t thread_fn,
122 const char *name, void *data, int db);
123 void mic_free_card_irq(struct mic_irq *cookie, void *data);
124 u32 mic_read_spad(struct mic_device *mdev, unsigned int idx);
125 void mic_send_intr(struct mic_device *mdev, int doorbell);
126 void mic_send_p2p_intr(int doorbell, struct mic_mw *mw);
127 int mic_db_to_irq(struct mic_driver *mdrv, int db);
128 u32 mic_ack_interrupt(struct mic_device *mdev);
129 void mic_hw_intr_init(struct mic_driver *mdrv);
130 void __iomem *
131 mic_card_map(struct mic_device *mdev, dma_addr_t addr, size_t size);
132 void mic_card_unmap(struct mic_device *mdev, void __iomem *addr);
133 void __init mic_create_card_debug_dir(struct mic_driver *mdrv);
134 void mic_delete_card_debug_dir(struct mic_driver *mdrv);
135 void __init mic_init_card_debugfs(void);
136 void mic_exit_card_debugfs(void);
137 #endif