1. 06 Aug, 2003 8 commits
    • Patrick Mochel's avatar
      [power] Add PM info structure to struct device and PM registration functions. · 63dd56a0
      Patrick Mochel authored
      - struct device_pm_info 
        - Defined in include/linux/pm.h.
        - Statically allocated in struct device (->power)
        - Body is empty if CONFIG_PM=n
      
      - deivce_pm_{add,remove}
        - Called from device_{add,del} respectively.
        - Adds device to internal list of power managed objects and creates
          attribute group for device. 
          (Group currently empty, but placeholder directory is created for now)
        - Are defined as empty statc inline's when CONFIG_PM=n.
      63dd56a0
    • Patrick Mochel's avatar
      Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-core · 274e497b
      Patrick Mochel authored
      into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-power
      274e497b
    • Patrick Mochel's avatar
      [sysfs] Add attribute groups · 7bf68565
      Patrick Mochel authored
      Attribute groups provide the ability to register a set of sysfs attributes
      for a kobject all at once, and optionally create a subdirectory to hold 
      them.
      
      The constructs are simple:
                                                                                                               
      struct attribute_group {
              char                    * name;
              struct attribute        * attrs;
      };
      
      int sysfs_create_group(struct kobject *, struct attribute_group *);
      void sysfs_remove_group(struct kobject *, struct attribute_group *);
      
      
      If ->name is not NULL, then we create a subdirectory of that name to hold
      the attributes. We then iterate over ->attrs and create a file for each,
      in the subdirectory if we created one.
      
      This prevents one from having to register a kobject (and define a new
      kobj_type) to create a subdirectory for a group of attributes. Attributes
      currently defined in that way can be converted to use attribute_groups
      easily, with one caveat:
      
      The attributes that are added for a kobject, even if in a subdirectory,
      must be declared as the high-level attribute type (with an embedded struct
      attribute) for the kobject, and conform to the kobj_type's calling
      convention for reading/writing attributes.
      
      The kobject that you're creating attributes for owns the directory, and
      will assume ownership of the subdirectory. sysfs will reference this
      kobject, and it's kobj_type, when the attribute file is opened to
      determine the methods for reading/writing the attribute.
      
      sysfs will call the kobj_type's show()/store() methods, which will convert
      the kobject into a high-level object type, and convert the attribute into
      a high-level attribute type, which (depending on the kobj_type) is
      expected to have a show() and/or store() method.
      
      Note that this makes it only slightly easier to create attributes en masse,
      though it is a bit technically superior, since it doesn't require a new 
      kobj_type and kobject register. More will come in this area.. 
      7bf68565
    • Patrick Mochel's avatar
      [power] Split device PM functions · 2d7681a4
      Patrick Mochel authored
      - Create drivers/base/power/
      - Move drivers/base/power.c there.
      - Split into shutdown.c suspend.c and resume.c
      2d7681a4
    • Patrick Mochel's avatar
      [power] Move pm.c and mark functions depcrecated. · f670dfba
      Patrick Mochel authored
      - Move kernel/pm.c to kernel/power/pm.c 
      - Move poweroff sysrq registration to kernel/power/poweroff.c
      - Mark pm_* functions deprecated to prevent new uers. 
      f670dfba
    • Patrick Mochel's avatar
      [power] Fix #ifdef in ACPI sleep code. · 49bb8042
      Patrick Mochel authored
      Remove dependency on CONFIG_SOFTWARE_SUSPEND, since CONFIG_ACPI_SLEEP is 
      sufficient. 
      
      From Pavel Machek.
      49bb8042
    • Patrick Mochel's avatar
      [power] Fix some incorrect comments. · 0bc118af
      Patrick Mochel authored
      From Pavel Machek.
      0bc118af
    • Patrick Mochel's avatar
      Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin · 1ab04085
      Patrick Mochel authored
      into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-power
      1ab04085
  2. 05 Aug, 2003 32 commits