aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-30 18:04:13 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-30 18:04:13 -0500
commitce362c009250340358a7221f3cdb7954cbf19c01 (patch)
tree38b4700e51d3cce214690e7882069e0e12abf8d4 /drivers
parent064c94f9da8845f12446ab37142aa10f3c6f66ac (diff)
parentcd7a9202a5a6e7712df2b80ed5ebd7b078130fc3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6: (24 commits) [PARISC] Fix double free when removing HIL drivers [PARISC] Add atomic_sub_and_test [PARISC] Enabled some NLS modules in a500, b180 and c3000 defconfigs [PARISC] Kill duplicated EXPORT_SYMBOL warnings [PARISC] Move ioremap EXPORT_SYMBOL from parisc_ksyms.c [PARISC] Make local_t use atomic_long_t [PARISC] Update defconfigs [PARISC] Add PREEMPT support [PARISC] More useful readwrite lock helpers [PARISC] Convert HIL drivers to use input_allocate_device [PARISC] Fixup CONFIG_EISA a bit [PARISC] getsockopt should be ENTRY_COMP [PARISC] Remove obsolete CONFIG_DEBUG_IOREMAP [PARISC] Temporary FIXME for ioremapping EISA regions [PARISC] Enable ioremap functionality unconditionally [PARISC] Fix stifb with IOREMAP and a 64-bit kernel [PARISC] Add CONFIG_HPPA_IOREMAP to conditionally enable ioremap [PARISC] Add STRICT_MM_TYPECHECKS [PARISC] Fix IOREMAP with a 64-bit kernel [PARISC] Add parisc implementation of flush_kernel_dcache_page() ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/keyboard/hil_kbd.c56
-rw-r--r--drivers/input/keyboard/hilkbd.c53
-rw-r--r--drivers/input/mouse/hil_ptr.c90
-rw-r--r--drivers/input/serio/gscps2.c4
-rw-r--r--drivers/parisc/ccio-dma.c2
-rw-r--r--drivers/parisc/dino.c5
-rw-r--r--drivers/parisc/eisa.c2
-rw-r--r--drivers/parisc/iosapic.c2
-rw-r--r--drivers/parisc/lba_pci.c8
-rw-r--r--drivers/parisc/pdc_stable.c5
-rw-r--r--drivers/parisc/sba_iommu.c6
-rw-r--r--drivers/parisc/superio.c48
-rw-r--r--drivers/scsi/lasi700.c2
-rw-r--r--drivers/scsi/zalon.c2
-rw-r--r--drivers/serial/8250_gsc.c15
-rw-r--r--drivers/serial/mux.c4
-rw-r--r--drivers/video/console/sticore.c18
-rw-r--r--drivers/video/sticore.h37
-rw-r--r--drivers/video/stifb.c91
19 files changed, 174 insertions, 276 deletions
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index 0a90962c38e..63f387e4b78 100644
--- a/drivers/input/keyboard/hil_kbd.c
+++ b/drivers/input/keyboard/hil_kbd.c
@@ -66,7 +66,7 @@ static unsigned int hil_kbd_set3[HIL_KEYCODES_SET3_TBLSIZE] =
66static char hil_language[][16] = { HIL_LOCALE_MAP }; 66static char hil_language[][16] = { HIL_LOCALE_MAP };
67 67
68struct hil_kbd { 68struct hil_kbd {
69 struct input_dev dev; 69 struct input_dev *dev;
70 struct serio *serio; 70 struct serio *serio;
71 71
72 /* Input buffer and index for packets from HIL bus. */ 72 /* Input buffer and index for packets from HIL bus. */
@@ -86,7 +86,7 @@ struct hil_kbd {
86/* Process a complete packet after transfer from the HIL */ 86/* Process a complete packet after transfer from the HIL */
87static void hil_kbd_process_record(struct hil_kbd *kbd) 87static void hil_kbd_process_record(struct hil_kbd *kbd)
88{ 88{
89 struct input_dev *dev = &kbd->dev; 89 struct input_dev *dev = kbd->dev;
90 hil_packet *data = kbd->data; 90 hil_packet *data = kbd->data;
91 hil_packet p; 91 hil_packet p;
92 int idx, i, cnt; 92 int idx, i, cnt;
@@ -240,8 +240,8 @@ static void hil_kbd_disconnect(struct serio *serio)
240 return; 240 return;
241 } 241 }
242 242
243 input_unregister_device(&kbd->dev);
244 serio_close(serio); 243 serio_close(serio);
244 input_unregister_device(kbd->dev);
245 kfree(kbd); 245 kfree(kbd);
246} 246}
247 247
@@ -251,16 +251,18 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
251 uint8_t did, *idd; 251 uint8_t did, *idd;
252 int i; 252 int i;
253 253
254 kbd = kmalloc(sizeof(*kbd), GFP_KERNEL); 254 kbd = kzalloc(sizeof(*kbd), GFP_KERNEL);
255 if (!kbd) 255 if (!kbd)
256 return -ENOMEM; 256 return -ENOMEM;
257 memset(kbd, 0, sizeof(struct hil_kbd)); 257
258 kbd->dev = input_allocate_device();
259 if (!kbd->dev) goto bail1;
260 kbd->dev->private = kbd;
258 261
259 if (serio_open(serio, drv)) goto bail0; 262 if (serio_open(serio, drv)) goto bail0;
260 263
261 serio_set_drvdata(serio, kbd); 264 serio_set_drvdata(serio, kbd);
262 kbd->serio = serio; 265 kbd->serio = serio;
263 kbd->dev.private = kbd;
264 266
265 init_MUTEX_LOCKED(&(kbd->sem)); 267 init_MUTEX_LOCKED(&(kbd->sem));
266 268
@@ -302,38 +304,38 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
302 did, hil_language[did & HIL_IDD_DID_TYPE_KB_LANG_MASK]); 304 did, hil_language[did & HIL_IDD_DID_TYPE_KB_LANG_MASK]);
303 break; 305 break;
304 default: 306 default:
305 goto bail1; 307 goto bail2;
306 } 308 }
307 309
308 if(HIL_IDD_NUM_BUTTONS(idd) || HIL_IDD_NUM_AXES_PER_SET(*idd)) { 310 if(HIL_IDD_NUM_BUTTONS(idd) || HIL_IDD_NUM_AXES_PER_SET(*idd)) {
309 printk(KERN_INFO PREFIX "keyboards only, no combo devices supported.\n"); 311 printk(KERN_INFO PREFIX "keyboards only, no combo devices supported.\n");
310 goto bail1; 312 goto bail2;
311 } 313 }
312 314
313 315
314 kbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 316 kbd->dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
315 kbd->dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); 317 kbd->dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
316 kbd->dev.keycodemax = HIL_KEYCODES_SET1_TBLSIZE; 318 kbd->dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE;
317 kbd->dev.keycodesize = sizeof(hil_kbd_set1[0]); 319 kbd->dev->keycodesize = sizeof(hil_kbd_set1[0]);
318 kbd->dev.keycode = hil_kbd_set1; 320 kbd->dev->keycode = hil_kbd_set1;
319 kbd->dev.name = strlen(kbd->rnm) ? kbd->rnm : HIL_GENERIC_NAME; 321 kbd->dev->name = strlen(kbd->rnm) ? kbd->rnm : HIL_GENERIC_NAME;
320 kbd->dev.phys = "hpkbd/input0"; /* XXX */ 322 kbd->dev->phys = "hpkbd/input0"; /* XXX */
321 323
322 kbd->dev.id.bustype = BUS_HIL; 324 kbd->dev->id.bustype = BUS_HIL;
323 kbd->dev.id.vendor = PCI_VENDOR_ID_HP; 325 kbd->dev->id.vendor = PCI_VENDOR_ID_HP;
324 kbd->dev.id.product = 0x0001; /* TODO: get from kbd->rsc */ 326 kbd->dev->id.product = 0x0001; /* TODO: get from kbd->rsc */
325 kbd->dev.id.version = 0x0100; /* TODO: get from kbd->rsc */ 327 kbd->dev->id.version = 0x0100; /* TODO: get from kbd->rsc */
326 kbd->dev.dev = &serio->dev; 328 kbd->dev->dev = &serio->dev;
327 329
328 for (i = 0; i < 128; i++) { 330 for (i = 0; i < 128; i++) {
329 set_bit(hil_kbd_set1[i], kbd->dev.keybit); 331 set_bit(hil_kbd_set1[i], kbd->dev->keybit);
330 set_bit(hil_kbd_set3[i], kbd->dev.keybit); 332 set_bit(hil_kbd_set3[i], kbd->dev->keybit);
331 } 333 }
332 clear_bit(0, kbd->dev.keybit); 334 clear_bit(0, kbd->dev->keybit);
333 335
334 input_register_device(&kbd->dev); 336 input_register_device(kbd->dev);
335 printk(KERN_INFO "input: %s, ID: %d\n", 337 printk(KERN_INFO "input: %s, ID: %d\n",
336 kbd->dev.name, did); 338 kbd->dev->name, did);
337 339
338 serio->write(serio, 0); 340 serio->write(serio, 0);
339 serio->write(serio, 0); 341 serio->write(serio, 0);
@@ -343,8 +345,10 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
343 up(&(kbd->sem)); 345 up(&(kbd->sem));
344 346
345 return 0; 347 return 0;
346 bail1: 348 bail2:
347 serio_close(serio); 349 serio_close(serio);
350 bail1:
351 input_free_device(kbd->dev);
348 bail0: 352 bail0:
349 kfree(kbd); 353 kfree(kbd);
350 serio_set_drvdata(serio, NULL); 354 serio_set_drvdata(serio, NULL);
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c
index e95bc052e32..33edd030aa7 100644
--- a/drivers/input/keyboard/hilkbd.c
+++ b/drivers/input/keyboard/hilkbd.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 1998 Philip Blundell <philb@gnu.org> 4 * Copyright (C) 1998 Philip Blundell <philb@gnu.org>
5 * Copyright (C) 1999 Matthew Wilcox <willy@bofh.ai> 5 * Copyright (C) 1999 Matthew Wilcox <willy@bofh.ai>
6 * Copyright (C) 1999-2003 Helge Deller <deller@gmx.de> 6 * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de>
7 * 7 *
8 * Very basic HP Human Interface Loop (HIL) driver. 8 * Very basic HP Human Interface Loop (HIL) driver.
9 * This driver handles the keyboard on HP300 (m68k) and on some 9 * This driver handles the keyboard on HP300 (m68k) and on some
@@ -90,7 +90,7 @@ static unsigned int hphilkeyb_keycode[HIL_KEYCODES_SET1_TBLSIZE] =
90 90
91/* HIL structure */ 91/* HIL structure */
92static struct { 92static struct {
93 struct input_dev dev; 93 struct input_dev *dev;
94 94
95 unsigned int curdev; 95 unsigned int curdev;
96 96
@@ -117,7 +117,7 @@ static void poll_finished(void)
117 down = (hil_dev.data[1] & 1) == 0; 117 down = (hil_dev.data[1] & 1) == 0;
118 scode = hil_dev.data[1] >> 1; 118 scode = hil_dev.data[1] >> 1;
119 key = hphilkeyb_keycode[scode]; 119 key = hphilkeyb_keycode[scode];
120 input_report_key(&hil_dev.dev, key, down); 120 input_report_key(hil_dev.dev, key, down);
121 break; 121 break;
122 } 122 }
123 hil_dev.curdev = 0; 123 hil_dev.curdev = 0;
@@ -207,9 +207,14 @@ hil_keyb_init(void)
207 unsigned int i, kbid; 207 unsigned int i, kbid;
208 wait_queue_head_t hil_wait; 208 wait_queue_head_t hil_wait;
209 209
210 if (hil_dev.dev.id.bustype) { 210 if (hil_dev.dev) {
211 return -ENODEV; /* already initialized */ 211 return -ENODEV; /* already initialized */
212 } 212 }
213
214 hil_dev.dev = input_allocate_device();
215 if (!hil_dev.dev)
216 return -ENOMEM;
217 hil_dev.dev->private = &hil_dev;
213 218
214#if defined(CONFIG_HP300) 219#if defined(CONFIG_HP300)
215 if (!hwreg_present((void *)(HILBASE + HIL_DATA))) 220 if (!hwreg_present((void *)(HILBASE + HIL_DATA)))
@@ -247,28 +252,26 @@ hil_keyb_init(void)
247 c = 0; 252 c = 0;
248 hil_do(HIL_WRITEKBDSADR, &c, 1); 253 hil_do(HIL_WRITEKBDSADR, &c, 1);
249 254
250 init_input_dev(&hil_dev.dev);
251
252 for (i = 0; i < HIL_KEYCODES_SET1_TBLSIZE; i++) 255 for (i = 0; i < HIL_KEYCODES_SET1_TBLSIZE; i++)
253 if (hphilkeyb_keycode[i] != KEY_RESERVED) 256 if (hphilkeyb_keycode[i] != KEY_RESERVED)
254 set_bit(hphilkeyb_keycode[i], hil_dev.dev.keybit); 257 set_bit(hphilkeyb_keycode[i], hil_dev.dev->keybit);
255 258
256 hil_dev.dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 259 hil_dev.dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
257 hil_dev.dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); 260 hil_dev.dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
258 hil_dev.dev.keycodemax = HIL_KEYCODES_SET1_TBLSIZE; 261 hil_dev.dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE;
259 hil_dev.dev.keycodesize = sizeof(hphilkeyb_keycode[0]); 262 hil_dev.dev->keycodesize = sizeof(hphilkeyb_keycode[0]);
260 hil_dev.dev.keycode = hphilkeyb_keycode; 263 hil_dev.dev->keycode = hphilkeyb_keycode;
261 hil_dev.dev.name = "HIL keyboard"; 264 hil_dev.dev->name = "HIL keyboard";
262 hil_dev.dev.phys = "hpkbd/input0"; 265 hil_dev.dev->phys = "hpkbd/input0";
263 266
264 hil_dev.dev.id.bustype = BUS_HIL; 267 hil_dev.dev->id.bustype = BUS_HIL;
265 hil_dev.dev.id.vendor = PCI_VENDOR_ID_HP; 268 hil_dev.dev->id.vendor = PCI_VENDOR_ID_HP;
266 hil_dev.dev.id.product = 0x0001; 269 hil_dev.dev->id.product = 0x0001;
267 hil_dev.dev.id.version = 0x0010; 270 hil_dev.dev->id.version = 0x0010;
268 271
269 input_register_device(&hil_dev.dev); 272 input_register_device(hil_dev.dev);
270 printk(KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n", 273 printk(KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n",
271 hil_dev.dev.name, kbid, HILBASE, HIL_IRQ); 274 hil_dev.dev->name, kbid, HILBASE, HIL_IRQ);
272 275
273 return 0; 276 return 0;
274} 277}
@@ -329,7 +332,9 @@ static void __exit hil_exit(void)
329 /* Turn off interrupts */ 332 /* Turn off interrupts */
330 hil_do(HIL_INTOFF, NULL, 0); 333 hil_do(HIL_INTOFF, NULL, 0);
331 334
332 input_unregister_device(&hil_dev.dev); 335 input_unregister_device(hil_dev.dev);
336
337 hil_dev.dev = NULL;
333 338
334#if defined(CONFIG_PARISC) 339#if defined(CONFIG_PARISC)
335 unregister_parisc_driver(&hil_driver); 340 unregister_parisc_driver(&hil_driver);
diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c
index c2bf2ed07dc..bfb564fd8fe 100644
--- a/drivers/input/mouse/hil_ptr.c
+++ b/drivers/input/mouse/hil_ptr.c
@@ -55,7 +55,7 @@ MODULE_LICENSE("Dual BSD/GPL");
55#define HIL_PTR_MAX_LENGTH 16 55#define HIL_PTR_MAX_LENGTH 16
56 56
57struct hil_ptr { 57struct hil_ptr {
58 struct input_dev dev; 58 struct input_dev *dev;
59 struct serio *serio; 59 struct serio *serio;
60 60
61 /* Input buffer and index for packets from HIL bus. */ 61 /* Input buffer and index for packets from HIL bus. */
@@ -79,7 +79,7 @@ struct hil_ptr {
79/* Process a complete packet after transfer from the HIL */ 79/* Process a complete packet after transfer from the HIL */
80static void hil_ptr_process_record(struct hil_ptr *ptr) 80static void hil_ptr_process_record(struct hil_ptr *ptr)
81{ 81{
82 struct input_dev *dev = &ptr->dev; 82 struct input_dev *dev = ptr->dev;
83 hil_packet *data = ptr->data; 83 hil_packet *data = ptr->data;
84 hil_packet p; 84 hil_packet p;
85 int idx, i, cnt, laxis; 85 int idx, i, cnt, laxis;
@@ -148,12 +148,12 @@ static void hil_ptr_process_record(struct hil_ptr *ptr)
148 if (absdev) { 148 if (absdev) {
149 val = lo + (hi<<8); 149 val = lo + (hi<<8);
150#ifdef TABLET_AUTOADJUST 150#ifdef TABLET_AUTOADJUST
151 if (val < ptr->dev.absmin[ABS_X + i]) 151 if (val < dev->absmin[ABS_X + i])
152 ptr->dev.absmin[ABS_X + i] = val; 152 dev->absmin[ABS_X + i] = val;
153 if (val > ptr->dev.absmax[ABS_X + i]) 153 if (val > dev->absmax[ABS_X + i])
154 ptr->dev.absmax[ABS_X + i] = val; 154 dev->absmax[ABS_X + i] = val;
155#endif 155#endif
156 if (i%3) val = ptr->dev.absmax[ABS_X + i] - val; 156 if (i%3) val = dev->absmax[ABS_X + i] - val;
157 input_report_abs(dev, ABS_X + i, val); 157 input_report_abs(dev, ABS_X + i, val);
158 } else { 158 } else {
159 val = (int) (((int8_t)lo) | ((int8_t)hi<<8)); 159 val = (int) (((int8_t)lo) | ((int8_t)hi<<8));
@@ -233,26 +233,29 @@ static void hil_ptr_disconnect(struct serio *serio)
233 return; 233 return;
234 } 234 }
235 235
236 input_unregister_device(&ptr->dev);
237 serio_close(serio); 236 serio_close(serio);
237 input_unregister_device(ptr->dev);
238 kfree(ptr); 238 kfree(ptr);
239} 239}
240 240
241static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) 241static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
242{ 242{
243 struct hil_ptr *ptr; 243 struct hil_ptr *ptr;
244 char *txt; 244 char *txt;
245 unsigned int i, naxsets, btntype; 245 unsigned int i, naxsets, btntype;
246 uint8_t did, *idd; 246 uint8_t did, *idd;
247 247
248 if (!(ptr = kmalloc(sizeof(struct hil_ptr), GFP_KERNEL))) return -ENOMEM; 248 if (!(ptr = kzalloc(sizeof(struct hil_ptr), GFP_KERNEL)))
249 memset(ptr, 0, sizeof(struct hil_ptr)); 249 return -ENOMEM;
250 250
251 if (serio_open(serio, driver)) goto bail0; 251 ptr->dev = input_allocate_device();
252 if (!ptr->dev) goto bail0;
253 ptr->dev->private = ptr;
254
255 if (serio_open(serio, driver)) goto bail1;
252 256
253 serio_set_drvdata(serio, ptr); 257 serio_set_drvdata(serio, ptr);
254 ptr->serio = serio; 258 ptr->serio = serio;
255 ptr->dev.private = ptr;
256 259
257 init_MUTEX_LOCKED(&(ptr->sem)); 260 init_MUTEX_LOCKED(&(ptr->sem));
258 261
@@ -283,25 +286,24 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
283 286
284 up(&(ptr->sem)); 287 up(&(ptr->sem));
285 288
286 init_input_dev(&ptr->dev);
287 did = ptr->idd[0]; 289 did = ptr->idd[0];
288 idd = ptr->idd + 1; 290 idd = ptr->idd + 1;
289 txt = "unknown"; 291 txt = "unknown";
290 if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) { 292 if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) {
291 ptr->dev.evbit[0] = BIT(EV_REL); 293 ptr->dev->evbit[0] = BIT(EV_REL);
292 txt = "relative"; 294 txt = "relative";
293 } 295 }
294 296
295 if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_ABS) { 297 if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_ABS) {
296 ptr->dev.evbit[0] = BIT(EV_ABS); 298 ptr->dev->evbit[0] = BIT(EV_ABS);
297 txt = "absolute"; 299 txt = "absolute";
298 } 300 }
299 if (!ptr->dev.evbit[0]) { 301 if (!ptr->dev->evbit[0]) {
300 goto bail1; 302 goto bail2;
301 } 303 }
302 304
303 ptr->nbtn = HIL_IDD_NUM_BUTTONS(idd); 305 ptr->nbtn = HIL_IDD_NUM_BUTTONS(idd);
304 if (ptr->nbtn) ptr->dev.evbit[0] |= BIT(EV_KEY); 306 if (ptr->nbtn) ptr->dev->evbit[0] |= BIT(EV_KEY);
305 307
306 naxsets = HIL_IDD_NUM_AXSETS(*idd); 308 naxsets = HIL_IDD_NUM_AXSETS(*idd);
307 ptr->naxes = HIL_IDD_NUM_AXES_PER_SET(*idd); 309 ptr->naxes = HIL_IDD_NUM_AXES_PER_SET(*idd);
@@ -325,7 +327,7 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
325 btntype = BTN_MOUSE; 327 btntype = BTN_MOUSE;
326 328
327 for (i = 0; i < ptr->nbtn; i++) { 329 for (i = 0; i < ptr->nbtn; i++) {
328 set_bit(btntype | i, ptr->dev.keybit); 330 set_bit(btntype | i, ptr->dev->keybit);
329 ptr->btnmap[i] = btntype | i; 331 ptr->btnmap[i] = btntype | i;
330 } 332 }
331 333
@@ -337,50 +339,52 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
337 339
338 if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) { 340 if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) {
339 for (i = 0; i < ptr->naxes; i++) { 341 for (i = 0; i < ptr->naxes; i++) {
340 set_bit(REL_X + i, ptr->dev.relbit); 342 set_bit(REL_X + i, ptr->dev->relbit);
341 } 343 }
342 for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) { 344 for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) {
343 set_bit(REL_X + i, ptr->dev.relbit); 345 set_bit(REL_X + i, ptr->dev->relbit);
344 } 346 }
345 } else { 347 } else {
346 for (i = 0; i < ptr->naxes; i++) { 348 for (i = 0; i < ptr->naxes; i++) {
347 set_bit(ABS_X + i, ptr->dev.absbit); 349 set_bit(ABS_X + i, ptr->dev->absbit);
348 ptr->dev.absmin[ABS_X + i] = 0; 350 ptr->dev->absmin[ABS_X + i] = 0;
349 ptr->dev.absmax[ABS_X + i] = 351 ptr->dev->absmax[ABS_X + i] =
350 HIL_IDD_AXIS_MAX((ptr->idd + 1), i); 352 HIL_IDD_AXIS_MAX((ptr->idd + 1), i);
351 } 353 }
352 for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) { 354 for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) {
353 set_bit(ABS_X + i, ptr->dev.absbit); 355 set_bit(ABS_X + i, ptr->dev->absbit);
354 ptr->dev.absmin[ABS_X + i] = 0; 356 ptr->dev->absmin[ABS_X + i] = 0;
355 ptr->dev.absmax[ABS_X + i] = 357 ptr->dev->absmax[ABS_X + i] =
356 HIL_IDD_AXIS_MAX((ptr->idd + 1), (i - 3)); 358 HIL_IDD_AXIS_MAX((ptr->idd + 1), (i - 3));
357 } 359 }
358#ifdef TABLET_AUTOADJUST 360#ifdef TABLET_AUTOADJUST
359 for (i = 0; i < ABS_MAX; i++) { 361 for (i = 0; i < ABS_MAX; i++) {
360 int diff = ptr->dev.absmax[ABS_X + i] / 10; 362 int diff = ptr->dev->absmax[ABS_X + i] / 10;
361 ptr->dev.absmin[ABS_X + i] += diff; 363 ptr->dev->absmin[ABS_X + i] += diff;
362 ptr->dev.absmax[ABS_X + i] -= diff; 364 ptr->dev->absmax[ABS_X + i] -= diff;
363 } 365 }
364#endif 366#endif
365 } 367 }
366 368
367 ptr->dev.name = strlen(ptr->rnm) ? ptr->rnm : HIL_GENERIC_NAME; 369 ptr->dev->name = strlen(ptr->rnm) ? ptr->rnm : HIL_GENERIC_NAME;
368 370
369 ptr->dev.id.bustype = BUS_HIL; 371 ptr->dev->id.bustype = BUS_HIL;
370 ptr->dev.id.vendor = PCI_VENDOR_ID_HP; 372 ptr->dev->id.vendor = PCI_VENDOR_ID_HP;
371 ptr->dev.id.product = 0x0001; /* TODO: get from ptr->rsc */ 373 ptr->dev->id.product = 0x0001; /* TODO: get from ptr->rsc */
372 ptr->dev.id.version = 0x0100; /* TODO: get from ptr->rsc */ 374 ptr->dev->id.version = 0x0100; /* TODO: get from ptr->rsc */
373 ptr->dev.dev = &serio->dev; 375 ptr->dev->dev = &serio->dev;
374 376
375 input_register_device(&ptr->dev); 377 input_register_device(ptr->dev);
376 printk(KERN_INFO "input: %s (%s), ID: %d\n", 378 printk(KERN_INFO "input: %s (%s), ID: %d\n",
377 ptr->dev.name, 379 ptr->dev->name,
378 (btntype == BTN_MOUSE) ? "HIL mouse":"HIL tablet or touchpad", 380 (btntype == BTN_MOUSE) ? "HIL mouse":"HIL tablet or touchpad",
379 did); 381 did);
380 382
381 return 0; 383 return 0;
382 bail1: 384 bail2:
383 serio_close(serio); 385 serio_close(serio);
386 bail1:
387 input_free_device(ptr->dev);
384 bail0: 388 bail0:
385 kfree(ptr); 389 kfree(ptr);
386 serio_set_drvdata(serio, NULL); 390 serio_set_drvdata(serio, NULL);
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
index a7b0de0f92b..c0b1e4becad 100644
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * drivers/input/serio/gscps2.c 2 * drivers/input/serio/gscps2.c
3 * 3 *
4 * Copyright (c) 2004 Helge Deller <deller@gmx.de> 4 * Copyright (c) 2004-2006 Helge Deller <deller@gmx.de>
5 * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr> 5 * Copyright (c) 2002 Laurent Canet <canetl@esiee.fr>
6 * Copyright (c) 2002 Thibaut Varene <varenet@parisc-linux.org> 6 * Copyright (c) 2002 Thibaut Varene <varenet@parisc-linux.org>
7 * 7 *
@@ -354,7 +354,7 @@ static int __init gscps2_probe(struct parisc_device *dev)
354 memset(serio, 0, sizeof(struct serio)); 354 memset(serio, 0, sizeof(struct serio));
355 ps2port->port = serio; 355 ps2port->port = serio;
356 ps2port->padev = dev; 356 ps2port->padev = dev;
357 ps2port->addr = ioremap(hpa, GSC_STATUS + 4); 357 ps2port->addr = ioremap_nocache(hpa, GSC_STATUS + 4);
358 spin_lock_init(&ps2port->lock); 358 spin_lock_init(&ps2port->lock);
359 359
360 gscps2_reset(ps2port); 360 gscps2_reset(ps2port);
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 93f8a8fa889..a5d826237b2 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -1560,7 +1560,7 @@ static int ccio_probe(struct parisc_device *dev)
1560 *ioc_p = ioc; 1560 *ioc_p = ioc;
1561 1561
1562 ioc->hw_path = dev->hw_path; 1562 ioc->hw_path = dev->hw_path;
1563 ioc->ioc_regs = ioremap(dev->hpa.start, 4096); 1563 ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096);
1564 ccio_ioc_init(ioc); 1564 ccio_ioc_init(ioc);
1565 ccio_init_resources(ioc); 1565 ccio_init_resources(ioc);
1566 hppa_dma_ops = &ccio_ops; 1566 hppa_dma_ops = &ccio_ops;
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 3d1a7f98c67..6e8ed0c81a6 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -5,6 +5,7 @@
5** (c) Copyright 1999 SuSE GmbH 5** (c) Copyright 1999 SuSE GmbH
6** (c) Copyright 1999,2000 Hewlett-Packard Company 6** (c) Copyright 1999,2000 Hewlett-Packard Company
7** (c) Copyright 2000 Grant Grundler 7** (c) Copyright 2000 Grant Grundler
8** (c) Copyright 2006 Helge Deller
8** 9**
9** This program is free software; you can redistribute it and/or modify 10** This program is free software; you can redistribute it and/or modify
10** it under the terms of the GNU General Public License as published by 11** it under the terms of the GNU General Public License as published by
@@ -785,7 +786,7 @@ dino_bridge_init(struct dino_device *dino_dev, const char *name)
785 if((io_addr & (1 << i)) == 0) 786 if((io_addr & (1 << i)) == 0)
786 continue; 787 continue;
787 788
788 start = (unsigned long)(signed int)(0xf0000000 | (i << 23)); 789 start = F_EXTEND(0xf0000000UL) | (i << 23);
789 end = start + 8 * 1024 * 1024 - 1; 790 end = start + 8 * 1024 * 1024 - 1;
790 791
791 DBG("DINO RANGE %d is at 0x%lx-0x%lx\n", count, 792 DBG("DINO RANGE %d is at 0x%lx-0x%lx\n", count,
@@ -996,7 +997,7 @@ static int __init dino_probe(struct parisc_device *dev)
996 } 997 }
997 998
998 dino_dev->hba.dev = dev; 999 dino_dev->hba.dev = dev;
999 dino_dev->hba.base_addr = ioremap(hpa, 4096); 1000 dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096);
1000 dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ 1001 dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */
1001 spin_lock_init(&dino_dev->dinosaur_pen); 1002 spin_lock_init(&dino_dev->dinosaur_pen);
1002 dino_dev->hba.iommu = ccio_get_iommu(dev); 1003 dino_dev->hba.iommu = ccio_get_iommu(dev);
diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c
index 3d94d86c1c9..9d3bd15bf53 100644
--- a/drivers/parisc/eisa.c
+++ b/drivers/parisc/eisa.c
@@ -366,7 +366,7 @@ static int __devinit eisa_probe(struct parisc_device *dev)
366 eisa_dev.eeprom_addr = MIRAGE_EEPROM_BASE_ADDR; 366 eisa_dev.eeprom_addr = MIRAGE_EEPROM_BASE_ADDR;
367 } 367 }
368 } 368 }
369 eisa_eeprom_addr = ioremap(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH); 369 eisa_eeprom_addr = ioremap_nocache(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH);
370 result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space, 370 result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space,
371 &eisa_dev.hba.lmmio_space); 371 &eisa_dev.hba.lmmio_space);
372 init_eisa_pic(); 372 init_eisa_pic();
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
index 8d7a36392eb..7a458d5bc75 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -879,7 +879,7 @@ void *iosapic_register(unsigned long hpa)
879 return NULL; 879 return NULL;
880 } 880 }
881 881
882 isi->addr = ioremap(hpa, 4096); 882 isi->addr = ioremap_nocache(hpa, 4096);
883 isi->isi_hpa = hpa; 883 isi->isi_hpa = hpa;
884 isi->isi_version = iosapic_rd_version(isi); 884 isi->isi_version = iosapic_rd_version(isi);
885 isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; 885 isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1;
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index e8a2a4a852f..3fe4a77fa16 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -1213,7 +1213,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
1213 ** Postable I/O port space is per PCI host adapter. 1213 ** Postable I/O port space is per PCI host adapter.
1214 ** base of 64MB PIOP region 1214 ** base of 64MB PIOP region
1215 */ 1215 */
1216 lba_dev->iop_base = ioremap(p->start, 64 * 1024 * 1024); 1216 lba_dev->iop_base = ioremap_nocache(p->start, 64 * 1024 * 1024);
1217 1217
1218 sprintf(lba_dev->hba.io_name, "PCI%02lx Ports", 1218 sprintf(lba_dev->hba.io_name, "PCI%02lx Ports",
1219 lba_dev->hba.bus_num.start); 1219 lba_dev->hba.bus_num.start);
@@ -1525,7 +1525,7 @@ lba_driver_probe(struct parisc_device *dev)
1525 u32 func_class; 1525 u32 func_class;
1526 void *tmp_obj; 1526 void *tmp_obj;
1527 char *version; 1527 char *version;
1528 void __iomem *addr = ioremap(dev->hpa.start, 4096); 1528 void __iomem *addr = ioremap_nocache(dev->hpa.start, 4096);
1529 1529
1530 /* Read HW Rev First */ 1530 /* Read HW Rev First */
1531 func_class = READ_REG32(addr + LBA_FCLASS); 1531 func_class = READ_REG32(addr + LBA_FCLASS);
@@ -1619,7 +1619,7 @@ lba_driver_probe(struct parisc_device *dev)
1619 } else { 1619 } else {
1620 if (!astro_iop_base) { 1620 if (!astro_iop_base) {
1621 /* Sprockets PDC uses NPIOP region */ 1621 /* Sprockets PDC uses NPIOP region */
1622 astro_iop_base = ioremap(LBA_PORT_BASE, 64 * 1024); 1622 astro_iop_base = ioremap_nocache(LBA_PORT_BASE, 64 * 1024);
1623 pci_port = &lba_astro_port_ops; 1623 pci_port = &lba_astro_port_ops;
1624 } 1624 }
1625 1625
@@ -1700,7 +1700,7 @@ void __init lba_init(void)
1700*/ 1700*/
1701void lba_set_iregs(struct parisc_device *lba, u32 ibase, u32 imask) 1701void lba_set_iregs(struct parisc_device *lba, u32 ibase, u32 imask)
1702{ 1702{
1703 void __iomem * base_addr = ioremap(lba->hpa.start, 4096); 1703 void __iomem * base_addr = ioremap_nocache(lba->hpa.start, 4096);
1704 1704
1705 imask <<= 2; /* adjust for hints - 2 more bits */ 1705 imask <<= 2; /* adjust for hints - 2 more bits */
1706 1706
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index a28e17898fb..4e53be9c03a 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -4,9 +4,8 @@
4 * Copyright (C) 2005-2006 Thibaut VARENE <varenet@parisc-linux.org> 4 * Copyright (C) 2005-2006 Thibaut VARENE <varenet@parisc-linux.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License, version 2, as
8 * the Free Software Foundation; either version 2 of the License, or 8 * published by the Free Software Foundation.
9 * (at your option) any later version.
10 * 9 *
11 * This program is distributed in the hope that it will be useful, 10 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 0821747e44c..42b32ff2fca 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -1642,9 +1642,9 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
1642** 1642**
1643**************************************************************************/ 1643**************************************************************************/
1644 1644
1645static void __iomem *ioc_remap(struct sba_device *sba_dev, int offset) 1645static void __iomem *ioc_remap(struct sba_device *sba_dev, unsigned int offset)
1646{ 1646{
1647 return ioremap(sba_dev->dev->hpa.start + offset, SBA_FUNC_SIZE); 1647 return ioremap_nocache(sba_dev->dev->hpa.start + offset, SBA_FUNC_SIZE);
1648} 1648}
1649 1649
1650static void sba_hw_init(struct sba_device *sba_dev) 1650static void sba_hw_init(struct sba_device *sba_dev)
@@ -2040,7 +2040,7 @@ sba_driver_callback(struct parisc_device *dev)
2040 u32 func_class; 2040 u32 func_class;
2041 int i; 2041 int i;
2042 char *version; 2042 char *version;
2043 void __iomem *sba_addr = ioremap(dev->hpa.start, SBA_FUNC_SIZE); 2043 void __iomem *sba_addr = ioremap_nocache(dev->hpa.start, SBA_FUNC_SIZE);
2044 struct proc_dir_entry *info_entry, *bitmap_entry, *root; 2044 struct proc_dir_entry *info_entry, *bitmap_entry, *root;
2045 2045
2046 sba_dump_ranges(sba_addr); 2046 sba_dump_ranges(sba_addr);
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index ad6d3b28a3a..719b863bc20 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -12,6 +12,7 @@
12 * (C) Copyright 2001 John Marvin <jsm fc hp com> 12 * (C) Copyright 2001 John Marvin <jsm fc hp com>
13 * (C) Copyright 2003 Grant Grundler <grundler parisc-linux org> 13 * (C) Copyright 2003 Grant Grundler <grundler parisc-linux org>
14 * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org> 14 * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org>
15 * (C) Copyright 2006 Helge Deller <deller@gmx.de>
15 * 16 *
16 * This program is free software; you can redistribute it and/or 17 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as 18 * modify it under the terms of the GNU General Public License as
@@ -388,43 +389,34 @@ int superio_fixup_irq(struct pci_dev *pcidev)
388 return local_irq; 389 return local_irq;
389} 390}
390 391
391static struct uart_port serial[] = {
392 {
393 .iotype = UPIO_PORT,
394 .line = 0,
395 .type = PORT_16550A,
396 .uartclk = 115200*16,
397 .fifosize = 16,
398 },
399 {
400 .iotype = UPIO_PORT,
401 .line = 1,
402 .type = PORT_16550A,
403 .uartclk = 115200*16,
404 .fifosize = 16,
405 }
406};
407
408static void __devinit superio_serial_init(void) 392static void __devinit superio_serial_init(void)
409{ 393{
410#ifdef CONFIG_SERIAL_8250 394#ifdef CONFIG_SERIAL_8250
411 int retval; 395 int retval;
412 396 struct uart_port serial_port;
413 serial[0].iobase = sio_dev.sp1_base; 397
414 serial[0].irq = SP1_IRQ; 398 memset(&serial_port, 0, sizeof(serial_port));
415 spin_lock_init(&serial[0].lock); 399 serial_port.iotype = UPIO_PORT;
416 400 serial_port.type = PORT_16550A;
417 retval = early_serial_setup(&serial[0]); 401 serial_port.uartclk = 115200*16;
402 serial_port.fifosize = 16;
403 spin_lock_init(&serial_port.lock);
404
405 /* serial port #1 */
406 serial_port.iobase = sio_dev.sp1_base;
407 serial_port.irq = SP1_IRQ;
408 serial_port.line = 0;
409 retval = early_serial_setup(&serial_port);
418 if (retval < 0) { 410 if (retval < 0) {
419 printk(KERN_WARNING PFX "Register Serial #0 failed.\n"); 411 printk(KERN_WARNING PFX "Register Serial #0 failed.\n");
420 return; 412 return;
421 } 413 }
422 414
423 serial[1].iobase = sio_dev.sp2_base; 415 /* serial port #2 */
424 serial[1].irq = SP2_IRQ; 416 serial_port.iobase = sio_dev.sp2_base;
425 spin_lock_init(&serial[1].lock); 417 serial_port.irq = SP2_IRQ;
426 retval = early_serial_setup(&serial[1]); 418 serial_port.line = 1;
427 419 retval = early_serial_setup(&serial_port);
428 if (retval < 0) 420 if (retval < 0)
429 printk(KERN_WARNING PFX "Register Serial #1 failed.\n"); 421 printk(KERN_WARNING PFX "Register Serial #1 failed.\n");
430#endif /* CONFIG_SERIAL_8250 */ 422#endif /* CONFIG_SERIAL_8250 */
diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c
index 459a4daebec..eb7bd310cc8 100644
--- a/drivers/scsi/lasi700.c
+++ b/drivers/scsi/lasi700.c
@@ -112,7 +112,7 @@ lasi700_probe(struct parisc_device *dev)
112 112
113 hostdata->dev = &dev->dev; 113 hostdata->dev = &dev->dev;
114 dma_set_mask(&dev->dev, DMA_32BIT_MASK); 114 dma_set_mask(&dev->dev, DMA_32BIT_MASK);
115 hostdata->base = ioremap(base, 0x100); 115 hostdata->base = ioremap_nocache(base, 0x100);
116 hostdata->differential = 0; 116 hostdata->differential = 0;
117 117
118 if (dev->id.sversion == LASI_700_SVERSION) { 118 if (dev->id.sversion == LASI_700_SVERSION) {
diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c
index b131432c677..a6cfbb3b361 100644
--- a/drivers/scsi/zalon.c
+++ b/drivers/scsi/zalon.c
@@ -88,7 +88,7 @@ zalon_probe(struct parisc_device *dev)
88 struct gsc_irq gsc_irq; 88 struct gsc_irq gsc_irq;
89 u32 zalon_vers; 89 u32 zalon_vers;
90 int error = -ENODEV; 90 int error = -ENODEV;
91 void __iomem *zalon = ioremap(dev->hpa.start, 4096); 91 void __iomem *zalon = ioremap_nocache(dev->hpa.start, 4096);
92 void __iomem *io_port = zalon + GSC_SCSI_ZALON_OFFSET; 92 void __iomem *io_port = zalon + GSC_SCSI_ZALON_OFFSET;
93 static int unit = 0; 93 static int unit = 0;
94 struct Scsi_Host *host; 94 struct Scsi_Host *host;
diff --git a/drivers/serial/8250_gsc.c b/drivers/serial/8250_gsc.c
index 8b4947933d9..913c71cc056 100644
--- a/drivers/serial/8250_gsc.c
+++ b/drivers/serial/8250_gsc.c
@@ -52,13 +52,14 @@ serial_init_chip(struct parisc_device *dev)
52 address += 0x800; 52 address += 0x800;
53 } 53 }
54 54
55 memset(&port, 0, sizeof(struct uart_port)); 55 memset(&port, 0, sizeof(port));
56 port.mapbase = address; 56 port.iotype = UPIO_MEM;
57 port.irq = dev->irq; 57 port.uartclk = LASI_BASE_BAUD * 16;
58 port.iotype = UPIO_MEM; 58 port.mapbase = address;
59 port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; 59 port.membase = ioremap_nocache(address, 16);
60 port.uartclk = LASI_BASE_BAUD * 16; 60 port.irq = dev->irq;
61 port.dev = &dev->dev; 61 port.flags = UPF_BOOT_AUTOCONF;
62 port.dev = &dev->dev;
62 63
63 err = serial8250_register_port(&port); 64 err = serial8250_register_port(&port);
64 if (err < 0) { 65 if (err < 0) {
diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c
index 868eaf4a1a6..64c0e89124c 100644
--- a/drivers/serial/mux.c
+++ b/drivers/serial/mux.c
@@ -51,7 +51,7 @@
51#define MUX_BREAK(status) ((status & 0xF000) == 0x2000) 51#define MUX_BREAK(status) ((status & 0xF000) == 0x2000)
52 52
53#define MUX_NR 256 53#define MUX_NR 256
54static unsigned int port_cnt = 0; 54static unsigned int port_cnt __read_mostly;
55static struct uart_port mux_ports[MUX_NR]; 55static struct uart_port mux_ports[MUX_NR];
56 56
57static struct uart_driver mux_driver = { 57static struct uart_driver mux_driver = {
@@ -461,7 +461,7 @@ static int __init mux_probe(struct parisc_device *dev)
461 port->iobase = 0; 461 port->iobase = 0;
462 port->mapbase = dev->hpa.start + MUX_OFFSET + 462 port->mapbase = dev->hpa.start + MUX_OFFSET +
463 (i * MUX_LINE_OFFSET); 463 (i * MUX_LINE_OFFSET);
464 port->membase = ioremap(port->mapbase, MUX_LINE_OFFSET); 464 port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET);
465 port->iotype = UPIO_MEM; 465 port->iotype = UPIO_MEM;
466 port->type = PORT_MUX; 466 port->type = PORT_MUX;
467 port->irq = NO_IRQ; 467 port->irq = NO_IRQ;
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index 0339f5640a7..d6041e781ac 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -373,7 +373,7 @@ sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request)
373 glob_cfg->save_addr)); 373 glob_cfg->save_addr));
374 374
375 /* dump extended cfg */ 375 /* dump extended cfg */
376 cfg = PTR_STI(glob_cfg->ext_ptr); 376 cfg = PTR_STI((unsigned long)glob_cfg->ext_ptr);
377 DPRINTK(( KERN_INFO 377 DPRINTK(( KERN_INFO
378 "monitor %d\n" 378 "monitor %d\n"
379 "in friendly mode: %d\n" 379 "in friendly mode: %d\n"
@@ -453,25 +453,11 @@ sti_init_glob_cfg(struct sti_struct *sti,
453 sti->regions_phys[i] = 453 sti->regions_phys[i] =
454 REGION_OFFSET_TO_PHYS(sti->regions[i], newhpa); 454 REGION_OFFSET_TO_PHYS(sti->regions[i], newhpa);
455 455
456 /* remap virtually */
457 /* FIXME: add BTLB support if btlb==1 */
458 len = sti->regions[i].region_desc.length * 4096; 456 len = sti->regions[i].region_desc.length * 4096;
459
460/* XXX: Enabling IOREMAP debugging causes a crash, so we must be passing
461 * a virtual address to something expecting a physical address that doesn't
462 * go through a readX macro */
463#if 0
464 if (len)
465 glob_cfg->region_ptrs[i] = (unsigned long) (
466 sti->regions[i].region_desc.cache ?
467 ioremap(sti->regions_phys[i], len) :
468 ioremap_nocache(sti->regions_phys[i], len) );
469#else
470 if (len) 457 if (len)
471 glob_cfg->region_ptrs[i] = sti->regions_phys[i]; 458 glob_cfg->region_ptrs[i] = sti->regions_phys[i];
472#endif
473 459
474 DPRINTK(("region #%d: phys %08lx, virt %08x, len=%lukB, " 460 DPRINTK(("region #%d: phys %08lx, region_ptr %08x, len=%lukB, "
475 "btlb=%d, sysonly=%d, cache=%d, last=%d\n", 461 "btlb=%d, sysonly=%d, cache=%d, last=%d\n",
476 i, sti->regions_phys[i], glob_cfg->region_ptrs[i], 462 i, sti->regions_phys[i], glob_cfg->region_ptrs[i],
477 len/1024, 463 len/1024,
diff --git a/drivers/video/sticore.h b/drivers/video/sticore.h
index dc93336af55..1a9a60c74be 100644
--- a/drivers/video/sticore.h
+++ b/drivers/video/sticore.h
@@ -34,36 +34,20 @@
34 * for them to fix it and steal their solution. prumpf 34 * for them to fix it and steal their solution. prumpf
35 */ 35 */
36 36
37#define STI_WAIT 1 37#include <asm/io.h>
38
39#include <asm/io.h> /* for USE_HPPA_IOREMAP */
40
41#if USE_HPPA_IOREMAP
42 38
43#define STI_PTR(p) (p) 39#define STI_WAIT 1
44#define PTR_STI(p) (p)
45static inline int STI_CALL( unsigned long func,
46 void *flags, void *inptr, void *outptr, void *glob_cfg )
47{
48 int (*f)(void *,void *,void *,void *);
49 f = (void*)func;
50 return f(flags, inptr, outptr, glob_cfg);
51}
52
53#else /* !USE_HPPA_IOREMAP */
54 40
55#define STI_PTR(p) ( virt_to_phys(p) ) 41#define STI_PTR(p) ( virt_to_phys(p) )
56#define PTR_STI(p) ( phys_to_virt((long)p) ) 42#define PTR_STI(p) ( phys_to_virt((unsigned long)p) )
57#define STI_CALL(func, flags, inptr, outptr, glob_cfg) \ 43#define STI_CALL(func, flags, inptr, outptr, glob_cfg) \
58 ({ \ 44 ({ \
59 pdc_sti_call( func, (unsigned long)STI_PTR(flags), \ 45 pdc_sti_call( func, STI_PTR(flags), \
60 (unsigned long)STI_PTR(inptr), \ 46 STI_PTR(inptr), \
61 (unsigned long)STI_PTR(outptr), \ 47 STI_PTR(outptr), \
62 (unsigned long)STI_PTR(glob_cfg)); \ 48 STI_PTR(glob_cfg)); \
63 }) 49 })
64 50
65#endif /* USE_HPPA_IOREMAP */
66
67 51
68#define sti_onscreen_x(sti) (sti->glob_cfg->onscreen_x) 52#define sti_onscreen_x(sti) (sti->glob_cfg->onscreen_x)
69#define sti_onscreen_y(sti) (sti->glob_cfg->onscreen_y) 53#define sti_onscreen_y(sti) (sti->glob_cfg->onscreen_y)
@@ -352,8 +336,9 @@ struct sti_struct {
352 struct sti_conf_outptr outptr; /* configuration */ 336 struct sti_conf_outptr outptr; /* configuration */
353 struct sti_conf_outptr_ext outptr_ext; 337 struct sti_conf_outptr_ext outptr_ext;
354 338
355 /* PCI data structures (pg. 17ff from sti.pdf) */
356 struct pci_dev *pd; 339 struct pci_dev *pd;
340
341 /* PCI data structures (pg. 17ff from sti.pdf) */
357 u8 rm_entry[16]; /* pci region mapper array == pci config space offset */ 342 u8 rm_entry[16]; /* pci region mapper array == pci config space offset */
358 343
359 /* pointer to the fb_info where this STI device is used */ 344 /* pointer to the fb_info where this STI device is used */
diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c
index 56d71d6e9a7..8d5f35676f9 100644
--- a/drivers/video/stifb.c
+++ b/drivers/video/stifb.c
@@ -3,7 +3,7 @@
3 * Low level Frame buffer driver for HP workstations with 3 * Low level Frame buffer driver for HP workstations with
4 * STI (standard text interface) video firmware. 4 * STI (standard text interface) video firmware.
5 * 5 *
6 * Copyright (C) 2001-2005 Helge Deller <deller@gmx.de> 6 * Copyright (C) 2001-2006 Helge Deller <deller@gmx.de>
7 * Portions Copyright (C) 2001 Thomas Bogendoerfer <tsbogend@alpha.franken.de> 7 * Portions Copyright (C) 2001 Thomas Bogendoerfer <tsbogend@alpha.franken.de>
8 * 8 *
9 * Based on: 9 * Based on:
@@ -514,7 +514,7 @@ rattlerSetupPlanes(struct stifb_info *fb)
514 SETUP_HW(fb); 514 SETUP_HW(fb);
515 WRITE_BYTE(1, fb, REG_16b1); 515 WRITE_BYTE(1, fb, REG_16b1);
516 516
517 fb_memset(fb->info.fix.smem_start, 0xff, 517 fb_memset((void*)fb->info.fix.smem_start, 0xff,
518 fb->info.var.yres*fb->info.fix.line_length); 518 fb->info.var.yres*fb->info.fix.line_length);
519 519
520 CRX24_SET_OVLY_MASK(fb); 520 CRX24_SET_OVLY_MASK(fb);
@@ -908,83 +908,6 @@ SETUP_HCRX(struct stifb_info *fb)
908 908
909/* ------------------- driver specific functions --------------------------- */ 909/* ------------------- driver specific functions --------------------------- */
910 910
911#define TMPBUFLEN 2048
912
913static ssize_t
914stifb_read(struct file *file, char *buf, size_t count, loff_t *ppos)
915{
916 unsigned long p = *ppos;
917 struct inode *inode = file->f_dentry->d_inode;
918 int fbidx = iminor(inode);
919 struct fb_info *info = registered_fb[fbidx];
920 char tmpbuf[TMPBUFLEN];
921
922 if (!info || ! info->screen_base)
923 return -ENODEV;
924
925 if (p >= info->fix.smem_len)
926 return 0;
927 if (count >= info->fix.smem_len)
928 count = info->fix.smem_len;
929 if (count + p > info->fix.smem_len)
930 count = info->fix.smem_len - p;
931 if (count > sizeof(tmpbuf))
932 count = sizeof(tmpbuf);
933 if (count) {
934 char *base_addr;
935
936 base_addr = info->screen_base;
937 memcpy_fromio(&tmpbuf, base_addr+p, count);
938 count -= copy_to_user(buf, &tmpbuf, count);
939 if (!count)
940 return -EFAULT;
941 *ppos += count;
942 }
943 return count;
944}
945
946static ssize_t
947stifb_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
948{
949 struct inode *inode = file->f_dentry->d_inode;
950 int fbidx = iminor(inode);
951 struct fb_info *info = registered_fb[fbidx];
952 unsigned long p = *ppos;
953 size_t c;
954 int err;
955 char tmpbuf[TMPBUFLEN];
956
957 if (!info || !info->screen_base)
958 return -ENODEV;
959
960 if (p > info->fix.smem_len)
961 return -ENOSPC;
962 if (count >= info->fix.smem_len)
963 count = info->fix.smem_len;
964 err = 0;
965 if (count + p > info->fix.smem_len) {
966 count = info->fix.smem_len - p;
967 err = -ENOSPC;
968 }
969
970 p += (unsigned long)info->screen_base;
971 c = count;
972 while (c) {
973 int len = c > sizeof(tmpbuf) ? sizeof(tmpbuf) : c;
974 err = -EFAULT;
975 if (copy_from_user(&tmpbuf, buf, len))
976 break;
977 memcpy_toio(p, &tmpbuf, len);
978 c -= len;
979 p += len;
980 buf += len;
981 *ppos += len;
982 }
983 if (count-c)
984 return (count-c);
985 return err;
986}
987
988static int 911static int
989stifb_setcolreg(u_int regno, u_int red, u_int green, 912stifb_setcolreg(u_int regno, u_int red, u_int green,
990 u_int blue, u_int transp, struct fb_info *info) 913 u_int blue, u_int transp, struct fb_info *info)
@@ -1137,8 +1060,6 @@ stifb_init_display(struct stifb_info *fb)
1137 1060
1138static struct fb_ops stifb_ops = { 1061static struct fb_ops stifb_ops = {
1139 .owner = THIS_MODULE, 1062 .owner = THIS_MODULE,
1140 .fb_read = stifb_read,
1141 .fb_write = stifb_write,
1142 .fb_setcolreg = stifb_setcolreg, 1063 .fb_setcolreg = stifb_setcolreg,
1143 .fb_blank = stifb_blank, 1064 .fb_blank = stifb_blank,
1144 .fb_fillrect = cfb_fillrect, 1065 .fb_fillrect = cfb_fillrect,
@@ -1162,7 +1083,7 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
1162 char *dev_name; 1083 char *dev_name;
1163 int bpp, xres, yres; 1084 int bpp, xres, yres;
1164 1085
1165 fb = kmalloc(sizeof(*fb), GFP_ATOMIC); 1086 fb = kzalloc(sizeof(*fb), GFP_ATOMIC);
1166 if (!fb) { 1087 if (!fb) {
1167 printk(KERN_ERR "stifb: Could not allocate stifb structure\n"); 1088 printk(KERN_ERR "stifb: Could not allocate stifb structure\n");
1168 return -ENODEV; 1089 return -ENODEV;
@@ -1171,7 +1092,6 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
1171 info = &fb->info; 1092 info = &fb->info;
1172 1093
1173 /* set struct to a known state */ 1094 /* set struct to a known state */
1174 memset(fb, 0, sizeof(*fb));
1175 fix = &info->fix; 1095 fix = &info->fix;
1176 var = &info->var; 1096 var = &info->var;
1177 1097
@@ -1234,7 +1154,7 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
1234 case S9000_ID_TOMCAT: /* Dual CRX, behaves else like a CRX */ 1154 case S9000_ID_TOMCAT: /* Dual CRX, behaves else like a CRX */
1235 /* FIXME: TomCat supports two heads: 1155 /* FIXME: TomCat supports two heads:
1236 * fb.iobase = REGION_BASE(fb_info,3); 1156 * fb.iobase = REGION_BASE(fb_info,3);
1237 * fb.screen_base = (void*) REGION_BASE(fb_info,2); 1157 * fb.screen_base = ioremap_nocache(REGION_BASE(fb_info,2),xxx);
1238 * for now we only support the left one ! */ 1158 * for now we only support the left one ! */
1239 xres = fb->ngle_rom.x_size_visible; 1159 xres = fb->ngle_rom.x_size_visible;
1240 yres = fb->ngle_rom.y_size_visible; 1160 yres = fb->ngle_rom.y_size_visible;
@@ -1327,7 +1247,8 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
1327 1247
1328 strcpy(fix->id, "stifb"); 1248 strcpy(fix->id, "stifb");
1329 info->fbops = &stifb_ops; 1249 info->fbops = &stifb_ops;
1330 info->screen_base = (void*) REGION_BASE(fb,1); 1250 info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len);
1251 info->screen_size = fix->smem_len;
1331 info->flags = FBINFO_DEFAULT; 1252 info->flags = FBINFO_DEFAULT;
1332 info->pseudo_palette = &fb->pseudo_palette; 1253 info->pseudo_palette = &fb->pseudo_palette;
1333 1254