diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-04-04 08:38:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-21 14:38:22 -0400 |
commit | b5dbfe46e40fa3fd9a6dd43f20cc71050fe5ef2d (patch) | |
tree | b97bd3bcd4b27d4949089a72f72783967fc2fe99 /drivers/media | |
parent | 39b553dbb4a75debf814a261e58f09347eef337f (diff) |
[media] omap1-camera: move interface activation and deactivation to clock callbacks
When adding and removing a client, the omap1-camera driver only activates
and deactivates its camera interface respectively, which doesn't include
any client-specific actions. Move this functionality into .clock_start()
and .clock_stop() callbacks.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/soc_camera/omap1_camera.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/media/platform/soc_camera/omap1_camera.c b/drivers/media/platform/soc_camera/omap1_camera.c index c42c23e4eb72..6769193c7c7b 100644 --- a/drivers/media/platform/soc_camera/omap1_camera.c +++ b/drivers/media/platform/soc_camera/omap1_camera.c | |||
@@ -893,13 +893,26 @@ static void sensor_reset(struct omap1_cam_dev *pcdev, bool reset) | |||
893 | CAM_WRITE(pcdev, GPIO, !reset); | 893 | CAM_WRITE(pcdev, GPIO, !reset); |
894 | } | 894 | } |
895 | 895 | ||
896 | static int omap1_cam_add_device(struct soc_camera_device *icd) | ||
897 | { | ||
898 | dev_dbg(icd->parent, "OMAP1 Camera driver attached to camera %d\n", | ||
899 | icd->devnum); | ||
900 | |||
901 | return 0; | ||
902 | } | ||
903 | |||
904 | static void omap1_cam_remove_device(struct soc_camera_device *icd) | ||
905 | { | ||
906 | dev_dbg(icd->parent, | ||
907 | "OMAP1 Camera driver detached from camera %d\n", icd->devnum); | ||
908 | } | ||
909 | |||
896 | /* | 910 | /* |
897 | * The following two functions absolutely depend on the fact, that | 911 | * The following two functions absolutely depend on the fact, that |
898 | * there can be only one camera on OMAP1 camera sensor interface | 912 | * there can be only one camera on OMAP1 camera sensor interface |
899 | */ | 913 | */ |
900 | static int omap1_cam_add_device(struct soc_camera_device *icd) | 914 | static int omap1_cam_clock_start(struct soc_camera_host *ici) |
901 | { | 915 | { |
902 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | ||
903 | struct omap1_cam_dev *pcdev = ici->priv; | 916 | struct omap1_cam_dev *pcdev = ici->priv; |
904 | u32 ctrlclock; | 917 | u32 ctrlclock; |
905 | 918 | ||
@@ -937,14 +950,11 @@ static int omap1_cam_add_device(struct soc_camera_device *icd) | |||
937 | 950 | ||
938 | sensor_reset(pcdev, false); | 951 | sensor_reset(pcdev, false); |
939 | 952 | ||
940 | dev_dbg(icd->parent, "OMAP1 Camera driver attached to camera %d\n", | ||
941 | icd->devnum); | ||
942 | return 0; | 953 | return 0; |
943 | } | 954 | } |
944 | 955 | ||
945 | static void omap1_cam_remove_device(struct soc_camera_device *icd) | 956 | static void omap1_cam_clock_stop(struct soc_camera_host *ici) |
946 | { | 957 | { |
947 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | ||
948 | struct omap1_cam_dev *pcdev = ici->priv; | 958 | struct omap1_cam_dev *pcdev = ici->priv; |
949 | u32 ctrlclock; | 959 | u32 ctrlclock; |
950 | 960 | ||
@@ -965,9 +975,6 @@ static void omap1_cam_remove_device(struct soc_camera_device *icd) | |||
965 | CAM_WRITE(pcdev, CTRLCLOCK, ctrlclock & ~MCLK_EN); | 975 | CAM_WRITE(pcdev, CTRLCLOCK, ctrlclock & ~MCLK_EN); |
966 | 976 | ||
967 | clk_disable(pcdev->clk); | 977 | clk_disable(pcdev->clk); |
968 | |||
969 | dev_dbg(icd->parent, | ||
970 | "OMAP1 Camera driver detached from camera %d\n", icd->devnum); | ||
971 | } | 978 | } |
972 | 979 | ||
973 | /* Duplicate standard formats based on host capability of byte swapping */ | 980 | /* Duplicate standard formats based on host capability of byte swapping */ |
@@ -1525,6 +1532,8 @@ static struct soc_camera_host_ops omap1_host_ops = { | |||
1525 | .owner = THIS_MODULE, | 1532 | .owner = THIS_MODULE, |
1526 | .add = omap1_cam_add_device, | 1533 | .add = omap1_cam_add_device, |
1527 | .remove = omap1_cam_remove_device, | 1534 | .remove = omap1_cam_remove_device, |
1535 | .clock_start = omap1_cam_clock_start, | ||
1536 | .clock_stop = omap1_cam_clock_stop, | ||
1528 | .get_formats = omap1_cam_get_formats, | 1537 | .get_formats = omap1_cam_get_formats, |
1529 | .set_crop = omap1_cam_set_crop, | 1538 | .set_crop = omap1_cam_set_crop, |
1530 | .set_fmt = omap1_cam_set_fmt, | 1539 | .set_fmt = omap1_cam_set_fmt, |