drm/nouveau/volt/gf117: fix speedo readout register
Subsystems (3)
PATCH v2 1/1 drm/nouveau/volt/gf117: fix speedo readout register
GF117 appears to use the same register as GK104 (but still with the general Fermi readout mechanism).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108980
---
v1 -> v2: split out different regid into separate file.
.../drm/nouveau/include/nvkm/subdev/volt.h | 1 + .../gpu/drm/nouveau/nvkm/engine/device/base.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/volt/Kbuild | 1 + .../gpu/drm/nouveau/nvkm/subdev/volt/gf117.c | 60 +++++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c
drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h +1 -0
@@ -38,6 +38,7 @@ int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,int nv40_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gf100_volt_new (struct nvkm_device *,int ,struct nvkm_volt **); +int gf117_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gk104_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gk20a_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gm20b_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +1 -1
@@ -1613,7 +1613,7 @@ nvd7_chipset = { .pci = gf106_pci_new, .therm = gf119_therm_new, .timer = nv41_timer_new, - .volt = gf100_volt_new, + .volt = gf117_volt_new, .ce[0] = gf100_ce_new, .disp = gf119_disp_new, .dma = gf119_dma_new,
drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild +1 -0
@@ -2,6 +2,7 @@ nvkm-y += nvkm/subdev/volt/base.o nvkm-y += nvkm/subdev/volt/gpio.o nvkm-y += nvkm/subdev/volt/nv40.o nvkm-y += nvkm/subdev/volt/gf100.o +nvkm-y += nvkm/subdev/volt/gf117.o nvkm-y += nvkm/subdev/volt/gk104.o nvkm-y += nvkm/subdev/volt/gk20a.o nvkm-y += nvkm/subdev/volt/gm20b.o
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c new file +60 -0
60 lines not on this page · raw message
Signature · 6 lines
2.19.2 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): 20190113225010.891-1-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]
Quoted 9 lines · Ilia Mirkin
GF117 appears to use the same register as GK104 (but still with the general Fermi readout mechanism).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108980
Signed-off-by Ilia Mirkin <[email protected]>---
v1 -> v2: split out different regid into separate file.
Merged. Thanks!
Quoted 114 lines
.../drm/nouveau/include/nvkm/subdev/volt.h | 1 + .../gpu/drm/nouveau/nvkm/engine/device/base.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/volt/Kbuild | 1 + .../gpu/drm/nouveau/nvkm/subdev/volt/gf117.c | 60 +++++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.cdrivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h +1
-0@@ -38,6 +38,7 @@ int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,int nv40_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gf100_volt_new (struct nvkm_device *,int ,struct nvkm_volt **); +int gf117_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gk104_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gk20a_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);int gm20b_volt_new (struct nvkm_device *,int ,struct nvkm_volt **);drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +1
-1@@ -1613,7 +1613,7 @@ nvd7_chipset = { .pci = gf106_pci_new, .therm = gf119_therm_new, .timer = nv41_timer_new, - .volt = gf100_volt_new, + .volt = gf117_volt_new, .ce[0] = gf100_ce_new, .disp = gf119_disp_new, .dma = gf119_dma_new,drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild +1
-0@@ -2,6 +2,7 @@ nvkm-y += nvkm/subdev/volt/base.o nvkm-y += nvkm/subdev/volt/gpio.o nvkm-y += nvkm/subdev/volt/nv40.o nvkm-y += nvkm/subdev/volt/gf100.o +nvkm-y += nvkm/subdev/volt/gf117.o nvkm-y += nvkm/subdev/volt/gk104.o nvkm-y += nvkm/subdev/volt/gk20a.o nvkm-y += nvkm/subdev/volt/gm20b.odrivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c new file +60
-1@@ -0,0 +1,60 @@ +/* +* Copyright 2019 Ilia Mirkin +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Authors: Ilia Mirkin +*/ +#include "priv.h" + +#include <subdev/fuse.h> + +static int +gf117_volt_speedo_read (struct nvkm_volt *volt) +{ +struct nvkm_device *device = volt->subdev.device; +struct nvkm_fuse *fuse = device->fuse; + +if (!fuse) +return -EINVAL ; + +return nvkm_fuse_read (fuse,0x3a8 ); +} + +static const struct nvkm_volt_func +gf117_volt = { + .oneinit = gf100_volt_oneinit, + .vid_get = nvkm_voltgpio_get, + .vid_set = nvkm_voltgpio_set, + .speedo_read = gf117_volt_speedo_read, +}; + +int +gf117_volt_new (struct nvkm_device *device,int index,struct nvkm_volt **pvolt) +{ +struct nvkm_volt *volt; +int ret; + + ret =nvkm_volt_new_ (&gf117_volt, device, index, &volt); + *pvolt = volt; +if (ret) +return ret; + +return nvkm_voltgpio_init (volt); +} --2.19.2
Quoted 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau