Skip to content

Commit 03e67ed

Browse files
imirkingregkh
authored andcommitted
drm/nouveau/volt/gf117: fix speedo readout register
[ Upstream commit fc78224 ] 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]> Signed-off-by: Ben Skeggs <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a68ee10 commit 03e67ed

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,
3838

3939
int nv40_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
4040
int gf100_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
41+
int gf117_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
4142
int gk104_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
4243
int gk20a_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
4344
int gm20b_volt_new(struct nvkm_device *, int, struct nvkm_volt **);

drivers/gpu/drm/nouveau/nvkm/engine/device/base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ nvd7_chipset = {
16121612
.pci = gf106_pci_new,
16131613
.therm = gf119_therm_new,
16141614
.timer = nv41_timer_new,
1615-
.volt = gf100_volt_new,
1615+
.volt = gf117_volt_new,
16161616
.ce[0] = gf100_ce_new,
16171617
.disp = gf119_disp_new,
16181618
.dma = gf119_dma_new,

drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ nvkm-y += nvkm/subdev/volt/base.o
22
nvkm-y += nvkm/subdev/volt/gpio.o
33
nvkm-y += nvkm/subdev/volt/nv40.o
44
nvkm-y += nvkm/subdev/volt/gf100.o
5+
nvkm-y += nvkm/subdev/volt/gf117.o
56
nvkm-y += nvkm/subdev/volt/gk104.o
67
nvkm-y += nvkm/subdev/volt/gk20a.o
78
nvkm-y += nvkm/subdev/volt/gm20b.o
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright 2019 Ilia Mirkin
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
* OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* Authors: Ilia Mirkin
23+
*/
24+
#include "priv.h"
25+
26+
#include <subdev/fuse.h>
27+
28+
static int
29+
gf117_volt_speedo_read(struct nvkm_volt *volt)
30+
{
31+
struct nvkm_device *device = volt->subdev.device;
32+
struct nvkm_fuse *fuse = device->fuse;
33+
34+
if (!fuse)
35+
return -EINVAL;
36+
37+
return nvkm_fuse_read(fuse, 0x3a8);
38+
}
39+
40+
static const struct nvkm_volt_func
41+
gf117_volt = {
42+
.oneinit = gf100_volt_oneinit,
43+
.vid_get = nvkm_voltgpio_get,
44+
.vid_set = nvkm_voltgpio_set,
45+
.speedo_read = gf117_volt_speedo_read,
46+
};
47+
48+
int
49+
gf117_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
50+
{
51+
struct nvkm_volt *volt;
52+
int ret;
53+
54+
ret = nvkm_volt_new_(&gf117_volt, device, index, &volt);
55+
*pvolt = volt;
56+
if (ret)
57+
return ret;
58+
59+
return nvkm_voltgpio_init(volt);
60+
}

0 commit comments

Comments
 (0)