ARM: pmu: add support for interrupt-affinity property
[linux/fpc-iii.git] / drivers / gpu / drm / nouveau / nvkm / subdev / i2c / pad.h
blobf3422cc6f8db01c101aeefbe3bf0e18d2ee7fb51
1 #ifndef __NVKM_I2C_PAD_H__
2 #define __NVKM_I2C_PAD_H__
3 #include "priv.h"
5 struct nvkm_i2c_pad {
6 struct nvkm_object base;
7 int index;
8 struct nvkm_i2c_port *port;
9 struct nvkm_i2c_port *next;
12 static inline struct nvkm_i2c_pad *
13 nvkm_i2c_pad(struct nvkm_i2c_port *port)
15 struct nvkm_object *pad = nv_object(port);
16 while (!nv_iclass(pad->parent, NV_SUBDEV_CLASS))
17 pad = pad->parent;
18 return (void *)pad;
21 #define nvkm_i2c_pad_create(p,e,o,i,d) \
22 nvkm_i2c_pad_create_((p), (e), (o), (i), sizeof(**d), (void **)d)
23 #define nvkm_i2c_pad_destroy(p) ({ \
24 struct nvkm_i2c_pad *_p = (p); \
25 _nvkm_i2c_pad_dtor(nv_object(_p)); \
27 #define nvkm_i2c_pad_init(p) ({ \
28 struct nvkm_i2c_pad *_p = (p); \
29 _nvkm_i2c_pad_init(nv_object(_p)); \
31 #define nvkm_i2c_pad_fini(p,s) ({ \
32 struct nvkm_i2c_pad *_p = (p); \
33 _nvkm_i2c_pad_fini(nv_object(_p), (s)); \
36 int nvkm_i2c_pad_create_(struct nvkm_object *, struct nvkm_object *,
37 struct nvkm_oclass *, int index, int, void **);
39 int _nvkm_i2c_pad_ctor(struct nvkm_object *, struct nvkm_object *,
40 struct nvkm_oclass *, void *, u32,
41 struct nvkm_object **);
42 #define _nvkm_i2c_pad_dtor nvkm_object_destroy
43 int _nvkm_i2c_pad_init(struct nvkm_object *);
44 int _nvkm_i2c_pad_fini(struct nvkm_object *, bool);
46 #ifndef MSG
47 #define MSG(l,f,a...) do { \
48 struct nvkm_i2c_pad *_pad = (void *)pad; \
49 nv_##l(_pad, "PAD:%c:%02x: "f, \
50 _pad->index >= 0x100 ? 'X' : 'S', \
51 _pad->index >= 0x100 ? _pad->index - 0x100 : _pad->index, ##a); \
52 } while(0)
53 #define DBG(f,a...) MSG(debug, f, ##a)
54 #define ERR(f,a...) MSG(error, f, ##a)
55 #endif
56 #endif