From f35b83dbb68c5c9d01b9c10f8afc95f436a0a40c Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Thu, 26 Dec 2019 15:27:34 +0300 Subject: [PATCH] media: i2c: ov10640: fix dvp order and soft reset 1) the s/w reset must be removed since some comeras have serizlizer connected to imager gpio and the address of imager may change after soft reset 2) add dvp order Signed-off-by: Vladimir Barinov --- drivers/media/i2c/soc_camera/ov10640.c | 6 ++++++ drivers/media/i2c/soc_camera/ov10640.h | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/soc_camera/ov10640.c b/drivers/media/i2c/soc_camera/ov10640.c index 89dac1b..6414c6e 100644 --- a/drivers/media/i2c/soc_camera/ov10640.c +++ b/drivers/media/i2c/soc_camera/ov10640.c @@ -481,6 +481,8 @@ static int ov10640_initialize(struct i2c_client *client) ov10640_otp_id_read(client); /* Program wizard registers */ ov10640_set_regs(client, ov10640_regs_wizard_r1e, ARRAY_SIZE(ov10640_regs_wizard_r1e)); + /* Set DVP bit swap */ + reg16_write(client, 0x3124, priv->dvp_order << 4); dev_info(&client->dev, "ov10640 PID %x, res %dx%d, OTP_ID %02x:%02x:%02x:%02x:%02x:%02x\n", pid, OV10640_MAX_WIDTH, OV10640_MAX_HEIGHT, priv->id[0], priv->id[1], priv->id[2], priv->id[3], priv->id[4], priv->id[5]); @@ -552,6 +554,10 @@ static int ov10640_parse_dt(struct device_node *np, struct ov10640_priv *priv) } client->addr = tmp_addr; + /* module params override dts */ + if (dvp_order != -1) + priv->dvp_order = dvp_order; + return 0; } diff --git a/drivers/media/i2c/soc_camera/ov10640.h b/drivers/media/i2c/soc_camera/ov10640.h index dbc6c0b..32cdb2c 100644 --- a/drivers/media/i2c/soc_camera/ov10640.h +++ b/drivers/media/i2c/soc_camera/ov10640.h @@ -1,7 +1,7 @@ /* - * OmniVision ov10640 sensor camera wizard 1280x800@30/UYVY/BT601/8bit + * OmniVision ov10640 sensor camera wizard 1280x1080@30/BGGR/BT601/12bit * - * Copyright (C) 2015-2017 Cogent Embedded, Inc. + * Copyright (C) 2015-2019 Cogent Embedded, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -1185,7 +1185,7 @@ static const struct ov10640_reg ov10640_regs_wizard_r1f[] = { /* DVP_1280x1080_COMB12_raw 30fps */ static const struct ov10640_reg ov10640_regs_wizard_r1e[] = { /* ov10640_R1E_setting_3x12_1280x1080_MIPIin_4lane_raw */ -{0x3013, 0x01}, +//{0x3013, 0x01}, {OV10640_DELAY, 10}, {0x328a, 0x11}, {0x313f, 0x80}, -- 2.7.4