aboutsummaryrefslogtreecommitdiff
path: root/drivers/pnp/resource.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2010-03-05 10:47:57 -0700
committerLen Brown <len.brown@intel.com>2010-03-14 20:08:38 -0400
commit7e0e9c042790d4ea44c6a00ddaad8b8bbcc3f17f (patch)
treeb0caf1f008ae1f2f2f32bfecfaba7c8ba9986c6f /drivers/pnp/resource.c
parentfa35b49260b615d634bfa1f767aa315fa323c2e9 (diff)
PNPACPI: add bus number support
Add support for bus number resources. This is for bridges with a range of bus numbers behind them. Previously, PNP ignored bus number resources. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/resource.c')
-rw-r--r--drivers/pnp/resource.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index 64d0596bafb..5b277dbaacd 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -470,7 +470,8 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res)
unsigned long pnp_resource_type(struct resource *res)
{
return res->flags & (IORESOURCE_IO | IORESOURCE_MEM |
- IORESOURCE_IRQ | IORESOURCE_DMA);
+ IORESOURCE_IRQ | IORESOURCE_DMA |
+ IORESOURCE_BUS);
}
struct resource *pnp_get_resource(struct pnp_dev *dev,
@@ -590,6 +591,30 @@ struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev,
return pnp_res;
}
+struct pnp_resource *pnp_add_bus_resource(struct pnp_dev *dev,
+ resource_size_t start,
+ resource_size_t end)
+{
+ struct pnp_resource *pnp_res;
+ struct resource *res;
+
+ pnp_res = pnp_new_resource(dev);
+ if (!pnp_res) {
+ dev_err(&dev->dev, "can't add resource for BUS %#llx-%#llx\n",
+ (unsigned long long) start,
+ (unsigned long long) end);
+ return NULL;
+ }
+
+ res = &pnp_res->res;
+ res->flags = IORESOURCE_BUS;
+ res->start = start;
+ res->end = end;
+
+ pnp_dbg(&dev->dev, " add %pr\n", res);
+ return pnp_res;
+}
+
/*
* Determine whether the specified resource is a possible configuration
* for this device.