|
@@ -26,37 +26,37 @@
|
|
void
|
|
void
|
|
nv50_i2c_drive_scl(struct nvkm_i2c_port *base, int state)
|
|
nv50_i2c_drive_scl(struct nvkm_i2c_port *base, int state)
|
|
{
|
|
{
|
|
- struct nv50_i2c_priv *priv = (void *)nvkm_i2c(base);
|
|
|
|
|
|
+ struct nvkm_i2c *i2c = (void *)nvkm_i2c(base);
|
|
struct nv50_i2c_port *port = (void *)base;
|
|
struct nv50_i2c_port *port = (void *)base;
|
|
if (state) port->state |= 0x01;
|
|
if (state) port->state |= 0x01;
|
|
else port->state &= 0xfe;
|
|
else port->state &= 0xfe;
|
|
- nv_wr32(priv, port->addr, port->state);
|
|
|
|
|
|
+ nv_wr32(i2c, port->addr, port->state);
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|
|
nv50_i2c_drive_sda(struct nvkm_i2c_port *base, int state)
|
|
nv50_i2c_drive_sda(struct nvkm_i2c_port *base, int state)
|
|
{
|
|
{
|
|
- struct nv50_i2c_priv *priv = (void *)nvkm_i2c(base);
|
|
|
|
|
|
+ struct nvkm_i2c *i2c = (void *)nvkm_i2c(base);
|
|
struct nv50_i2c_port *port = (void *)base;
|
|
struct nv50_i2c_port *port = (void *)base;
|
|
if (state) port->state |= 0x02;
|
|
if (state) port->state |= 0x02;
|
|
else port->state &= 0xfd;
|
|
else port->state &= 0xfd;
|
|
- nv_wr32(priv, port->addr, port->state);
|
|
|
|
|
|
+ nv_wr32(i2c, port->addr, port->state);
|
|
}
|
|
}
|
|
|
|
|
|
int
|
|
int
|
|
nv50_i2c_sense_scl(struct nvkm_i2c_port *base)
|
|
nv50_i2c_sense_scl(struct nvkm_i2c_port *base)
|
|
{
|
|
{
|
|
- struct nv50_i2c_priv *priv = (void *)nvkm_i2c(base);
|
|
|
|
|
|
+ struct nvkm_i2c *i2c = (void *)nvkm_i2c(base);
|
|
struct nv50_i2c_port *port = (void *)base;
|
|
struct nv50_i2c_port *port = (void *)base;
|
|
- return !!(nv_rd32(priv, port->addr) & 0x00000001);
|
|
|
|
|
|
+ return !!(nv_rd32(i2c, port->addr) & 0x00000001);
|
|
}
|
|
}
|
|
|
|
|
|
int
|
|
int
|
|
nv50_i2c_sense_sda(struct nvkm_i2c_port *base)
|
|
nv50_i2c_sense_sda(struct nvkm_i2c_port *base)
|
|
{
|
|
{
|
|
- struct nv50_i2c_priv *priv = (void *)nvkm_i2c(base);
|
|
|
|
|
|
+ struct nvkm_i2c *i2c = (void *)nvkm_i2c(base);
|
|
struct nv50_i2c_port *port = (void *)base;
|
|
struct nv50_i2c_port *port = (void *)base;
|
|
- return !!(nv_rd32(priv, port->addr) & 0x00000002);
|
|
|
|
|
|
+ return !!(nv_rd32(i2c, port->addr) & 0x00000002);
|
|
}
|
|
}
|
|
|
|
|
|
static const struct nvkm_i2c_func
|
|
static const struct nvkm_i2c_func
|
|
@@ -100,9 +100,9 @@ nv50_i2c_port_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
|
|
int
|
|
int
|
|
nv50_i2c_port_init(struct nvkm_object *object)
|
|
nv50_i2c_port_init(struct nvkm_object *object)
|
|
{
|
|
{
|
|
- struct nv50_i2c_priv *priv = (void *)nvkm_i2c(object);
|
|
|
|
|
|
+ struct nvkm_i2c *i2c = (void *)nvkm_i2c(object);
|
|
struct nv50_i2c_port *port = (void *)object;
|
|
struct nv50_i2c_port *port = (void *)object;
|
|
- nv_wr32(priv, port->addr, port->state);
|
|
|
|
|
|
+ nv_wr32(i2c, port->addr, port->state);
|
|
return nvkm_i2c_port_init(&port->base);
|
|
return nvkm_i2c_port_init(&port->base);
|
|
}
|
|
}
|
|
|
|
|