diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:20 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:40:42 +1000 |
commit | bb23f9d7919311ebc696bc540e41c908168f9cb5 (patch) | |
tree | ec74fe41840c0f913ba00e9cbb2e7610acd16669 /drivers/gpu/drm/nouveau/nvkm/subdev/bus/nv31.c | |
parent | 46484438ab7dbab6ed29cf647d029e0b1ef3d9d8 (diff) |
drm/nouveau/bus: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/bus/nv31.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/bus/nv31.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/nv31.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/nv31.c index 2e5340a2c94d..5153d89e1f0b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/nv31.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/nv31.c @@ -22,14 +22,15 @@ * Authors: Martin Peres <martin.peres@labri.fr> * Ben Skeggs */ -#include "nv04.h" +#include "priv.h" #include <subdev/gpio.h> #include <subdev/therm.h> static void -nv31_bus_intr(struct nvkm_subdev *subdev) +nv31_bus_intr(struct nvkm_bus *bus) { + struct nvkm_subdev *subdev = &bus->subdev; struct nvkm_device *device = subdev->device; u32 stat = nvkm_rd32(device, 0x001100) & nvkm_rd32(device, 0x001140); u32 gpio = nvkm_rd32(device, 0x001104) & nvkm_rd32(device, 0x001144); @@ -66,30 +67,22 @@ nv31_bus_intr(struct nvkm_subdev *subdev) } } -static int -nv31_bus_init(struct nvkm_object *object) +static void +nv31_bus_init(struct nvkm_bus *bus) { - struct nvkm_bus *bus = (void *)object; struct nvkm_device *device = bus->subdev.device; - int ret; - - ret = nvkm_bus_init(bus); - if (ret) - return ret; - nvkm_wr32(device, 0x001100, 0xffffffff); nvkm_wr32(device, 0x001140, 0x00070008); - return 0; } -struct nvkm_oclass * -nv31_bus_oclass = &(struct nv04_bus_impl) { - .base.handle = NV_SUBDEV(BUS, 0x31), - .base.ofuncs = &(struct nvkm_ofuncs) { - .ctor = nv04_bus_ctor, - .dtor = _nvkm_bus_dtor, - .init = nv31_bus_init, - .fini = _nvkm_bus_fini, - }, +static const struct nvkm_bus_func +nv31_bus = { + .init = nv31_bus_init, .intr = nv31_bus_intr, -}.base; +}; + +int +nv31_bus_new(struct nvkm_device *device, int index, struct nvkm_bus **pbus) +{ + return nvkm_bus_new_(&nv31_bus, device, index, pbus); +} |