Linux-libre 3.10.54-gnu
[librecmc/linux-libre.git] / drivers / gpu / drm / nouveau / core / include / subdev / bus.h
1 #ifndef __NOUVEAU_BUS_H__
2 #define __NOUVEAU_BUS_H__
3
4 #include <core/subdev.h>
5 #include <core/device.h>
6
7 struct nouveau_bus_intr {
8         u32 stat;
9         u32 unit;
10 };
11
12 struct nouveau_bus {
13         struct nouveau_subdev base;
14 };
15
16 static inline struct nouveau_bus *
17 nouveau_bus(void *obj)
18 {
19         return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BUS];
20 }
21
22 #define nouveau_bus_create(p, e, o, d)                                         \
23         nouveau_subdev_create_((p), (e), (o), 0, "PBUS", "master",             \
24                                sizeof(**d), (void **)d)
25 #define nouveau_bus_destroy(p)                                                 \
26         nouveau_subdev_destroy(&(p)->base)
27 #define nouveau_bus_init(p)                                                    \
28         nouveau_subdev_init(&(p)->base)
29 #define nouveau_bus_fini(p, s)                                                 \
30         nouveau_subdev_fini(&(p)->base, (s))
31
32 #define _nouveau_bus_dtor _nouveau_subdev_dtor
33 #define _nouveau_bus_init _nouveau_subdev_init
34 #define _nouveau_bus_fini _nouveau_subdev_fini
35
36 extern struct nouveau_oclass nv04_bus_oclass;
37 extern struct nouveau_oclass nv31_bus_oclass;
38 extern struct nouveau_oclass nv50_bus_oclass;
39 extern struct nouveau_oclass nvc0_bus_oclass;
40
41 #endif