aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ssb/main.c')
-rw-r--r--drivers/ssb/main.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index bedb2b4ee9d2..8db40c4b86e9 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -505,6 +505,14 @@ error:
505 return err; 505 return err;
506} 506}
507 507
508static u8 ssb_ssb_read8(struct ssb_device *dev, u16 offset)
509{
510 struct ssb_bus *bus = dev->bus;
511
512 offset += dev->core_index * SSB_CORE_SIZE;
513 return readb(bus->mmio + offset);
514}
515
508static u16 ssb_ssb_read16(struct ssb_device *dev, u16 offset) 516static u16 ssb_ssb_read16(struct ssb_device *dev, u16 offset)
509{ 517{
510 struct ssb_bus *bus = dev->bus; 518 struct ssb_bus *bus = dev->bus;
@@ -521,6 +529,14 @@ static u32 ssb_ssb_read32(struct ssb_device *dev, u16 offset)
521 return readl(bus->mmio + offset); 529 return readl(bus->mmio + offset);
522} 530}
523 531
532static void ssb_ssb_write8(struct ssb_device *dev, u16 offset, u8 value)
533{
534 struct ssb_bus *bus = dev->bus;
535
536 offset += dev->core_index * SSB_CORE_SIZE;
537 writeb(value, bus->mmio + offset);
538}
539
524static void ssb_ssb_write16(struct ssb_device *dev, u16 offset, u16 value) 540static void ssb_ssb_write16(struct ssb_device *dev, u16 offset, u16 value)
525{ 541{
526 struct ssb_bus *bus = dev->bus; 542 struct ssb_bus *bus = dev->bus;
@@ -539,8 +555,10 @@ static void ssb_ssb_write32(struct ssb_device *dev, u16 offset, u32 value)
539 555
540/* Ops for the plain SSB bus without a host-device (no PCI or PCMCIA). */ 556/* Ops for the plain SSB bus without a host-device (no PCI or PCMCIA). */
541static const struct ssb_bus_ops ssb_ssb_ops = { 557static const struct ssb_bus_ops ssb_ssb_ops = {
558 .read8 = ssb_ssb_read8,
542 .read16 = ssb_ssb_read16, 559 .read16 = ssb_ssb_read16,
543 .read32 = ssb_ssb_read32, 560 .read32 = ssb_ssb_read32,
561 .write8 = ssb_ssb_write8,
544 .write16 = ssb_ssb_write16, 562 .write16 = ssb_ssb_write16,
545 .write32 = ssb_ssb_write32, 563 .write32 = ssb_ssb_write32,
546}; 564};