aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-07-22 00:43:25 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-22 00:43:25 -0400
commitcfcfe22256d5a8a14924a1145d56017b043b554f (patch)
treee1ba97ac58eb21f7e94e831c3f6d37e4f44907ba /drivers
parent07d66921337176e9d27e4d0a8a23425c8284a381 (diff)
parent453c9abd38910cc36a59d503fac15a2d0f4d36c7 (diff)
Merge branch 'sparc64_io'
Sam Ravnborg says: ==================== sparc64 io refactoring The following patchset refactor io_64.h. This was triggered by another patchset by Thierry Reding that updates the the generic io.h such that it may be used by sparc64 and thus make sparc and sparc64 more equal in this area. Before attempting to introduce the generic version it was necessary to clean up the current state to avoid any mistakes. The updates from Thierry needs to go in before I will attempt introducing the generic io.h. The sparcspkr used inb()/outb() primitives for of_ioremap() memory. Update this driver to use sbus_ variants. This change was triggered by a number of new warnings that would otherwise have been seen when dropping the macro indirections. Likewise PeeCeeI.c had some warnings that was fixed by using another IO varaint - which simplified the code too. The patchs has been generated with the --histogram option to make the patch that re-order functions in io_64.h more readable. So to see the same patches locally you need this option too. I have not yet any working sparc64 HW - so this is not tested. But I brought a SUN NetraX1 that I am working on gettting running. That may allow me to do some minimal tests in the future. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/misc/sparcspkr.c22
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);