These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / gpu / drm / nouveau / nvkm / subdev / volt / nv40.c
index 0ac5a3f..2340938 100644 (file)
  *
  * Authors: Ben Skeggs
  */
-#include <subdev/volt.h>
+#include "priv.h"
 
-struct nv40_volt_priv {
-       struct nvkm_volt base;
+static const struct nvkm_volt_func
+nv40_volt = {
+       .vid_get = nvkm_voltgpio_get,
+       .vid_set = nvkm_voltgpio_set,
 };
 
-static int
-nv40_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
-              struct nvkm_oclass *oclass, void *data, u32 size,
-              struct nvkm_object **pobject)
+int
+nv40_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
 {
-       struct nv40_volt_priv *priv;
+       struct nvkm_volt *volt;
        int ret;
 
-       ret = nvkm_volt_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
+       ret = nvkm_volt_new_(&nv40_volt, device, index, &volt);
+       *pvolt = volt;
        if (ret)
                return ret;
 
-       return 0;
+       return nvkm_voltgpio_init(volt);
 }
-
-struct nvkm_oclass
-nv40_volt_oclass = {
-       .handle = NV_SUBDEV(VOLT, 0x40),
-       .ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = nv40_volt_ctor,
-               .dtor = _nvkm_volt_dtor,
-               .init = _nvkm_volt_init,
-               .fini = _nvkm_volt_fini,
-       },
-};