diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/ov772x.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index 0af2ca6a98f7..d3b54a41758a 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c | |||
@@ -593,12 +593,30 @@ static int ov772x_reset(struct i2c_client *client) | |||
593 | 593 | ||
594 | static int ov772x_init(struct soc_camera_device *icd) | 594 | static int ov772x_init(struct soc_camera_device *icd) |
595 | { | 595 | { |
596 | return 0; | 596 | struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd); |
597 | int ret = 0; | ||
598 | |||
599 | if (priv->info->link.power) { | ||
600 | ret = priv->info->link.power(&priv->client->dev, 1); | ||
601 | if (ret < 0) | ||
602 | return ret; | ||
603 | } | ||
604 | |||
605 | if (priv->info->link.reset) | ||
606 | ret = priv->info->link.reset(&priv->client->dev); | ||
607 | |||
608 | return ret; | ||
597 | } | 609 | } |
598 | 610 | ||
599 | static int ov772x_release(struct soc_camera_device *icd) | 611 | static int ov772x_release(struct soc_camera_device *icd) |
600 | { | 612 | { |
601 | return 0; | 613 | struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd); |
614 | int ret = 0; | ||
615 | |||
616 | if (priv->info->link.power) | ||
617 | ret = priv->info->link.power(&priv->client->dev, 0); | ||
618 | |||
619 | return ret; | ||
602 | } | 620 | } |
603 | 621 | ||
604 | static int ov772x_start_capture(struct soc_camera_device *icd) | 622 | static int ov772x_start_capture(struct soc_camera_device *icd) |
@@ -814,9 +832,6 @@ static int ov772x_video_probe(struct soc_camera_device *icd) | |||
814 | icd->formats = ov772x_fmt_lists; | 832 | icd->formats = ov772x_fmt_lists; |
815 | icd->num_formats = ARRAY_SIZE(ov772x_fmt_lists); | 833 | icd->num_formats = ARRAY_SIZE(ov772x_fmt_lists); |
816 | 834 | ||
817 | if (priv->info->link.power) | ||
818 | priv->info->link.power(&priv->client->dev, 1); | ||
819 | |||
820 | /* | 835 | /* |
821 | * check and show product ID and manufacturer ID | 836 | * check and show product ID and manufacturer ID |
822 | */ | 837 | */ |
@@ -824,8 +839,8 @@ static int ov772x_video_probe(struct soc_camera_device *icd) | |||
824 | ver = i2c_smbus_read_byte_data(priv->client, VER); | 839 | ver = i2c_smbus_read_byte_data(priv->client, VER); |
825 | if (pid != 0x77 || | 840 | if (pid != 0x77 || |
826 | ver != 0x21) { | 841 | ver != 0x21) { |
827 | if (priv->info->link.power) | 842 | dev_err(&icd->dev, |
828 | priv->info->link.power(&priv->client->dev, 0); | 843 | "Product ID error %x:%x\n", pid, ver); |
829 | return -ENODEV; | 844 | return -ENODEV; |
830 | } | 845 | } |
831 | 846 | ||
@@ -842,13 +857,7 @@ static int ov772x_video_probe(struct soc_camera_device *icd) | |||
842 | 857 | ||
843 | static void ov772x_video_remove(struct soc_camera_device *icd) | 858 | static void ov772x_video_remove(struct soc_camera_device *icd) |
844 | { | 859 | { |
845 | struct ov772x_priv *priv = container_of(icd, struct ov772x_priv, icd); | ||
846 | |||
847 | soc_camera_video_stop(icd); | 860 | soc_camera_video_stop(icd); |
848 | |||
849 | if (priv->info->link.power) | ||
850 | priv->info->link.power(&priv->client->dev, 0); | ||
851 | |||
852 | } | 861 | } |
853 | 862 | ||
854 | static struct soc_camera_ops ov772x_ops = { | 863 | static struct soc_camera_ops ov772x_ops = { |