static int
nvkm_volt_set(struct nvkm_volt *volt, u32 uv)
{
+ struct nvkm_subdev *subdev = &volt->subdev;
if (volt->vid_set) {
int i, ret = -EINVAL;
for (i = 0; i < volt->vid_nr; i++) {
if (volt->vid[i].uv == uv) {
ret = volt->vid_set(volt, volt->vid[i].vid);
- nv_debug(volt, "set %duv: %d\n", uv, ret);
+ nvkm_debug(subdev, "set %duv: %d\n", uv, ret);
break;
}
}
_nvkm_volt_init(struct nvkm_object *object)
{
struct nvkm_volt *volt = (void *)object;
+ struct nvkm_subdev *subdev = &volt->subdev;
int ret;
ret = nvkm_subdev_init(&volt->subdev);
ret = volt->get(volt);
if (ret < 0) {
if (ret != -ENODEV)
- nv_debug(volt, "current voltage unknown\n");
+ nvkm_debug(subdev, "current voltage unknown\n");
return 0;
}
- nv_info(volt, "GPU voltage: %duv\n", ret);
+ nvkm_debug(subdev, "current voltage: %duv\n", ret);
return 0;
}
nvkm_volt_create_(struct nvkm_object *parent, struct nvkm_object *engine,
struct nvkm_oclass *oclass, int length, void **pobject)
{
- struct nvkm_bios *bios = nvkm_bios(parent);
+ struct nvkm_device *device = (void *)parent;
+ struct nvkm_bios *bios = device->bios;
struct nvkm_volt *volt;
int ret, i;
if (volt->vid_nr) {
for (i = 0; i < volt->vid_nr; i++) {
- nv_debug(volt, "VID %02x: %duv\n",
- volt->vid[i].vid, volt->vid[i].uv);
+ nvkm_debug(&volt->subdev, "VID %02x: %duv\n",
+ volt->vid[i].vid, volt->vid[i].uv);
}
/*XXX: this is an assumption.. there probably exists boards
gk20a_volt_vid_set(struct nvkm_volt *obj, u8 vid)
{
struct gk20a_volt *volt = container_of(obj, typeof(*volt), base);
+ struct nvkm_subdev *subdev = &volt->base.subdev;
- nv_debug(volt, "set voltage as %duv\n", volt->base.vid[vid].uv);
+ nvkm_debug(subdev, "set voltage as %duv\n", volt->base.vid[vid].uv);
return regulator_set_voltage(volt->vdd, volt->base.vid[vid].uv, 1200000);
}
gk20a_volt_set_id(struct nvkm_volt *obj, u8 id, int condition)
{
struct gk20a_volt *volt = container_of(obj, typeof(*volt), base);
+ struct nvkm_subdev *subdev = &volt->base.subdev;
int prev_uv = regulator_get_voltage(volt->vdd);
int target_uv = volt->base.vid[id].uv;
int ret;
- nv_debug(volt, "prev=%d, target=%d, condition=%d\n",
- prev_uv, target_uv, condition);
+ nvkm_debug(subdev, "prev=%d, target=%d, condition=%d\n",
+ prev_uv, target_uv, condition);
if (!condition ||
(condition < 0 && target_uv < prev_uv) ||
(condition > 0 && target_uv > prev_uv)) {
plat = nv_device_to_platform(nv_device(parent));
uv = regulator_get_voltage(plat->gpu->vdd);
- nv_info(volt, "The default voltage is %duV\n", uv);
+ nvkm_info(&volt->base.subdev, "The default voltage is %duV\n", uv);
volt->vdd = plat->gpu->vdd;
volt->base.vid_get = gk20a_volt_vid_get;
volt->base.set_id = gk20a_volt_set_id;
volt->base.vid_nr = ARRAY_SIZE(gk20a_cvb_coef);
- nv_debug(volt, "%s - vid_nr = %d\n", __func__, volt->base.vid_nr);
+ nvkm_debug(&volt->base.subdev, "%s - vid_nr = %d\n", __func__,
+ volt->base.vid_nr);
for (i = 0; i < volt->base.vid_nr; i++) {
volt->base.vid[i].vid = i;
volt->base.vid[i].uv =
gk20a_volt_calc_voltage(&gk20a_cvb_coef[i],
plat->gpu_speedo);
- nv_debug(volt, "%2d: vid=%d, uv=%d\n", i,
- volt->base.vid[i].vid, volt->base.vid[i].uv);
+ nvkm_debug(&volt->base.subdev, "%2d: vid=%d, uv=%d\n", i,
+ volt->base.vid[i].vid, volt->base.vid[i].uv);
}
return 0;