CHROMIUM: MALI: More properly handle missing regulators

The mali code makes some attempt to work without regulators but it's
definitely wonky.  Let's clean it up.  Specifically:

1. We'll use regulator_get() instead of regulator_get_optional().
   This causes the regulator framework to create a dummy regulator for
   us that we can safely enable/disable and is there specifically to
   avoid the need for special cases like this.  When the framework
   creates a dummy it nicely prints to the logs so you're aware of it,
   like: "ffa30000.gpu supply bogus not found, using dummy regulator"
2. We know regulator_get() won't return NULL so don't check for it.
   The old code wouldn't have worked right if regulator_get_optional()
   had returned NULL since the PTR_ERR() call below wouldn't have made
   sense.
3. In general we don't want to print about EPROBE_DEFER errors, so
   let's not do that.  ...and, in fact, now that we're using
   regulator_get() we no longer _expect_ any errors, so we end up
   totally inverting the old "if" test for when to print errors.
4. If a regulator is missing (or was replaced with a dummy) then
   dev_opp_table will fail to init.  When that happened we didn't
   crash but we'd keep spewing "core: dev_pm_opp_get_voltage_supply:
   Invalid supply index" all the time.  Let's fix it to just not init
   devfreq in this case since (I believe) devfreq makes no real sense
   without a regulator.

BUG=chromium:941638
TEST=devfreq works OK on veyron still
TEST=Add 'supply-names = "mali", "bogus";' to veyron and look at dmesg

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1544030
(cherry-picked from c335bdf220e40540fc0c5913f1e07fb43d986467)
[drinkcat: Rebased on r20p0:
 - Significant core changes, we do not use the default regulator
   names and fetch them from device tree instead.
 - Point 3 is obsolete now (the core was properly checking for
   EPROBE_DEFER, yeay!
 - Restore opp_table check.
]

Change-Id: Id1d242908ee972f153651df525101b8c1a40434f
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
2 files changed