aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/base.h
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2008-04-30 13:59:05 -0400
committerLen Brown <len.brown@intel.com>2008-04-30 13:59:05 -0400
commit008238b54ac2350babf195084ecedbcf7851a202 (patch)
treea7cc18ea0403f4478883a3e36a6f0d2bf67eef3e /drivers/pnp/base.h
parent96916090f488986a4ebb8e9ffa6a3b50881d5ccd (diff)
parentdfd2e1b4e6eb46ff59c7e1c1111c967b8b5981c1 (diff)
Merge branch 'pnp' into release
Diffstat (limited to 'drivers/pnp/base.h')
-rw-r--r--drivers/pnp/base.h74
1 files changed, 70 insertions, 4 deletions
diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h
index 31a633f65547..4fe7c58f57e9 100644
--- a/drivers/pnp/base.h
+++ b/drivers/pnp/base.h
@@ -1,12 +1,78 @@
1extern spinlock_t pnp_lock; 1extern spinlock_t pnp_lock;
2void *pnp_alloc(long size); 2void *pnp_alloc(long size);
3
4int pnp_register_protocol(struct pnp_protocol *protocol);
5void pnp_unregister_protocol(struct pnp_protocol *protocol);
6
7#define PNP_EISA_ID_MASK 0x7fffffff
8void pnp_eisa_id_to_string(u32 id, char *str);
9struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *, int id, char *pnpid);
10struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid);
11
12int pnp_add_device(struct pnp_dev *dev);
13struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id);
3int pnp_interface_attach_device(struct pnp_dev *dev); 14int pnp_interface_attach_device(struct pnp_dev *dev);
15
16int pnp_add_card(struct pnp_card *card);
17struct pnp_id *pnp_add_card_id(struct pnp_card *card, char *id);
18void pnp_remove_card(struct pnp_card *card);
19int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
20void pnp_remove_card_device(struct pnp_dev *dev);
21
22struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev);
23struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
24 int priority);
25int pnp_register_irq_resource(struct pnp_dev *dev, struct pnp_option *option,
26 struct pnp_irq *data);
27int pnp_register_dma_resource(struct pnp_dev *dev, struct pnp_option *option,
28 struct pnp_dma *data);
29int pnp_register_port_resource(struct pnp_dev *dev, struct pnp_option *option,
30 struct pnp_port *data);
31int pnp_register_mem_resource(struct pnp_dev *dev, struct pnp_option *option,
32 struct pnp_mem *data);
33void pnp_init_resources(struct pnp_dev *dev);
34
4void pnp_fixup_device(struct pnp_dev *dev); 35void pnp_fixup_device(struct pnp_dev *dev);
5void pnp_free_option(struct pnp_option *option); 36void pnp_free_option(struct pnp_option *option);
6int __pnp_add_device(struct pnp_dev *dev); 37int __pnp_add_device(struct pnp_dev *dev);
7void __pnp_remove_device(struct pnp_dev *dev); 38void __pnp_remove_device(struct pnp_dev *dev);
8 39
9int pnp_check_port(struct pnp_dev * dev, int idx); 40int pnp_check_port(struct pnp_dev *dev, struct resource *res);
10int pnp_check_mem(struct pnp_dev * dev, int idx); 41int pnp_check_mem(struct pnp_dev *dev, struct resource *res);
11int pnp_check_irq(struct pnp_dev * dev, int idx); 42int pnp_check_irq(struct pnp_dev *dev, struct resource *res);
12int pnp_check_dma(struct pnp_dev * dev, int idx); 43int pnp_check_dma(struct pnp_dev *dev, struct resource *res);
44
45void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc);
46
47void pnp_init_resource(struct resource *res);
48
49struct pnp_resource *pnp_get_pnp_resource(struct pnp_dev *dev,
50 unsigned int type, unsigned int num);
51
52#define PNP_MAX_PORT 40
53#define PNP_MAX_MEM 24
54#define PNP_MAX_IRQ 2
55#define PNP_MAX_DMA 2
56
57struct pnp_resource {
58 struct resource res;
59 unsigned int index; /* ISAPNP config register index */
60};
61
62struct pnp_resource_table {
63 struct pnp_resource port[PNP_MAX_PORT];
64 struct pnp_resource mem[PNP_MAX_MEM];
65 struct pnp_resource dma[PNP_MAX_DMA];
66 struct pnp_resource irq[PNP_MAX_IRQ];
67};
68
69struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq,
70 int flags);
71struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma,
72 int flags);
73struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev,
74 resource_size_t start,
75 resource_size_t end, int flags);
76struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev,
77 resource_size_t start,
78 resource_size_t end, int flags);