aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bcma/bcma.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bcma/bcma.h')
-rw-r--r--include/linux/bcma/bcma.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 08763e4e848f..6ff080eac0b2 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/ssb/ssb.h> /* SPROM sharing */
9 10
10#include "bcma_regs.h" 11#include "bcma_regs.h"
11 12
@@ -31,6 +32,12 @@ struct bcma_host_ops {
31 void (*write8)(struct bcma_device *core, u16 offset, u8 value); 32 void (*write8)(struct bcma_device *core, u16 offset, u8 value);
32 void (*write16)(struct bcma_device *core, u16 offset, u16 value); 33 void (*write16)(struct bcma_device *core, u16 offset, u16 value);
33 void (*write32)(struct bcma_device *core, u16 offset, u32 value); 34 void (*write32)(struct bcma_device *core, u16 offset, u32 value);
35#ifdef CONFIG_BCMA_BLOCKIO
36 void (*block_read)(struct bcma_device *core, void *buffer,
37 size_t count, u16 offset, u8 reg_width);
38 void (*block_write)(struct bcma_device *core, const void *buffer,
39 size_t count, u16 offset, u8 reg_width);
40#endif
34 /* Agent ops */ 41 /* Agent ops */
35 u32 (*aread32)(struct bcma_device *core, u16 offset); 42 u32 (*aread32)(struct bcma_device *core, u16 offset);
36 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value); 43 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value);
@@ -117,6 +124,8 @@ struct bcma_device {
117 struct bcma_device_id id; 124 struct bcma_device_id id;
118 125
119 struct device dev; 126 struct device dev;
127 struct device *dma_dev;
128 unsigned int irq;
120 bool dev_registered; 129 bool dev_registered;
121 130
122 u8 core_index; 131 u8 core_index;
@@ -179,6 +188,10 @@ struct bcma_bus {
179 188
180 struct bcma_drv_cc drv_cc; 189 struct bcma_drv_cc drv_cc;
181 struct bcma_drv_pci drv_pci; 190 struct bcma_drv_pci drv_pci;
191
192 /* We decided to share SPROM struct with SSB as long as we do not need
193 * any hacks for BCMA. This simplifies drivers code. */
194 struct ssb_sprom sprom;
182}; 195};
183 196
184extern inline u32 bcma_read8(struct bcma_device *core, u16 offset) 197extern inline u32 bcma_read8(struct bcma_device *core, u16 offset)
@@ -208,6 +221,18 @@ void bcma_write32(struct bcma_device *core, u16 offset, u32 value)
208{ 221{
209 core->bus->ops->write32(core, offset, value); 222 core->bus->ops->write32(core, offset, value);
210} 223}
224#ifdef CONFIG_BCMA_BLOCKIO
225extern inline void bcma_block_read(struct bcma_device *core, void *buffer,
226 size_t count, u16 offset, u8 reg_width)
227{
228 core->bus->ops->block_read(core, buffer, count, offset, reg_width);
229}
230extern inline void bcma_block_write(struct bcma_device *core, const void *buffer,
231 size_t count, u16 offset, u8 reg_width)
232{
233 core->bus->ops->block_write(core, buffer, count, offset, reg_width);
234}
235#endif
211extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset) 236extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset)
212{ 237{
213 return core->bus->ops->aread32(core, offset); 238 return core->bus->ops->aread32(core, offset);