drm/nouveau/volt: switch to instanced constructor
authorBen Skeggs <bskeggs@redhat.com>
Fri, 4 Dec 2020 02:58:05 +0000 (12:58 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 11 Feb 2021 01:49:55 +0000 (11:49 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
14 files changed:
drivers/gpu/drm/nouveau/include/nvkm/core/device.h
drivers/gpu/drm/nouveau/include/nvkm/core/layout.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h
drivers/gpu/drm/nouveau/nvkm/core/subdev.c
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.h
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gm20b.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/nv40.c
drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h

index 032a38b..9ffec22 100644 (file)
@@ -60,8 +60,6 @@ struct nvkm_device {
                struct notifier_block nb;
        } acpi;
 
-       struct nvkm_volt *volt;
-
        struct nvkm_engine *bsp;
        struct nvkm_engine *ce[9];
        struct nvkm_engine *cipher;
@@ -124,7 +122,6 @@ struct nvkm_device_chip {
 #include <core/layout.h>
 #undef NVKM_LAYOUT_INST
 #undef NVKM_LAYOUT_ONCE
-       int (*volt    )(struct nvkm_device *, int idx, struct nvkm_volt **);
 
        int (*bsp     )(struct nvkm_device *, int idx, struct nvkm_engine **);
        int (*ce[9]   )(struct nvkm_device *, int idx, struct nvkm_engine **);
index 4160716..39bc036 100644 (file)
@@ -19,6 +19,7 @@ NVKM_LAYOUT_ONCE(NVKM_SUBDEV_BAR     , struct nvkm_bar     ,      bar)
 NVKM_LAYOUT_ONCE(NVKM_SUBDEV_FAULT   , struct nvkm_fault   ,    fault)
 NVKM_LAYOUT_ONCE(NVKM_SUBDEV_ACR     , struct nvkm_acr     ,      acr)
 NVKM_LAYOUT_ONCE(NVKM_SUBDEV_PMU     , struct nvkm_pmu     ,      pmu)
+NVKM_LAYOUT_ONCE(NVKM_SUBDEV_VOLT    , struct nvkm_volt    ,     volt)
 NVKM_LAYOUT_ONCE(NVKM_SUBDEV_ICCSENSE, struct nvkm_iccsense, iccsense)
 NVKM_LAYOUT_ONCE(NVKM_SUBDEV_THERM   , struct nvkm_therm   ,    therm)
 NVKM_LAYOUT_ONCE(NVKM_SUBDEV_CLK     , struct nvkm_clk     ,      clk)
index 45053a2..0be86d5 100644 (file)
@@ -36,10 +36,10 @@ int nvkm_volt_get(struct nvkm_volt *);
 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 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 **);
+int nv40_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
+int gf100_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
+int gf117_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
+int gk104_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
+int gk20a_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
+int gm20b_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
 #endif
index db5e75d..e91b1c3 100644 (file)
@@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = {
 #include <core/layout.h>
 #undef NVKM_LAYOUT_ONCE
 #undef NVKM_LAYOUT_INST
-       [NVKM_SUBDEV_VOLT    ] = "volt",
        [NVKM_ENGINE_BSP     ] = "bsp",
        [NVKM_ENGINE_CE0     ] = "ce0",
        [NVKM_ENGINE_CE1     ] = "ce1",
index 49057c4..e605ea5 100644 (file)
@@ -485,7 +485,7 @@ nv40_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv40_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -511,7 +511,7 @@ nv41_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -537,7 +537,7 @@ nv42_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -563,7 +563,7 @@ nv43_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -589,7 +589,7 @@ nv44_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -615,7 +615,7 @@ nv45_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -641,7 +641,7 @@ nv46_chipset = {
        .pci      = { 0x00000001, nv46_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -667,7 +667,7 @@ nv47_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -693,7 +693,7 @@ nv49_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -719,7 +719,7 @@ nv4a_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -745,7 +745,7 @@ nv4b_chipset = {
        .pci      = { 0x00000001, nv40_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -771,7 +771,7 @@ nv4c_chipset = {
        .pci      = { 0x00000001, nv4c_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -797,7 +797,7 @@ nv4e_chipset = {
        .pci      = { 0x00000001, nv4c_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -826,7 +826,7 @@ nv50_chipset = {
        .pci      = { 0x00000001, nv46_pci_new },
        .therm    = { 0x00000001, nv50_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv50_disp_new,
        .dma = nv50_dma_new,
        .fifo = nv50_fifo_new,
@@ -852,7 +852,7 @@ nv63_chipset = {
        .pci      = { 0x00000001, nv4c_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -878,7 +878,7 @@ nv67_chipset = {
        .pci      = { 0x00000001, nv4c_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -904,7 +904,7 @@ nv68_chipset = {
        .pci      = { 0x00000001, nv4c_pci_new },
        .therm    = { 0x00000001, nv40_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = nv04_disp_new,
        .dma = nv04_dma_new,
        .fifo = nv40_fifo_new,
@@ -933,7 +933,7 @@ nv84_chipset = {
        .pci      = { 0x00000001, g84_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .bsp = g84_bsp_new,
        .cipher = g84_cipher_new,
        .disp = g84_disp_new,
@@ -965,7 +965,7 @@ nv86_chipset = {
        .pci      = { 0x00000001, g84_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .bsp = g84_bsp_new,
        .cipher = g84_cipher_new,
        .disp = g84_disp_new,
@@ -997,7 +997,7 @@ nv92_chipset = {
        .pci      = { 0x00000001, g92_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .bsp = g84_bsp_new,
        .cipher = g84_cipher_new,
        .disp = g84_disp_new,
@@ -1029,7 +1029,7 @@ nv94_chipset = {
        .pci      = { 0x00000001, g94_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .bsp = g84_bsp_new,
        .cipher = g84_cipher_new,
        .disp = g94_disp_new,
@@ -1061,7 +1061,7 @@ nv96_chipset = {
        .pci      = { 0x00000001, g94_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .bsp = g84_bsp_new,
        .cipher = g84_cipher_new,
        .disp = g94_disp_new,
@@ -1093,7 +1093,7 @@ nv98_chipset = {
        .pci      = { 0x00000001, g94_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = g94_disp_new,
        .dma = nv50_dma_new,
        .fifo = g84_fifo_new,
@@ -1125,7 +1125,7 @@ nva0_chipset = {
        .pci      = { 0x00000001, g94_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .bsp = g84_bsp_new,
        .cipher = g84_cipher_new,
        .disp = gt200_disp_new,
@@ -1158,7 +1158,7 @@ nva3_chipset = {
        .pmu      = { 0x00000001, gt215_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .ce[0] = gt215_ce_new,
        .disp = gt215_disp_new,
        .dma = nv50_dma_new,
@@ -1192,7 +1192,7 @@ nva5_chipset = {
        .pmu      = { 0x00000001, gt215_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .ce[0] = gt215_ce_new,
        .disp = gt215_disp_new,
        .dma = nv50_dma_new,
@@ -1225,7 +1225,7 @@ nva8_chipset = {
        .pmu      = { 0x00000001, gt215_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .ce[0] = gt215_ce_new,
        .disp = gt215_disp_new,
        .dma = nv50_dma_new,
@@ -1257,7 +1257,7 @@ nvaa_chipset = {
        .pci      = { 0x00000001, g94_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = mcp77_disp_new,
        .dma = nv50_dma_new,
        .fifo = g84_fifo_new,
@@ -1289,7 +1289,7 @@ nvac_chipset = {
        .pci      = { 0x00000001, g94_pci_new },
        .therm    = { 0x00000001, g84_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .disp = mcp77_disp_new,
        .dma = nv50_dma_new,
        .fifo = g84_fifo_new,
@@ -1322,7 +1322,7 @@ nvaf_chipset = {
        .pmu      = { 0x00000001, gt215_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = nv40_volt_new,
+       .volt     = { 0x00000001, nv40_volt_new },
        .ce[0] = gt215_ce_new,
        .disp = mcp89_disp_new,
        .dma = nv50_dma_new,
@@ -1358,7 +1358,7 @@ nvc0_chipset = {
        .pmu      = { 0x00000001, gf100_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf100_volt_new,
+       .volt     = { 0x00000001, gf100_volt_new },
        .ce[0] = gf100_ce_new,
        .ce[1] = gf100_ce_new,
        .disp = gt215_disp_new,
@@ -1395,7 +1395,7 @@ nvc1_chipset = {
        .pmu      = { 0x00000001, gf100_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf100_volt_new,
+       .volt     = { 0x00000001, gf100_volt_new },
        .ce[0] = gf100_ce_new,
        .disp = gt215_disp_new,
        .dma = gf100_dma_new,
@@ -1431,7 +1431,7 @@ nvc3_chipset = {
        .pmu      = { 0x00000001, gf100_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf100_volt_new,
+       .volt     = { 0x00000001, gf100_volt_new },
        .ce[0] = gf100_ce_new,
        .disp = gt215_disp_new,
        .dma = gf100_dma_new,
@@ -1467,7 +1467,7 @@ nvc4_chipset = {
        .pmu      = { 0x00000001, gf100_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf100_volt_new,
+       .volt     = { 0x00000001, gf100_volt_new },
        .ce[0] = gf100_ce_new,
        .ce[1] = gf100_ce_new,
        .disp = gt215_disp_new,
@@ -1504,7 +1504,7 @@ nvc8_chipset = {
        .pmu      = { 0x00000001, gf100_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf100_volt_new,
+       .volt     = { 0x00000001, gf100_volt_new },
        .ce[0] = gf100_ce_new,
        .ce[1] = gf100_ce_new,
        .disp = gt215_disp_new,
@@ -1541,7 +1541,7 @@ nvce_chipset = {
        .pmu      = { 0x00000001, gf100_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf100_volt_new,
+       .volt     = { 0x00000001, gf100_volt_new },
        .ce[0] = gf100_ce_new,
        .ce[1] = gf100_ce_new,
        .disp = gt215_disp_new,
@@ -1578,7 +1578,7 @@ nvcf_chipset = {
        .pmu      = { 0x00000001, gf100_pmu_new },
        .therm    = { 0x00000001, gt215_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf100_volt_new,
+       .volt     = { 0x00000001, gf100_volt_new },
        .ce[0] = gf100_ce_new,
        .disp = gt215_disp_new,
        .dma = gf100_dma_new,
@@ -1613,7 +1613,7 @@ nvd7_chipset = {
        .pci      = { 0x00000001, gf106_pci_new },
        .therm    = { 0x00000001, gf119_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf117_volt_new,
+       .volt     = { 0x00000001, gf117_volt_new },
        .ce[0] = gf100_ce_new,
        .disp = gf119_disp_new,
        .dma = gf119_dma_new,
@@ -1649,7 +1649,7 @@ nvd9_chipset = {
        .pmu      = { 0x00000001, gf119_pmu_new },
        .therm    = { 0x00000001, gf119_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
-       .volt = gf100_volt_new,
+       .volt     = { 0x00000001, gf100_volt_new },
        .ce[0] = gf100_ce_new,
        .disp = gf119_disp_new,
        .dma = gf119_dma_new,
@@ -1686,7 +1686,7 @@ nve4_chipset = {
        .therm    = { 0x00000001, gk104_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gk104_ce_new,
        .ce[1] = gk104_ce_new,
        .ce[2] = gk104_ce_new,
@@ -1725,7 +1725,7 @@ nve6_chipset = {
        .therm    = { 0x00000001, gk104_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gk104_ce_new,
        .ce[1] = gk104_ce_new,
        .ce[2] = gk104_ce_new,
@@ -1764,7 +1764,7 @@ nve7_chipset = {
        .therm    = { 0x00000001, gk104_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gk104_ce_new,
        .ce[1] = gk104_ce_new,
        .ce[2] = gk104_ce_new,
@@ -1795,7 +1795,7 @@ nvea_chipset = {
        .pmu      = { 0x00000001, gk20a_pmu_new },
        .timer    = { 0x00000001, gk20a_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk20a_volt_new,
+       .volt     = { 0x00000001, gk20a_volt_new },
        .ce[2] = gk104_ce_new,
        .dma = gf119_dma_new,
        .fifo = gk20a_fifo_new,
@@ -1828,7 +1828,7 @@ nvf0_chipset = {
        .therm    = { 0x00000001, gk104_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gk104_ce_new,
        .ce[1] = gk104_ce_new,
        .ce[2] = gk104_ce_new,
@@ -1866,7 +1866,7 @@ nvf1_chipset = {
        .therm    = { 0x00000001, gk104_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gk104_ce_new,
        .ce[1] = gk104_ce_new,
        .ce[2] = gk104_ce_new,
@@ -1904,7 +1904,7 @@ nv106_chipset = {
        .therm    = { 0x00000001, gk104_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gk104_ce_new,
        .ce[1] = gk104_ce_new,
        .ce[2] = gk104_ce_new,
@@ -1942,7 +1942,7 @@ nv108_chipset = {
        .therm    = { 0x00000001, gk104_therm_new },
        .timer    = { 0x00000001, nv41_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gk104_ce_new,
        .ce[1] = gk104_ce_new,
        .ce[2] = gk104_ce_new,
@@ -1980,7 +1980,7 @@ nv117_chipset = {
        .therm    = { 0x00000001, gm107_therm_new },
        .timer    = { 0x00000001, gk20a_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gm107_ce_new,
        .ce[2] = gm107_ce_new,
        .disp = gm107_disp_new,
@@ -2016,7 +2016,7 @@ nv118_chipset = {
        .therm    = { 0x00000001, gm107_therm_new },
        .timer    = { 0x00000001, gk20a_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gm107_ce_new,
        .ce[2] = gm107_ce_new,
        .disp = gm107_disp_new,
@@ -2050,7 +2050,7 @@ nv120_chipset = {
        .therm    = { 0x00000001, gm200_therm_new },
        .timer    = { 0x00000001, gk20a_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gm200_ce_new,
        .ce[1] = gm200_ce_new,
        .ce[2] = gm200_ce_new,
@@ -2088,7 +2088,7 @@ nv124_chipset = {
        .therm    = { 0x00000001, gm200_therm_new },
        .timer    = { 0x00000001, gk20a_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gm200_ce_new,
        .ce[1] = gm200_ce_new,
        .ce[2] = gm200_ce_new,
@@ -2126,7 +2126,7 @@ nv126_chipset = {
        .therm    = { 0x00000001, gm200_therm_new },
        .timer    = { 0x00000001, gk20a_timer_new },
        .top      = { 0x00000001, gk104_top_new },
-       .volt = gk104_volt_new,
+       .volt     = { 0x00000001, gk104_volt_new },
        .ce[0] = gm200_ce_new,
        .ce[1] = gm200_ce_new,
        .ce[2] = gm200_ce_new,
@@ -2156,8 +2156,8 @@ nv12b_chipset = {
        .pmu      = { 0x00000001, gm20b_pmu_new },
        .timer    = { 0x00000001, gk20a_timer_new },
        .top      = { 0x00000001, gk104_top_new },
+       .volt     = { 0x00000001, gm20b_volt_new },
        .ce[2] = gm200_ce_new,
-       .volt = gm20b_volt_new,
        .dma = gf119_dma_new,
        .fifo = gm20b_fifo_new,
        .gr = gm20b_gr_new,
@@ -3248,7 +3248,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
 #include <core/layout.h>
 #undef NVKM_LAYOUT_INST
 #undef NVKM_LAYOUT_ONCE
-               _(NVKM_SUBDEV_VOLT    ,     volt);
                _(NVKM_ENGINE_BSP     ,      bsp);
                _(NVKM_ENGINE_CE0     ,    ce[0]);
                _(NVKM_ENGINE_CE1     ,    ce[1]);
index e344901..a17a6dd 100644 (file)
@@ -281,12 +281,12 @@ nvkm_volt = {
 
 void
 nvkm_volt_ctor(const struct nvkm_volt_func *func, struct nvkm_device *device,
-              int index, struct nvkm_volt *volt)
+              enum nvkm_subdev_type type, int inst, struct nvkm_volt *volt)
 {
        struct nvkm_bios *bios = device->bios;
        int i;
 
-       nvkm_subdev_ctor(&nvkm_volt, device, index, &volt->subdev);
+       nvkm_subdev_ctor(&nvkm_volt, device, type, inst, &volt->subdev);
        volt->func = func;
 
        /* Assuming the non-bios device should build the voltage table later */
@@ -319,10 +319,10 @@ nvkm_volt_ctor(const struct nvkm_volt_func *func, struct nvkm_device *device,
 
 int
 nvkm_volt_new_(const struct nvkm_volt_func *func, struct nvkm_device *device,
-              int index, struct nvkm_volt **pvolt)
+              enum nvkm_subdev_type type, int inst, struct nvkm_volt **pvolt)
 {
        if (!(*pvolt = kzalloc(sizeof(**pvolt), GFP_KERNEL)))
                return -ENOMEM;
-       nvkm_volt_ctor(func, device, index, *pvolt);
+       nvkm_volt_ctor(func, device, type, inst, *pvolt);
        return 0;
 }
index d9ed692..b47a1c0 100644 (file)
@@ -56,12 +56,13 @@ gf100_volt = {
 };
 
 int
-gf100_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
+gf100_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
+              struct nvkm_volt **pvolt)
 {
        struct nvkm_volt *volt;
        int ret;
 
-       ret = nvkm_volt_new_(&gf100_volt, device, index, &volt);
+       ret = nvkm_volt_new_(&gf100_volt, device, type, inst, &volt);
        *pvolt = volt;
        if (ret)
                return ret;
index 547a58f..03c8a2c 100644 (file)
@@ -46,12 +46,13 @@ gf117_volt = {
 };
 
 int
-gf117_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
+gf117_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
+              struct nvkm_volt **pvolt)
 {
        struct nvkm_volt *volt;
        int ret;
 
-       ret = nvkm_volt_new_(&gf117_volt, device, index, &volt);
+       ret = nvkm_volt_new_(&gf117_volt, device, type, inst, &volt);
        *pvolt = volt;
        if (ret)
                return ret;
index 1c744e0..d1ce430 100644 (file)
@@ -95,7 +95,8 @@ gk104_volt_pwm = {
 };
 
 int
-gk104_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
+gk104_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
+              struct nvkm_volt **pvolt)
 {
        const struct nvkm_volt_func *volt_func = &gk104_volt_gpio;
        struct dcb_gpio_func gpio;
@@ -114,7 +115,7 @@ gk104_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
 
        if (!(volt = kzalloc(sizeof(*volt), GFP_KERNEL)))
                return -ENOMEM;
-       nvkm_volt_ctor(volt_func, device, index, &volt->base);
+       nvkm_volt_ctor(volt_func, device, type, inst, &volt->base);
        *pvolt = &volt->base;
        volt->bios = bios;
 
index ce5d83c..8c2faa9 100644 (file)
@@ -144,14 +144,14 @@ gk20a_volt = {
 };
 
 int
-gk20a_volt_ctor(struct nvkm_device *device, int index,
+gk20a_volt_ctor(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
                const struct cvb_coef *coefs, int nb_coefs,
                int vmin, struct gk20a_volt *volt)
 {
        struct nvkm_device_tegra *tdev = device->func->tegra(device);
        int i, uv;
 
-       nvkm_volt_ctor(&gk20a_volt, device, index, &volt->base);
+       nvkm_volt_ctor(&gk20a_volt, device, type, inst, &volt->base);
 
        uv = regulator_get_voltage(tdev->vdd);
        nvkm_debug(&volt->base.subdev, "the default voltage is %duV\n", uv);
@@ -172,7 +172,7 @@ gk20a_volt_ctor(struct nvkm_device *device, int index,
 }
 
 int
-gk20a_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
+gk20a_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_volt **pvolt)
 {
        struct gk20a_volt *volt;
 
@@ -181,6 +181,6 @@ gk20a_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
                return -ENOMEM;
        *pvolt = &volt->base;
 
-       return gk20a_volt_ctor(device, index, gk20a_cvb_coef,
+       return gk20a_volt_ctor(device, type, inst, gk20a_cvb_coef,
                               ARRAY_SIZE(gk20a_cvb_coef), 0, volt);
 }
index 6a6c97f..01f8a5f 100644 (file)
@@ -37,7 +37,7 @@ struct gk20a_volt {
        struct regulator *vdd;
 };
 
-int gk20a_volt_ctor(struct nvkm_device *device, int index,
+int gk20a_volt_ctor(struct nvkm_device *device, enum nvkm_subdev_type, int,
                    const struct cvb_coef *coefs, int nb_coefs,
                    int vmin, struct gk20a_volt *volt);
 
index 2925b9c..c2e9694 100644 (file)
@@ -64,7 +64,8 @@ static const u32 speedo_to_vmin[] = {
 };
 
 int
-gm20b_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
+gm20b_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
+              struct nvkm_volt **pvolt)
 {
        struct nvkm_device_tegra *tdev = device->func->tegra(device);
        struct gk20a_volt *volt;
@@ -84,9 +85,9 @@ gm20b_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
        vmin = speedo_to_vmin[tdev->gpu_speedo_id];
 
        if (tdev->gpu_speedo_id >= 1)
-               return gk20a_volt_ctor(device, index, gm20b_na_cvb_coef,
-                                    ARRAY_SIZE(gm20b_na_cvb_coef), vmin, volt);
+               return gk20a_volt_ctor(device, type, inst, gm20b_na_cvb_coef,
+                                      ARRAY_SIZE(gm20b_na_cvb_coef), vmin, volt);
        else
-               return gk20a_volt_ctor(device, index, gm20b_cvb_coef,
-                                       ARRAY_SIZE(gm20b_cvb_coef), vmin, volt);
+               return gk20a_volt_ctor(device, type, inst, gm20b_cvb_coef,
+                                      ARRAY_SIZE(gm20b_cvb_coef), vmin, volt);
 }
index 2340938..d6a587d 100644 (file)
@@ -30,12 +30,13 @@ nv40_volt = {
 };
 
 int
-nv40_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
+nv40_volt_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
+             struct nvkm_volt **pvolt)
 {
        struct nvkm_volt *volt;
        int ret;
 
-       ret = nvkm_volt_new_(&nv40_volt, device, index, &volt);
+       ret = nvkm_volt_new_(&nv40_volt, device, type, inst, &volt);
        *pvolt = volt;
        if (ret)
                return ret;
index 75f13a3..24e2d16 100644 (file)
@@ -4,10 +4,10 @@
 #define nvkm_volt(p) container_of((p), struct nvkm_volt, subdev)
 #include <subdev/volt.h>
 
-void nvkm_volt_ctor(const struct nvkm_volt_func *, struct nvkm_device *,
-                   int index, struct nvkm_volt *);
-int nvkm_volt_new_(const struct nvkm_volt_func *, struct nvkm_device *,
-                  int index, struct nvkm_volt **);
+void nvkm_volt_ctor(const struct nvkm_volt_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
+                   struct nvkm_volt *);
+int nvkm_volt_new_(const struct nvkm_volt_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
+                  struct nvkm_volt **);
 
 struct nvkm_volt_func {
        int (*oneinit)(struct nvkm_volt *);