]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/linux/mod_devicetable.h
gpio: gpiolib: Support for open source/emitter gpios
[linux-2.6.git] / include / linux / mod_devicetable.h
index 9b6d05172ed45ba62618a10a6b2e635105f5b3a5..ae28e93fd07276c27114709580ed555e772fcd94 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Device tables which are exported to userspace via
- * scripts/table2alias.c.  You must keep that file in sync with this
+ * scripts/mod/file2alias.c.  You must keep that file in sync with this
  * header.
  */
 
@@ -33,7 +33,8 @@ struct ieee1394_device_id {
        __u32 model_id;
        __u32 specifier_id;
        __u32 version;
-       kernel_ulong_t driver_data;
+       kernel_ulong_t driver_data
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
 };
 
 
@@ -130,6 +131,17 @@ struct usb_device_id {
 #define USB_DEVICE_ID_MATCH_INT_SUBCLASS       0x0100
 #define USB_DEVICE_ID_MATCH_INT_PROTOCOL       0x0200
 
+#define HID_ANY_ID                             (~0)
+
+struct hid_device_id {
+       __u16 bus;
+       __u16 pad1;
+       __u32 vendor;
+       __u32 product;
+       kernel_ulong_t driver_data
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
 /* s390 CCW devices */
 struct ccw_device_id {
        __u16   match_flags;    /* which fields to match against */
@@ -147,6 +159,33 @@ struct ccw_device_id {
 #define CCW_DEVICE_ID_MATCH_DEVICE_TYPE                0x04
 #define CCW_DEVICE_ID_MATCH_DEVICE_MODEL       0x08
 
+/* s390 AP bus devices */
+struct ap_device_id {
+       __u16 match_flags;      /* which fields to match against */
+       __u8 dev_type;          /* device type */
+       __u8 pad1;
+       __u32 pad2;
+       kernel_ulong_t driver_info;
+};
+
+#define AP_DEVICE_ID_MATCH_DEVICE_TYPE         0x01
+
+/* s390 css bus devices (subchannels) */
+struct css_device_id {
+       __u8 match_flags;
+       __u8 type; /* subchannel type */
+       __u16 pad2;
+       __u32 pad3;
+       kernel_ulong_t driver_data;
+};
+
+#define ACPI_ID_LEN    16 /* only 9 bytes needed here, 16 bytes are used */
+                          /* to workaround crosscompile issues */
+
+struct acpi_device_id {
+       __u8 id[ACPI_ID_LEN];
+       kernel_ulong_t driver_data;
+};
 
 #define PNP_ID_LEN     8
 #define PNP_MAX_DEVICES        8
@@ -174,6 +213,26 @@ struct serio_device_id {
        __u8 proto;
 };
 
+/*
+ * Struct used for matching a device
+ */
+struct of_device_id
+{
+       char    name[32];
+       char    type[32];
+       char    compatible[128];
+#ifdef __KERNEL__
+       void    *data;
+#else
+       kernel_ulong_t data;
+#endif
+};
+
+/* VIO */
+struct vio_device_id {
+       char type[32];
+       char compat[32];
+};
 
 /* PCMCIA */
 
@@ -188,16 +247,18 @@ struct pcmcia_device_id {
        /* for real multi-function devices */
        __u8            function;
 
-       /* for pseude multi-function devices */
+       /* for pseudo multi-function devices */
        __u8            device_no;
 
-       __u32           prod_id_hash[4];
+       __u32           prod_id_hash[4]
+               __attribute__((aligned(sizeof(__u32))));
 
        /* not matched against in kernelspace*/
 #ifdef __KERNEL__
        const char *    prod_id[4];
 #else
-       kernel_ulong_t  prod_id[4];
+       kernel_ulong_t  prod_id[4]
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
 #endif
 
        /* not matched against */
@@ -221,4 +282,255 @@ struct pcmcia_device_id {
 #define PCMCIA_DEV_ID_MATCH_FAKE_CIS   0x0200
 #define PCMCIA_DEV_ID_MATCH_ANONYMOUS  0x0400
 
+/* Input */
+#define INPUT_DEVICE_ID_EV_MAX         0x1f
+#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING    0x71
+#define INPUT_DEVICE_ID_KEY_MAX                0x2ff
+#define INPUT_DEVICE_ID_REL_MAX                0x0f
+#define INPUT_DEVICE_ID_ABS_MAX                0x3f
+#define INPUT_DEVICE_ID_MSC_MAX                0x07
+#define INPUT_DEVICE_ID_LED_MAX                0x0f
+#define INPUT_DEVICE_ID_SND_MAX                0x07
+#define INPUT_DEVICE_ID_FF_MAX         0x7f
+#define INPUT_DEVICE_ID_SW_MAX         0x0f
+
+#define INPUT_DEVICE_ID_MATCH_BUS      1
+#define INPUT_DEVICE_ID_MATCH_VENDOR   2
+#define INPUT_DEVICE_ID_MATCH_PRODUCT  4
+#define INPUT_DEVICE_ID_MATCH_VERSION  8
+
+#define INPUT_DEVICE_ID_MATCH_EVBIT    0x0010
+#define INPUT_DEVICE_ID_MATCH_KEYBIT   0x0020
+#define INPUT_DEVICE_ID_MATCH_RELBIT   0x0040
+#define INPUT_DEVICE_ID_MATCH_ABSBIT   0x0080
+#define INPUT_DEVICE_ID_MATCH_MSCIT    0x0100
+#define INPUT_DEVICE_ID_MATCH_LEDBIT   0x0200
+#define INPUT_DEVICE_ID_MATCH_SNDBIT   0x0400
+#define INPUT_DEVICE_ID_MATCH_FFBIT    0x0800
+#define INPUT_DEVICE_ID_MATCH_SWBIT    0x1000
+
+struct input_device_id {
+
+       kernel_ulong_t flags;
+
+       __u16 bustype;
+       __u16 vendor;
+       __u16 product;
+       __u16 version;
+
+       kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
+       kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
+
+       kernel_ulong_t driver_info;
+};
+
+/* EISA */
+
+#define EISA_SIG_LEN   8
+
+/* The EISA signature, in ASCII form, null terminated */
+struct eisa_device_id {
+       char          sig[EISA_SIG_LEN];
+       kernel_ulong_t driver_data;
+};
+
+#define EISA_DEVICE_MODALIAS_FMT "eisa:s%s"
+
+struct parisc_device_id {
+       __u8    hw_type;        /* 5 bits used */
+       __u8    hversion_rev;   /* 4 bits */
+       __u16   hversion;       /* 12 bits */
+       __u32   sversion;       /* 20 bits */
+};
+
+#define PA_HWTYPE_ANY_ID       0xff
+#define PA_HVERSION_REV_ANY_ID 0xff
+#define PA_HVERSION_ANY_ID     0xffff
+#define PA_SVERSION_ANY_ID     0xffffffff
+
+/* SDIO */
+
+#define SDIO_ANY_ID (~0)
+
+struct sdio_device_id {
+       __u8    class;                  /* Standard interface or SDIO_ANY_ID */
+       __u16   vendor;                 /* Vendor or SDIO_ANY_ID */
+       __u16   device;                 /* Device ID or SDIO_ANY_ID */
+       kernel_ulong_t driver_data      /* Data private to the driver */
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
+/* SSB core, see drivers/ssb/ */
+struct ssb_device_id {
+       __u16   vendor;
+       __u16   coreid;
+       __u8    revision;
+};
+#define SSB_DEVICE(_vendor, _coreid, _revision)  \
+       { .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
+#define SSB_DEVTABLE_END  \
+       { 0, },
+
+#define SSB_ANY_VENDOR         0xFFFF
+#define SSB_ANY_ID             0xFFFF
+#define SSB_ANY_REV            0xFF
+
+/* Broadcom's specific AMBA core, see drivers/bcma/ */
+struct bcma_device_id {
+       __u16   manuf;
+       __u16   id;
+       __u8    rev;
+       __u8    class;
+};
+#define BCMA_CORE(_manuf, _id, _rev, _class)  \
+       { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, }
+#define BCMA_CORETABLE_END  \
+       { 0, },
+
+#define BCMA_ANY_MANUF         0xFFFF
+#define BCMA_ANY_ID            0xFFFF
+#define BCMA_ANY_REV           0xFF
+#define BCMA_ANY_CLASS         0xFF
+
+struct virtio_device_id {
+       __u32 device;
+       __u32 vendor;
+};
+#define VIRTIO_DEV_ANY_ID      0xffffffff
+
+/* i2c */
+
+#define I2C_NAME_SIZE  20
+#define I2C_MODULE_PREFIX "i2c:"
+
+struct i2c_device_id {
+       char name[I2C_NAME_SIZE];
+       kernel_ulong_t driver_data      /* Data private to the driver */
+                       __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
+/* spi */
+
+#define SPI_NAME_SIZE  32
+#define SPI_MODULE_PREFIX "spi:"
+
+struct spi_device_id {
+       char name[SPI_NAME_SIZE];
+       kernel_ulong_t driver_data      /* Data private to the driver */
+                       __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
+/* dmi */
+enum dmi_field {
+       DMI_NONE,
+       DMI_BIOS_VENDOR,
+       DMI_BIOS_VERSION,
+       DMI_BIOS_DATE,
+       DMI_SYS_VENDOR,
+       DMI_PRODUCT_NAME,
+       DMI_PRODUCT_VERSION,
+       DMI_PRODUCT_SERIAL,
+       DMI_PRODUCT_UUID,
+       DMI_BOARD_VENDOR,
+       DMI_BOARD_NAME,
+       DMI_BOARD_VERSION,
+       DMI_BOARD_SERIAL,
+       DMI_BOARD_ASSET_TAG,
+       DMI_CHASSIS_VENDOR,
+       DMI_CHASSIS_TYPE,
+       DMI_CHASSIS_VERSION,
+       DMI_CHASSIS_SERIAL,
+       DMI_CHASSIS_ASSET_TAG,
+       DMI_STRING_MAX,
+};
+
+struct dmi_strmatch {
+       unsigned char slot;
+       char substr[79];
+};
+
+#ifndef __KERNEL__
+struct dmi_system_id {
+       kernel_ulong_t callback;
+       kernel_ulong_t ident;
+       struct dmi_strmatch matches[4];
+       kernel_ulong_t driver_data
+                       __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+#else
+struct dmi_system_id {
+       int (*callback)(const struct dmi_system_id *);
+       const char *ident;
+       struct dmi_strmatch matches[4];
+       void *driver_data;
+};
+/*
+ * struct dmi_device_id appears during expansion of
+ * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it
+ * but this is enough for gcc 3.4.6 to error out:
+ *     error: storage size of '__mod_dmi_device_table' isn't known
+ */
+#define dmi_device_id dmi_system_id
+#endif
+
+#define DMI_MATCH(a, b)        { a, b }
+
+#define PLATFORM_NAME_SIZE     20
+#define PLATFORM_MODULE_PREFIX "platform:"
+
+struct platform_device_id {
+       char name[PLATFORM_NAME_SIZE];
+       kernel_ulong_t driver_data
+                       __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
+#define MDIO_MODULE_PREFIX     "mdio:"
+
+#define MDIO_ID_FMT "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d"
+#define MDIO_ID_ARGS(_id) \
+       (_id)>>31, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1,   \
+       ((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \
+       ((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \
+       ((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \
+       ((_id)>>15) & 1, ((_id)>>14) & 1, ((_id)>>13) & 1, ((_id)>>12) & 1, \
+       ((_id)>>11) & 1, ((_id)>>10) & 1, ((_id)>>9) & 1, ((_id)>>8) & 1, \
+       ((_id)>>7) & 1, ((_id)>>6) & 1, ((_id)>>5) & 1, ((_id)>>4) & 1, \
+       ((_id)>>3) & 1, ((_id)>>2) & 1, ((_id)>>1) & 1, (_id) & 1
+
+/**
+ * struct mdio_device_id - identifies PHY devices on an MDIO/MII bus
+ * @phy_id: The result of
+ *     (mdio_read(&MII_PHYSID1) << 16 | mdio_read(&PHYSID2)) & @phy_id_mask
+ *     for this PHY type
+ * @phy_id_mask: Defines the significant bits of @phy_id.  A value of 0
+ *     is used to terminate an array of struct mdio_device_id.
+ */
+struct mdio_device_id {
+       __u32 phy_id;
+       __u32 phy_id_mask;
+};
+
+struct zorro_device_id {
+       __u32 id;                       /* Device ID or ZORRO_WILDCARD */
+       kernel_ulong_t driver_data;     /* Data private to the driver */
+};
+
+#define ZORRO_WILDCARD                 (0xffffffff)    /* not official */
+
+#define ZORRO_DEVICE_MODALIAS_FMT      "zorro:i%08X"
+
+#define ISAPNP_ANY_ID          0xffff
+struct isapnp_device_id {
+       unsigned short card_vendor, card_device;
+       unsigned short vendor, function;
+       kernel_ulong_t driver_data;     /* data private to the driver */
+};
+
 #endif /* LINUX_MOD_DEVICETABLE_H */