1 #ifndef __NVKM_DEVICE_H__
2 #define __NVKM_DEVICE_H__
3 #include <core/engine.h>
4 #include <core/event.h>
7 struct nvkm_engine engine
;
11 struct platform_device
*platformdev
;
14 struct nvkm_event event
;
38 struct nvkm_oclass
*oclass
[NVDEV_SUBDEV_NR
];
39 struct nvkm_object
*subdev
[NVDEV_SUBDEV_NR
];
42 struct notifier_block nb
;
46 struct nvkm_device
*nvkm_device_find(u64 name
);
47 int nvkm_device_list(u64
*name
, int size
);
49 struct nvkm_device
*nv_device(void *obj
);
52 nv_device_match(struct nvkm_object
*object
, u16 dev
, u16 ven
, u16 sub
)
54 struct nvkm_device
*device
= nv_device(object
);
55 return device
->pdev
->device
== dev
&&
56 device
->pdev
->subsystem_vendor
== ven
&&
57 device
->pdev
->subsystem_device
== sub
;
61 nv_device_is_pci(struct nvkm_device
*device
)
63 return device
->pdev
!= NULL
;
67 nv_device_is_cpu_coherent(struct nvkm_device
*device
)
69 return (!IS_ENABLED(CONFIG_ARM
) && nv_device_is_pci(device
));
72 static inline struct device
*
73 nv_device_base(struct nvkm_device
*device
)
75 return nv_device_is_pci(device
) ? &device
->pdev
->dev
:
76 &device
->platformdev
->dev
;
80 nv_device_resource_start(struct nvkm_device
*device
, unsigned int bar
);
83 nv_device_resource_len(struct nvkm_device
*device
, unsigned int bar
);
86 nv_device_get_irq(struct nvkm_device
*device
, bool stall
);
88 struct platform_device
;
95 #define nvkm_device_create(p,t,n,s,c,d,u) \
96 nvkm_device_create_((void *)(p), (t), (n), (s), (c), (d), \
97 sizeof(**u), (void **)u)
98 int nvkm_device_create_(void *, enum nv_bus_type type
, u64 name
,
99 const char *sname
, const char *cfg
, const char *dbg
,
This page took 0.05799 seconds and 6 git commands to generate.