Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * manager.c - Resource Management, Conflict Resolution, Activation and Disabling of Devices |
| 3 | * |
Jaroslav Kysela | c1017a4 | 2007-10-15 09:50:19 +0200 | [diff] [blame] | 4 | * based on isapnp.c resource management (c) Jaroslav Kysela <perex@perex.cz> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * Copyright 2003 Adam Belay <ambx1@neo.rr.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #include <linux/errno.h> |
| 9 | #include <linux/module.h> |
| 10 | #include <linux/init.h> |
| 11 | #include <linux/kernel.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <linux/pnp.h> |
Tim Schmielau | 4e57b68 | 2005-10-30 15:03:48 -0800 | [diff] [blame] | 13 | #include <linux/slab.h> |
| 14 | #include <linux/bitmap.h> |
Daniel Walker | b3bd86e | 2008-02-06 01:40:04 -0800 | [diff] [blame] | 15 | #include <linux/mutex.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include "base.h" |
| 17 | |
Daniel Walker | b3bd86e | 2008-02-06 01:40:04 -0800 | [diff] [blame] | 18 | DEFINE_MUTEX(pnp_res_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
| 20 | static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) |
| 21 | { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 22 | struct resource *res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | if (idx >= PNP_MAX_PORT) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 25 | dev_err(&dev->dev, "too many I/O port resources\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | /* pretend we were successful so at least the manager won't try again */ |
| 27 | return 1; |
| 28 | } |
| 29 | |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 30 | res = &dev->res.port_resource[idx]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 32 | /* check if this resource has been manually set, if so skip */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 33 | if (!(res->flags & IORESOURCE_AUTO)) { |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 34 | dev_dbg(&dev->dev, " io %d already set to %#llx-%#llx " |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 35 | "flags %#lx\n", idx, (unsigned long long) res->start, |
| 36 | (unsigned long long) res->end, res->flags); |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 37 | return 1; |
| 38 | } |
| 39 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | /* set the initial values */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 41 | res->flags |= rule->flags | IORESOURCE_IO; |
| 42 | res->flags &= ~IORESOURCE_UNSET; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
| 44 | if (!rule->size) { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 45 | res->flags |= IORESOURCE_DISABLED; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 46 | dev_dbg(&dev->dev, " io %d disabled\n", idx); |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 47 | return 1; /* skip disabled resource requests */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | } |
| 49 | |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 50 | res->start = rule->min; |
| 51 | res->end = res->start + rule->size - 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
| 53 | /* run through until pnp_check_port is happy */ |
| 54 | while (!pnp_check_port(dev, idx)) { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 55 | res->start += rule->align; |
| 56 | res->end = res->start + rule->size - 1; |
| 57 | if (res->start > rule->max || !rule->align) { |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 58 | dev_dbg(&dev->dev, " couldn't assign io %d\n", idx); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | return 0; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 60 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | } |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 62 | dev_dbg(&dev->dev, " assign io %d %#llx-%#llx\n", idx, |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 63 | (unsigned long long) res->start, (unsigned long long) res->end); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | return 1; |
| 65 | } |
| 66 | |
| 67 | static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) |
| 68 | { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 69 | struct resource *res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | if (idx >= PNP_MAX_MEM) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 72 | dev_err(&dev->dev, "too many memory resources\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | /* pretend we were successful so at least the manager won't try again */ |
| 74 | return 1; |
| 75 | } |
| 76 | |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 77 | res = &dev->res.mem_resource[idx]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 79 | /* check if this resource has been manually set, if so skip */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 80 | if (!(res->flags & IORESOURCE_AUTO)) { |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 81 | dev_dbg(&dev->dev, " mem %d already set to %#llx-%#llx " |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 82 | "flags %#lx\n", idx, (unsigned long long) res->start, |
| 83 | (unsigned long long) res->end, res->flags); |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 84 | return 1; |
| 85 | } |
| 86 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | /* set the initial values */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 88 | res->flags |= rule->flags | IORESOURCE_MEM; |
| 89 | res->flags &= ~IORESOURCE_UNSET; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
| 91 | /* convert pnp flags to standard Linux flags */ |
| 92 | if (!(rule->flags & IORESOURCE_MEM_WRITEABLE)) |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 93 | res->flags |= IORESOURCE_READONLY; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | if (rule->flags & IORESOURCE_MEM_CACHEABLE) |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 95 | res->flags |= IORESOURCE_CACHEABLE; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | if (rule->flags & IORESOURCE_MEM_RANGELENGTH) |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 97 | res->flags |= IORESOURCE_RANGELENGTH; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | if (rule->flags & IORESOURCE_MEM_SHADOWABLE) |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 99 | res->flags |= IORESOURCE_SHADOWABLE; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | |
| 101 | if (!rule->size) { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 102 | res->flags |= IORESOURCE_DISABLED; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 103 | dev_dbg(&dev->dev, " mem %d disabled\n", idx); |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 104 | return 1; /* skip disabled resource requests */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | } |
| 106 | |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 107 | res->start = rule->min; |
| 108 | res->end = res->start + rule->size - 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | |
| 110 | /* run through until pnp_check_mem is happy */ |
| 111 | while (!pnp_check_mem(dev, idx)) { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 112 | res->start += rule->align; |
| 113 | res->end = res->start + rule->size - 1; |
| 114 | if (res->start > rule->max || !rule->align) { |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 115 | dev_dbg(&dev->dev, " couldn't assign mem %d\n", idx); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | return 0; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 117 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | } |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 119 | dev_dbg(&dev->dev, " assign mem %d %#llx-%#llx\n", idx, |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 120 | (unsigned long long) res->start, (unsigned long long) res->end); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | return 1; |
| 122 | } |
| 123 | |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 124 | static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 126 | struct resource *res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | int i; |
| 128 | |
| 129 | /* IRQ priority: this table is good for i386 */ |
| 130 | static unsigned short xtab[16] = { |
| 131 | 5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2 |
| 132 | }; |
| 133 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | if (idx >= PNP_MAX_IRQ) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 135 | dev_err(&dev->dev, "too many IRQ resources\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | /* pretend we were successful so at least the manager won't try again */ |
| 137 | return 1; |
| 138 | } |
| 139 | |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 140 | res = &dev->res.irq_resource[idx]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 142 | /* check if this resource has been manually set, if so skip */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 143 | if (!(res->flags & IORESOURCE_AUTO)) { |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 144 | dev_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n", |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 145 | idx, (int) res->start, res->flags); |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 146 | return 1; |
| 147 | } |
| 148 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | /* set the initial values */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 150 | res->flags |= rule->flags | IORESOURCE_IRQ; |
| 151 | res->flags &= ~IORESOURCE_UNSET; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | |
| 153 | if (bitmap_empty(rule->map, PNP_IRQ_NR)) { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 154 | res->flags |= IORESOURCE_DISABLED; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 155 | dev_dbg(&dev->dev, " irq %d disabled\n", idx); |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 156 | return 1; /* skip disabled resource requests */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | /* TBD: need check for >16 IRQ */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 160 | res->start = find_next_bit(rule->map, PNP_IRQ_NR, 16); |
| 161 | if (res->start < PNP_IRQ_NR) { |
| 162 | res->end = res->start; |
| 163 | dev_dbg(&dev->dev, " assign irq %d %d\n", idx, |
| 164 | (int) res->start); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | return 1; |
| 166 | } |
| 167 | for (i = 0; i < 16; i++) { |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 168 | if (test_bit(xtab[i], rule->map)) { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 169 | res->start = res->end = xtab[i]; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 170 | if (pnp_check_irq(dev, idx)) { |
| 171 | dev_dbg(&dev->dev, " assign irq %d %d\n", idx, |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 172 | (int) res->start); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 | return 1; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 174 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | } |
| 176 | } |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 177 | dev_dbg(&dev->dev, " couldn't assign irq %d\n", idx); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | return 0; |
| 179 | } |
| 180 | |
Jan Beulich | 7ef3639 | 2007-10-16 23:31:07 -0700 | [diff] [blame] | 181 | static void pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 183 | struct resource *res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | int i; |
| 185 | |
| 186 | /* DMA priority: this table is good for i386 */ |
| 187 | static unsigned short xtab[8] = { |
| 188 | 1, 3, 5, 6, 7, 0, 2, 4 |
| 189 | }; |
| 190 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | if (idx >= PNP_MAX_DMA) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 192 | dev_err(&dev->dev, "too many DMA resources\n"); |
Jan Beulich | 7ef3639 | 2007-10-16 23:31:07 -0700 | [diff] [blame] | 193 | return; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 194 | } |
| 195 | |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 196 | res = &dev->res.dma_resource[idx]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 198 | /* check if this resource has been manually set, if so skip */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 199 | if (!(res->flags & IORESOURCE_AUTO)) { |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 200 | dev_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n", |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 201 | idx, (int) res->start, res->flags); |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 202 | return; |
| 203 | } |
| 204 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | /* set the initial values */ |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 206 | res->flags |= rule->flags | IORESOURCE_DMA; |
| 207 | res->flags &= ~IORESOURCE_UNSET; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | for (i = 0; i < 8; i++) { |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 210 | if (rule->map & (1 << xtab[i])) { |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 211 | res->start = res->end = xtab[i]; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 212 | if (pnp_check_dma(dev, idx)) { |
| 213 | dev_dbg(&dev->dev, " assign dma %d %d\n", idx, |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 214 | (int) res->start); |
Jan Beulich | 7ef3639 | 2007-10-16 23:31:07 -0700 | [diff] [blame] | 215 | return; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 216 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | } |
| 218 | } |
Jan Beulich | 7ef3639 | 2007-10-16 23:31:07 -0700 | [diff] [blame] | 219 | #ifdef MAX_DMA_CHANNELS |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 220 | res->start = res->end = MAX_DMA_CHANNELS; |
Jan Beulich | 7ef3639 | 2007-10-16 23:31:07 -0700 | [diff] [blame] | 221 | #endif |
Bjorn Helgaas | 28ccffc | 2008-04-28 16:34:18 -0600 | [diff] [blame^] | 222 | res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 223 | dev_dbg(&dev->dev, " disable dma %d\n", idx); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | } |
| 225 | |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 226 | void pnp_init_resource(struct resource *res) |
| 227 | { |
| 228 | unsigned long type; |
| 229 | |
| 230 | type = res->flags & (IORESOURCE_IO | IORESOURCE_MEM | |
| 231 | IORESOURCE_IRQ | IORESOURCE_DMA); |
| 232 | |
| 233 | res->name = NULL; |
| 234 | res->flags = type | IORESOURCE_AUTO | IORESOURCE_UNSET; |
| 235 | if (type == IORESOURCE_IRQ || type == IORESOURCE_DMA) { |
| 236 | res->start = -1; |
| 237 | res->end = -1; |
| 238 | } else { |
| 239 | res->start = 0; |
| 240 | res->end = 0; |
| 241 | } |
| 242 | } |
| 243 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | /** |
| 245 | * pnp_init_resources - Resets a resource table to default values. |
| 246 | * @table: pointer to the desired resource table |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | */ |
Bjorn Helgaas | 2cd139309 | 2008-04-28 16:34:11 -0600 | [diff] [blame] | 248 | void pnp_init_resources(struct pnp_dev *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 250 | struct resource *res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | int idx; |
Bjorn Helgaas | 07d4e9a | 2007-07-26 10:41:21 -0700 | [diff] [blame] | 252 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | for (idx = 0; idx < PNP_MAX_IRQ; idx++) { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 254 | res = &dev->res.irq_resource[idx]; |
| 255 | res->flags = IORESOURCE_IRQ; |
| 256 | pnp_init_resource(res); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | } |
| 258 | for (idx = 0; idx < PNP_MAX_DMA; idx++) { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 259 | res = &dev->res.dma_resource[idx]; |
| 260 | res->flags = IORESOURCE_DMA; |
| 261 | pnp_init_resource(res); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | } |
| 263 | for (idx = 0; idx < PNP_MAX_PORT; idx++) { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 264 | res = &dev->res.port_resource[idx]; |
| 265 | res->flags = IORESOURCE_IO; |
| 266 | pnp_init_resource(res); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | } |
| 268 | for (idx = 0; idx < PNP_MAX_MEM; idx++) { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 269 | res = &dev->res.mem_resource[idx]; |
| 270 | res->flags = IORESOURCE_MEM; |
| 271 | pnp_init_resource(res); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | } |
| 273 | } |
| 274 | |
| 275 | /** |
| 276 | * pnp_clean_resources - clears resources that were not manually set |
Martin Waitz | 67be2dd | 2005-05-01 08:59:26 -0700 | [diff] [blame] | 277 | * @res: the resources to clean |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | */ |
Bjorn Helgaas | 6969c7e | 2008-04-28 16:34:10 -0600 | [diff] [blame] | 279 | static void pnp_clean_resource_table(struct pnp_dev *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 281 | struct resource *res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | int idx; |
Bjorn Helgaas | 07d4e9a | 2007-07-26 10:41:21 -0700 | [diff] [blame] | 283 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | for (idx = 0; idx < PNP_MAX_IRQ; idx++) { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 285 | res = &dev->res.irq_resource[idx]; |
| 286 | if (res->flags & IORESOURCE_AUTO) { |
| 287 | res->flags = IORESOURCE_IRQ; |
| 288 | pnp_init_resource(res); |
| 289 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | } |
| 291 | for (idx = 0; idx < PNP_MAX_DMA; idx++) { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 292 | res = &dev->res.dma_resource[idx]; |
| 293 | if (res->flags & IORESOURCE_AUTO) { |
| 294 | res->flags = IORESOURCE_DMA; |
| 295 | pnp_init_resource(res); |
| 296 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | } |
| 298 | for (idx = 0; idx < PNP_MAX_PORT; idx++) { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 299 | res = &dev->res.port_resource[idx]; |
| 300 | if (res->flags & IORESOURCE_AUTO) { |
| 301 | res->flags = IORESOURCE_IO; |
| 302 | pnp_init_resource(res); |
| 303 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | } |
| 305 | for (idx = 0; idx < PNP_MAX_MEM; idx++) { |
Bjorn Helgaas | d948a8d | 2008-04-28 16:34:13 -0600 | [diff] [blame] | 306 | res = &dev->res.mem_resource[idx]; |
| 307 | if (res->flags & IORESOURCE_AUTO) { |
| 308 | res->flags = IORESOURCE_MEM; |
| 309 | pnp_init_resource(res); |
| 310 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | } |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * pnp_assign_resources - assigns resources to the device based on the specified dependent number |
| 316 | * @dev: pointer to the desired device |
| 317 | * @depnum: the dependent function number |
| 318 | * |
| 319 | * Only set depnum to 0 if the device does not have dependent options. |
| 320 | */ |
| 321 | static int pnp_assign_resources(struct pnp_dev *dev, int depnum) |
| 322 | { |
| 323 | struct pnp_port *port; |
| 324 | struct pnp_mem *mem; |
| 325 | struct pnp_irq *irq; |
| 326 | struct pnp_dma *dma; |
| 327 | int nport = 0, nmem = 0, nirq = 0, ndma = 0; |
| 328 | |
| 329 | if (!pnp_can_configure(dev)) |
| 330 | return -ENODEV; |
| 331 | |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 332 | dbg_pnp_show_resources(dev, "before pnp_assign_resources"); |
Daniel Walker | b3bd86e | 2008-02-06 01:40:04 -0800 | [diff] [blame] | 333 | mutex_lock(&pnp_res_mutex); |
Bjorn Helgaas | 6969c7e | 2008-04-28 16:34:10 -0600 | [diff] [blame] | 334 | pnp_clean_resource_table(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 335 | if (dev->independent) { |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 336 | dev_dbg(&dev->dev, "assigning independent options\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | port = dev->independent->port; |
| 338 | mem = dev->independent->mem; |
| 339 | irq = dev->independent->irq; |
| 340 | dma = dev->independent->dma; |
| 341 | while (port) { |
| 342 | if (!pnp_assign_port(dev, port, nport)) |
| 343 | goto fail; |
| 344 | nport++; |
| 345 | port = port->next; |
| 346 | } |
| 347 | while (mem) { |
| 348 | if (!pnp_assign_mem(dev, mem, nmem)) |
| 349 | goto fail; |
| 350 | nmem++; |
| 351 | mem = mem->next; |
| 352 | } |
| 353 | while (irq) { |
| 354 | if (!pnp_assign_irq(dev, irq, nirq)) |
| 355 | goto fail; |
| 356 | nirq++; |
| 357 | irq = irq->next; |
| 358 | } |
| 359 | while (dma) { |
Jan Beulich | 7ef3639 | 2007-10-16 23:31:07 -0700 | [diff] [blame] | 360 | pnp_assign_dma(dev, dma, ndma); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 361 | ndma++; |
| 362 | dma = dma->next; |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | if (depnum) { |
| 367 | struct pnp_option *dep; |
| 368 | int i; |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 369 | |
| 370 | dev_dbg(&dev->dev, "assigning dependent option %d\n", depnum); |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 371 | for (i = 1, dep = dev->dependent; i < depnum; |
| 372 | i++, dep = dep->next) |
| 373 | if (!dep) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 374 | goto fail; |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 375 | port = dep->port; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | mem = dep->mem; |
| 377 | irq = dep->irq; |
| 378 | dma = dep->dma; |
| 379 | while (port) { |
| 380 | if (!pnp_assign_port(dev, port, nport)) |
| 381 | goto fail; |
| 382 | nport++; |
| 383 | port = port->next; |
| 384 | } |
| 385 | while (mem) { |
| 386 | if (!pnp_assign_mem(dev, mem, nmem)) |
| 387 | goto fail; |
| 388 | nmem++; |
| 389 | mem = mem->next; |
| 390 | } |
| 391 | while (irq) { |
| 392 | if (!pnp_assign_irq(dev, irq, nirq)) |
| 393 | goto fail; |
| 394 | nirq++; |
| 395 | irq = irq->next; |
| 396 | } |
| 397 | while (dma) { |
Jan Beulich | 7ef3639 | 2007-10-16 23:31:07 -0700 | [diff] [blame] | 398 | pnp_assign_dma(dev, dma, ndma); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | ndma++; |
| 400 | dma = dma->next; |
| 401 | } |
| 402 | } else if (dev->dependent) |
| 403 | goto fail; |
| 404 | |
Daniel Walker | b3bd86e | 2008-02-06 01:40:04 -0800 | [diff] [blame] | 405 | mutex_unlock(&pnp_res_mutex); |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 406 | dbg_pnp_show_resources(dev, "after pnp_assign_resources"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 407 | return 1; |
| 408 | |
Bjorn Helgaas | 1e0aa9a | 2007-08-15 10:32:08 -0600 | [diff] [blame] | 409 | fail: |
Bjorn Helgaas | 6969c7e | 2008-04-28 16:34:10 -0600 | [diff] [blame] | 410 | pnp_clean_resource_table(dev); |
Daniel Walker | b3bd86e | 2008-02-06 01:40:04 -0800 | [diff] [blame] | 411 | mutex_unlock(&pnp_res_mutex); |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 412 | dbg_pnp_show_resources(dev, "after pnp_assign_resources (failed)"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 413 | return 0; |
| 414 | } |
| 415 | |
| 416 | /** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 417 | * pnp_auto_config_dev - automatically assigns resources to a device |
| 418 | * @dev: pointer to the desired device |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 419 | */ |
| 420 | int pnp_auto_config_dev(struct pnp_dev *dev) |
| 421 | { |
| 422 | struct pnp_option *dep; |
| 423 | int i = 1; |
| 424 | |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 425 | if (!pnp_can_configure(dev)) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 426 | dev_dbg(&dev->dev, "configuration not supported\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 427 | return -ENODEV; |
| 428 | } |
| 429 | |
| 430 | if (!dev->dependent) { |
| 431 | if (pnp_assign_resources(dev, 0)) |
| 432 | return 0; |
| 433 | } else { |
| 434 | dep = dev->dependent; |
| 435 | do { |
| 436 | if (pnp_assign_resources(dev, i)) |
| 437 | return 0; |
| 438 | dep = dep->next; |
| 439 | i++; |
| 440 | } while (dep); |
| 441 | } |
| 442 | |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 443 | dev_err(&dev->dev, "unable to assign resources\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 444 | return -EBUSY; |
| 445 | } |
| 446 | |
| 447 | /** |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 448 | * pnp_start_dev - low-level start of the PnP device |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 449 | * @dev: pointer to the desired device |
| 450 | * |
Bjorn Helgaas | 07d4e9a | 2007-07-26 10:41:21 -0700 | [diff] [blame] | 451 | * assumes that resources have already been allocated |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 452 | */ |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 453 | int pnp_start_dev(struct pnp_dev *dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 454 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 455 | if (!pnp_can_write(dev)) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 456 | dev_dbg(&dev->dev, "activation not supported\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 457 | return -EINVAL; |
| 458 | } |
| 459 | |
Bjorn Helgaas | 81b5c75 | 2008-04-28 16:34:08 -0600 | [diff] [blame] | 460 | dbg_pnp_show_resources(dev, "pnp_start_dev"); |
Bjorn Helgaas | 59284cb | 2008-04-28 16:34:05 -0600 | [diff] [blame] | 461 | if (dev->protocol->set(dev) < 0) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 462 | dev_err(&dev->dev, "activation failed\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 463 | return -EIO; |
| 464 | } |
| 465 | |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 466 | dev_info(&dev->dev, "activated\n"); |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 467 | return 0; |
| 468 | } |
| 469 | |
| 470 | /** |
| 471 | * pnp_stop_dev - low-level disable of the PnP device |
| 472 | * @dev: pointer to the desired device |
| 473 | * |
| 474 | * does not free resources |
| 475 | */ |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 476 | int pnp_stop_dev(struct pnp_dev *dev) |
| 477 | { |
| 478 | if (!pnp_can_disable(dev)) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 479 | dev_dbg(&dev->dev, "disabling not supported\n"); |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 480 | return -EINVAL; |
| 481 | } |
Bjorn Helgaas | 9dd7846 | 2007-07-26 10:41:20 -0700 | [diff] [blame] | 482 | if (dev->protocol->disable(dev) < 0) { |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 483 | dev_err(&dev->dev, "disable failed\n"); |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 484 | return -EIO; |
| 485 | } |
| 486 | |
Bjorn Helgaas | a05d078 | 2007-10-16 23:31:10 -0700 | [diff] [blame] | 487 | dev_info(&dev->dev, "disabled\n"); |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 488 | return 0; |
| 489 | } |
| 490 | |
| 491 | /** |
| 492 | * pnp_activate_dev - activates a PnP device for use |
| 493 | * @dev: pointer to the desired device |
| 494 | * |
| 495 | * does not validate or set resources so be careful. |
| 496 | */ |
| 497 | int pnp_activate_dev(struct pnp_dev *dev) |
| 498 | { |
| 499 | int error; |
| 500 | |
Bjorn Helgaas | 07d4e9a | 2007-07-26 10:41:21 -0700 | [diff] [blame] | 501 | if (dev->active) |
Bjorn Helgaas | cc8259a | 2008-02-06 01:40:02 -0800 | [diff] [blame] | 502 | return 0; |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 503 | |
| 504 | /* ensure resources are allocated */ |
| 505 | if (pnp_auto_config_dev(dev)) |
| 506 | return -EBUSY; |
| 507 | |
| 508 | error = pnp_start_dev(dev); |
| 509 | if (error) |
| 510 | return error; |
| 511 | |
| 512 | dev->active = 1; |
Bjorn Helgaas | cc8259a | 2008-02-06 01:40:02 -0800 | [diff] [blame] | 513 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 514 | } |
| 515 | |
| 516 | /** |
| 517 | * pnp_disable_dev - disables device |
| 518 | * @dev: pointer to the desired device |
| 519 | * |
| 520 | * inform the correct pnp protocol so that resources can be used by other devices |
| 521 | */ |
| 522 | int pnp_disable_dev(struct pnp_dev *dev) |
| 523 | { |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 524 | int error; |
| 525 | |
Bjorn Helgaas | 07d4e9a | 2007-07-26 10:41:21 -0700 | [diff] [blame] | 526 | if (!dev->active) |
Bjorn Helgaas | cc8259a | 2008-02-06 01:40:02 -0800 | [diff] [blame] | 527 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 528 | |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 529 | error = pnp_stop_dev(dev); |
| 530 | if (error) |
| 531 | return error; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 532 | |
| 533 | dev->active = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 534 | |
| 535 | /* release the resources so that other devices can use them */ |
Daniel Walker | b3bd86e | 2008-02-06 01:40:04 -0800 | [diff] [blame] | 536 | mutex_lock(&pnp_res_mutex); |
Bjorn Helgaas | 6969c7e | 2008-04-28 16:34:10 -0600 | [diff] [blame] | 537 | pnp_clean_resource_table(dev); |
Daniel Walker | b3bd86e | 2008-02-06 01:40:04 -0800 | [diff] [blame] | 538 | mutex_unlock(&pnp_res_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 539 | |
Bjorn Helgaas | cc8259a | 2008-02-06 01:40:02 -0800 | [diff] [blame] | 540 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 541 | } |
| 542 | |
Pierre Ossman | 68094e3 | 2005-11-29 09:09:32 +0100 | [diff] [blame] | 543 | EXPORT_SYMBOL(pnp_start_dev); |
| 544 | EXPORT_SYMBOL(pnp_stop_dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 545 | EXPORT_SYMBOL(pnp_activate_dev); |
| 546 | EXPORT_SYMBOL(pnp_disable_dev); |