Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358304
b: refs/heads/master
c: 548ddb6
h: refs/heads/master
v: v3
  • Loading branch information
Ben Skeggs committed Feb 20, 2013
1 parent abf1df6 commit bce3222
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31a34aa421032cfe3b2b892c929e7539e747a7ac
refs/heads/master: 548ddb6dec9964fc9c0812409f3e105b07324c4f
3 changes: 2 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct nouveau_i2c_port {
struct i2c_algo_bit_data bit;
struct list_head head;
u8 index;
u8 type;
u16 type;
u32 dcb;
u32 drive;
u32 sense;
Expand All @@ -29,6 +29,7 @@ struct nouveau_i2c {
struct nouveau_subdev base;

struct nouveau_i2c_port *(*find)(struct nouveau_i2c *, u8 index);
struct nouveau_i2c_port *(*find_type)(struct nouveau_i2c *, u16 type);
int (*identify)(struct nouveau_i2c *, int index,
const char *what, struct i2c_board_info *,
bool (*match)(struct nouveau_i2c_port *,
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ nouveau_i2c_find(struct nouveau_i2c *i2c, u8 index)
return NULL;
}

static struct nouveau_i2c_port *
nouveau_i2c_find_type(struct nouveau_i2c *i2c, u16 type)
{
struct nouveau_i2c_port *port;

list_for_each_entry(port, &i2c->ports, head) {
if (port->type == type)
return port;
}

return NULL;
}

static int
nouveau_i2c_identify(struct nouveau_i2c *i2c, int index, const char *what,
struct i2c_board_info *info,
Expand Down Expand Up @@ -264,6 +277,7 @@ nouveau_i2c_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return ret;

i2c->find = nouveau_i2c_find;
i2c->find_type = nouveau_i2c_find_type;
i2c->identify = nouveau_i2c_identify;
INIT_LIST_HEAD(&i2c->ports);

Expand Down

0 comments on commit bce3222

Please sign in to comment.