Commit 9e79a853 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/timer: namespace + nvidia gpu names (no binary change)

The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver.  This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent e1404611
#ifndef __NOUVEAU_TIMER_H__ #ifndef __NVKM_TIMER_H__
#define __NOUVEAU_TIMER_H__ #define __NVKM_TIMER_H__
#include <core/subdev.h> #include <core/subdev.h>
#include <core/device.h>
struct nouveau_alarm { struct nvkm_alarm {
struct list_head head; struct list_head head;
u64 timestamp; u64 timestamp;
void (*func)(struct nouveau_alarm *); void (*func)(struct nvkm_alarm *);
}; };
static inline void static inline void
nouveau_alarm_init(struct nouveau_alarm *alarm, nvkm_alarm_init(struct nvkm_alarm *alarm,
void (*func)(struct nouveau_alarm *)) void (*func)(struct nvkm_alarm *))
{ {
INIT_LIST_HEAD(&alarm->head); INIT_LIST_HEAD(&alarm->head);
alarm->func = func; alarm->func = func;
} }
bool nouveau_timer_wait_eq(void *, u64 nsec, u32 addr, u32 mask, u32 data); bool nvkm_timer_wait_eq(void *, u64 nsec, u32 addr, u32 mask, u32 data);
bool nouveau_timer_wait_ne(void *, u64 nsec, u32 addr, u32 mask, u32 data); bool nvkm_timer_wait_ne(void *, u64 nsec, u32 addr, u32 mask, u32 data);
bool nouveau_timer_wait_cb(void *, u64 nsec, bool (*func)(void *), void *data); bool nvkm_timer_wait_cb(void *, u64 nsec, bool (*func)(void *), void *data);
void nouveau_timer_alarm(void *, u32 nsec, struct nouveau_alarm *); void nvkm_timer_alarm(void *, u32 nsec, struct nvkm_alarm *);
void nouveau_timer_alarm_cancel(void *, struct nouveau_alarm *); void nvkm_timer_alarm_cancel(void *, struct nvkm_alarm *);
#define NV_WAIT_DEFAULT 2000000000ULL #define NV_WAIT_DEFAULT 2000000000ULL
#define nv_wait(o,a,m,v) \ #define nv_wait(o,a,m,v) \
nouveau_timer_wait_eq((o), NV_WAIT_DEFAULT, (a), (m), (v)) nvkm_timer_wait_eq((o), NV_WAIT_DEFAULT, (a), (m), (v))
#define nv_wait_ne(o,a,m,v) \ #define nv_wait_ne(o,a,m,v) \
nouveau_timer_wait_ne((o), NV_WAIT_DEFAULT, (a), (m), (v)) nvkm_timer_wait_ne((o), NV_WAIT_DEFAULT, (a), (m), (v))
#define nv_wait_cb(o,c,d) \ #define nv_wait_cb(o,c,d) \
nouveau_timer_wait_cb((o), NV_WAIT_DEFAULT, (c), (d)) nvkm_timer_wait_cb((o), NV_WAIT_DEFAULT, (c), (d))
struct nouveau_timer { struct nvkm_timer {
struct nouveau_subdev base; struct nvkm_subdev base;
u64 (*read)(struct nouveau_timer *); u64 (*read)(struct nvkm_timer *);
void (*alarm)(struct nouveau_timer *, u64 time, struct nouveau_alarm *); void (*alarm)(struct nvkm_timer *, u64 time, struct nvkm_alarm *);
void (*alarm_cancel)(struct nouveau_timer *, struct nouveau_alarm *); void (*alarm_cancel)(struct nvkm_timer *, struct nvkm_alarm *);
}; };
static inline struct nouveau_timer * static inline struct nvkm_timer *
nouveau_timer(void *obj) nvkm_timer(void *obj)
{ {
return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_TIMER); return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_TIMER);
} }
#define nouveau_timer_create(p,e,o,d) \ #define nvkm_timer_create(p,e,o,d) \
nouveau_subdev_create_((p), (e), (o), 0, "PTIMER", "timer", \ nvkm_subdev_create_((p), (e), (o), 0, "PTIMER", "timer", \
sizeof(**d), (void **)d) sizeof(**d), (void **)d)
#define nouveau_timer_destroy(p) \ #define nvkm_timer_destroy(p) \
nouveau_subdev_destroy(&(p)->base) nvkm_subdev_destroy(&(p)->base)
#define nouveau_timer_init(p) \ #define nvkm_timer_init(p) \
nouveau_subdev_init(&(p)->base) nvkm_subdev_init(&(p)->base)
#define nouveau_timer_fini(p,s) \ #define nvkm_timer_fini(p,s) \
nouveau_subdev_fini(&(p)->base, (s)) nvkm_subdev_fini(&(p)->base, (s))
int nouveau_timer_create_(struct nouveau_object *, struct nouveau_engine *, int nvkm_timer_create_(struct nvkm_object *, struct nvkm_engine *,
struct nouveau_oclass *, int size, void **); struct nvkm_oclass *, int size, void **);
extern struct nouveau_oclass nv04_timer_oclass; extern struct nvkm_oclass nv04_timer_oclass;
extern struct nouveau_oclass gk20a_timer_oclass; extern struct nvkm_oclass gk20a_timer_oclass;
#endif #endif
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
*/ */
#include <engine/falcon.h> #include <engine/falcon.h>
#include <core/device.h>
#include <subdev/timer.h> #include <subdev/timer.h>
void void
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
#include <core/client.h> #include <core/client.h>
#include <core/device.h>
#include <nvif/unpack.h> #include <nvif/unpack.h>
#include <nvif/class.h> #include <nvif/class.h>
#include <core/engctx.h> #include <core/engctx.h>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
#include <core/client.h> #include <core/client.h>
#include <core/device.h>
#include <core/os.h> #include <core/os.h>
#include <core/handle.h> #include <core/handle.h>
#include <core/namedb.h> #include <core/namedb.h>
......
#include <core/client.h> #include <core/client.h>
#include <core/device.h>
#include <core/os.h> #include <core/os.h>
#include <core/engctx.h> #include <core/engctx.h>
#include <core/handle.h> #include <core/handle.h>
......
#include <core/os.h> #include <core/os.h>
#include <core/device.h>
#include <core/engctx.h> #include <core/engctx.h>
#include <core/enum.h> #include <core/enum.h>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <core/os.h> #include <core/os.h>
#include <core/client.h> #include <core/client.h>
#include <core/device.h>
#include <core/handle.h> #include <core/handle.h>
#include <core/engctx.h> #include <core/engctx.h>
#include <core/enum.h> #include <core/enum.h>
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define __NVC0_GR_H__ #define __NVC0_GR_H__
#include <core/client.h> #include <core/client.h>
#include <core/device.h>
#include <core/handle.h> #include <core/handle.h>
#include <core/gpuobj.h> #include <core/gpuobj.h>
#include <core/option.h> #include <core/option.h>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
#include <core/gpuobj.h> #include <core/gpuobj.h>
#include <subdev/fb.h> #include <subdev/fb.h>
#include <subdev/mmu.h> #include <subdev/mmu.h>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <subdev/clk.h> #include <subdev/clk.h>
#include "pll.h" #include "pll.h"
#include <core/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/pll.h> #include <subdev/bios/pll.h>
#include <subdev/timer.h> #include <subdev/timer.h>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <subdev/clk.h> #include <subdev/clk.h>
#include "pll.h" #include "pll.h"
#include <core/device.h>
#include <subdev/timer.h> #include <subdev/timer.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/pll.h> #include <subdev/bios/pll.h>
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include <subdev/clk.h> #include <subdev/clk.h>
#include <subdev/timer.h> #include <subdev/timer.h>
#include <core/device.h>
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <nouveau_platform.h> #include <nouveau_platform.h>
#endif #endif
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "gt215.h" #include "gt215.h"
#include "pll.h" #include "pll.h"
#include <core/device.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/pll.h> #include <subdev/bios/pll.h>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "gt215.h" #include "gt215.h"
#include "pll.h" #include "pll.h"
#include <core/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/pll.h> #include <subdev/bios/pll.h>
#include <subdev/timer.h> #include <subdev/timer.h>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
#include "nv40.h" #include "nv40.h"
#include <core/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/init.h> #include <subdev/bios/init.h>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
#include <core/option.h> #include <core/option.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/fan.h> #include <subdev/bios/fan.h>
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
struct gf110_therm_priv { struct gf110_therm_priv {
struct nvkm_therm_priv base; struct nvkm_therm_priv base;
}; };
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
struct gm107_therm_priv { struct gm107_therm_priv {
struct nvkm_therm_priv base; struct nvkm_therm_priv base;
}; };
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
#include <subdev/gpio.h> #include <subdev/gpio.h>
struct gt215_therm_priv { struct gt215_therm_priv {
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
struct nv40_therm_priv { struct nv40_therm_priv {
struct nvkm_therm_priv base; struct nvkm_therm_priv base;
}; };
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
struct nv50_therm_priv { struct nv50_therm_priv {
struct nvkm_therm_priv base; struct nvkm_therm_priv base;
}; };
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/timer.h>
#include "subdev/timer.h"
bool bool
nouveau_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) nvkm_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data)
{ {
struct nouveau_timer *ptimer = nouveau_timer(obj); struct nvkm_timer *ptimer = nvkm_timer(obj);
u64 time0; u64 time0;
time0 = ptimer->read(ptimer); time0 = ptimer->read(ptimer);
...@@ -45,9 +44,9 @@ nouveau_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) ...@@ -45,9 +44,9 @@ nouveau_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data)
} }
bool bool
nouveau_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) nvkm_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data)
{ {
struct nouveau_timer *ptimer = nouveau_timer(obj); struct nvkm_timer *ptimer = nvkm_timer(obj);
u64 time0; u64 time0;
time0 = ptimer->read(ptimer); time0 = ptimer->read(ptimer);
...@@ -65,9 +64,9 @@ nouveau_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) ...@@ -65,9 +64,9 @@ nouveau_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data)
} }
bool bool
nouveau_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) nvkm_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data)
{ {
struct nouveau_timer *ptimer = nouveau_timer(obj); struct nvkm_timer *ptimer = nvkm_timer(obj);
u64 time0; u64 time0;
time0 = ptimer->read(ptimer); time0 = ptimer->read(ptimer);
...@@ -80,15 +79,15 @@ nouveau_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) ...@@ -80,15 +79,15 @@ nouveau_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data)
} }
void void
nouveau_timer_alarm(void *obj, u32 nsec, struct nouveau_alarm *alarm) nvkm_timer_alarm(void *obj, u32 nsec, struct nvkm_alarm *alarm)
{ {
struct nouveau_timer *ptimer = nouveau_timer(obj); struct nvkm_timer *ptimer = nvkm_timer(obj);
ptimer->alarm(ptimer, nsec, alarm); ptimer->alarm(ptimer, nsec, alarm);
} }
void void
nouveau_timer_alarm_cancel(void *obj, struct nouveau_alarm *alarm) nvkm_timer_alarm_cancel(void *obj, struct nvkm_alarm *alarm)
{ {
struct nouveau_timer *ptimer = nouveau_timer(obj); struct nvkm_timer *ptimer = nvkm_timer(obj);
ptimer->alarm_cancel(ptimer, alarm); ptimer->alarm_cancel(ptimer, alarm);
} }
...@@ -21,18 +21,17 @@ ...@@ -21,18 +21,17 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv04.h" #include "nv04.h"
static int static int
gk20a_timer_init(struct nouveau_object *object) gk20a_timer_init(struct nvkm_object *object)
{ {
struct nv04_timer_priv *priv = (void *)object; struct nv04_timer_priv *priv = (void *)object;
u32 hi = upper_32_bits(priv->suspend_time); u32 hi = upper_32_bits(priv->suspend_time);
u32 lo = lower_32_bits(priv->suspend_time); u32 lo = lower_32_bits(priv->suspend_time);
int ret; int ret;
ret = nouveau_timer_init(&priv->base); ret = nvkm_timer_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -45,10 +44,10 @@ gk20a_timer_init(struct nouveau_object *object) ...@@ -45,10 +44,10 @@ gk20a_timer_init(struct nouveau_object *object)
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
gk20a_timer_oclass = { gk20a_timer_oclass = {
.handle = NV_SUBDEV(TIMER, 0xff), .handle = NV_SUBDEV(TIMER, 0xff),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_timer_ctor, .ctor = nv04_timer_ctor,
.dtor = nv04_timer_dtor, .dtor = nv04_timer_dtor,
.init = gk20a_timer_init, .init = gk20a_timer_init,
......
...@@ -21,11 +21,12 @@ ...@@ -21,11 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv04.h" #include "nv04.h"
#include <core/device.h>
static u64 static u64
nv04_timer_read(struct nouveau_timer *ptimer) nv04_timer_read(struct nvkm_timer *ptimer)
{ {
struct nv04_timer_priv *priv = (void *)ptimer; struct nv04_timer_priv *priv = (void *)ptimer;
u32 hi, lo; u32 hi, lo;
...@@ -39,10 +40,10 @@ nv04_timer_read(struct nouveau_timer *ptimer) ...@@ -39,10 +40,10 @@ nv04_timer_read(struct nouveau_timer *ptimer)
} }
static void static void
nv04_timer_alarm_trigger(struct nouveau_timer *ptimer) nv04_timer_alarm_trigger(struct nvkm_timer *ptimer)
{ {
struct nv04_timer_priv *priv = (void *)ptimer; struct nv04_timer_priv *priv = (void *)ptimer;
struct nouveau_alarm *alarm, *atemp; struct nvkm_alarm *alarm, *atemp;
unsigned long flags; unsigned long flags;
LIST_HEAD(exec); LIST_HEAD(exec);
...@@ -71,11 +72,10 @@ nv04_timer_alarm_trigger(struct nouveau_timer *ptimer) ...@@ -71,11 +72,10 @@ nv04_timer_alarm_trigger(struct nouveau_timer *ptimer)
} }
static void static void
nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time, nv04_timer_alarm(struct nvkm_timer *ptimer, u64 time, struct nvkm_alarm *alarm)
struct nouveau_alarm *alarm)
{ {
struct nv04_timer_priv *priv = (void *)ptimer; struct nv04_timer_priv *priv = (void *)ptimer;
struct nouveau_alarm *list; struct nvkm_alarm *list;
unsigned long flags; unsigned long flags;
alarm->timestamp = ptimer->read(ptimer) + time; alarm->timestamp = ptimer->read(ptimer) + time;
...@@ -99,8 +99,7 @@ nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time, ...@@ -99,8 +99,7 @@ nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time,
} }
static void static void
nv04_timer_alarm_cancel(struct nouveau_timer *ptimer, nv04_timer_alarm_cancel(struct nvkm_timer *ptimer, struct nvkm_alarm *alarm)
struct nouveau_alarm *alarm)
{ {
struct nv04_timer_priv *priv = (void *)ptimer; struct nv04_timer_priv *priv = (void *)ptimer;
unsigned long flags; unsigned long flags;
...@@ -110,7 +109,7 @@ nv04_timer_alarm_cancel(struct nouveau_timer *ptimer, ...@@ -110,7 +109,7 @@ nv04_timer_alarm_cancel(struct nouveau_timer *ptimer,
} }
static void static void
nv04_timer_intr(struct nouveau_subdev *subdev) nv04_timer_intr(struct nvkm_subdev *subdev)
{ {
struct nv04_timer_priv *priv = (void *)subdev; struct nv04_timer_priv *priv = (void *)subdev;
u32 stat = nv_rd32(priv, NV04_PTIMER_INTR_0); u32 stat = nv_rd32(priv, NV04_PTIMER_INTR_0);
...@@ -128,24 +127,24 @@ nv04_timer_intr(struct nouveau_subdev *subdev) ...@@ -128,24 +127,24 @@ nv04_timer_intr(struct nouveau_subdev *subdev)
} }
int int
nv04_timer_fini(struct nouveau_object *object, bool suspend) nv04_timer_fini(struct nvkm_object *object, bool suspend)
{ {
struct nv04_timer_priv *priv = (void *)object; struct nv04_timer_priv *priv = (void *)object;
if (suspend) if (suspend)
priv->suspend_time = nv04_timer_read(&priv->base); priv->suspend_time = nv04_timer_read(&priv->base);
nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000); nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000);
return nouveau_timer_fini(&priv->base, suspend); return nvkm_timer_fini(&priv->base, suspend);
} }
static int static int
nv04_timer_init(struct nouveau_object *object) nv04_timer_init(struct nvkm_object *object)
{ {
struct nouveau_device *device = nv_device(object); struct nvkm_device *device = nv_device(object);
struct nv04_timer_priv *priv = (void *)object; struct nv04_timer_priv *priv = (void *)object;
u32 m = 1, f, n, d, lo, hi; u32 m = 1, f, n, d, lo, hi;
int ret; int ret;
ret = nouveau_timer_init(&priv->base); ret = nvkm_timer_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -155,7 +154,7 @@ nv04_timer_init(struct nouveau_object *object) ...@@ -155,7 +154,7 @@ nv04_timer_init(struct nouveau_object *object)
/* determine base clock for timer source */ /* determine base clock for timer source */
#if 0 /*XXX*/ #if 0 /*XXX*/
if (device->chipset < 0x40) { if (device->chipset < 0x40) {
n = nouveau_hw_get_clock(device, PLL_CORE); n = nvkm_hw_get_clock(device, PLL_CORE);
} else } else
#endif #endif
if (device->chipset <= 0x40) { if (device->chipset <= 0x40) {
...@@ -217,26 +216,25 @@ nv04_timer_init(struct nouveau_object *object) ...@@ -217,26 +216,25 @@ nv04_timer_init(struct nouveau_object *object)
nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000); nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000);
nv_wr32(priv, NV04_PTIMER_TIME_1, hi); nv_wr32(priv, NV04_PTIMER_TIME_1, hi);
nv_wr32(priv, NV04_PTIMER_TIME_0, lo); nv_wr32(priv, NV04_PTIMER_TIME_0, lo);
return 0; return 0;
} }
void void
nv04_timer_dtor(struct nouveau_object *object) nv04_timer_dtor(struct nvkm_object *object)
{ {
struct nv04_timer_priv *priv = (void *)object; struct nv04_timer_priv *priv = (void *)object;
return nouveau_timer_destroy(&priv->base); return nvkm_timer_destroy(&priv->base);
} }
int int
nv04_timer_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv04_timer_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv04_timer_priv *priv; struct nv04_timer_priv *priv;
int ret; int ret;
ret = nouveau_timer_create(parent, engine, oclass, &priv); ret = nvkm_timer_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -252,10 +250,10 @@ nv04_timer_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -252,10 +250,10 @@ nv04_timer_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv04_timer_oclass = { nv04_timer_oclass = {
.handle = NV_SUBDEV(TIMER, 0x04), .handle = NV_SUBDEV(TIMER, 0x04),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_timer_ctor, .ctor = nv04_timer_ctor,
.dtor = nv04_timer_dtor, .dtor = nv04_timer_dtor,
.init = nv04_timer_init, .init = nv04_timer_init,
......
#ifndef __NVKM_TIMER_NV04_H__ #ifndef __NVKM_TIMER_NV04_H__
#define __NVKM_TIMER_NV04_H__ #define __NVKM_TIMER_NV04_H__
#include "priv.h" #include "priv.h"
#define NV04_PTIMER_INTR_0 0x009100 #define NV04_PTIMER_INTR_0 0x009100
...@@ -12,16 +11,15 @@ ...@@ -12,16 +11,15 @@
#define NV04_PTIMER_ALARM_0 0x009420 #define NV04_PTIMER_ALARM_0 0x009420
struct nv04_timer_priv { struct nv04_timer_priv {
struct nouveau_timer base; struct nvkm_timer base;
struct list_head alarms; struct list_head alarms;
spinlock_t lock; spinlock_t lock;
u64 suspend_time; u64 suspend_time;
}; };
int nv04_timer_ctor(struct nouveau_object *, struct nouveau_object *, int nv04_timer_ctor(struct nvkm_object *, struct nvkm_object *,
struct nouveau_oclass *, void *, u32, struct nvkm_oclass *, void *, u32,
struct nouveau_object **); struct nvkm_object **);
void nv04_timer_dtor(struct nouveau_object *); void nv04_timer_dtor(struct nvkm_object *);
int nv04_timer_fini(struct nouveau_object *, bool); int nv04_timer_fini(struct nvkm_object *, bool);
#endif #endif
#ifndef __NVKM_TIMER_PRIV_H__ #ifndef __NVKM_TIMER_PRIV_H__
#define __NVKM_TIMER_PRIV_H__ #define __NVKM_TIMER_PRIV_H__
#include <subdev/timer.h> #include <subdev/timer.h>
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment