diff options
| author | Ben Skeggs <bskeggs@redhat.com> | 2015-01-14 00:04:16 -0500 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-21 21:17:54 -0500 |
| commit | b9ec14246dc4260294ccfb25ec40b113d23e5b9a (patch) | |
| tree | de377958f843c30a907768d2143604632c1055c2 /drivers/gpu/drm/nouveau/include/nvkm | |
| parent | 4e7659fc5b54925964142988a2f6888cd35c893e (diff) | |
drm/nouveau/i2c: 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: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/include/nvkm')
| -rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/core/os.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h | 91 |
2 files changed, 46 insertions, 46 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h index 4c16deb1ab7d..58f8d8bf2f8e 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h | |||
| @@ -196,6 +196,7 @@ | |||
| 196 | #define nouveau_gpio nvkm_gpio | 196 | #define nouveau_gpio nvkm_gpio |
| 197 | #define nouveau_i2c nvkm_i2c | 197 | #define nouveau_i2c nvkm_i2c |
| 198 | #define nouveau_i2c_port nvkm_i2c_port | 198 | #define nouveau_i2c_port nvkm_i2c_port |
| 199 | #define nouveau_i2c_board_info nvkm_i2c_board_info | ||
| 199 | #define nouveau_devinit nvkm_devinit | 200 | #define nouveau_devinit nvkm_devinit |
| 200 | #define nouveau_bios nvkm_bios | 201 | #define nouveau_bios nvkm_bios |
| 201 | #define nouveau_bios_oclass nvkm_bios_oclass | 202 | #define nouveau_bios_oclass nvkm_bios_oclass |
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h index a400e67f2d43..a2e33730f05e 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h | |||
| @@ -1,8 +1,7 @@ | |||
| 1 | #ifndef __NOUVEAU_I2C_H__ | 1 | #ifndef __NVKM_I2C_H__ |
| 2 | #define __NOUVEAU_I2C_H__ | 2 | #define __NVKM_I2C_H__ |
| 3 | |||
| 4 | #include <core/subdev.h> | 3 | #include <core/subdev.h> |
| 5 | #include <core/device.h> | 4 | #include <core/event.h> |
| 6 | 5 | ||
| 7 | #include <subdev/bios.h> | 6 | #include <subdev/bios.h> |
| 8 | #include <subdev/bios/i2c.h> | 7 | #include <subdev/bios/i2c.h> |
| @@ -30,8 +29,8 @@ struct nvkm_i2c_ntfy_rep { | |||
| 30 | u8 mask; | 29 | u8 mask; |
| 31 | }; | 30 | }; |
| 32 | 31 | ||
| 33 | struct nouveau_i2c_port { | 32 | struct nvkm_i2c_port { |
| 34 | struct nouveau_object base; | 33 | struct nvkm_object base; |
| 35 | struct i2c_adapter adapter; | 34 | struct i2c_adapter adapter; |
| 36 | struct mutex mutex; | 35 | struct mutex mutex; |
| 37 | 36 | ||
| @@ -39,62 +38,63 @@ struct nouveau_i2c_port { | |||
| 39 | u8 index; | 38 | u8 index; |
| 40 | int aux; | 39 | int aux; |
| 41 | 40 | ||
| 42 | const struct nouveau_i2c_func *func; | 41 | const struct nvkm_i2c_func *func; |
| 43 | }; | 42 | }; |
| 44 | 43 | ||
| 45 | struct nouveau_i2c_func { | 44 | struct nvkm_i2c_func { |
| 46 | void (*drive_scl)(struct nouveau_i2c_port *, int); | 45 | void (*drive_scl)(struct nvkm_i2c_port *, int); |
| 47 | void (*drive_sda)(struct nouveau_i2c_port *, int); | 46 | void (*drive_sda)(struct nvkm_i2c_port *, int); |
| 48 | int (*sense_scl)(struct nouveau_i2c_port *); | 47 | int (*sense_scl)(struct nvkm_i2c_port *); |
| 49 | int (*sense_sda)(struct nouveau_i2c_port *); | 48 | int (*sense_sda)(struct nvkm_i2c_port *); |
| 50 | 49 | ||
| 51 | int (*aux)(struct nouveau_i2c_port *, bool, u8, u32, u8 *, u8); | 50 | int (*aux)(struct nvkm_i2c_port *, bool, u8, u32, u8 *, u8); |
| 52 | int (*pattern)(struct nouveau_i2c_port *, int pattern); | 51 | int (*pattern)(struct nvkm_i2c_port *, int pattern); |
| 53 | int (*lnk_ctl)(struct nouveau_i2c_port *, int nr, int bw, bool enh); | 52 | int (*lnk_ctl)(struct nvkm_i2c_port *, int nr, int bw, bool enh); |
| 54 | int (*drv_ctl)(struct nouveau_i2c_port *, int lane, int sw, int pe); | 53 | int (*drv_ctl)(struct nvkm_i2c_port *, int lane, int sw, int pe); |
| 55 | }; | 54 | }; |
| 56 | 55 | ||
| 57 | struct nouveau_i2c_board_info { | 56 | struct nvkm_i2c_board_info { |
| 58 | struct i2c_board_info dev; | 57 | struct i2c_board_info dev; |
| 59 | u8 udelay; /* set to 0 to use the standard delay */ | 58 | u8 udelay; /* set to 0 to use the standard delay */ |
| 60 | }; | 59 | }; |
| 61 | 60 | ||
| 62 | struct nouveau_i2c { | 61 | struct nvkm_i2c { |
| 63 | struct nouveau_subdev base; | 62 | struct nvkm_subdev base; |
| 64 | struct nvkm_event event; | 63 | struct nvkm_event event; |
| 65 | 64 | ||
| 66 | struct nouveau_i2c_port *(*find)(struct nouveau_i2c *, u8 index); | 65 | struct nvkm_i2c_port *(*find)(struct nvkm_i2c *, u8 index); |
| 67 | struct nouveau_i2c_port *(*find_type)(struct nouveau_i2c *, u16 type); | 66 | struct nvkm_i2c_port *(*find_type)(struct nvkm_i2c *, u16 type); |
| 68 | int (*acquire_pad)(struct nouveau_i2c_port *, unsigned long timeout); | 67 | int (*acquire_pad)(struct nvkm_i2c_port *, unsigned long timeout); |
| 69 | void (*release_pad)(struct nouveau_i2c_port *); | 68 | void (*release_pad)(struct nvkm_i2c_port *); |
| 70 | int (*acquire)(struct nouveau_i2c_port *, unsigned long timeout); | 69 | int (*acquire)(struct nvkm_i2c_port *, unsigned long timeout); |
| 71 | void (*release)(struct nouveau_i2c_port *); | 70 | void (*release)(struct nvkm_i2c_port *); |
| 72 | int (*identify)(struct nouveau_i2c *, int index, | 71 | int (*identify)(struct nvkm_i2c *, int index, |
| 73 | const char *what, struct nouveau_i2c_board_info *, | 72 | const char *what, struct nvkm_i2c_board_info *, |
| 74 | bool (*match)(struct nouveau_i2c_port *, | 73 | bool (*match)(struct nvkm_i2c_port *, |
| 75 | struct i2c_board_info *, void *), void *); | 74 | struct i2c_board_info *, void *), |
| 75 | void *); | ||
| 76 | 76 | ||
| 77 | wait_queue_head_t wait; | 77 | wait_queue_head_t wait; |
| 78 | struct list_head ports; | 78 | struct list_head ports; |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | static inline struct nouveau_i2c * | 81 | static inline struct nvkm_i2c * |
| 82 | nouveau_i2c(void *obj) | 82 | nvkm_i2c(void *obj) |
| 83 | { | 83 | { |
| 84 | return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_I2C); | 84 | return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_I2C); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | extern struct nouveau_oclass *nv04_i2c_oclass; | 87 | extern struct nvkm_oclass *nv04_i2c_oclass; |
| 88 | extern struct nouveau_oclass *nv4e_i2c_oclass; | 88 | extern struct nvkm_oclass *nv4e_i2c_oclass; |
| 89 | extern struct nouveau_oclass *nv50_i2c_oclass; | 89 | extern struct nvkm_oclass *nv50_i2c_oclass; |
| 90 | extern struct nouveau_oclass *nv94_i2c_oclass; | 90 | extern struct nvkm_oclass *g94_i2c_oclass; |
| 91 | extern struct nouveau_oclass *nvd0_i2c_oclass; | 91 | extern struct nvkm_oclass *gf110_i2c_oclass; |
| 92 | extern struct nouveau_oclass *gf117_i2c_oclass; | 92 | extern struct nvkm_oclass *gf117_i2c_oclass; |
| 93 | extern struct nouveau_oclass *nve0_i2c_oclass; | 93 | extern struct nvkm_oclass *gk104_i2c_oclass; |
| 94 | extern struct nouveau_oclass *gm204_i2c_oclass; | 94 | extern struct nvkm_oclass *gm204_i2c_oclass; |
| 95 | 95 | ||
| 96 | static inline int | 96 | static inline int |
| 97 | nv_rdi2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg) | 97 | nv_rdi2cr(struct nvkm_i2c_port *port, u8 addr, u8 reg) |
| 98 | { | 98 | { |
| 99 | u8 val; | 99 | u8 val; |
| 100 | struct i2c_msg msgs[] = { | 100 | struct i2c_msg msgs[] = { |
| @@ -110,7 +110,7 @@ nv_rdi2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg) | |||
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static inline int | 112 | static inline int |
| 113 | nv_wri2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg, u8 val) | 113 | nv_wri2cr(struct nvkm_i2c_port *port, u8 addr, u8 reg, u8 val) |
| 114 | { | 114 | { |
| 115 | u8 buf[2] = { reg, val }; | 115 | u8 buf[2] = { reg, val }; |
| 116 | struct i2c_msg msgs[] = { | 116 | struct i2c_msg msgs[] = { |
| @@ -125,12 +125,11 @@ nv_wri2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg, u8 val) | |||
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | static inline bool | 127 | static inline bool |
| 128 | nv_probe_i2c(struct nouveau_i2c_port *port, u8 addr) | 128 | nv_probe_i2c(struct nvkm_i2c_port *port, u8 addr) |
| 129 | { | 129 | { |
| 130 | return nv_rdi2cr(port, addr, 0) >= 0; | 130 | return nv_rdi2cr(port, addr, 0) >= 0; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | int nv_rdaux(struct nouveau_i2c_port *, u32 addr, u8 *data, u8 size); | 133 | int nv_rdaux(struct nvkm_i2c_port *, u32 addr, u8 *data, u8 size); |
| 134 | int nv_wraux(struct nouveau_i2c_port *, u32 addr, u8 *data, u8 size); | 134 | int nv_wraux(struct nvkm_i2c_port *, u32 addr, u8 *data, u8 size); |
| 135 | |||
| 136 | #endif | 135 | #endif |
