Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366774
b: refs/heads/master
c: dcafb6d
h: refs/heads/master
v: v3
  • Loading branch information
Volokh Konstantin authored and Mauro Carvalho Chehab committed Mar 24, 2013
1 parent 35a3baf commit ec882f5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 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: 523a4f7fbcf856fb1c2a4850f44edea6738ee37b
refs/heads/master: dcafb6dea60fd6d4eaf20f8d5ce1503b0c03155d
20 changes: 11 additions & 9 deletions trunk/drivers/staging/media/go7007/go7007-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,22 @@ int go7007_reset_encoder(struct go7007 *go)
/*
* Attempt to instantiate an I2C client by ID, probably loading a module.
*/
static int init_i2c_module(struct i2c_adapter *adapter, const char *type,
int addr)
static int init_i2c_module(struct i2c_adapter *adapter, const struct go_i2c *const i2c)
{
struct go7007 *go = i2c_get_adapdata(adapter);
struct v4l2_device *v4l2_dev = &go->v4l2_dev;
struct i2c_board_info info;

if (v4l2_i2c_new_subdev(v4l2_dev, adapter, type, addr, NULL))
memset(&info, 0, sizeof(info));
strlcpy(info.type, i2c->type, sizeof(info.type));
info.addr = i2c->addr;
info.flags = i2c->flags;

if (v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, NULL))
return 0;

dev_info(&adapter->dev,
"go7007: probing for module i2c:%s failed\n", type);
return -1;
printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", i2c->type);
return -EINVAL;
}

/*
Expand Down Expand Up @@ -243,9 +247,7 @@ int go7007_register_encoder(struct go7007 *go)
}
if (go->i2c_adapter_online) {
for (i = 0; i < go->board_info->num_i2c_devs; ++i)
init_i2c_module(&go->i2c_adapter,
go->board_info->i2c_devs[i].type,
go->board_info->i2c_devs[i].addr);
init_i2c_module(&go->i2c_adapter, &go->board_info->i2c_devs[i]);
if (go->board_id == GO7007_BOARDID_ADLINK_MPG24)
i2c_clients_command(&go->i2c_adapter,
DECODER_SET_CHANNEL, &go->channel_number);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/staging/media/go7007/go7007-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ struct go7007_board_info {
int audio_bclk_div;
int audio_main_div;
int num_i2c_devs;
struct {
struct go_i2c {
const char *type;
int id;
int addr;
u32 flags;
} i2c_devs[4];
int num_inputs;
struct {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/media/go7007/go7007-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ static struct go7007_usb_board board_adlink_mpg24 = {
.type = "wis_tw2804",
.id = I2C_DRIVERID_WIS_TW2804,
.addr = 0x00, /* yes, really */
.flags = I2C_CLIENT_TEN,
},
},
.num_inputs = 1,
Expand Down

0 comments on commit ec882f5

Please sign in to comment.