2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-08 21:53:54 +08:00
linux-next/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h
Ben Skeggs b9ec14246d 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>
2015-01-22 12:17:54 +10:00

88 lines
3.3 KiB
C

#ifndef __NVKM_I2C_PRIV_H__
#define __NVKM_I2C_PRIV_H__
#include <subdev/i2c.h>
extern struct nvkm_oclass nv04_i2c_pad_oclass;
extern struct nvkm_oclass g94_i2c_pad_oclass;
extern struct nvkm_oclass gm204_i2c_pad_oclass;
#define nvkm_i2c_port_create(p,e,o,i,a,f,d) \
nvkm_i2c_port_create_((p), (e), (o), (i), (a), (f), \
sizeof(**d), (void **)d)
#define nvkm_i2c_port_destroy(p) ({ \
struct nvkm_i2c_port *port = (p); \
_nvkm_i2c_port_dtor(nv_object(i2c)); \
})
#define nvkm_i2c_port_init(p) \
nvkm_object_init(&(p)->base)
#define nvkm_i2c_port_fini(p,s) \
nvkm_object_fini(&(p)->base, (s))
int nvkm_i2c_port_create_(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, u8,
const struct i2c_algorithm *,
const struct nvkm_i2c_func *,
int, void **);
void _nvkm_i2c_port_dtor(struct nvkm_object *);
#define _nvkm_i2c_port_init nvkm_object_init
int _nvkm_i2c_port_fini(struct nvkm_object *, bool);
#define nvkm_i2c_create(p,e,o,d) \
nvkm_i2c_create_((p), (e), (o), sizeof(**d), (void **)d)
#define nvkm_i2c_destroy(p) ({ \
struct nvkm_i2c *i2c = (p); \
_nvkm_i2c_dtor(nv_object(i2c)); \
})
#define nvkm_i2c_init(p) ({ \
struct nvkm_i2c *i2c = (p); \
_nvkm_i2c_init(nv_object(i2c)); \
})
#define nvkm_i2c_fini(p,s) ({ \
struct nvkm_i2c *i2c = (p); \
_nvkm_i2c_fini(nv_object(i2c), (s)); \
})
int nvkm_i2c_create_(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, int, void **);
int _nvkm_i2c_ctor(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, void *, u32,
struct nvkm_object **);
void _nvkm_i2c_dtor(struct nvkm_object *);
int _nvkm_i2c_init(struct nvkm_object *);
int _nvkm_i2c_fini(struct nvkm_object *, bool);
extern struct nvkm_oclass nvkm_anx9805_sclass[];
extern struct nvkm_oclass gf110_i2c_sclass[];
extern const struct i2c_algorithm nvkm_i2c_bit_algo;
extern const struct i2c_algorithm nvkm_i2c_aux_algo;
struct nvkm_i2c_impl {
struct nvkm_oclass base;
/* supported i2c port classes */
struct nvkm_oclass *sclass;
struct nvkm_oclass *pad_x;
struct nvkm_oclass *pad_s;
/* number of native dp aux channels present */
int aux;
/* read and ack pending interrupts, returning only data
* for ports that have not been masked off, while still
* performing the ack for anything that was pending.
*/
void (*aux_stat)(struct nvkm_i2c *, u32 *, u32 *, u32 *, u32 *);
/* mask on/off interrupt types for a given set of auxch
*/
void (*aux_mask)(struct nvkm_i2c *, u32, u32, u32);
};
void g94_aux_stat(struct nvkm_i2c *, u32 *, u32 *, u32 *, u32 *);
void g94_aux_mask(struct nvkm_i2c *, u32, u32, u32);
void gk104_aux_stat(struct nvkm_i2c *, u32 *, u32 *, u32 *, u32 *);
void gk104_aux_mask(struct nvkm_i2c *, u32, u32, u32);
#endif