diff options
| author | Sam Ravnborg <sam@ravnborg.org> | 2014-07-20 07:38:58 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-07-22 00:43:18 -0400 |
| commit | d650471a399e65e423967e0b7692c86228211522 (patch) | |
| tree | bf9ca52103956ce55c230052d61fe01cbdb07c55 | |
| parent | 07d66921337176e9d27e4d0a8a23425c8284a381 (diff) | |
sparcspkr: use sbus_*() primitives for IO
The memory are mapped using of_ioremap() which is
an indication this is sbus memory.
Shift all uses of inb/outb to the sbus variants.
The inb/outb methods uses ASI_PHYS_BYPASS_EC_E_L,
whereas sbus_ variants uses ASI_PHYS_BYPASS_EC_E.
The difference is if the reads/writes are done in
native or little endian.
But for byte reads/writes there is no difference
so this does not matter for inb/outb - and this
driver only uses the byte variants.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/input/misc/sparcspkr.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c index 65fd3150919b..179ff1cd6f6b 100644 --- a/drivers/input/misc/sparcspkr.c +++ b/drivers/input/misc/sparcspkr.c | |||
| @@ -86,13 +86,13 @@ static int bbc_spkr_event(struct input_dev *dev, unsigned int type, unsigned int | |||
| 86 | spin_lock_irqsave(&state->lock, flags); | 86 | spin_lock_irqsave(&state->lock, flags); |
| 87 | 87 | ||
| 88 | if (count) { | 88 | if (count) { |
| 89 | outb(0x01, info->regs + 0); | 89 | sbus_writeb(0x01, info->regs + 0); |
| 90 | outb(0x00, info->regs + 2); | 90 | sbus_writeb(0x00, info->regs + 2); |
| 91 | outb((count >> 16) & 0xff, info->regs + 3); | 91 | sbus_writeb((count >> 16) & 0xff, info->regs + 3); |
| 92 | outb((count >> 8) & 0xff, info->regs + 4); | 92 | sbus_writeb((count >> 8) & 0xff, info->regs + 4); |
| 93 | outb(0x00, info->regs + 5); | 93 | sbus_writeb(0x00, info->regs + 5); |
| 94 | } else { | 94 | } else { |
| 95 | outb(0x00, info->regs + 0); | 95 | sbus_writeb(0x00, info->regs + 0); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | spin_unlock_irqrestore(&state->lock, flags); | 98 | spin_unlock_irqrestore(&state->lock, flags); |
| @@ -123,15 +123,15 @@ static int grover_spkr_event(struct input_dev *dev, unsigned int type, unsigned | |||
| 123 | 123 | ||
| 124 | if (count) { | 124 | if (count) { |
| 125 | /* enable counter 2 */ | 125 | /* enable counter 2 */ |
| 126 | outb(inb(info->enable_reg) | 3, info->enable_reg); | 126 | sbus_writeb(sbus_readb(info->enable_reg) | 3, info->enable_reg); |
| 127 | /* set command for counter 2, 2 byte write */ | 127 | /* set command for counter 2, 2 byte write */ |
| 128 | outb(0xB6, info->freq_regs + 1); | 128 | sbus_writeb(0xB6, info->freq_regs + 1); |
| 129 | /* select desired HZ */ | 129 | /* select desired HZ */ |
| 130 | outb(count & 0xff, info->freq_regs + 0); | 130 | sbus_writeb(count & 0xff, info->freq_regs + 0); |
| 131 | outb((count >> 8) & 0xff, info->freq_regs + 0); | 131 | sbus_writeb((count >> 8) & 0xff, info->freq_regs + 0); |
| 132 | } else { | 132 | } else { |
| 133 | /* disable counter 2 */ | 133 | /* disable counter 2 */ |
| 134 | outb(inb_p(info->enable_reg) & 0xFC, info->enable_reg); | 134 | sbus_writeb(sbus_readb(info->enable_reg) & 0xFC, info->enable_reg); |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | spin_unlock_irqrestore(&state->lock, flags); | 137 | spin_unlock_irqrestore(&state->lock, flags); |
