diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-03-03 08:05:22 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 03:53:55 -0400 |
commit | 4b0ec19e02fabdd09fc2f4754304894bbefb3f45 (patch) | |
tree | c9ff3d9e330b1cc42fc640bc1f4f7fab5c0cf8aa /drivers/media/video/omap3isp | |
parent | 7e8970e1d5ae9237d00909599e70f85fce1fc489 (diff) |
[media] omap3isp: Add set performance callback in isp platform data
Replace the omap_pm_set_min_bus_tput() with a callback to board code.
This makes the omap3isp driver compilable as a module, and lets board
code manage OMAP PM details depending on board requirements.
Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/omap3isp')
-rw-r--r-- | drivers/media/video/omap3isp/isp.h | 1 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/ispvideo.c | 21 |
2 files changed, 7 insertions, 15 deletions
diff --git a/drivers/media/video/omap3isp/isp.h b/drivers/media/video/omap3isp/isp.h index a8dfea413d34..cf5214e95a92 100644 --- a/drivers/media/video/omap3isp/isp.h +++ b/drivers/media/video/omap3isp/isp.h | |||
@@ -199,6 +199,7 @@ struct isp_v4l2_subdevs_group { | |||
199 | 199 | ||
200 | struct isp_platform_data { | 200 | struct isp_platform_data { |
201 | struct isp_v4l2_subdevs_group *subdevs; | 201 | struct isp_v4l2_subdevs_group *subdevs; |
202 | void (*set_constraints)(struct isp_device *isp, bool enable); | ||
202 | }; | 203 | }; |
203 | 204 | ||
204 | struct isp_platform_callback { | 205 | struct isp_platform_callback { |
diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c index 517a24de5836..a0bb5db9cb8a 100644 --- a/drivers/media/video/omap3isp/ispvideo.c +++ b/drivers/media/video/omap3isp/ispvideo.c | |||
@@ -921,18 +921,8 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) | |||
921 | pipe->output = far_end; | 921 | pipe->output = far_end; |
922 | } | 922 | } |
923 | 923 | ||
924 | /* Make sure the interconnect clock runs fast enough. | 924 | if (video->isp->pdata->set_constraints) |
925 | * | 925 | video->isp->pdata->set_constraints(video->isp, true); |
926 | * Formula from: resource34xx.c set_opp() | ||
927 | * If MPU freq is above 500MHz, make sure the interconnect | ||
928 | * is at 100Mhz or above. | ||
929 | * throughput in KiB/s for 100 Mhz = 100 * 1000 * 4. | ||
930 | * | ||
931 | * We want to be fast enough then set OCP clock to be max as | ||
932 | * possible, in that case 185Mhz then: | ||
933 | * throughput in KiB/s for 185Mhz = 185 * 1000 * 4 = 740000 KiB/s | ||
934 | */ | ||
935 | omap_pm_set_min_bus_tput(video->isp->dev, OCP_INITIATOR_AGENT, 740000); | ||
936 | pipe->l3_ick = clk_get_rate(video->isp->clock[ISP_CLK_L3_ICK]); | 926 | pipe->l3_ick = clk_get_rate(video->isp->clock[ISP_CLK_L3_ICK]); |
937 | 927 | ||
938 | /* Validate the pipeline and update its state. */ | 928 | /* Validate the pipeline and update its state. */ |
@@ -978,8 +968,8 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) | |||
978 | error: | 968 | error: |
979 | if (ret < 0) { | 969 | if (ret < 0) { |
980 | omap3isp_video_queue_streamoff(&vfh->queue); | 970 | omap3isp_video_queue_streamoff(&vfh->queue); |
981 | omap_pm_set_min_bus_tput(video->isp->dev, | 971 | if (video->isp->pdata->set_constraints) |
982 | OCP_INITIATOR_AGENT, 0); | 972 | video->isp->pdata->set_constraints(video->isp, false); |
983 | media_entity_pipeline_stop(&video->video.entity); | 973 | media_entity_pipeline_stop(&video->video.entity); |
984 | video->queue = NULL; | 974 | video->queue = NULL; |
985 | } | 975 | } |
@@ -1032,7 +1022,8 @@ isp_video_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) | |||
1032 | video->queue = NULL; | 1022 | video->queue = NULL; |
1033 | video->streaming = 0; | 1023 | video->streaming = 0; |
1034 | 1024 | ||
1035 | omap_pm_set_min_bus_tput(video->isp->dev, OCP_INITIATOR_AGENT, 0); | 1025 | if (video->isp->pdata->set_constraints) |
1026 | video->isp->pdata->set_constraints(video->isp, false); | ||
1036 | media_entity_pipeline_stop(&video->video.entity); | 1027 | media_entity_pipeline_stop(&video->video.entity); |
1037 | 1028 | ||
1038 | done: | 1029 | done: |