CHROMIUM: MALI: Fix extra regulator_disable/enable for rk

When you try to do a suspend on a Rockchip Chromebook you get an error
message in the logs saying that we were unable to disable a regulator.
  mali ffa30000.gpu: Power off reg 0 failed error = -22

This is because we try to disable our regulator twice.  Specifically
see that the last line in rk_pm_callback_power_off() turns the
regulator off and then we do it again in rk_pm_suspend_callback().

Let's get rid of the extra call and get rid of the matching one in resume.

NOTE: without this patch if you do:
  grep gpu /sys/kernel/debug/regulator/regulator_summary

...at the login screen you will see the gpu regulator toggle between 0
and 1 at first bootup and then after the first suspend/resume it will
toggle between 1 and 2.  That's because the first "disable" is ignored
but then we re-enable it.  That means after the first suspend/resume
we end up with a persistent count of 1.  After this patch the count
looks better.

Also note that the difference here is mostly academic.  The GPU
regulator is marked "always on" and is only turned off (due to
regulator properties) at suspend time.

BUG=chromium:941638
TEST=gpu works both before and after s2r

Change-Id: I3e6524558e14ce809de3c2bbf2feafdb085593d0
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1554994
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
1 file changed