stm class: Add runtime power management handling
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Tue, 28 Jun 2016 08:35:02 +0000 (11:35 +0300)
committerAlexander Shishkin <alexander.shishkin@linux.intel.com>
Fri, 1 Jul 2016 08:00:14 +0000 (11:00 +0300)
commit8e0469a4f3e647059c0ef8db961140ee25246fbd
treee98b5e24ba140a035f3e36243a041788dcd83009
parentaf8c34ce6ae32addda3788d54a7e340cad22516b
stm class: Add runtime power management handling

Currently, there's no runtime pm in stm class devices, which makes it
harder for the underlying hardware drivers to handle their power
management.

This patch applies the following runtime pm policy to stm class devices,
which their parents can rely on for their power management tracking:

  * device is in use during character device writes,
  * delayed autosuspend is used to keep it active between adjacent
  writes,
  * device is in use while mmio regions are mapped,
  * device is is use while any stm_source devices are linked to it.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Chunyan Zhang <zhang.chunyan@linaro.org>
drivers/hwtracing/stm/core.c