media: rockchip: isp1: config grf dvp datawidth

Change-Id: I173a2054d3f3878d0cc8b4f12236a5ce3f050834
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
Cai YiWei
2018-10-16 09:42:59 +08:00
committed by Tao Huang
parent 4e29453602
commit 894be9903f
4 changed files with 23 additions and 0 deletions

View File

@@ -34,12 +34,14 @@
#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/of_platform.h>
#include <linux/pm_runtime.h>
#include <linux/pinctrl/consumer.h>
#include <linux/regmap.h>
#include <media/videobuf2-dma-contig.h>
#include <linux/dma-iommu.h>
#include <dt-bindings/soc/rockchip-system-status.h>
@@ -702,6 +704,11 @@ static int rkisp1_plat_probe(struct platform_device *pdev)
dev_set_drvdata(dev, isp_dev);
isp_dev->dev = dev;
isp_dev->grf = syscon_regmap_lookup_by_phandle(dev->of_node,
"rockchip,grf");
if (IS_ERR(isp_dev->grf))
dev_warn(dev, "Missing rockchip,grf property\n");
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
isp_dev->base_addr = devm_ioremap_resource(dev, res);
if (IS_ERR(isp_dev->base_addr))

View File

@@ -103,6 +103,7 @@ struct rkisp1_sensor_info {
* @params_vdev: ISP input parameters device
*/
struct rkisp1_device {
struct regmap *grf;
void __iomem *base_addr;
int irq;
struct device *dev;

View File

@@ -36,6 +36,11 @@
#define _RKISP1_REGS_H
#include "dev.h"
/* GRF */
#define GRF_VI_CON0 0x430
#define ISP_CIF_DATA_WIDTH_MASK 0x60006000
#define ISP_CIF_DATA_WIDTH_12B (2 << 13 | 2 << 29)
/* ISP_CTRL */
#define CIF_ISP_CTRL_ISP_ENABLE BIT(0)
#define CIF_ISP_CTRL_ISP_MODE_RAW_PICT (0 << 1)

View File

@@ -34,6 +34,7 @@
#include <linux/iopoll.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/videodev2.h>
#include <linux/vmalloc.h>
#include <media/v4l2-event.h>
@@ -276,6 +277,15 @@ static int rkisp1_config_dvp(struct rkisp1_device *dev)
val = readl(base + CIF_ISP_ACQ_PROP);
writel(val | input_sel, base + CIF_ISP_ACQ_PROP);
if (!IS_ERR(dev->grf) &&
(dev->isp_ver == ISP_V12 ||
dev->isp_ver == ISP_V13))
/* config isp cif 12bit datawidth */
regmap_update_bits(dev->grf,
GRF_VI_CON0,
ISP_CIF_DATA_WIDTH_MASK,
ISP_CIF_DATA_WIDTH_12B);
return 0;
}