drm/nouveau/volt: Don't require perfect fit
authorKarol Herbst <karolherbst@gmail.com>
Tue, 12 Jul 2016 19:36:08 +0000 (21:36 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 12 Oct 2016 07:29:25 +0000 (17:29 +1000)
commit5e00e3263ba68bd32337063a43aa8467b27acd1d
tree57970a8bff5bebf7c47ac331d7906336c48ba455
parent4b9ce6e7b68683ac3874f9ebb243eb6f29c46812
drm/nouveau/volt: Don't require perfect fit

If we calculate the voltage in the table right, we get all kinds of values,
which never fit the hardware steps, so we use the closest higher value the
hardware can do.

v3: Simplify the implementation.
v5: Initialize best_err with volt->max_uv.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c