diff options
| author | Michael Buesch <mb@bu3sch.de> | 2008-02-20 13:08:10 -0500 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:37:26 -0500 |
| commit | ffc7689ddae5cbe12bde437ae0f2b386d568b5cd (patch) | |
| tree | 638e7dcf083c88cf45763953aa244504d357a220 /include/linux/ssb | |
| parent | 004c872e78d433f84f0a5cd4db7a6c780c0946e1 (diff) | |
ssb: Add support for 8bit register access
This adds support for 8bit wide register reads/writes.
This is needed in order to support the gigabit ethernet core.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/ssb')
| -rw-r--r-- | include/linux/ssb/ssb.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 20add65215af..860d28c6d149 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
| @@ -72,8 +72,10 @@ struct ssb_device; | |||
| 72 | /* Lowlevel read/write operations on the device MMIO. | 72 | /* Lowlevel read/write operations on the device MMIO. |
| 73 | * Internal, don't use that outside of ssb. */ | 73 | * Internal, don't use that outside of ssb. */ |
| 74 | struct ssb_bus_ops { | 74 | struct ssb_bus_ops { |
| 75 | u8 (*read8)(struct ssb_device *dev, u16 offset); | ||
| 75 | u16 (*read16)(struct ssb_device *dev, u16 offset); | 76 | u16 (*read16)(struct ssb_device *dev, u16 offset); |
| 76 | u32 (*read32)(struct ssb_device *dev, u16 offset); | 77 | u32 (*read32)(struct ssb_device *dev, u16 offset); |
| 78 | void (*write8)(struct ssb_device *dev, u16 offset, u8 value); | ||
| 77 | void (*write16)(struct ssb_device *dev, u16 offset, u16 value); | 79 | void (*write16)(struct ssb_device *dev, u16 offset, u16 value); |
| 78 | void (*write32)(struct ssb_device *dev, u16 offset, u32 value); | 80 | void (*write32)(struct ssb_device *dev, u16 offset, u32 value); |
| 79 | }; | 81 | }; |
| @@ -344,6 +346,10 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags); | |||
| 344 | 346 | ||
| 345 | 347 | ||
| 346 | /* Device MMIO register read/write functions. */ | 348 | /* Device MMIO register read/write functions. */ |
| 349 | static inline u8 ssb_read8(struct ssb_device *dev, u16 offset) | ||
| 350 | { | ||
| 351 | return dev->ops->read8(dev, offset); | ||
| 352 | } | ||
| 347 | static inline u16 ssb_read16(struct ssb_device *dev, u16 offset) | 353 | static inline u16 ssb_read16(struct ssb_device *dev, u16 offset) |
| 348 | { | 354 | { |
| 349 | return dev->ops->read16(dev, offset); | 355 | return dev->ops->read16(dev, offset); |
| @@ -352,6 +358,10 @@ static inline u32 ssb_read32(struct ssb_device *dev, u16 offset) | |||
| 352 | { | 358 | { |
| 353 | return dev->ops->read32(dev, offset); | 359 | return dev->ops->read32(dev, offset); |
| 354 | } | 360 | } |
| 361 | static inline void ssb_write8(struct ssb_device *dev, u16 offset, u8 value) | ||
| 362 | { | ||
| 363 | dev->ops->write8(dev, offset, value); | ||
| 364 | } | ||
| 355 | static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value) | 365 | static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value) |
| 356 | { | 366 | { |
| 357 | dev->ops->write16(dev, offset, value); | 367 | dev->ops->write16(dev, offset, value); |
