From 8d056d9987e3fb0189ffd281c7ba065bd265d8b0 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 4 Dec 2020 11:18:45 +1000 Subject: [PATCH] drm/nouveau/fuse: switch to instanced constructor Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul --- drivers/gpu/drm/nouveau/include/nvkm/core/device.h | 2 - drivers/gpu/drm/nouveau/include/nvkm/core/layout.h | 1 + drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h | 6 +- drivers/gpu/drm/nouveau/nvkm/core/subdev.c | 1 - drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 101 ++++++++++----------- drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c | 4 +- drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gf100.c | 5 +- drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c | 5 +- drivers/gpu/drm/nouveau/nvkm/subdev/fuse/nv50.c | 5 +- drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h | 4 +- 10 files changed, 67 insertions(+), 67 deletions(-) diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h index c1cb34b..3a264d2 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h @@ -60,7 +60,6 @@ struct nvkm_device { struct notifier_block nb; } acpi; - struct nvkm_fuse *fuse; struct nvkm_gpio *gpio; struct nvkm_gsp *gsp; struct nvkm_i2c *i2c; @@ -140,7 +139,6 @@ struct nvkm_device_chip { #include #undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_ONCE - int (*fuse )(struct nvkm_device *, int idx, struct nvkm_fuse **); int (*gpio )(struct nvkm_device *, int idx, struct nvkm_gpio **); int (*gsp )(struct nvkm_device *, int idx, struct nvkm_gsp **); int (*i2c )(struct nvkm_device *, int idx, struct nvkm_i2c **); diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h b/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h index 85092d5..e34c1b9 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/layout.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: MIT */ NVKM_LAYOUT_ONCE(NVKM_SUBDEV_VBIOS , struct nvkm_bios , bios) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_DEVINIT , struct nvkm_devinit , devinit) +NVKM_LAYOUT_ONCE(NVKM_SUBDEV_FUSE , struct nvkm_fuse , fuse) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_BUS , struct nvkm_bus , bus) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_FB , struct nvkm_fb , fb) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_BAR , struct nvkm_bar , bar) diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h index 00111c3..dabbef0 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h @@ -11,7 +11,7 @@ struct nvkm_fuse { u32 nvkm_fuse_read(struct nvkm_fuse *, u32 addr); -int nv50_fuse_new(struct nvkm_device *, int, struct nvkm_fuse **); -int gf100_fuse_new(struct nvkm_device *, int, struct nvkm_fuse **); -int gm107_fuse_new(struct nvkm_device *, int, struct nvkm_fuse **); +int nv50_fuse_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fuse **); +int gf100_fuse_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fuse **); +int gm107_fuse_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fuse **); #endif diff --git a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c index e43a88f..fbe8a23 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c @@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = { #include #undef NVKM_LAYOUT_ONCE #undef NVKM_LAYOUT_INST - [NVKM_SUBDEV_FUSE ] = "fuse", [NVKM_SUBDEV_GPIO ] = "gpio", [NVKM_SUBDEV_GSP ] = "gsp", [NVKM_SUBDEV_I2C ] = "i2c", diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index a4ef6ca..0a43556 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c @@ -816,7 +816,7 @@ nv50_chipset = { .clk = { 0x00000001, nv50_clk_new }, .devinit = { 0x00000001, nv50_devinit_new }, .fb = { 0x00000001, nv50_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = nv50_gpio_new, .i2c = nv50_i2c_new, .imem = nv50_instmem_new, @@ -923,7 +923,7 @@ nv84_chipset = { .clk = { 0x00000001, g84_clk_new }, .devinit = { 0x00000001, g84_devinit_new }, .fb = { 0x00000001, g84_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = nv50_gpio_new, .i2c = nv50_i2c_new, .imem = nv50_instmem_new, @@ -955,7 +955,7 @@ nv86_chipset = { .clk = { 0x00000001, g84_clk_new }, .devinit = { 0x00000001, g84_devinit_new }, .fb = { 0x00000001, g84_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = nv50_gpio_new, .i2c = nv50_i2c_new, .imem = nv50_instmem_new, @@ -987,7 +987,7 @@ nv92_chipset = { .clk = { 0x00000001, g84_clk_new }, .devinit = { 0x00000001, g84_devinit_new }, .fb = { 0x00000001, g84_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = nv50_gpio_new, .i2c = nv50_i2c_new, .imem = nv50_instmem_new, @@ -1019,7 +1019,7 @@ nv94_chipset = { .clk = { 0x00000001, g84_clk_new }, .devinit = { 0x00000001, g84_devinit_new }, .fb = { 0x00000001, g84_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1051,7 +1051,7 @@ nv96_chipset = { .clk = { 0x00000001, g84_clk_new }, .devinit = { 0x00000001, g84_devinit_new }, .fb = { 0x00000001, g84_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1083,7 +1083,7 @@ nv98_chipset = { .clk = { 0x00000001, g84_clk_new }, .devinit = { 0x00000001, g98_devinit_new }, .fb = { 0x00000001, g84_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1115,7 +1115,7 @@ nva0_chipset = { .clk = { 0x00000001, g84_clk_new }, .devinit = { 0x00000001, g84_devinit_new }, .fb = { 0x00000001, g84_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = nv50_i2c_new, .imem = nv50_instmem_new, @@ -1147,7 +1147,7 @@ nva3_chipset = { .clk = { 0x00000001, gt215_clk_new }, .devinit = { 0x00000001, gt215_devinit_new }, .fb = { 0x00000001, gt215_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1181,7 +1181,7 @@ nva5_chipset = { .clk = { 0x00000001, gt215_clk_new }, .devinit = { 0x00000001, gt215_devinit_new }, .fb = { 0x00000001, gt215_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1214,7 +1214,7 @@ nva8_chipset = { .clk = { 0x00000001, gt215_clk_new }, .devinit = { 0x00000001, gt215_devinit_new }, .fb = { 0x00000001, gt215_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1247,7 +1247,7 @@ nvaa_chipset = { .clk = { 0x00000001, mcp77_clk_new }, .devinit = { 0x00000001, g98_devinit_new }, .fb = { 0x00000001, mcp77_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1279,7 +1279,7 @@ nvac_chipset = { .clk = { 0x00000001, mcp77_clk_new }, .devinit = { 0x00000001, g98_devinit_new }, .fb = { 0x00000001, mcp77_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1311,7 +1311,7 @@ nvaf_chipset = { .clk = { 0x00000001, gt215_clk_new }, .devinit = { 0x00000001, mcp89_devinit_new }, .fb = { 0x00000001, mcp89_fb_new }, - .fuse = nv50_fuse_new, + .fuse = { 0x00000001, nv50_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .imem = nv50_instmem_new, @@ -1344,7 +1344,7 @@ nvc0_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf100_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .ibus = gf100_ibus_new, @@ -1381,7 +1381,7 @@ nvc1_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf108_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .ibus = gf100_ibus_new, @@ -1417,7 +1417,7 @@ nvc3_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf100_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .ibus = gf100_ibus_new, @@ -1453,7 +1453,7 @@ nvc4_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf100_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .ibus = gf100_ibus_new, @@ -1490,7 +1490,7 @@ nvc8_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf100_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .ibus = gf100_ibus_new, @@ -1527,7 +1527,7 @@ nvce_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf100_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .ibus = gf100_ibus_new, @@ -1564,7 +1564,7 @@ nvcf_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf100_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = g94_gpio_new, .i2c = g94_i2c_new, .ibus = gf100_ibus_new, @@ -1600,7 +1600,7 @@ nvd7_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf100_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gf119_gpio_new, .i2c = gf117_i2c_new, .ibus = gf117_ibus_new, @@ -1635,7 +1635,7 @@ nvd9_chipset = { .clk = { 0x00000001, gf100_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gf100_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gf119_gpio_new, .i2c = gf119_i2c_new, .ibus = gf117_ibus_new, @@ -1671,7 +1671,7 @@ nve4_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gk104_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk104_i2c_new, .ibus = gk104_ibus_new, @@ -1710,7 +1710,7 @@ nve6_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gk104_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk104_i2c_new, .ibus = gk104_ibus_new, @@ -1749,7 +1749,7 @@ nve7_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gk104_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk104_i2c_new, .ibus = gk104_ibus_new, @@ -1786,7 +1786,7 @@ nvea_chipset = { .bus = { 0x00000001, gf100_bus_new }, .clk = { 0x00000001, gk20a_clk_new }, .fb = { 0x00000001, gk20a_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .ibus = gk20a_ibus_new, .imem = gk20a_instmem_new, .ltc = gk104_ltc_new, @@ -1813,7 +1813,7 @@ nvf0_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gk110_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk110_i2c_new, .ibus = gk104_ibus_new, @@ -1851,7 +1851,7 @@ nvf1_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gk110_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk110_i2c_new, .ibus = gk104_ibus_new, @@ -1889,7 +1889,7 @@ nv106_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gk110_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk110_i2c_new, .ibus = gk104_ibus_new, @@ -1927,7 +1927,7 @@ nv108_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gf100_devinit_new }, .fb = { 0x00000001, gk110_fb_new }, - .fuse = gf100_fuse_new, + .fuse = { 0x00000001, gf100_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk110_i2c_new, .ibus = gk104_ibus_new, @@ -1965,7 +1965,7 @@ nv117_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gm107_devinit_new }, .fb = { 0x00000001, gm107_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk110_i2c_new, .ibus = gk104_ibus_new, @@ -2001,7 +2001,7 @@ nv118_chipset = { .clk = { 0x00000001, gk104_clk_new }, .devinit = { 0x00000001, gm107_devinit_new }, .fb = { 0x00000001, gm107_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gk110_i2c_new, .ibus = gk104_ibus_new, @@ -2035,7 +2035,7 @@ nv120_chipset = { .bus = { 0x00000001, gf100_bus_new }, .devinit = { 0x00000001, gm200_devinit_new }, .fb = { 0x00000001, gm200_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2073,7 +2073,7 @@ nv124_chipset = { .bus = { 0x00000001, gf100_bus_new }, .devinit = { 0x00000001, gm200_devinit_new }, .fb = { 0x00000001, gm200_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2111,7 +2111,7 @@ nv126_chipset = { .bus = { 0x00000001, gf100_bus_new }, .devinit = { 0x00000001, gm200_devinit_new }, .fb = { 0x00000001, gm200_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2147,7 +2147,7 @@ nv12b_chipset = { .bus = { 0x00000001, gf100_bus_new }, .clk = { 0x00000001, gm20b_clk_new }, .fb = { 0x00000001, gm20b_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .ibus = gk20a_ibus_new, .imem = gk20a_instmem_new, .ltc = gm200_ltc_new, @@ -2174,7 +2174,7 @@ nv130_chipset = { .devinit = { 0x00000001, gm200_devinit_new }, .fault = { 0x00000001, gp100_fault_new }, .fb = { 0x00000001, gp100_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2214,7 +2214,7 @@ nv132_chipset = { .devinit = { 0x00000001, gm200_devinit_new }, .fault = { 0x00000001, gp100_fault_new }, .fb = { 0x00000001, gp102_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2252,7 +2252,7 @@ nv134_chipset = { .devinit = { 0x00000001, gm200_devinit_new }, .fault = { 0x00000001, gp100_fault_new }, .fb = { 0x00000001, gp102_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2290,7 +2290,7 @@ nv136_chipset = { .devinit = { 0x00000001, gm200_devinit_new }, .fault = { 0x00000001, gp100_fault_new }, .fb = { 0x00000001, gp102_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2327,7 +2327,7 @@ nv137_chipset = { .devinit = { 0x00000001, gm200_devinit_new }, .fault = { 0x00000001, gp100_fault_new }, .fb = { 0x00000001, gp102_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2365,7 +2365,7 @@ nv138_chipset = { .devinit = { 0x00000001, gm200_devinit_new }, .fault = { 0x00000001, gp100_fault_new }, .fb = { 0x00000001, gp102_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .i2c = gm200_i2c_new, .ibus = gm200_ibus_new, @@ -2399,7 +2399,7 @@ nv13b_chipset = { .bus = { 0x00000001, gf100_bus_new }, .fault = { 0x00000001, gp10b_fault_new }, .fb = { 0x00000001, gp10b_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .ibus = gp10b_ibus_new, .imem = gk20a_instmem_new, .ltc = gp10b_ltc_new, @@ -2425,7 +2425,7 @@ nv140_chipset = { .devinit = { 0x00000001, gv100_devinit_new }, .fault = { 0x00000001, gv100_fault_new }, .fb = { 0x00000001, gv100_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .gsp = gv100_gsp_new, .i2c = gm200_i2c_new, @@ -2469,7 +2469,7 @@ nv162_chipset = { .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, .fb = { 0x00000001, gv100_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .gsp = gv100_gsp_new, .i2c = gm200_i2c_new, @@ -2507,7 +2507,7 @@ nv164_chipset = { .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, .fb = { 0x00000001, gv100_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .gsp = gv100_gsp_new, .i2c = gm200_i2c_new, @@ -2546,7 +2546,7 @@ nv166_chipset = { .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, .fb = { 0x00000001, gv100_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .gsp = gv100_gsp_new, .i2c = gm200_i2c_new, @@ -2586,7 +2586,7 @@ nv167_chipset = { .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, .fb = { 0x00000001, gv100_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .gsp = gv100_gsp_new, .i2c = gm200_i2c_new, @@ -2624,7 +2624,7 @@ nv168_chipset = { .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, .fb = { 0x00000001, gv100_fb_new }, - .fuse = gm107_fuse_new, + .fuse = { 0x00000001, gm107_fuse_new }, .gpio = gk104_gpio_new, .gsp = gv100_gsp_new, .i2c = gm200_i2c_new, @@ -3248,7 +3248,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func, #include #undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_ONCE - _(NVKM_SUBDEV_FUSE , fuse); _(NVKM_SUBDEV_GPIO , gpio); _(NVKM_SUBDEV_GSP , gsp); _(NVKM_SUBDEV_I2C , i2c); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c index 1c3c18e..375dfce 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/base.c @@ -42,12 +42,12 @@ nvkm_fuse = { int nvkm_fuse_new_(const struct nvkm_fuse_func *func, struct nvkm_device *device, - int index, struct nvkm_fuse **pfuse) + enum nvkm_subdev_type type, int inst, struct nvkm_fuse **pfuse) { struct nvkm_fuse *fuse; if (!(fuse = *pfuse = kzalloc(sizeof(*fuse), GFP_KERNEL))) return -ENOMEM; - nvkm_subdev_ctor(&nvkm_fuse, device, index, &fuse->subdev); + nvkm_subdev_ctor(&nvkm_fuse, device, type, inst, &fuse->subdev); fuse->func = func; spin_lock_init(&fuse->lock); return 0; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gf100.c index 13671fe..01f7706 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gf100.c @@ -47,7 +47,8 @@ gf100_fuse = { }; int -gf100_fuse_new(struct nvkm_device *device, int index, struct nvkm_fuse **pfuse) +gf100_fuse_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, + struct nvkm_fuse **pfuse) { - return nvkm_fuse_new_(&gf100_fuse, device, index, pfuse); + return nvkm_fuse_new_(&gf100_fuse, device, type, inst, pfuse); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c index 9aff4ea..7dc9949 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/gm107.c @@ -36,7 +36,8 @@ gm107_fuse = { }; int -gm107_fuse_new(struct nvkm_device *device, int index, struct nvkm_fuse **pfuse) +gm107_fuse_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, + struct nvkm_fuse **pfuse) { - return nvkm_fuse_new_(&gm107_fuse, device, index, pfuse); + return nvkm_fuse_new_(&gm107_fuse, device, type, inst, pfuse); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/nv50.c index 514c193..2505e8e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/nv50.c @@ -45,7 +45,8 @@ nv50_fuse = { }; int -nv50_fuse_new(struct nvkm_device *device, int index, struct nvkm_fuse **pfuse) +nv50_fuse_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, + struct nvkm_fuse **pfuse) { - return nvkm_fuse_new_(&nv50_fuse, device, index, pfuse); + return nvkm_fuse_new_(&nv50_fuse, device, type, inst, pfuse); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h index 2edc6124..e83d0c3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h @@ -8,6 +8,6 @@ struct nvkm_fuse_func { u32 (*read)(struct nvkm_fuse *, u32 addr); }; -int nvkm_fuse_new_(const struct nvkm_fuse_func *, struct nvkm_device *, - int index, struct nvkm_fuse **); +int nvkm_fuse_new_(const struct nvkm_fuse_func *, struct nvkm_device *, enum nvkm_subdev_type, int, + struct nvkm_fuse **); #endif -- 2.7.4