]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/device.h
Introduce new top level suspend and hibernation callbacks
[linux-2.6-omap-h63xx.git] / include / linux / device.h
index 832fb0eb293368793cef2565db179a333907c09d..f71a78d123aef9d7b3b03276921d10286e1eceed 100644 (file)
@@ -68,6 +68,8 @@ struct bus_type {
        int (*resume_early)(struct device *dev);
        int (*resume)(struct device *dev);
 
+       struct pm_ext_ops *pm;
+
        struct bus_type_private *p;
 };
 
@@ -131,6 +133,8 @@ struct device_driver {
        int (*resume) (struct device *dev);
        struct attribute_group **groups;
 
+       struct pm_ops *pm;
+
        struct driver_private *p;
 };
 
@@ -183,7 +187,6 @@ struct class {
        struct module           *owner;
 
        struct kset             subsys;
-       struct list_head        children;
        struct list_head        devices;
        struct list_head        interfaces;
        struct kset             class_dirs;
@@ -198,6 +201,8 @@ struct class {
 
        int (*suspend)(struct device *dev, pm_message_t state);
        int (*resume)(struct device *dev);
+
+       struct pm_ops *pm;
 };
 
 extern int __must_check class_register(struct class *class);
@@ -249,8 +254,11 @@ struct device_type {
        struct attribute_group **groups;
        int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
        void (*release)(struct device *dev);
+
        int (*suspend)(struct device *dev, pm_message_t state);
        int (*resume)(struct device *dev);
+
+       struct pm_ops *pm;
 };
 
 /* interface for exporting device attributes */
@@ -380,6 +388,15 @@ struct device {
 /* Get the wakeup routines, which depend on struct device */
 #include <linux/pm_wakeup.h>
 
+static inline const char *dev_name(struct device *dev)
+{
+       /* will be changed into kobject_name(&dev->kobj) in the near future */
+       return dev->bus_id;
+}
+
+extern int dev_set_name(struct device *dev, const char *name, ...)
+                       __attribute__((format(printf, 2, 3)));
+
 #ifdef CONFIG_NUMA
 static inline int dev_to_node(struct device *dev)
 {
@@ -444,9 +461,21 @@ extern int __must_check device_reprobe(struct device *dev);
 /*
  * Easy functions for dynamically creating devices on the fly
  */
+extern struct device *device_create_vargs(struct class *cls,
+                                         struct device *parent,
+                                         dev_t devt,
+                                         void *drvdata,
+                                         const char *fmt,
+                                         va_list vargs);
 extern struct device *device_create(struct class *cls, struct device *parent,
                                    dev_t devt, const char *fmt, ...)
                                    __attribute__((format(printf, 4, 5)));
+extern struct device *device_create_drvdata(struct class *cls,
+                                           struct device *parent,
+                                           dev_t devt,
+                                           void *drvdata,
+                                           const char *fmt, ...)
+                                   __attribute__((format(printf, 5, 6)));
 extern void device_destroy(struct class *cls, dev_t devt);
 
 /*
@@ -478,7 +507,7 @@ extern void sysdev_shutdown(void);
 extern const char *dev_driver_string(struct device *dev);
 #define dev_printk(level, dev, format, arg...) \
        printk(level "%s %s: " format , dev_driver_string(dev) , \
-              (dev)->bus_id , ## arg)
+              dev_name(dev) , ## arg)
 
 #define dev_emerg(dev, format, arg...)         \
        dev_printk(KERN_EMERG , dev , format , ## arg)