Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3c950f2 authored by Karol Herbst's avatar Karol Herbst Committed by Ben Skeggs
Browse files

drm/nouveau/volt: Add implementation for gf100



Since gf100 we need a speedo value for calculating the voltage. The readout
will be added in a later patch.

Signed-off-by: default avatarKarol Herbst <karolherbst@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 5c3b16ee
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,
		     int condition);

int nv40_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
int gf100_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 **);
+9 −8
Original line number Diff line number Diff line
@@ -1357,7 +1357,7 @@ nvc0_chipset = {
	.pmu = gf100_pmu_new,
	.therm = gt215_therm_new,
	.timer = nv41_timer_new,
	.volt = nv40_volt_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.ce[1] = gf100_ce_new,
	.disp = gt215_disp_new,
@@ -1394,7 +1394,7 @@ nvc1_chipset = {
	.pmu = gf100_pmu_new,
	.therm = gt215_therm_new,
	.timer = nv41_timer_new,
	.volt = nv40_volt_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.disp = gt215_disp_new,
	.dma = gf100_dma_new,
@@ -1430,7 +1430,7 @@ nvc3_chipset = {
	.pmu = gf100_pmu_new,
	.therm = gt215_therm_new,
	.timer = nv41_timer_new,
	.volt = nv40_volt_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.disp = gt215_disp_new,
	.dma = gf100_dma_new,
@@ -1466,7 +1466,7 @@ nvc4_chipset = {
	.pmu = gf100_pmu_new,
	.therm = gt215_therm_new,
	.timer = nv41_timer_new,
	.volt = nv40_volt_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.ce[1] = gf100_ce_new,
	.disp = gt215_disp_new,
@@ -1503,7 +1503,7 @@ nvc8_chipset = {
	.pmu = gf100_pmu_new,
	.therm = gt215_therm_new,
	.timer = nv41_timer_new,
	.volt = nv40_volt_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.ce[1] = gf100_ce_new,
	.disp = gt215_disp_new,
@@ -1540,7 +1540,7 @@ nvce_chipset = {
	.pmu = gf100_pmu_new,
	.therm = gt215_therm_new,
	.timer = nv41_timer_new,
	.volt = nv40_volt_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.ce[1] = gf100_ce_new,
	.disp = gt215_disp_new,
@@ -1577,7 +1577,7 @@ nvcf_chipset = {
	.pmu = gf100_pmu_new,
	.therm = gt215_therm_new,
	.timer = nv41_timer_new,
	.volt = nv40_volt_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.disp = gt215_disp_new,
	.dma = gf100_dma_new,
@@ -1612,6 +1612,7 @@ nvd7_chipset = {
	.pci = gf106_pci_new,
	.therm = gf119_therm_new,
	.timer = nv41_timer_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.disp = gf119_disp_new,
	.dma = gf119_dma_new,
@@ -1647,7 +1648,7 @@ nvd9_chipset = {
	.pmu = gf119_pmu_new,
	.therm = gf119_therm_new,
	.timer = nv41_timer_new,
	.volt = nv40_volt_new,
	.volt = gf100_volt_new,
	.ce[0] = gf100_ce_new,
	.disp = gf119_disp_new,
	.dma = gf119_dma_new,
+1 −0
Original line number Diff line number Diff line
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/gk104.o
nvkm-y += nvkm/subdev/volt/gk20a.o
nvkm-y += nvkm/subdev/volt/gm20b.o
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright 2016 Karol Herbst
 *
 * 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: Karol Herbst
 */
#include "priv.h"

static const struct nvkm_volt_func
gf100_volt = {
	.vid_get = nvkm_voltgpio_get,
	.vid_set = nvkm_voltgpio_set,
};

int
gf100_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
{
	struct nvkm_volt *volt;
	int ret;

	ret = nvkm_volt_new_(&gf100_volt, device, index, &volt);
	*pvolt = volt;
	if (ret)
		return ret;

	return nvkm_voltgpio_init(volt);
}