static int nouveau_platform_remove(struct platform_device *pdev) { struct drm_device *drm_dev = platform_get_drvdata(pdev); struct nouveau_device *device = nouveau_dev(drm_dev); struct nouveau_platform_gpu *gpu = nv_device_to_platform(device)->gpu; nouveau_drm_device_remove(drm_dev); return nouveau_platform_power_down(gpu); }
static int gk20a_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_object **pobject) { struct gk20a_volt_priv *priv; struct nvkm_volt *volt; struct nouveau_platform_device *plat; int i, ret, uv; ret = nvkm_volt_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); if (ret) return ret; volt = &priv->base; plat = nv_device_to_platform(nv_device(parent)); uv = regulator_get_voltage(plat->gpu->vdd); nv_info(priv, "The default voltage is %duV\n", uv); priv->vdd = plat->gpu->vdd; priv->base.vid_get = gk20a_volt_vid_get; priv->base.vid_set = gk20a_volt_vid_set; priv->base.set_id = gk20a_volt_set_id; volt->vid_nr = ARRAY_SIZE(gk20a_cvb_coef); nv_debug(priv, "%s - vid_nr = %d\n", __func__, volt->vid_nr); for (i = 0; i < volt->vid_nr; i++) { volt->vid[i].vid = i; volt->vid[i].uv = gk20a_volt_calc_voltage(&gk20a_cvb_coef[i], plat->gpu_speedo); nv_debug(priv, "%2d: vid=%d, uv=%d\n", i, volt->vid[i].vid, volt->vid[i].uv); } return 0; }