aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <jason.chen@linaro.org>2011-12-06 12:46:00 +0800
committerJason Chen <jason.chen@linaro.org>2011-12-06 12:46:00 +0800
commit5e92208bf5080984e18cf042bd2616c55b15100b (patch)
tree3e99ebc194abb2c11c831a9a978a0ed623cac6cc
parent6ff70b00c7a931e7459150355a06b3bb1fb63d48 (diff)
downloadlinux-linaro-5e92208bf5080984e18cf042bd2616c55b15100b.tar.gz
IPU3: merge to fsl imx_2.6.38 branch base
to commit 433c6306fe9455163cff3591b4cf8e2f22bc6cc8 add basic ipu drivers. Signed-off-by: Jason Chen <jason.chen@linaro.org>
-rw-r--r--arch/arm/plat-mxc/include/mach/ipu-v3.h1
-rw-r--r--drivers/mxc/Kconfig15
-rw-r--r--drivers/mxc/ipu3/ipu_calc_stripes_sizes.c11
-rw-r--r--drivers/mxc/ipu3/ipu_common.c9
-rw-r--r--drivers/mxc/ipu3/ipu_ic.c1
-rw-r--r--drivers/mxc/ipu3/ipu_prv.h1
6 files changed, 23 insertions, 15 deletions
diff --git a/arch/arm/plat-mxc/include/mach/ipu-v3.h b/arch/arm/plat-mxc/include/mach/ipu-v3.h
index 0816ae9b4c4..480b4ea338e 100644
--- a/arch/arm/plat-mxc/include/mach/ipu-v3.h
+++ b/arch/arm/plat-mxc/include/mach/ipu-v3.h
@@ -125,6 +125,7 @@ typedef union {
struct {
uint32_t csi;
uint32_t mipi_id;
+ uint32_t mipi_vc;
bool mipi_en;
bool interlaced;
} csi_mem;
diff --git a/drivers/mxc/Kconfig b/drivers/mxc/Kconfig
index d2b05814832..8b4e6ccd7f7 100644
--- a/drivers/mxc/Kconfig
+++ b/drivers/mxc/Kconfig
@@ -6,13 +6,14 @@ menu "MXC support drivers"
config MXC_IPU
bool "Image Processing Unit Driver"
- depends on !ARCH_MX21
- depends on !ARCH_MX27
- depends on !ARCH_MX25
- select MXC_IPU_V1 if !ARCH_MX37 && !ARCH_MX5
- select MXC_IPU_V3 if ARCH_MX37 || ARCH_MX5
- select MXC_IPU_V3D if ARCH_MX37
- select MXC_IPU_V3EX if ARCH_MX5
+ depends on !SOC_MX21
+ depends on !SOC_MX27
+ depends on !SOC_MX25
+ select MXC_IPU_V1 if !SOC_MX37 && !SOC_MX5 && !SOC_IMX6Q
+ select MXC_IPU_V3 if SOC_MX37 || SOC_MX5 || SOC_IMX6Q
+ select MXC_IPU_V3D if SOC_MX37
+ select MXC_IPU_V3EX if SOC_MX5
+ select MXC_IPU_V3H if SOC_IMX6Q
help
If you plan to use the Image Processing unit, say
Y here. IPU is needed by Framebuffer and V4L2 drivers.
diff --git a/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c b/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c
index 1e05cc5808b..aa9fdaf27cd 100644
--- a/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c
+++ b/drivers/mxc/ipu3/ipu_calc_stripes_sizes.c
@@ -52,8 +52,8 @@ static u32 truncate(u32 up, /* 0: down; else: up */
return d;
}
-/*static unsigned int f_calc(unsigned int pfs, unsigned int bpp, unsigned int *write)
-{[> return input_f <]
+static unsigned int f_calc(unsigned int pfs, unsigned int bpp, unsigned int *write)
+{/* return input_f */
unsigned int f_calculated = 0;
switch (pfs) {
case IPU_PIX_FMT_YVU422P:
@@ -129,7 +129,7 @@ static unsigned int m_calc(unsigned int pfs)
}
return m_calculated;
-}*/
+}
/* Stripe parameters calculator */
@@ -214,14 +214,14 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width,
/* M, F calculations */
/* read back pfs from params */
- input_f = 16;
+ input_f = f_calc(input_pixelformat, 0, NULL);
input_m = 16;
/* BPP should be used in the out_F calc */
/* Temporarily not used */
/* out_F = F_calc(idmac->pfs, idmac->bpp, NULL); */
output_f = 16;
- output_m = 16;
+ output_m = m_calc(output_pixelformat);
if ((input_frame_width < 4) || (output_frame_width < 4))
@@ -370,7 +370,6 @@ int ipu_calc_stripes_sizes(const unsigned int input_frame_width,
left->output_column = 0;
right->output_column = onw;
}
-
return status;
}
EXPORT_SYMBOL(ipu_calc_stripes_sizes);
diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c
index 014125921c8..4a7ebc02548 100644
--- a/drivers/mxc/ipu3/ipu_common.c
+++ b/drivers/mxc/ipu3/ipu_common.c
@@ -662,8 +662,10 @@ int32_t ipu_init_channel(struct ipu_soc *ipu, ipu_channel_t channel, ipu_channel
if (params->csi_mem.mipi_en) {
ipu_conf |= (1 << (IPU_CONF_CSI0_DATA_SOURCE_OFFSET +
params->csi_mem.csi));
- _ipu_smfc_init(ipu, channel, params->csi_mem.mipi_id,
+ _ipu_smfc_init(ipu, channel, params->csi_mem.mipi_vc,
params->csi_mem.csi);
+ _ipu_csi_set_mipi_di(ipu, params->csi_mem.mipi_vc,
+ params->csi_mem.mipi_id, params->csi_mem.csi);
} else {
ipu_conf &= ~(1 << (IPU_CONF_CSI0_DATA_SOURCE_OFFSET +
params->csi_mem.csi));
@@ -2316,6 +2318,7 @@ int32_t ipu_enable_csi(struct ipu_soc *ipu, uint32_t csi)
return -EINVAL;
}
+ _ipu_get(ipu);
_ipu_lock(ipu);
ipu->csi_use_count[csi]++;
@@ -2327,6 +2330,7 @@ int32_t ipu_enable_csi(struct ipu_soc *ipu, uint32_t csi)
ipu_cm_write(ipu, reg | IPU_CONF_CSI1_EN, IPU_CONF);
}
_ipu_unlock(ipu);
+ _ipu_put(ipu);
return 0;
}
EXPORT_SYMBOL(ipu_enable_csi);
@@ -2348,7 +2352,7 @@ int32_t ipu_disable_csi(struct ipu_soc *ipu, uint32_t csi)
dev_err(ipu->dev, "Wrong csi num_%d\n", csi);
return -EINVAL;
}
-
+ _ipu_get(ipu);
_ipu_lock(ipu);
ipu->csi_use_count[csi]--;
if (ipu->csi_use_count[csi] == 0) {
@@ -2359,6 +2363,7 @@ int32_t ipu_disable_csi(struct ipu_soc *ipu, uint32_t csi)
ipu_cm_write(ipu, reg & ~IPU_CONF_CSI1_EN, IPU_CONF);
}
_ipu_unlock(ipu);
+ _ipu_put(ipu);
return 0;
}
EXPORT_SYMBOL(ipu_disable_csi);
diff --git a/drivers/mxc/ipu3/ipu_ic.c b/drivers/mxc/ipu3/ipu_ic.c
index 7387e518deb..c34e65e1317 100644
--- a/drivers/mxc/ipu3/ipu_ic.c
+++ b/drivers/mxc/ipu3/ipu_ic.c
@@ -18,6 +18,7 @@
*
* @ingroup IPU
*/
+#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/errno.h>
diff --git a/drivers/mxc/ipu3/ipu_prv.h b/drivers/mxc/ipu3/ipu_prv.h
index 7c803a1693d..42060c954a1 100644
--- a/drivers/mxc/ipu3/ipu_prv.h
+++ b/drivers/mxc/ipu3/ipu_prv.h
@@ -319,6 +319,7 @@ int _ipu_ic_idma_init(struct ipu_soc *ipu, int dma_chan, uint16_t width, uint16_
int burst_size, ipu_rotate_mode_t rot);
void _ipu_vdi_toggle_top_field_man(struct ipu_soc *ipu);
int _ipu_csi_init(struct ipu_soc *ipu, ipu_channel_t channel, uint32_t csi);
+int _ipu_csi_set_mipi_di(struct ipu_soc *ipu, uint32_t num, uint32_t di_val, uint32_t csi);
void ipu_csi_set_test_generator(struct ipu_soc *ipu, bool active, uint32_t r_value,
uint32_t g_value, uint32_t b_value,
uint32_t pix_clk, uint32_t csi);