aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/i8253.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-01-30 07:33:14 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:14 -0500
commit466eed22d127a1f16e1251cdc54a9f8f944140c0 (patch)
treef9b85efa895f3e2dd7f112a4aded5b2ae0bd0ca2 /arch/x86/kernel/i8253.c
parentfb8830e72d9bd86f1e7b6886cb1886c391130f86 (diff)
x86: isolate PIC/PIT in/out calls
Rather than remove and/or mangle inb_p/outb_p we want to remove the use of them from inappropriate places. For the PIC/PIT this may eventually depend on 32/64bitism or similar so start by adding inb/outb_pit and inb/outb_pic so that we can make them use any scheme we settle on without disturbing the existing, correct (for ISA), port 0x80 usage. (eg we can make inb_pit use udelay without messing up inb_p). Floppy already does this for the fdc. That really only leaves the CMOS as a core logic item to tackle, and bits of parallel port handling in the chipset layers. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/i8253.c')
-rw-r--r--arch/x86/kernel/i8253.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index c76fef1ce355..ef62b07b2b48 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -43,26 +43,26 @@ static void init_pit_timer(enum clock_event_mode mode,
43 switch(mode) { 43 switch(mode) {
44 case CLOCK_EVT_MODE_PERIODIC: 44 case CLOCK_EVT_MODE_PERIODIC:
45 /* binary, mode 2, LSB/MSB, ch 0 */ 45 /* binary, mode 2, LSB/MSB, ch 0 */
46 outb_p(0x34, PIT_MODE); 46 outb_pit(0x34, PIT_MODE);
47 outb_p(LATCH & 0xff , PIT_CH0); /* LSB */ 47 outb_pit(LATCH & 0xff , PIT_CH0); /* LSB */
48 outb(LATCH >> 8 , PIT_CH0); /* MSB */ 48 outb_pit(LATCH >> 8 , PIT_CH0); /* MSB */
49 break; 49 break;
50 50
51 case CLOCK_EVT_MODE_SHUTDOWN: 51 case CLOCK_EVT_MODE_SHUTDOWN:
52 case CLOCK_EVT_MODE_UNUSED: 52 case CLOCK_EVT_MODE_UNUSED:
53 if (evt->mode == CLOCK_EVT_MODE_PERIODIC || 53 if (evt->mode == CLOCK_EVT_MODE_PERIODIC ||
54 evt->mode == CLOCK_EVT_MODE_ONESHOT) { 54 evt->mode == CLOCK_EVT_MODE_ONESHOT) {
55 outb_p(0x30, PIT_MODE); 55 outb_pit(0x30, PIT_MODE);
56 outb_p(0, PIT_CH0); 56 outb_pit(0, PIT_CH0);
57 outb_p(0, PIT_CH0); 57 outb_pit(0, PIT_CH0);
58 } 58 }
59 pit_disable_clocksource(); 59 pit_disable_clocksource();
60 break; 60 break;
61 61
62 case CLOCK_EVT_MODE_ONESHOT: 62 case CLOCK_EVT_MODE_ONESHOT:
63 /* One shot setup */ 63 /* One shot setup */
64 outb_p(0x38, PIT_MODE);
65 pit_disable_clocksource(); 64 pit_disable_clocksource();
65 outb_pit(0x38, PIT_MODE);
66 break; 66 break;
67 67
68 case CLOCK_EVT_MODE_RESUME: 68 case CLOCK_EVT_MODE_RESUME:
@@ -80,8 +80,8 @@ static void init_pit_timer(enum clock_event_mode mode,
80static int pit_next_event(unsigned long delta, struct clock_event_device *evt) 80static int pit_next_event(unsigned long delta, struct clock_event_device *evt)
81{ 81{
82 spin_lock(&i8253_lock); 82 spin_lock(&i8253_lock);
83 outb_p(delta & 0xff , PIT_CH0); /* LSB */ 83 outb_pit(delta & 0xff , PIT_CH0); /* LSB */
84 outb(delta >> 8 , PIT_CH0); /* MSB */ 84 outb_pit(delta >> 8 , PIT_CH0); /* MSB */
85 spin_unlock(&i8253_lock); 85 spin_unlock(&i8253_lock);
86 86
87 return 0; 87 return 0;
@@ -153,15 +153,15 @@ static cycle_t pit_read(void)
153 * count), it cannot be newer. 153 * count), it cannot be newer.
154 */ 154 */
155 jifs = jiffies; 155 jifs = jiffies;
156 outb_p(0x00, PIT_MODE); /* latch the count ASAP */ 156 outb_pit(0x00, PIT_MODE); /* latch the count ASAP */
157 count = inb_p(PIT_CH0); /* read the latched count */ 157 count = inb_pit(PIT_CH0); /* read the latched count */
158 count |= inb_p(PIT_CH0) << 8; 158 count |= inb_pit(PIT_CH0) << 8;
159 159
160 /* VIA686a test code... reset the latch if count > max + 1 */ 160 /* VIA686a test code... reset the latch if count > max + 1 */
161 if (count > LATCH) { 161 if (count > LATCH) {
162 outb_p(0x34, PIT_MODE); 162 outb_pit(0x34, PIT_MODE);
163 outb_p(LATCH & 0xff, PIT_CH0); 163 outb_pit(LATCH & 0xff, PIT_CH0);
164 outb(LATCH >> 8, PIT_CH0); 164 outb_pit(LATCH >> 8, PIT_CH0);
165 count = LATCH - 1; 165 count = LATCH - 1;
166 } 166 }
167 167