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 032a38b0604fb2803d272143dbc7a548352f8788..9ffec226dceeb0926c2e5bba3dafca6e47b5e6c2 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 4160716d7c60dbcb4f455299193e362c2499c243..39bc036d2c59a1b179093c669543c66ecb1303a7 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 45053a2809309b7e1507c5ee9eb3f3ecf60986a4..0be86d5f0158e2447d1c3739c688b85a508eba0b 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 db5e75d781545d74a9edcc3fe32ba36bd5e5ecad..e91b1c3b3ffa9426cbdd1d34f601ad39b2690311 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 49057c4fd3e444bc126d1f73e3a1a01218b26938..e605ea5df5f69e076c88e6a4577480431a7cf375 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 e344901cfdc7fcdbe02f9e0f2d32be0a1ef18a90..a17a6dd8d3de9066df9d8f3e074f3b5f43be8e29 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 d9ed6925ca6422c94f802ee109815a4ff5dabf52..b47a1c0817be16de1107b4baa280fb1dc9b9194e 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 547a58f0aeac326b3b7685d5a04fa1956e77b1c6..03c8a2c2916c25437df7b821432f17e1e9a71f5d 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 1c744e029454030e04c3003a7db803ae83b59e28..d1ce4309cfb84057872f2d8af9cf52490bf0c33f 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 ce5d83cdc7cf7900cf86060750b9398ef24063d9..8c2faa9645111932c6920befc021d71363d7869c 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 6a6c97f9684e0c1e560d03209fbed77755ac4dac..01f8a5fcf496162dfb2b92f07d44181461a0d586 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 2925b9cae6813fe8c67d5c7ced06d06183c203a0..c2e9694d333f4d5a4167d80a26e59b0885a6d046 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 23409387abb58701f6773b8a7cc1c64326f1aa01..d6a587d6082d96b7f48a4c4b271155450a8d8c76 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 75f13a34671fb34db527dc0406ee98f839d66708..24e2d16d19134e249795aee33354a1d92b94da7d 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 *);