summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/soc_camera/atmel-isi.c
diff options
context:
space:
mode:
authorJosh Wu <josh.wu@atmel.com>2015-11-03 03:45:10 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-11-17 15:29:39 -0200
commitbd70f260cb2629a60b676f045eeb90a061a7630e (patch)
tree809ebd99bfa0bcdb1c61ae4b901bbda4a0ab4312 /drivers/media/platform/soc_camera/atmel-isi.c
parent0fb725750b040253b111b106ca235dfbccf4ec3f (diff)
downloadop-kernel-dev-bd70f260cb2629a60b676f045eeb90a061a7630e.zip
op-kernel-dev-bd70f260cb2629a60b676f045eeb90a061a7630e.tar.gz
[media] atmel-isi: add code to setup correct resolution for preview path
Not like codec path, preview path can do downsampling, so we should setup a extra preview width, height for it. This patch add preview resolution setup without down sampling. So currently preview path will output same size as sensor output size. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/soc_camera/atmel-isi.c')
-rw-r--r--drivers/media/platform/soc_camera/atmel-isi.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index 112a4b4..22ae4c8 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -131,7 +131,7 @@ static u32 setup_cfg2_yuv_swap(struct atmel_isi *isi,
static void configure_geometry(struct atmel_isi *isi, u32 width,
u32 height, const struct soc_camera_format_xlate *xlate)
{
- u32 cfg2;
+ u32 cfg2, psize;
/* According to sensor's output format to set cfg2 */
switch (xlate->code) {
@@ -159,6 +159,16 @@ static void configure_geometry(struct atmel_isi *isi, u32 width,
cfg2 |= ((height - 1) << ISI_CFG2_IM_VSIZE_OFFSET)
& ISI_CFG2_IM_VSIZE_MASK;
isi_writel(isi, ISI_CFG2, cfg2);
+
+ /* No down sampling, preview size equal to sensor output size */
+ psize = ((width - 1) << ISI_PSIZE_PREV_HSIZE_OFFSET) &
+ ISI_PSIZE_PREV_HSIZE_MASK;
+ psize |= ((height - 1) << ISI_PSIZE_PREV_VSIZE_OFFSET) &
+ ISI_PSIZE_PREV_VSIZE_MASK;
+ isi_writel(isi, ISI_PSIZE, psize);
+ isi_writel(isi, ISI_PDECF, ISI_PDECF_NO_SAMPLING);
+
+ return;
}
static bool is_supported(struct soc_camera_device *icd,
OpenPOWER on IntegriCloud