diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-04-21 19:47:22 (GMT) |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-04-21 19:47:22 (GMT) |
commit | 7400516ab40d8fe55031dc8d614e2b365bd95f1c (patch) | |
tree | 33fc8410c9727ca32747ed84832bafb785285f79 /drivers/staging/go7007/go7007-driver.c | |
parent | a939b96cccdb65df80a52447ec8e4a6d79c56dbb (diff) | |
download | linux-fsl-qoriq-7400516ab40d8fe55031dc8d614e2b365bd95f1c.tar.xz |
go7007: Convert to the new i2c device binding model
Move the go7007 driver away from the legacy i2c binding model, which
is going away really soon now.
The I2C addresses of the audio and video chips in s2250-board didn't
look quite right, apparently they were left-aligned values when Linux
wants right-aligned values, so I fixed them too.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/go7007/go7007-driver.c')
-rw-r--r-- | drivers/staging/go7007/go7007-driver.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c index f47c0ce..77b1e76 100644 --- a/drivers/staging/go7007/go7007-driver.c +++ b/drivers/staging/go7007/go7007-driver.c @@ -191,8 +191,10 @@ 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, int id, int addr) +static int init_i2c_module(struct i2c_adapter *adapter, const char *type, + int id, int addr) { + struct i2c_board_info info; char *modname; switch (id) { @@ -226,7 +228,11 @@ static int init_i2c_module(struct i2c_adapter *adapter, int id, int addr) } if (modname != NULL) request_module(modname); - if (wis_i2c_probe_device(adapter, id, addr) == 1) + + memset(&info, 0, sizeof(struct i2c_board_info)); + info.addr = addr; + strlcpy(info.type, type, I2C_NAME_SIZE); + if (!i2c_new_device(adapter, &info)) return 0; if (modname != NULL) printk(KERN_INFO @@ -266,6 +272,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].id, go->board_info->i2c_devs[i].addr); if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) |