aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-11 00:31:24 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-11 00:31:24 -0500
commit05f6ece6f37f987e9de643f6f76e8fb5d5b9e014 (patch)
tree5244e85d0dfb2619b0af4bc80a2c99dd579f79a5 /drivers
parent35d138ae22f826f95f0f8d0285947582ccf4508f (diff)
parent58b6c58caef7a34eab7ec887288fa495696653e7 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/parisc/dino.c30
-rw-r--r--drivers/parisc/eisa.c4
-rw-r--r--drivers/parisc/eisa_eeprom.c2
-rw-r--r--drivers/parisc/lasi.c2
-rw-r--r--drivers/parisc/lba_pci.c115
-rw-r--r--drivers/parisc/led.c18
-rw-r--r--drivers/parisc/pdc_stable.c44
-rw-r--r--drivers/parisc/power.c12
-rw-r--r--drivers/parport/Kconfig1
-rw-r--r--drivers/video/stifb.c65
10 files changed, 194 insertions, 99 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 5ab75334c579..216d1d859326 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -83,7 +83,8 @@
83** bus number for each dino. 83** bus number for each dino.
84*/ 84*/
85 85
86#define is_card_dino(id) ((id)->hw_type == HPHW_A_DMA) 86#define is_card_dino(id) ((id)->hw_type == HPHW_A_DMA)
87#define is_cujo(id) ((id)->hversion == 0x682)
87 88
88#define DINO_IAR0 0x004 89#define DINO_IAR0 0x004
89#define DINO_IODC_ADDR 0x008 90#define DINO_IODC_ADDR 0x008
@@ -124,6 +125,7 @@
124 125
125#define DINO_IRQS 11 /* bits 0-10 are architected */ 126#define DINO_IRQS 11 /* bits 0-10 are architected */
126#define DINO_IRR_MASK 0x5ff /* only 10 bits are implemented */ 127#define DINO_IRR_MASK 0x5ff /* only 10 bits are implemented */
128#define DINO_LOCAL_IRQS (DINO_IRQS+1)
127 129
128#define DINO_MASK_IRQ(x) (1<<(x)) 130#define DINO_MASK_IRQ(x) (1<<(x))
129 131
@@ -146,7 +148,7 @@ struct dino_device
146 unsigned long txn_addr; /* EIR addr to generate interrupt */ 148 unsigned long txn_addr; /* EIR addr to generate interrupt */
147 u32 txn_data; /* EIR data assign to each dino */ 149 u32 txn_data; /* EIR data assign to each dino */
148 u32 imr; /* IRQ's which are enabled */ 150 u32 imr; /* IRQ's which are enabled */
149 int global_irq[12]; /* map IMR bit to global irq */ 151 int global_irq[DINO_LOCAL_IRQS]; /* map IMR bit to global irq */
150#ifdef DINO_DEBUG 152#ifdef DINO_DEBUG
151 unsigned int dino_irr0; /* save most recent IRQ line stat */ 153 unsigned int dino_irr0; /* save most recent IRQ line stat */
152#endif 154#endif
@@ -297,7 +299,7 @@ struct pci_port_ops dino_port_ops = {
297static void dino_disable_irq(unsigned int irq) 299static void dino_disable_irq(unsigned int irq)
298{ 300{
299 struct dino_device *dino_dev = irq_desc[irq].handler_data; 301 struct dino_device *dino_dev = irq_desc[irq].handler_data;
300 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, irq); 302 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
301 303
302 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, dino_dev, irq); 304 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, dino_dev, irq);
303 305
@@ -309,7 +311,7 @@ static void dino_disable_irq(unsigned int irq)
309static void dino_enable_irq(unsigned int irq) 311static void dino_enable_irq(unsigned int irq)
310{ 312{
311 struct dino_device *dino_dev = irq_desc[irq].handler_data; 313 struct dino_device *dino_dev = irq_desc[irq].handler_data;
312 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, irq); 314 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
313 u32 tmp; 315 u32 tmp;
314 316
315 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, dino_dev, irq); 317 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, dino_dev, irq);
@@ -435,6 +437,21 @@ static void dino_choose_irq(struct parisc_device *dev, void *ctrl)
435 dino_assign_irq(dino, irq, &dev->irq); 437 dino_assign_irq(dino, irq, &dev->irq);
436} 438}
437 439
440
441/*
442 * Cirrus 6832 Cardbus reports wrong irq on RDI Tadpole PARISC Laptop (deller@gmx.de)
443 * (the irqs are off-by-one, not sure yet if this is a cirrus, dino-hardware or dino-driver problem...)
444 */
445static void __devinit quirk_cirrus_cardbus(struct pci_dev *dev)
446{
447 u8 new_irq = dev->irq - 1;
448 printk(KERN_INFO "PCI: Cirrus Cardbus IRQ fixup for %s, from %d to %d\n",
449 pci_name(dev), dev->irq, new_irq);
450 dev->irq = new_irq;
451}
452DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6832, quirk_cirrus_cardbus );
453
454
438static void __init 455static void __init
439dino_bios_init(void) 456dino_bios_init(void)
440{ 457{
@@ -666,7 +683,6 @@ dino_fixup_bus(struct pci_bus *bus)
666 printk(KERN_WARNING "Device %s has unassigned IRQ\n", pci_name(dev)); 683 printk(KERN_WARNING "Device %s has unassigned IRQ\n", pci_name(dev));
667#endif 684#endif
668 } else { 685 } else {
669
670 /* Adjust INT_LINE for that busses region */ 686 /* Adjust INT_LINE for that busses region */
671 dino_assign_irq(dino_dev, dev->irq, &dev->irq); 687 dino_assign_irq(dino_dev, dev->irq, &dev->irq);
672 } 688 }
@@ -872,7 +888,7 @@ static int __init dino_common_init(struct parisc_device *dev,
872 888
873 /* allocate I/O Port resource region */ 889 /* allocate I/O Port resource region */
874 res = &dino_dev->hba.io_space; 890 res = &dino_dev->hba.io_space;
875 if (dev->id.hversion == 0x680 || is_card_dino(&dev->id)) { 891 if (!is_cujo(&dev->id)) {
876 res->name = "Dino I/O Port"; 892 res->name = "Dino I/O Port";
877 } else { 893 } else {
878 res->name = "Cujo I/O Port"; 894 res->name = "Cujo I/O Port";
@@ -927,7 +943,7 @@ static int __init dino_probe(struct parisc_device *dev)
927 if (is_card_dino(&dev->id)) { 943 if (is_card_dino(&dev->id)) {
928 version = "3.x (card mode)"; 944 version = "3.x (card mode)";
929 } else { 945 } else {
930 if(dev->id.hversion == 0x680) { 946 if (!is_cujo(&dev->id)) {
931 if (dev->id.hversion_rev < 4) { 947 if (dev->id.hversion_rev < 4) {
932 version = dino_vers[dev->id.hversion_rev]; 948 version = dino_vers[dev->id.hversion_rev];
933 } 949 }
diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c
index 6362bf99eff6..3d94d86c1c9f 100644
--- a/drivers/parisc/eisa.c
+++ b/drivers/parisc/eisa.c
@@ -57,7 +57,7 @@
57 57
58static DEFINE_SPINLOCK(eisa_irq_lock); 58static DEFINE_SPINLOCK(eisa_irq_lock);
59 59
60void __iomem *eisa_eeprom_addr; 60void __iomem *eisa_eeprom_addr __read_mostly;
61 61
62/* We can only have one EISA adapter in the system because neither 62/* We can only have one EISA adapter in the system because neither
63 * implementation can be flexed. 63 * implementation can be flexed.
@@ -141,7 +141,7 @@ static int slave_mask;
141 * in the furure. 141 * in the furure.
142 */ 142 */
143/* irq 13,8,2,1,0 must be edge */ 143/* irq 13,8,2,1,0 must be edge */
144static unsigned int eisa_irq_level; /* default to edge triggered */ 144static unsigned int eisa_irq_level __read_mostly; /* default to edge triggered */
145 145
146 146
147/* called by free irq */ 147/* called by free irq */
diff --git a/drivers/parisc/eisa_eeprom.c b/drivers/parisc/eisa_eeprom.c
index 3a1b4826e5c1..e13aafa70bf5 100644
--- a/drivers/parisc/eisa_eeprom.c
+++ b/drivers/parisc/eisa_eeprom.c
@@ -48,7 +48,7 @@ static loff_t eisa_eeprom_llseek(struct file *file, loff_t offset, int origin )
48} 48}
49 49
50static ssize_t eisa_eeprom_read(struct file * file, 50static ssize_t eisa_eeprom_read(struct file * file,
51 char *buf, size_t count, loff_t *ppos ) 51 char __user *buf, size_t count, loff_t *ppos )
52{ 52{
53 unsigned char *tmp; 53 unsigned char *tmp;
54 ssize_t ret; 54 ssize_t ret;
diff --git a/drivers/parisc/lasi.c b/drivers/parisc/lasi.c
index a8c20396ffbe..2b3ba1dcf332 100644
--- a/drivers/parisc/lasi.c
+++ b/drivers/parisc/lasi.c
@@ -150,7 +150,7 @@ void __init lasi_led_init(unsigned long lasi_hpa)
150 * 150 *
151 */ 151 */
152 152
153static unsigned long lasi_power_off_hpa; 153static unsigned long lasi_power_off_hpa __read_mostly;
154 154
155static void lasi_power_off(void) 155static void lasi_power_off(void)
156{ 156{
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index 5e495dcbc58a..cbae8c8963fa 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -167,7 +167,7 @@
167 167
168/* non-postable I/O port space, densely packed */ 168/* non-postable I/O port space, densely packed */
169#define LBA_PORT_BASE (PCI_F_EXTEND | 0xfee00000UL) 169#define LBA_PORT_BASE (PCI_F_EXTEND | 0xfee00000UL)
170static void __iomem *astro_iop_base; 170static void __iomem *astro_iop_base __read_mostly;
171 171
172#define ELROY_HVERS 0x782 172#define ELROY_HVERS 0x782
173#define MERCURY_HVERS 0x783 173#define MERCURY_HVERS 0x783
@@ -695,11 +695,71 @@ lba_claim_dev_resources(struct pci_dev *dev)
695 } 695 }
696 } 696 }
697} 697}
698
699
700/*
701 * truncate_pat_collision: Deal with overlaps or outright collisions
702 * between PAT PDC reported ranges.
703 *
704 * Broken PA8800 firmware will report lmmio range that
705 * overlaps with CPU HPA. Just truncate the lmmio range.
706 *
707 * BEWARE: conflicts with this lmmio range may be an
708 * elmmio range which is pointing down another rope.
709 *
710 * FIXME: only deals with one collision per range...theoretically we
711 * could have several. Supporting more than one collision will get messy.
712 */
713static unsigned long
714truncate_pat_collision(struct resource *root, struct resource *new)
715{
716 unsigned long start = new->start;
717 unsigned long end = new->end;
718 struct resource *tmp = root->child;
719
720 if (end <= start || start < root->start || !tmp)
721 return 0;
722
723 /* find first overlap */
724 while (tmp && tmp->end < start)
725 tmp = tmp->sibling;
726
727 /* no entries overlap */
728 if (!tmp) return 0;
729
730 /* found one that starts behind the new one
731 ** Don't need to do anything.
732 */
733 if (tmp->start >= end) return 0;
734
735 if (tmp->start <= start) {
736 /* "front" of new one overlaps */
737 new->start = tmp->end + 1;
738
739 if (tmp->end >= end) {
740 /* AACCKK! totally overlaps! drop this range. */
741 return 1;
742 }
743 }
744
745 if (tmp->end < end ) {
746 /* "end" of new one overlaps */
747 new->end = tmp->start - 1;
748 }
749
750 printk(KERN_WARNING "LBA: Truncating lmmio_space [%lx/%lx] "
751 "to [%lx,%lx]\n",
752 start, end,
753 new->start, new->end );
754
755 return 0; /* truncation successful */
756}
757
698#else 758#else
699#define lba_claim_dev_resources(dev) 759#define lba_claim_dev_resources(dev) do { } while (0)
760#define truncate_pat_collision(r,n) (0)
700#endif 761#endif
701 762
702
703/* 763/*
704** The algorithm is generic code. 764** The algorithm is generic code.
705** But it needs to access local data structures to get the IRQ base. 765** But it needs to access local data structures to get the IRQ base.
@@ -747,6 +807,9 @@ lba_fixup_bus(struct pci_bus *bus)
747 lba_dump_res(&ioport_resource, 2); 807 lba_dump_res(&ioport_resource, 2);
748 BUG(); 808 BUG();
749 } 809 }
810 /* advertize Host bridge resources to PCI bus */
811 bus->resource[0] = &(ldev->hba.io_space);
812 i = 1;
750 813
751 if (ldev->hba.elmmio_space.start) { 814 if (ldev->hba.elmmio_space.start) {
752 err = request_resource(&iomem_resource, 815 err = request_resource(&iomem_resource,
@@ -760,23 +823,35 @@ lba_fixup_bus(struct pci_bus *bus)
760 823
761 /* lba_dump_res(&iomem_resource, 2); */ 824 /* lba_dump_res(&iomem_resource, 2); */
762 /* BUG(); */ 825 /* BUG(); */
763 } 826 } else
827 bus->resource[i++] = &(ldev->hba.elmmio_space);
764 } 828 }
765 829
766 err = request_resource(&iomem_resource, &(ldev->hba.lmmio_space)); 830
767 if (err < 0) { 831 /* Overlaps with elmmio can (and should) fail here.
768 /* FIXME overlaps with elmmio will fail here. 832 * We will prune (or ignore) the distributed range.
769 * Need to prune (or disable) the distributed range. 833 *
770 * 834 * FIXME: SBA code should register all elmmio ranges first.
771 * BEWARE: conflicts with this lmmio range may be 835 * that would take care of elmmio ranges routed
772 * elmmio range which is pointing down another rope. 836 * to a different rope (already discovered) from
773 */ 837 * getting registered *after* LBA code has already
774 838 * registered it's distributed lmmio range.
775 printk("FAILED: lba_fixup_bus() request for " 839 */
840 if (truncate_pat_collision(&iomem_resource,
841 &(ldev->hba.lmmio_space))) {
842
843 printk(KERN_WARNING "LBA: lmmio_space [%lx/%lx] duplicate!\n",
844 ldev->hba.lmmio_space.start,
845 ldev->hba.lmmio_space.end);
846 } else {
847 err = request_resource(&iomem_resource, &(ldev->hba.lmmio_space));
848 if (err < 0) {
849 printk(KERN_ERR "FAILED: lba_fixup_bus() request for "
776 "lmmio_space [%lx/%lx]\n", 850 "lmmio_space [%lx/%lx]\n",
777 ldev->hba.lmmio_space.start, 851 ldev->hba.lmmio_space.start,
778 ldev->hba.lmmio_space.end); 852 ldev->hba.lmmio_space.end);
779 /* lba_dump_res(&iomem_resource, 2); */ 853 } else
854 bus->resource[i++] = &(ldev->hba.lmmio_space);
780 } 855 }
781 856
782#ifdef CONFIG_64BIT 857#ifdef CONFIG_64BIT
@@ -791,18 +866,10 @@ lba_fixup_bus(struct pci_bus *bus)
791 lba_dump_res(&iomem_resource, 2); 866 lba_dump_res(&iomem_resource, 2);
792 BUG(); 867 BUG();
793 } 868 }
869 bus->resource[i++] = &(ldev->hba.gmmio_space);
794 } 870 }
795#endif 871#endif
796 872
797 /* advertize Host bridge resources to PCI bus */
798 bus->resource[0] = &(ldev->hba.io_space);
799 bus->resource[1] = &(ldev->hba.lmmio_space);
800 i=2;
801 if (ldev->hba.elmmio_space.start)
802 bus->resource[i++] = &(ldev->hba.elmmio_space);
803 if (ldev->hba.gmmio_space.start)
804 bus->resource[i++] = &(ldev->hba.gmmio_space);
805
806 } 873 }
807 874
808 list_for_each(ln, &bus->devices) { 875 list_for_each(ln, &bus->devices) {
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index 315be4770d3e..f357d3f60360 100644
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * (c) Copyright 2000 Red Hat Software 4 * (c) Copyright 2000 Red Hat Software
5 * (c) Copyright 2000 Helge Deller <hdeller@redhat.com> 5 * (c) Copyright 2000 Helge Deller <hdeller@redhat.com>
6 * (c) Copyright 2001-2004 Helge Deller <deller@gmx.de> 6 * (c) Copyright 2001-2005 Helge Deller <deller@gmx.de>
7 * (c) Copyright 2001 Randolph Chung <tausq@debian.org> 7 * (c) Copyright 2001 Randolph Chung <tausq@debian.org>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -56,13 +56,13 @@
56 relatively large amount of CPU time, some of the calculations can be 56 relatively large amount of CPU time, some of the calculations can be
57 turned off with the following variables (controlled via procfs) */ 57 turned off with the following variables (controlled via procfs) */
58 58
59static int led_type = -1; 59static int led_type __read_mostly = -1;
60static unsigned char lastleds; /* LED state from most recent update */ 60static unsigned char lastleds; /* LED state from most recent update */
61static unsigned int led_heartbeat = 1; 61static unsigned int led_heartbeat __read_mostly = 1;
62static unsigned int led_diskio = 1; 62static unsigned int led_diskio __read_mostly = 1;
63static unsigned int led_lanrxtx = 1; 63static unsigned int led_lanrxtx __read_mostly = 1;
64static char lcd_text[32]; 64static char lcd_text[32] __read_mostly;
65static char lcd_text_default[32]; 65static char lcd_text_default[32] __read_mostly;
66 66
67 67
68static struct workqueue_struct *led_wq; 68static struct workqueue_struct *led_wq;
@@ -108,7 +108,7 @@ struct pdc_chassis_lcd_info_ret_block {
108/* lcd_info is pre-initialized to the values needed to program KittyHawk LCD's 108/* lcd_info is pre-initialized to the values needed to program KittyHawk LCD's
109 * HP seems to have used Sharp/Hitachi HD44780 LCDs most of the time. */ 109 * HP seems to have used Sharp/Hitachi HD44780 LCDs most of the time. */
110static struct pdc_chassis_lcd_info_ret_block 110static struct pdc_chassis_lcd_info_ret_block
111lcd_info __attribute__((aligned(8))) = 111lcd_info __attribute__((aligned(8))) __read_mostly =
112{ 112{
113 .model = DISPLAY_MODEL_LCD, 113 .model = DISPLAY_MODEL_LCD,
114 .lcd_width = 16, 114 .lcd_width = 16,
@@ -144,7 +144,7 @@ static int start_task(void)
144device_initcall(start_task); 144device_initcall(start_task);
145 145
146/* ptr to LCD/LED-specific function */ 146/* ptr to LCD/LED-specific function */
147static void (*led_func_ptr) (unsigned char); 147static void (*led_func_ptr) (unsigned char) __read_mostly;
148 148
149#ifdef CONFIG_PROC_FS 149#ifdef CONFIG_PROC_FS
150static int led_proc_read(char *page, char **start, off_t off, int count, 150static int led_proc_read(char *page, char **start, off_t off, int count,
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 273a74179720..38bdca2fac6b 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -56,7 +56,7 @@
56#include <asm/uaccess.h> 56#include <asm/uaccess.h>
57#include <asm/hardware.h> 57#include <asm/hardware.h>
58 58
59#define PDCS_VERSION "0.09" 59#define PDCS_VERSION "0.10"
60 60
61#define PDCS_ADDR_PPRI 0x00 61#define PDCS_ADDR_PPRI 0x00
62#define PDCS_ADDR_OSID 0x40 62#define PDCS_ADDR_OSID 0x40
@@ -70,7 +70,7 @@ MODULE_DESCRIPTION("sysfs interface to HP PDC Stable Storage data");
70MODULE_LICENSE("GPL"); 70MODULE_LICENSE("GPL");
71MODULE_VERSION(PDCS_VERSION); 71MODULE_VERSION(PDCS_VERSION);
72 72
73static unsigned long pdcs_size = 0; 73static unsigned long pdcs_size __read_mostly;
74 74
75/* This struct defines what we need to deal with a parisc pdc path entry */ 75/* This struct defines what we need to deal with a parisc pdc path entry */
76struct pdcspath_entry { 76struct pdcspath_entry {
@@ -194,7 +194,8 @@ pdcspath_store(struct pdcspath_entry *entry)
194 return -EIO; 194 return -EIO;
195 } 195 }
196 196
197 entry->ready = 1; 197 /* kobject is already registered */
198 entry->ready = 2;
198 199
199 DPRINTK("%s: device: 0x%p\n", __func__, entry->dev); 200 DPRINTK("%s: device: 0x%p\n", __func__, entry->dev);
200 201
@@ -653,15 +654,21 @@ pdcs_register_pathentries(void)
653{ 654{
654 unsigned short i; 655 unsigned short i;
655 struct pdcspath_entry *entry; 656 struct pdcspath_entry *entry;
657 int err;
656 658
657 for (i = 0; (entry = pdcspath_entries[i]); i++) { 659 for (i = 0; (entry = pdcspath_entries[i]); i++) {
658 if (pdcspath_fetch(entry) < 0) 660 if (pdcspath_fetch(entry) < 0)
659 continue; 661 continue;
660 662
661 kobject_set_name(&entry->kobj, "%s", entry->name); 663 if ((err = kobject_set_name(&entry->kobj, "%s", entry->name)))
664 return err;
662 kobj_set_kset_s(entry, paths_subsys); 665 kobj_set_kset_s(entry, paths_subsys);
663 kobject_register(&entry->kobj); 666 if ((err = kobject_register(&entry->kobj)))
664 667 return err;
668
669 /* kobject is now registered */
670 entry->ready = 2;
671
665 if (!entry->dev) 672 if (!entry->dev)
666 continue; 673 continue;
667 674
@@ -675,14 +682,14 @@ pdcs_register_pathentries(void)
675/** 682/**
676 * pdcs_unregister_pathentries - Routine called when unregistering the module. 683 * pdcs_unregister_pathentries - Routine called when unregistering the module.
677 */ 684 */
678static inline void __exit 685static inline void
679pdcs_unregister_pathentries(void) 686pdcs_unregister_pathentries(void)
680{ 687{
681 unsigned short i; 688 unsigned short i;
682 struct pdcspath_entry *entry; 689 struct pdcspath_entry *entry;
683 690
684 for (i = 0; (entry = pdcspath_entries[i]); i++) 691 for (i = 0; (entry = pdcspath_entries[i]); i++)
685 if (entry->ready) 692 if (entry->ready >= 2)
686 kobject_unregister(&entry->kobj); 693 kobject_unregister(&entry->kobj);
687} 694}
688 695
@@ -704,7 +711,7 @@ pdc_stable_init(void)
704 711
705 /* For now we'll register the pdc subsys within this driver */ 712 /* For now we'll register the pdc subsys within this driver */
706 if ((rc = firmware_register(&pdc_subsys))) 713 if ((rc = firmware_register(&pdc_subsys)))
707 return rc; 714 goto fail_firmreg;
708 715
709 /* Don't forget the info entry */ 716 /* Don't forget the info entry */
710 for (i = 0; (attr = pdcs_subsys_attrs[i]) && !error; i++) 717 for (i = 0; (attr = pdcs_subsys_attrs[i]) && !error; i++)
@@ -713,12 +720,25 @@ pdc_stable_init(void)
713 720
714 /* register the paths subsys as a subsystem of pdc subsys */ 721 /* register the paths subsys as a subsystem of pdc subsys */
715 kset_set_kset_s(&paths_subsys, pdc_subsys); 722 kset_set_kset_s(&paths_subsys, pdc_subsys);
716 subsystem_register(&paths_subsys); 723 if ((rc= subsystem_register(&paths_subsys)))
724 goto fail_subsysreg;
717 725
718 /* now we create all "files" for the paths subsys */ 726 /* now we create all "files" for the paths subsys */
719 pdcs_register_pathentries(); 727 if ((rc = pdcs_register_pathentries()))
728 goto fail_pdcsreg;
729
730 return rc;
720 731
721 return 0; 732fail_pdcsreg:
733 pdcs_unregister_pathentries();
734 subsystem_unregister(&paths_subsys);
735
736fail_subsysreg:
737 firmware_unregister(&pdc_subsys);
738
739fail_firmreg:
740 printk(KERN_INFO "PDC Stable Storage bailing out\n");
741 return rc;
722} 742}
723 743
724static void __exit 744static void __exit
diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c
index ff75e9296df9..54b2b7f20b96 100644
--- a/drivers/parisc/power.c
+++ b/drivers/parisc/power.c
@@ -2,7 +2,7 @@
2 * linux/arch/parisc/kernel/power.c 2 * linux/arch/parisc/kernel/power.c
3 * HP PARISC soft power switch support driver 3 * HP PARISC soft power switch support driver
4 * 4 *
5 * Copyright (c) 2001-2002 Helge Deller <deller@gmx.de> 5 * Copyright (c) 2001-2005 Helge Deller <deller@gmx.de>
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * 8 *
@@ -102,7 +102,7 @@ static DECLARE_WORK(poweroff_work, deferred_poweroff, NULL);
102 102
103static void poweroff(void) 103static void poweroff(void)
104{ 104{
105 static int powering_off; 105 static int powering_off __read_mostly;
106 106
107 if (powering_off) 107 if (powering_off)
108 return; 108 return;
@@ -113,7 +113,7 @@ static void poweroff(void)
113 113
114 114
115/* local time-counter for shutdown */ 115/* local time-counter for shutdown */
116static int shutdown_timer; 116static int shutdown_timer __read_mostly;
117 117
118/* check, give feedback and start shutdown after one second */ 118/* check, give feedback and start shutdown after one second */
119static void process_shutdown(void) 119static void process_shutdown(void)
@@ -139,7 +139,7 @@ static void process_shutdown(void)
139DECLARE_TASKLET_DISABLED(power_tasklet, NULL, 0); 139DECLARE_TASKLET_DISABLED(power_tasklet, NULL, 0);
140 140
141/* soft power switch enabled/disabled */ 141/* soft power switch enabled/disabled */
142int pwrsw_enabled = 1; 142int pwrsw_enabled __read_mostly = 1;
143 143
144/* 144/*
145 * On gecko style machines (e.g. 712/xx and 715/xx) 145 * On gecko style machines (e.g. 712/xx and 715/xx)
@@ -149,7 +149,7 @@ int pwrsw_enabled = 1;
149 */ 149 */
150static void gecko_tasklet_func(unsigned long unused) 150static void gecko_tasklet_func(unsigned long unused)
151{ 151{
152 if (!pwrsw_enabled) 152 if (unlikely(!pwrsw_enabled))
153 return; 153 return;
154 154
155 if (__getDIAG(25) & 0x80000000) { 155 if (__getDIAG(25) & 0x80000000) {
@@ -173,7 +173,7 @@ static void polling_tasklet_func(unsigned long soft_power_reg)
173{ 173{
174 unsigned long current_status; 174 unsigned long current_status;
175 175
176 if (!pwrsw_enabled) 176 if (unlikely(!pwrsw_enabled))
177 return; 177 return;
178 178
179 current_status = gsc_readl(soft_power_reg); 179 current_status = gsc_readl(soft_power_reg);
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig
index a665951b1586..f605dea57224 100644
--- a/drivers/parport/Kconfig
+++ b/drivers/parport/Kconfig
@@ -121,6 +121,7 @@ config PARPORT_GSC
121 tristate 121 tristate
122 default GSC 122 default GSC
123 depends on PARPORT 123 depends on PARPORT
124 select PARPORT_NOT_PC
124 125
125config PARPORT_SUNBPP 126config PARPORT_SUNBPP
126 tristate "Sparc hardware (EXPERIMENTAL)" 127 tristate "Sparc hardware (EXPERIMENTAL)"
diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c
index fbb17332afd7..56d71d6e9a72 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-2004 Helge Deller <deller@gmx.de> 6 * Copyright (C) 2001-2005 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:
@@ -73,16 +73,13 @@
73#include "sticore.h" 73#include "sticore.h"
74 74
75/* REGION_BASE(fb_info, index) returns the virtual address for region <index> */ 75/* REGION_BASE(fb_info, index) returns the virtual address for region <index> */
76#ifdef __LP64__ 76#define REGION_BASE(fb_info, index) \
77 #define REGION_BASE(fb_info, index) \ 77 F_EXTEND(fb_info->sti->glob_cfg->region_ptrs[index])
78 (fb_info->sti->glob_cfg->region_ptrs[index] | 0xffffffff00000000)
79#else
80 #define REGION_BASE(fb_info, index) \
81 fb_info->sti->glob_cfg->region_ptrs[index]
82#endif
83 78
84#define NGLEDEVDEPROM_CRT_REGION 1 79#define NGLEDEVDEPROM_CRT_REGION 1
85 80
81#define NR_PALETTE 256
82
86typedef struct { 83typedef struct {
87 __s32 video_config_reg; 84 __s32 video_config_reg;
88 __s32 misc_video_start; 85 __s32 misc_video_start;
@@ -112,7 +109,7 @@ struct stifb_info {
112 ngle_rom_t ngle_rom; 109 ngle_rom_t ngle_rom;
113 struct sti_struct *sti; 110 struct sti_struct *sti;
114 int deviceSpecificConfig; 111 int deviceSpecificConfig;
115 u32 pseudo_palette[256]; 112 u32 pseudo_palette[16];
116}; 113};
117 114
118static int __initdata stifb_bpp_pref[MAX_STI_ROMS]; 115static int __initdata stifb_bpp_pref[MAX_STI_ROMS];
@@ -352,10 +349,10 @@ ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
352#define IS_888_DEVICE(fb) \ 349#define IS_888_DEVICE(fb) \
353 (!(IS_24_DEVICE(fb))) 350 (!(IS_24_DEVICE(fb)))
354 351
355#define GET_FIFO_SLOTS(fb, cnt, numslots) \ 352#define GET_FIFO_SLOTS(fb, cnt, numslots) \
356{ while (cnt < numslots) \ 353{ while (cnt < numslots) \
357 cnt = READ_WORD(fb, REG_34); \ 354 cnt = READ_WORD(fb, REG_34); \
358 cnt -= numslots; \ 355 cnt -= numslots; \
359} 356}
360 357
361#define IndexedDcd 0 /* Pixel data is indexed (pseudo) color */ 358#define IndexedDcd 0 /* Pixel data is indexed (pseudo) color */
@@ -995,7 +992,7 @@ stifb_setcolreg(u_int regno, u_int red, u_int green,
995 struct stifb_info *fb = (struct stifb_info *) info; 992 struct stifb_info *fb = (struct stifb_info *) info;
996 u32 color; 993 u32 color;
997 994
998 if (regno >= 256) /* no. of hw registers */ 995 if (regno >= NR_PALETTE)
999 return 1; 996 return 1;
1000 997
1001 red >>= 8; 998 red >>= 8;
@@ -1005,8 +1002,8 @@ stifb_setcolreg(u_int regno, u_int red, u_int green,
1005 DEBUG_OFF(); 1002 DEBUG_OFF();
1006 1003
1007 START_IMAGE_COLORMAP_ACCESS(fb); 1004 START_IMAGE_COLORMAP_ACCESS(fb);
1008 1005
1009 if (fb->info.var.grayscale) { 1006 if (unlikely(fb->info.var.grayscale)) {
1010 /* gray = 0.30*R + 0.59*G + 0.11*B */ 1007 /* gray = 0.30*R + 0.59*G + 0.11*B */
1011 color = ((red * 77) + 1008 color = ((red * 77) +
1012 (green * 151) + 1009 (green * 151) +
@@ -1017,17 +1014,17 @@ stifb_setcolreg(u_int regno, u_int red, u_int green,
1017 (blue)); 1014 (blue));
1018 } 1015 }
1019 1016
1020 if (info->var.bits_per_pixel == 32) { 1017 if (fb->info.fix.visual == FB_VISUAL_DIRECTCOLOR) {
1021 ((u32 *)(info->pseudo_palette))[regno] = 1018 struct fb_var_screeninfo *var = &fb->info.var;
1022 (red << info->var.red.offset) | 1019 if (regno < 16)
1023 (green << info->var.green.offset) | 1020 ((u32 *)fb->info.pseudo_palette)[regno] =
1024 (blue << info->var.blue.offset); 1021 regno << var->red.offset |
1025 } else { 1022 regno << var->green.offset |
1026 ((u32 *)(info->pseudo_palette))[regno] = regno; 1023 regno << var->blue.offset;
1027 } 1024 }
1028 1025
1029 WRITE_IMAGE_COLOR(fb, regno, color); 1026 WRITE_IMAGE_COLOR(fb, regno, color);
1030 1027
1031 if (fb->id == S9000_ID_HCRX) { 1028 if (fb->id == S9000_ID_HCRX) {
1032 NgleLutBltCtl lutBltCtl; 1029 NgleLutBltCtl lutBltCtl;
1033 1030
@@ -1066,9 +1063,9 @@ stifb_blank(int blank_mode, struct fb_info *info)
1066 case S9000_ID_HCRX: 1063 case S9000_ID_HCRX:
1067 HYPER_ENABLE_DISABLE_DISPLAY(fb, enable); 1064 HYPER_ENABLE_DISABLE_DISPLAY(fb, enable);
1068 break; 1065 break;
1069 case S9000_ID_A1659A:; /* fall through */ 1066 case S9000_ID_A1659A: /* fall through */
1070 case S9000_ID_TIMBER:; 1067 case S9000_ID_TIMBER:
1071 case CRX24_OVERLAY_PLANES:; 1068 case CRX24_OVERLAY_PLANES:
1072 default: 1069 default:
1073 ENABLE_DISABLE_DISPLAY(fb, enable); 1070 ENABLE_DISABLE_DISPLAY(fb, enable);
1074 break; 1071 break;
@@ -1250,12 +1247,10 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
1250 memset(&fb->ngle_rom, 0, sizeof(fb->ngle_rom)); 1247 memset(&fb->ngle_rom, 0, sizeof(fb->ngle_rom));
1251 if ((fb->sti->regions_phys[0] & 0xfc000000) == 1248 if ((fb->sti->regions_phys[0] & 0xfc000000) ==
1252 (fb->sti->regions_phys[2] & 0xfc000000)) 1249 (fb->sti->regions_phys[2] & 0xfc000000))
1253 sti_rom_address = fb->sti->regions_phys[0]; 1250 sti_rom_address = F_EXTEND(fb->sti->regions_phys[0]);
1254 else 1251 else
1255 sti_rom_address = fb->sti->regions_phys[1]; 1252 sti_rom_address = F_EXTEND(fb->sti->regions_phys[1]);
1256#ifdef __LP64__ 1253
1257 sti_rom_address |= 0xffffffff00000000;
1258#endif
1259 fb->deviceSpecificConfig = gsc_readl(sti_rom_address); 1254 fb->deviceSpecificConfig = gsc_readl(sti_rom_address);
1260 if (IS_24_DEVICE(fb)) { 1255 if (IS_24_DEVICE(fb)) {
1261 if (bpp_pref == 8 || bpp_pref == 32) 1256 if (bpp_pref == 8 || bpp_pref == 32)
@@ -1315,7 +1310,7 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
1315 break; 1310 break;
1316 case 32: 1311 case 32:
1317 fix->type = FB_TYPE_PACKED_PIXELS; 1312 fix->type = FB_TYPE_PACKED_PIXELS;
1318 fix->visual = FB_VISUAL_TRUECOLOR; 1313 fix->visual = FB_VISUAL_DIRECTCOLOR;
1319 var->red.length = var->green.length = var->blue.length = var->transp.length = 8; 1314 var->red.length = var->green.length = var->blue.length = var->transp.length = 8;
1320 var->blue.offset = 0; 1315 var->blue.offset = 0;
1321 var->green.offset = 8; 1316 var->green.offset = 8;
@@ -1337,7 +1332,7 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
1337 info->pseudo_palette = &fb->pseudo_palette; 1332 info->pseudo_palette = &fb->pseudo_palette;
1338 1333
1339 /* This has to been done !!! */ 1334 /* This has to been done !!! */
1340 fb_alloc_cmap(&info->cmap, 256, 0); 1335 fb_alloc_cmap(&info->cmap, NR_PALETTE, 0);
1341 stifb_init_display(fb); 1336 stifb_init_display(fb);
1342 1337
1343 if (!request_mem_region(fix->smem_start, fix->smem_len, "stifb fb")) { 1338 if (!request_mem_region(fix->smem_start, fix->smem_len, "stifb fb")) {
@@ -1488,7 +1483,3 @@ module_exit(stifb_cleanup);
1488MODULE_AUTHOR("Helge Deller <deller@gmx.de>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>"); 1483MODULE_AUTHOR("Helge Deller <deller@gmx.de>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>");
1489MODULE_DESCRIPTION("Framebuffer driver for HP's NGLE series graphics cards in HP PARISC machines"); 1484MODULE_DESCRIPTION("Framebuffer driver for HP's NGLE series graphics cards in HP PARISC machines");
1490MODULE_LICENSE("GPL v2"); 1485MODULE_LICENSE("GPL v2");
1491
1492MODULE_PARM(bpp, "i");
1493MODULE_PARM_DESC(mem, "Bits per pixel (default: 8)");
1494