aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9t031.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/mt9t031.c')
-rw-r--r--drivers/media/video/mt9t031.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/media/video/mt9t031.c b/drivers/media/video/mt9t031.c
index 7ce37990a446..95cd602ae4ec 100644
--- a/drivers/media/video/mt9t031.c
+++ b/drivers/media/video/mt9t031.c
@@ -265,7 +265,7 @@ static int mt9t031_set_params(struct i2c_client *client,
265 265
266 /* 266 /*
267 * The caller provides a supported format, as guaranteed by 267 * The caller provides a supported format, as guaranteed by
268 * icd->try_fmt_cap(), soc_camera_s_crop() and soc_camera_cropcap() 268 * .try_mbus_fmt(), soc_camera_s_crop() and soc_camera_cropcap()
269 */ 269 */
270 if (ret >= 0) 270 if (ret >= 0)
271 ret = reg_write(client, MT9T031_COLUMN_START, rect->left); 271 ret = reg_write(client, MT9T031_COLUMN_START, rect->left);
@@ -573,8 +573,7 @@ static int mt9t031_runtime_suspend(struct device *dev)
573static int mt9t031_runtime_resume(struct device *dev) 573static int mt9t031_runtime_resume(struct device *dev)
574{ 574{
575 struct video_device *vdev = to_video_device(dev); 575 struct video_device *vdev = to_video_device(dev);
576 struct soc_camera_device *icd = dev_get_drvdata(vdev->parent); 576 struct v4l2_subdev *sd = soc_camera_vdev_to_subdev(vdev);
577 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
578 struct i2c_client *client = v4l2_get_subdevdata(sd); 577 struct i2c_client *client = v4l2_get_subdevdata(sd);
579 struct mt9t031 *mt9t031 = to_mt9t031(client); 578 struct mt9t031 *mt9t031 = to_mt9t031(client);
580 579
@@ -684,8 +683,7 @@ static int mt9t031_g_mbus_config(struct v4l2_subdev *sd,
684 struct v4l2_mbus_config *cfg) 683 struct v4l2_mbus_config *cfg)
685{ 684{
686 struct i2c_client *client = v4l2_get_subdevdata(sd); 685 struct i2c_client *client = v4l2_get_subdevdata(sd);
687 struct soc_camera_device *icd = client->dev.platform_data; 686 struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
688 struct soc_camera_link *icl = to_soc_camera_link(icd);
689 687
690 cfg->flags = V4L2_MBUS_MASTER | V4L2_MBUS_PCLK_SAMPLE_RISING | 688 cfg->flags = V4L2_MBUS_MASTER | V4L2_MBUS_PCLK_SAMPLE_RISING |
691 V4L2_MBUS_PCLK_SAMPLE_FALLING | V4L2_MBUS_HSYNC_ACTIVE_HIGH | 689 V4L2_MBUS_PCLK_SAMPLE_FALLING | V4L2_MBUS_HSYNC_ACTIVE_HIGH |
@@ -700,8 +698,7 @@ static int mt9t031_s_mbus_config(struct v4l2_subdev *sd,
700 const struct v4l2_mbus_config *cfg) 698 const struct v4l2_mbus_config *cfg)
701{ 699{
702 struct i2c_client *client = v4l2_get_subdevdata(sd); 700 struct i2c_client *client = v4l2_get_subdevdata(sd);
703 struct soc_camera_device *icd = client->dev.platform_data; 701 struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
704 struct soc_camera_link *icl = to_soc_camera_link(icd);
705 702
706 if (soc_camera_apply_board_flags(icl, cfg) & 703 if (soc_camera_apply_board_flags(icl, cfg) &
707 V4L2_MBUS_PCLK_SAMPLE_FALLING) 704 V4L2_MBUS_PCLK_SAMPLE_FALLING)
@@ -737,16 +734,13 @@ static int mt9t031_probe(struct i2c_client *client,
737 const struct i2c_device_id *did) 734 const struct i2c_device_id *did)
738{ 735{
739 struct mt9t031 *mt9t031; 736 struct mt9t031 *mt9t031;
740 struct soc_camera_device *icd = client->dev.platform_data; 737 struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
741 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); 738 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
742 int ret; 739 int ret;
743 740
744 if (icd) { 741 if (!icl) {
745 struct soc_camera_link *icl = to_soc_camera_link(icd); 742 dev_err(&client->dev, "MT9T031 driver needs platform data\n");
746 if (!icl) { 743 return -EINVAL;
747 dev_err(&client->dev, "MT9T031 driver needs platform data\n");
748 return -EINVAL;
749 }
750 } 744 }
751 745
752 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) { 746 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {