diff options
author | Frank Chen <frankc@nvidia.com> | 2017-05-25 17:56:23 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-18 22:24:44 -0400 |
commit | 37ab34d419f106cb859b5d8fc74196da7422d46a (patch) | |
tree | eda999efc5fbec51248dad244da727da6adaec2e /drivers/media/i2c/ov5693.c | |
parent | 019edbbeb72c7330f902d5f0ed4db3b703b02d05 (diff) |
drivers: camera: update camera drivers
Updating all camera drivers to pass generic
device structure to common camera functions.
This is needed to support SPI sensors.
Jira CHWI-1191
Change-Id: I798336c432aac61a623297eff4b10bb3c162252b
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1490036
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/media/i2c/ov5693.c')
-rw-r--r-- | drivers/media/i2c/ov5693.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 3ae173c0e..6080960d5 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c | |||
@@ -282,7 +282,7 @@ static void ov5693_gpio_set(struct ov5693 *priv, | |||
282 | unsigned int gpio, int val) | 282 | unsigned int gpio, int val) |
283 | { | 283 | { |
284 | if (priv->pdata && priv->pdata->use_cam_gpio) | 284 | if (priv->pdata && priv->pdata->use_cam_gpio) |
285 | cam_gpio_ctrl(priv->i2c_client, gpio, val, 1); | 285 | cam_gpio_ctrl(&priv->i2c_client->dev, gpio, val, 1); |
286 | else { | 286 | else { |
287 | if (gpio_cansleep(gpio)) | 287 | if (gpio_cansleep(gpio)) |
288 | gpio_set_value_cansleep(gpio, val); | 288 | gpio_set_value_cansleep(gpio, val); |
@@ -409,7 +409,7 @@ static int ov5693_power_put(struct ov5693 *priv) | |||
409 | pw->iovdd = NULL; | 409 | pw->iovdd = NULL; |
410 | 410 | ||
411 | if (priv->pdata && priv->pdata->use_cam_gpio) | 411 | if (priv->pdata && priv->pdata->use_cam_gpio) |
412 | cam_gpio_deregister(priv->i2c_client, pw->pwdn_gpio); | 412 | cam_gpio_deregister(&priv->i2c_client->dev, pw->pwdn_gpio); |
413 | else { | 413 | else { |
414 | gpio_free(pw->pwdn_gpio); | 414 | gpio_free(pw->pwdn_gpio); |
415 | gpio_free(pw->reset_gpio); | 415 | gpio_free(pw->reset_gpio); |
@@ -454,10 +454,10 @@ static int ov5693_power_get(struct ov5693 *priv) | |||
454 | 454 | ||
455 | 455 | ||
456 | /* analog 2.8v */ | 456 | /* analog 2.8v */ |
457 | err |= camera_common_regulator_get(priv->i2c_client, | 457 | err |= camera_common_regulator_get(&priv->i2c_client->dev, |
458 | &pw->avdd, pdata->regulators.avdd); | 458 | &pw->avdd, pdata->regulators.avdd); |
459 | /* IO 1.8v */ | 459 | /* IO 1.8v */ |
460 | err |= camera_common_regulator_get(priv->i2c_client, | 460 | err |= camera_common_regulator_get(&priv->i2c_client->dev, |
461 | &pw->iovdd, pdata->regulators.iovdd); | 461 | &pw->iovdd, pdata->regulators.iovdd); |
462 | 462 | ||
463 | if (!err) { | 463 | if (!err) { |
@@ -466,7 +466,7 @@ static int ov5693_power_get(struct ov5693 *priv) | |||
466 | } | 466 | } |
467 | 467 | ||
468 | if (pdata->use_cam_gpio) { | 468 | if (pdata->use_cam_gpio) { |
469 | err = cam_gpio_register(priv->i2c_client, pw->pwdn_gpio); | 469 | err = cam_gpio_register(&priv->i2c_client->dev, pw->pwdn_gpio); |
470 | if (err) | 470 | if (err) |
471 | dev_err(&priv->i2c_client->dev, | 471 | dev_err(&priv->i2c_client->dev, |
472 | "%s ERR can't register cam gpio %u!\n", | 472 | "%s ERR can't register cam gpio %u!\n", |
@@ -497,7 +497,7 @@ static int ov5693_set_coarse_time_short(struct ov5693 *priv, s32 val); | |||
497 | static int ov5693_s_stream(struct v4l2_subdev *sd, int enable) | 497 | static int ov5693_s_stream(struct v4l2_subdev *sd, int enable) |
498 | { | 498 | { |
499 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 499 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
500 | struct camera_common_data *s_data = to_camera_common_data(client); | 500 | struct camera_common_data *s_data = to_camera_common_data(&client->dev); |
501 | struct ov5693 *priv = (struct ov5693 *)s_data->priv; | 501 | struct ov5693 *priv = (struct ov5693 *)s_data->priv; |
502 | struct v4l2_control control; | 502 | struct v4l2_control control; |
503 | int err; | 503 | int err; |
@@ -589,7 +589,7 @@ exit: | |||
589 | static int ov5693_g_input_status(struct v4l2_subdev *sd, u32 *status) | 589 | static int ov5693_g_input_status(struct v4l2_subdev *sd, u32 *status) |
590 | { | 590 | { |
591 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 591 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
592 | struct camera_common_data *s_data = to_camera_common_data(client); | 592 | struct camera_common_data *s_data = to_camera_common_data(&client->dev); |
593 | struct ov5693 *priv = (struct ov5693 *)s_data->priv; | 593 | struct ov5693 *priv = (struct ov5693 *)s_data->priv; |
594 | struct camera_common_power_rail *pw = &priv->power; | 594 | struct camera_common_power_rail *pw = &priv->power; |
595 | 595 | ||
@@ -1291,7 +1291,7 @@ static struct camera_common_pdata *ov5693_parse_dt(struct i2c_client *client) | |||
1291 | if (!board_priv_pdata) | 1291 | if (!board_priv_pdata) |
1292 | return NULL; | 1292 | return NULL; |
1293 | 1293 | ||
1294 | err = camera_common_parse_clocks(client, board_priv_pdata); | 1294 | err = camera_common_parse_clocks(&client->dev, board_priv_pdata); |
1295 | if (err) { | 1295 | if (err) { |
1296 | dev_err(&client->dev, "Failed to find clocks\n"); | 1296 | dev_err(&client->dev, "Failed to find clocks\n"); |
1297 | goto error; | 1297 | goto error; |
@@ -1405,7 +1405,7 @@ static int ov5693_probe(struct i2c_client *client, | |||
1405 | 1405 | ||
1406 | common_data->ops = &ov5693_common_ops; | 1406 | common_data->ops = &ov5693_common_ops; |
1407 | common_data->ctrl_handler = &priv->ctrl_handler; | 1407 | common_data->ctrl_handler = &priv->ctrl_handler; |
1408 | common_data->i2c_client = client; | 1408 | common_data->dev = &client->dev; |
1409 | common_data->frmfmt = ov5693_frmfmt; | 1409 | common_data->frmfmt = ov5693_frmfmt; |
1410 | common_data->colorfmt = camera_common_find_datafmt( | 1410 | common_data->colorfmt = camera_common_find_datafmt( |
1411 | OV5693_DEFAULT_DATAFMT); | 1411 | OV5693_DEFAULT_DATAFMT); |
@@ -1431,7 +1431,7 @@ static int ov5693_probe(struct i2c_client *client, | |||
1431 | if (err) | 1431 | if (err) |
1432 | return err; | 1432 | return err; |
1433 | 1433 | ||
1434 | err = camera_common_parse_ports(client, common_data); | 1434 | err = camera_common_parse_ports(&client->dev, common_data); |
1435 | if (err) { | 1435 | if (err) { |
1436 | dev_err(&client->dev, "Failed to find port info\n"); | 1436 | dev_err(&client->dev, "Failed to find port info\n"); |
1437 | return err; | 1437 | return err; |
@@ -1480,7 +1480,7 @@ static int ov5693_probe(struct i2c_client *client, | |||
1480 | static int | 1480 | static int |
1481 | ov5693_remove(struct i2c_client *client) | 1481 | ov5693_remove(struct i2c_client *client) |
1482 | { | 1482 | { |
1483 | struct camera_common_data *s_data = to_camera_common_data(client); | 1483 | struct camera_common_data *s_data = to_camera_common_data(&client->dev); |
1484 | struct ov5693 *priv = (struct ov5693 *)s_data->priv; | 1484 | struct ov5693 *priv = (struct ov5693 *)s_data->priv; |
1485 | 1485 | ||
1486 | v4l2_async_unregister_subdev(priv->subdev); | 1486 | v4l2_async_unregister_subdev(priv->subdev); |