aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ssb/ssb.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-04-02 13:46:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-08 16:44:40 -0400
commitd625a29ba649a4df6027520ffc378f23c0e6883e (patch)
tree07b895d38717e24e655948c963f4287f551df42f /include/linux/ssb/ssb.h
parent93af2614513103216038afa708718295e7016dbb (diff)
ssb: Add support for block-I/O
This adds support for block based I/O to SSB. This is needed in order to efficiently support PIO data transfers to the card. The block-I/O support is only compiled, if it's selected by the weird driver that needs it. So there's no overhead for sane devices. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/ssb/ssb.h')
-rw-r--r--include/linux/ssb/ssb.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index a8ca396f810a..9f95afd0e9e3 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -78,6 +78,12 @@ struct ssb_bus_ops {
78 void (*write8)(struct ssb_device *dev, u16 offset, u8 value); 78 void (*write8)(struct ssb_device *dev, u16 offset, u8 value);
79 void (*write16)(struct ssb_device *dev, u16 offset, u16 value); 79 void (*write16)(struct ssb_device *dev, u16 offset, u16 value);
80 void (*write32)(struct ssb_device *dev, u16 offset, u32 value); 80 void (*write32)(struct ssb_device *dev, u16 offset, u32 value);
81#ifdef CONFIG_SSB_BLOCKIO
82 void (*block_read)(struct ssb_device *dev, void *buffer,
83 size_t count, u16 offset, u8 reg_width);
84 void (*block_write)(struct ssb_device *dev, const void *buffer,
85 size_t count, u16 offset, u8 reg_width);
86#endif
81}; 87};
82 88
83 89
@@ -374,6 +380,19 @@ static inline void ssb_write32(struct ssb_device *dev, u16 offset, u32 value)
374{ 380{
375 dev->ops->write32(dev, offset, value); 381 dev->ops->write32(dev, offset, value);
376} 382}
383#ifdef CONFIG_SSB_BLOCKIO
384static inline void ssb_block_read(struct ssb_device *dev, void *buffer,
385 size_t count, u16 offset, u8 reg_width)
386{
387 dev->ops->block_read(dev, buffer, count, offset, reg_width);
388}
389
390static inline void ssb_block_write(struct ssb_device *dev, const void *buffer,
391 size_t count, u16 offset, u8 reg_width)
392{
393 dev->ops->block_write(dev, buffer, count, offset, reg_width);
394}
395#endif /* CONFIG_SSB_BLOCKIO */
377 396
378 397
379/* Translation (routing) bits that need to be ORed to DMA 398/* Translation (routing) bits that need to be ORed to DMA