diff options
| author | Patrick Mochel <mochel@osdl.org> | 2003-08-09 01:07:00 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-08-09 01:07:00 -0700 |
| commit | a40b9b0b335c466d587ba43f6337d432ea524a72 (patch) | |
| tree | 57cc7fc0f9f71af0e3d2f87555270baacc6dcf16 /include | |
| parent | 3525978ca4d3eba4e036e12a4af43d3feedada4e (diff) | |
| parent | 4d7e0ff7ac018db904242642844d18c8419b67e7 (diff) | |
Merge bk://kernel.bkbits.net//home/mochel/linux-2.5-power
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-power
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-ppc/macio.h (renamed from include/asm-ppc/macio_asic.h) | 40 | ||||
| -rw-r--r-- | include/asm-ppc/of_device.h | 70 | ||||
| -rw-r--r-- | include/asm-ppc/pmac_feature.h | 2 | ||||
| -rw-r--r-- | include/linux/i2c.h | 12 | ||||
| -rw-r--r-- | include/linux/pci.h | 3 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 3 |
6 files changed, 99 insertions, 31 deletions
diff --git a/include/asm-ppc/macio_asic.h b/include/asm-ppc/macio.h index 58d15c5b6c69..fea90e46aa09 100644 --- a/include/asm-ppc/macio_asic.h +++ b/include/asm-ppc/macio.h @@ -1,7 +1,7 @@ #ifndef __MACIO_ASIC_H__ #define __MACIO_ASIC_H__ -#include <linux/device.h> +#include <asm/of_device.h> extern struct bus_type macio_bus_type; @@ -17,12 +17,16 @@ struct macio_chip; * within a MacIO ASIC. It's typically provided by a macio_pci_asic * PCI device, but could be provided differently as well (nubus * machines using a fake OF tree). + * + * The pdev field can be NULL on non-PCI machines */ struct macio_bus { struct macio_chip *chip; /* macio_chip (private use) */ + int index; /* macio chip index in system */ +#ifdef CONFIG_PCI struct pci_dev *pdev; /* PCI device hosting this bus */ - struct list_head devices; /* list of devices on this bus */ +#endif }; /* @@ -31,39 +35,23 @@ struct macio_bus */ struct macio_dev { - struct macio_bus *bus; /* virtual bus this device is on */ - - struct device_node *node; /* OF node */ - struct macio_driver *driver; /* which driver allocated this device */ - void *driver_data; /* placeholder for driver specific stuffs */ - struct resource resources[MACIO_DEV_COUNT_RESOURCE]; /* I/O */ - int irqs[MACIO_DEV_COUNT_IRQS]; - - struct device dev; /* Generic device interface */ -}; -#define to_macio_device(d) container_of(d, struct macio_dev, dev) - -/* - * Struct used for matching a device - */ -struct macio_match -{ - char *name; - char *type; - char *compatible; + struct macio_bus *bus; /* macio bus this device is on */ + struct macio_dev *media_bay; /* Device is part of a media bay */ + struct of_device ofdev; }; -#define MACIO_ANY_MATCH ((char *)-1L) +#define to_macio_device(d) container_of(d, struct macio_dev, ofdev.dev) +#define of_to_macio_device(d) container_of(d, struct macio_dev, ofdev) /* * A driver for a mac-io chip based device */ struct macio_driver { - struct list_head node; char *name; - struct macio_match *match_table; + struct of_match *match_table; + struct module *owner; - int (*probe)(struct macio_dev* dev, const struct macio_match *match); + int (*probe)(struct macio_dev* dev, const struct of_match *match); int (*remove)(struct macio_dev* dev); int (*suspend)(struct macio_dev* dev, u32 state, u32 level); diff --git a/include/asm-ppc/of_device.h b/include/asm-ppc/of_device.h new file mode 100644 index 000000000000..71a0a3708ea5 --- /dev/null +++ b/include/asm-ppc/of_device.h @@ -0,0 +1,70 @@ +#ifndef __OF_DEVICE_H__ +#define __OF_DEVICE_H__ + +#include <linux/device.h> +#include <asm/prom.h> + +/* + * The of_platform_bus_type is a bus type used by drivers that do not + * attach to a macio or similar bus but still use OF probing + * mecanism + */ +extern struct bus_type of_platform_bus_type; + +/* + * The of_device is a kind of "base class" that is a superset of + * struct device for use by devices attached to an OF node and + * probed using OF properties + */ +struct of_device +{ + struct device_node *node; /* OF device node */ + u64 dma_mask; /* DMA mask */ + struct device dev; /* Generic device interface */ +}; +#define to_of_device(d) container_of(d, struct of_device, dev) + +/* + * Struct used for matching a device + */ +struct of_match +{ + char *name; + char *type; + char *compatible; + void *data; +}; +#define OF_ANY_MATCH ((char *)-1L) + +extern const struct of_match *of_match_device( + const struct of_match *matches, const struct of_device *dev); + +/* + * An of_platform_driver driver is attached to a basic of_device on + * the "platform bus" (of_platform_bus_type) + */ +struct of_platform_driver +{ + char *name; + struct of_match *match_table; + struct module *owner; + + int (*probe)(struct of_device* dev, const struct of_match *match); + int (*remove)(struct of_device* dev); + + int (*suspend)(struct of_device* dev, u32 state, u32 level); + int (*resume)(struct of_device* dev, u32 level); + int (*shutdown)(struct of_device* dev); + + struct device_driver driver; +}; +#define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver) + +extern int of_register_driver(struct of_platform_driver *drv); +extern void of_unregister_driver(struct of_platform_driver *drv); +extern int of_device_register(struct of_device *ofdev); +extern void of_device_unregister(struct of_device *ofdev); +extern struct of_device *of_platform_device_create(struct device_node *np, const char *bus_id); + +#endif /* __OF_DEVICE_H__ */ + diff --git a/include/asm-ppc/pmac_feature.h b/include/asm-ppc/pmac_feature.h index eace23e7d6ca..44eaa7543384 100644 --- a/include/asm-ppc/pmac_feature.h +++ b/include/asm-ppc/pmac_feature.h @@ -31,7 +31,7 @@ #ifndef __PPC_ASM_PMAC_FEATURE_H #define __PPC_ASM_PMAC_FEATURE_H -#include <asm/macio_asic.h> +#include <asm/macio.h> /* * Known Mac motherboard models diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 43a277eabcd9..f2dc147bda89 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -166,6 +166,8 @@ struct i2c_client { /* to the client */ struct device dev; /* the device structure */ struct list_head list; + char name[DEVICE_NAME_SIZE]; + struct completion released; }; #define to_i2c_client(d) container_of(d, struct i2c_client, dev) @@ -179,11 +181,11 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) dev_set_drvdata (&dev->dev, data); } -#define I2C_DEVNAME(str) .dev = { .name = str } +#define I2C_DEVNAME(str) .name = str static inline char *i2c_clientname(struct i2c_client *c) { - return c->dev.name; + return &c->name[0]; } /* @@ -251,8 +253,12 @@ struct i2c_adapter { int nr; struct list_head clients; struct list_head list; + char name[DEVICE_NAME_SIZE]; + struct completion dev_released; + struct completion class_dev_released; }; -#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) +#define dev_to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) +#define class_dev_to_i2c_adapter(d) container_of(d, struct i2c_adapter, class_dev) static inline void *i2c_get_adapdata (struct i2c_adapter *dev) { diff --git a/include/linux/pci.h b/include/linux/pci.h index 89c42feef5be..a4c7a4c7965e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -419,6 +419,9 @@ struct pci_dev { /* These fields are used by common fixups */ unsigned int transparent:1; /* Transparent PCI bridge */ unsigned int multifunction:1;/* Part of multi-function device */ +#ifdef CONFIG_PCI_NAMES + char pretty_name[DEVICE_NAME_SIZE]; /* pretty name for users to see */ +#endif }; #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index a74d999e9b18..27e515912d29 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -608,6 +608,7 @@ #define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049 #define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A #define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B +#define PCI_DEVICE_ID_HP_PCI_LBA 0x1054 #define PCI_DEVICE_ID_HP_REO_SBA 0x10f0 #define PCI_DEVICE_ID_HP_REO_IOC 0x10f1 #define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b @@ -616,7 +617,7 @@ #define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227 #define PCI_DEVICE_ID_HP_ZX1_SBA 0x1229 #define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a -#define PCI_DEVICE_ID_HP_ZX1_LBA 0x122e +#define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e #define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c #define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 #define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 |
