Skip to content

Commit

Permalink
[media] davinci: vpif_capture: remove hard-coded I2C adapter id
Browse files Browse the repository at this point in the history
Remove hard-coded I2C adapter in favor of getting the
ID from platform_data.

Signed-off-by: Kevin Hilman <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
khilman authored and mchehab committed Jan 31, 2017
1 parent bff782d commit 2d40cb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/platform/davinci/vpif_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,10 @@ static __init int vpif_probe(struct platform_device *pdev)
}

if (!vpif_obj.config->asd_sizes) {
i2c_adap = i2c_get_adapter(1);
int i2c_id = vpif_obj.config->i2c_adapter_id;

i2c_adap = i2c_get_adapter(i2c_id);
WARN_ON(!i2c_adap);
for (i = 0; i < subdev_count; i++) {
subdevdata = &vpif_obj.config->subdev_info[i];
vpif_obj.sd[i] =
Expand Down
1 change: 1 addition & 0 deletions include/media/davinci/vpif_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct vpif_capture_config {
struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS];
struct vpif_subdev_info *subdev_info;
int subdev_count;
int i2c_adapter_id;
const char *card_name;
struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
int *asd_sizes; /* 0-terminated array of asd group sizes */
Expand Down

0 comments on commit 2d40cb3

Please sign in to comment.