spi-topcliff-pch: add recovery processing in case wait-event timeout
[zen-stable.git] / arch / mips / include / asm / gio_device.h
blob5437c84664bfc80bb15901442b080c3753186163
1 #include <linux/device.h>
2 #include <linux/mod_devicetable.h>
4 struct gio_device_id {
5 __u8 id;
6 };
8 struct gio_device {
9 struct device dev;
10 struct resource resource;
11 unsigned int irq;
12 unsigned int slotno;
14 const char *name;
15 struct gio_device_id id;
16 unsigned id32:1;
17 unsigned gio64:1;
19 #define to_gio_device(d) container_of(d, struct gio_device, dev)
21 struct gio_driver {
22 const char *name;
23 struct module *owner;
24 const struct gio_device_id *id_table;
26 int (*probe)(struct gio_device *, const struct gio_device_id *);
27 void (*remove)(struct gio_device *);
28 int (*suspend)(struct gio_device *, pm_message_t);
29 int (*resume)(struct gio_device *);
30 void (*shutdown)(struct gio_device *);
32 struct device_driver driver;
34 #define to_gio_driver(drv) container_of(drv, struct gio_driver, driver)
36 extern const struct gio_device_id *gio_match_device(const struct gio_device_id *,
37 const struct gio_device *);
38 extern struct gio_device *gio_dev_get(struct gio_device *);
39 extern void gio_dev_put(struct gio_device *);
41 extern int gio_device_register(struct gio_device *);
42 extern void gio_device_unregister(struct gio_device *);
43 extern void gio_release_dev(struct device *);
45 static inline void gio_device_free(struct gio_device *dev)
47 gio_release_dev(&dev->dev);
50 extern int gio_register_driver(struct gio_driver *);
51 extern void gio_unregister_driver(struct gio_driver *);
53 #define gio_get_drvdata(_dev) drv_get_drvdata(&(_dev)->dev)
54 #define gio_set_drvdata(_dev, data) drv_set_drvdata(&(_dev)->dev, (data))
56 extern void gio_set_master(struct gio_device *);