tests/pm_rps: vlv: round middle point to freq supported by HW
authorImre Deak <imre.deak@intel.com>
Thu, 4 Dec 2014 15:23:05 +0000 (17:23 +0200)
committerImre Deak <imre.deak@intel.com>
Mon, 8 Dec 2014 10:36:59 +0000 (12:36 +0200)
commitb32b5327a20b3747890235c362b093439b854f59
treef3f1decaa39b14c1dafdd6cf6980b3115be79d64
parentf70afed4c7abd95fc3250141a1e36587e31f7c87
tests/pm_rps: vlv: round middle point to freq supported by HW

When setting the calculated middle frequency value the test assumes that
the HW/kernel rounds this value according to a 50MHz step value. This is
not so at least on VLV/CHV, on my B0 BYT-M for example this step value
is 22MHz, so there the test will fail.

To fix this get the nearest supported value by setting the target
frequency as a min or max frequency and read it back. The kernel will
round the returned value to the nearest supported.

v2:
- remove the 50MHz rounding that was done for non-VLV platforms, the new
  way of rounding should provide the correct value for all platforms
  (Ville)

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Imre Deak <imre.deak@intel.com>
tests/pm_rps.c