static inline struct nouveau_disp *
nouveau_disp(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_DISP];
+ return (void *)nouveau_engine(obj, NVDEV_ENGINE_DISP);
}
extern struct nouveau_oclass *nv04_disp_oclass;
static inline struct nouveau_fifo *
nouveau_fifo(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_FIFO];
+ return (void *)nouveau_engine(obj, NVDEV_ENGINE_FIFO);
}
#define nouveau_fifo_create(o,e,c,fc,lc,d) \
static inline struct nouveau_graph *
nouveau_graph(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_GR];
+ return (void *)nouveau_engine(obj, NVDEV_ENGINE_GR);
}
#define nouveau_graph_create(p,e,c,y,d) \
static inline struct nouveau_perfmon *
nouveau_perfmon(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_PERFMON];
+ return (void *)nouveau_engine(obj, NVDEV_ENGINE_PERFMON);
}
extern struct nouveau_oclass *nv40_perfmon_oclass;
static inline struct nouveau_bar *
nouveau_bar(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BAR];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_BAR);
}
extern struct nouveau_oclass nv50_bar_oclass;
static inline struct nouveau_bios *
nouveau_bios(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_VBIOS];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_VBIOS);
}
u8 nvbios_checksum(const u8 *data, int size);
static inline struct nouveau_bus *
nouveau_bus(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BUS];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_BUS);
}
#define nouveau_bus_create(p, e, o, d) \
static inline struct nouveau_clock *
nouveau_clock(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_CLOCK];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_CLOCK);
}
struct nouveau_clocks {
static inline struct nouveau_devinit *
nouveau_devinit(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_DEVINIT];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_DEVINIT);
}
extern struct nouveau_oclass *nv04_devinit_oclass;
nv_subidx(obj) == NVDEV_SUBDEV_FB)
return obj;
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_FB);
}
extern struct nouveau_oclass *nv04_fb_oclass;
static inline struct nouveau_fuse *
nouveau_fuse(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FUSE];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_FUSE);
}
#define nouveau_fuse_create(p, e, o, d) \
static inline struct nouveau_gpio *
nouveau_gpio(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_GPIO];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_GPIO);
}
extern struct nouveau_oclass *nv10_gpio_oclass;
static inline struct nouveau_i2c *
nouveau_i2c(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_I2C];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_I2C);
}
extern struct nouveau_oclass *nv04_i2c_oclass;
static inline struct nouveau_ibus *
nouveau_ibus(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_IBUS];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_IBUS);
}
#define nouveau_ibus_create(p,e,o,d) \
nv_subidx(obj) == NVDEV_SUBDEV_INSTMEM)
return obj;
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_INSTMEM];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_INSTMEM);
}
extern struct nouveau_oclass *nv04_instmem_oclass;
static inline struct nouveau_ltc *
nouveau_ltc(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_LTC];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_LTC);
}
extern struct nouveau_oclass *gf100_ltc_oclass;
static inline struct nouveau_mc *
nouveau_mc(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_MC];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_MC);
}
extern struct nouveau_oclass *nv04_mc_oclass;
static inline struct nouveau_mxm *
nouveau_mxm(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_MXM];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_MXM);
}
#define nouveau_mxm_create(p,e,o,d) \
static inline struct nouveau_pwr *
nouveau_pwr(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_PWR];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_PWR);
}
extern struct nouveau_oclass *nva3_pwr_oclass;
static inline struct nouveau_therm *
nouveau_therm(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_THERM];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_THERM);
}
#define nouveau_therm_create(p,e,o,d) \
static inline struct nouveau_timer *
nouveau_timer(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_TIMER];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_TIMER);
}
#define nouveau_timer_create(p,e,o,d) \
static inline struct nouveau_vmmgr *
nouveau_vmmgr(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_VM];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_VM);
}
#define nouveau_vmmgr_create(p,e,o,i,f,d) \
static inline struct nouveau_volt *
nouveau_volt(void *obj)
{
- return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_VOLT];
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_VOLT);
}
#define nouveau_volt_create(p, e, o, d) \