1. 10 7月, 2016 6 次提交
  2. 06 7月, 2016 2 次提交
  3. 05 7月, 2016 10 次提交
  4. 03 7月, 2016 21 次提交
  5. 01 7月, 2016 1 次提交
    • L
      iio: magn: ak8975: deploy runtime and system PM · cde4cb5d
      Linus Walleij 提交于
      This adds runtime PM support to the AK8975 driver. It solves two
      problems:
      
      - After reading the first value the chip was left in MODE_ONCE,
        meaning (presumably) it may be consuming more power. Now the
        runtime PM hooks kick in and set it to POWER_DOWN.
      
      - Regulators were simply enabled and left on, making it
        impossible to turn the power consuming regulators off because
        of the increased refcount. We now disable the regulators at
        autosuspend.
      
      - We also handle system suspend: by using pm_runtime_force_suspend()
        and pm_runtime_force_resume() from the system PM sleep hooks,
        the runtime PM code is managing the power also for this case.
        It is currently not completely optimal: when the system resumes
        the AK8975 goes into active mode even if noone is going to use
        it: currently the force calls need to be paired, but the runtime
        PM people are working on making it possible to leave devices
        runtime suspended when coming back from sleep.
      
      Inspired by my work on the BH1780 light sensor driver.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      cde4cb5d