From 95dd6e161b73701ca68adfab66767d02b1fc8617 Mon Sep 17 00:00:00 2001 From: Jignesh Mehta Date: Fri, 18 Nov 2011 17:21:16 -0800 Subject: [PATCH] msm: camera: Enable IMEM clock for inline jpeg This change enables IMEM clock so that VFE can put frame in to IMEM and Gemini received frame from IMEM. Change-Id: Ia7d12d7ec5bd433deef545d04e8a72256e19513c Signed-off-by: Jignesh Mehta --- arch/arm/mach-msm/board-8960-camera.c | 60 +++++++++++++++++++++++++ arch/arm/mach-msm/clock-8960.c | 2 +- arch/arm/mach-msm/include/mach/camera.h | 1 + drivers/media/video/msm/msm_io_8960.c | 10 +++++ 4 files changed, 72 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-msm/board-8960-camera.c b/arch/arm/mach-msm/board-8960-camera.c index 6c292a48729..23c49287a14 100644 --- a/arch/arm/mach-msm/board-8960-camera.c +++ b/arch/arm/mach-msm/board-8960-camera.c @@ -219,6 +219,18 @@ static struct msm_bus_vectors cam_init_vectors[] = { .ab = 0, .ib = 0, }, + { + .src = MSM_BUS_MASTER_JPEG_ENC, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 0, + .ib = 0, + }, + { + .src = MSM_BUS_MASTER_VFE, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 0, + .ib = 0, + }, }; static struct msm_bus_vectors cam_preview_vectors[] = { @@ -240,6 +252,18 @@ static struct msm_bus_vectors cam_preview_vectors[] = { .ab = 0, .ib = 0, }, + { + .src = MSM_BUS_MASTER_JPEG_ENC, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 0, + .ib = 0, + }, + { + .src = MSM_BUS_MASTER_VFE, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 0, + .ib = 0, + }, }; static struct msm_bus_vectors cam_video_vectors[] = { @@ -261,6 +285,18 @@ static struct msm_bus_vectors cam_video_vectors[] = { .ab = 0, .ib = 0, }, + { + .src = MSM_BUS_MASTER_JPEG_ENC, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 0, + .ib = 0, + }, + { + .src = MSM_BUS_MASTER_VFE, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 0, + .ib = 0, + }, }; static struct msm_bus_vectors cam_snapshot_vectors[] = { @@ -282,6 +318,18 @@ static struct msm_bus_vectors cam_snapshot_vectors[] = { .ab = 540000000, .ib = 1350000000, }, + { + .src = MSM_BUS_MASTER_JPEG_ENC, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 43200000, + .ib = 69120000, + }, + { + .src = MSM_BUS_MASTER_VFE, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 43200000, + .ib = 69120000, + }, }; static struct msm_bus_vectors cam_zsl_vectors[] = { @@ -303,6 +351,18 @@ static struct msm_bus_vectors cam_zsl_vectors[] = { .ab = 540000000, .ib = 1350000000, }, + { + .src = MSM_BUS_MASTER_JPEG_ENC, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 43200000, + .ib = 69120000, + }, + { + .src = MSM_BUS_MASTER_VFE, + .dst = MSM_BUS_SLAVE_MM_IMEM, + .ab = 43200000, + .ib = 69120000, + }, }; static struct msm_bus_paths cam_bus_client_config[] = { diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c index 8ecfea216f4..a2748b076bc 100644 --- a/arch/arm/mach-msm/clock-8960.c +++ b/arch/arm/mach-msm/clock-8960.c @@ -5249,7 +5249,7 @@ static struct clk_lookup msm_clocks_8960[] = { CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), - CLK_LOOKUP("mem_clk", imem_axi_clk.c, ""), + CLK_LOOKUP("imem_clk", imem_axi_clk.c, NULL), CLK_LOOKUP("ijpeg_clk", ijpeg_clk.c, NULL), CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), CLK_LOOKUP("core_clk", jpegd_clk.c, ""), diff --git a/arch/arm/mach-msm/include/mach/camera.h b/arch/arm/mach-msm/include/mach/camera.h index 06d214f6253..530d2c14856 100644 --- a/arch/arm/mach-msm/include/mach/camera.h +++ b/arch/arm/mach-msm/include/mach/camera.h @@ -577,6 +577,7 @@ enum msm_camio_clk_type { CAMIO_CSI0_PHY_CLK, CAMIO_CSI1_PHY_CLK, CAMIO_CSIPHY_TIMER_SRC_CLK, + CAMIO_IMEM_CLK, CAMIO_MAX_CLK }; diff --git a/drivers/media/video/msm/msm_io_8960.c b/drivers/media/video/msm/msm_io_8960.c index 79294a3f34c..d111452dd47 100644 --- a/drivers/media/video/msm/msm_io_8960.c +++ b/drivers/media/video/msm/msm_io_8960.c @@ -29,6 +29,7 @@ static struct clk *camio_jpeg_clk; static struct clk *camio_jpeg_pclk; +static struct clk *camio_imem_clk; static struct regulator *fs_ijpeg; static struct platform_device *camio_dev; @@ -129,6 +130,11 @@ int msm_camio_clk_enable(enum msm_camio_clk_type clktype) clk = clk_get(NULL, "ijpeg_pclk"); break; + case CAMIO_IMEM_CLK: + camio_imem_clk = + clk = clk_get(NULL, "imem_clk"); + break; + default: break; } @@ -158,6 +164,10 @@ int msm_camio_clk_disable(enum msm_camio_clk_type clktype) clk = camio_jpeg_pclk; break; + case CAMIO_IMEM_CLK: + clk = camio_imem_clk; + break; + default: break; }