aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2016-10-05 11:33:45 -0400
committerPhilipp Zabel <p.zabel@pengutronix.de>2016-11-07 09:17:47 -0500
commit867341b95891ca176e9cb5fcc3c68b325f0eb306 (patch)
tree1fe495b652954433e4219b0acd337a1c80c799f4
parentcdda2df7e05d84fee0a8298076941928af036c73 (diff)
gpu: ipu-v3: add ipu_csi_set_downsize
Support downsizing to 1/2 width and/or height in the CSI. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r--drivers/gpu/ipu-v3/ipu-csi.c16
-rw-r--r--include/video/imx-ipu-v3.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c
index d6e5ded24418..63c7292f427a 100644
--- a/drivers/gpu/ipu-v3/ipu-csi.c
+++ b/drivers/gpu/ipu-v3/ipu-csi.c
@@ -529,6 +529,22 @@ void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w)
529} 529}
530EXPORT_SYMBOL_GPL(ipu_csi_set_window); 530EXPORT_SYMBOL_GPL(ipu_csi_set_window);
531 531
532void ipu_csi_set_downsize(struct ipu_csi *csi, bool horiz, bool vert)
533{
534 unsigned long flags;
535 u32 reg;
536
537 spin_lock_irqsave(&csi->lock, flags);
538
539 reg = ipu_csi_read(csi, CSI_OUT_FRM_CTRL);
540 reg &= ~(CSI_HORI_DOWNSIZE_EN | CSI_VERT_DOWNSIZE_EN);
541 reg |= (horiz ? CSI_HORI_DOWNSIZE_EN : 0) |
542 (vert ? CSI_VERT_DOWNSIZE_EN : 0);
543 ipu_csi_write(csi, reg, CSI_OUT_FRM_CTRL);
544
545 spin_unlock_irqrestore(&csi->lock, flags);
546}
547
532void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active, 548void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active,
533 u32 r_value, u32 g_value, u32 b_value, 549 u32 r_value, u32 g_value, u32 b_value,
534 u32 pix_clk) 550 u32 pix_clk)
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index cc8174c14df8..53cd07ccaa4c 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -318,6 +318,7 @@ int ipu_csi_init_interface(struct ipu_csi *csi,
318bool ipu_csi_is_interlaced(struct ipu_csi *csi); 318bool ipu_csi_is_interlaced(struct ipu_csi *csi);
319void ipu_csi_get_window(struct ipu_csi *csi, struct v4l2_rect *w); 319void ipu_csi_get_window(struct ipu_csi *csi, struct v4l2_rect *w);
320void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w); 320void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w);
321void ipu_csi_set_downsize(struct ipu_csi *csi, bool horiz, bool vert);
321void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active, 322void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active,
322 u32 r_value, u32 g_value, u32 b_value, 323 u32 r_value, u32 g_value, u32 b_value,
323 u32 pix_clk); 324 u32 pix_clk);