]> git.hungrycats.org Git - linux/commit
[driver model] Allow per-device shutdown or suspend on driver detach.
authorPatrick Mochel <mochel@osdl.org>
Thu, 14 Aug 2003 05:34:30 +0000 (22:34 -0700)
committerPatrick Mochel <mochel@osdl.org>
Thu, 14 Aug 2003 05:34:30 +0000 (22:34 -0700)
commit47149728061b93f44f39ae5e682c8d306c3469e7
tree46e262a2ae212f85d06d44e370f4bde3937f92a1
parent9bdbe787ab190da1ed2a54a62e25c705b7b566a5
[driver model] Allow per-device shutdown or suspend on driver detach.

- Add struct device::detach_state, which tells the core what state to put
  the device in when it's detached from its driver (on module removal).

  This is a value in the range of 0-4, with 0 being On and meaning 'Do
  Nothing', 4 being Off, meaing calling ->shutdown() for the device, and
  1-3 being low-power states, meaning call ->suspend() for the device.

- Add per-device sysfs file 'detach_state' to control the value of the
  field.

- Add device_device_shutdown() function, and call it from bus.c::
  device_detach_driver().
drivers/base/base.h
drivers/base/bus.c
drivers/base/core.c
drivers/base/interface.c
drivers/base/power/power.h
drivers/base/power/shutdown.c
include/linux/device.h