aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-11 11:10:19 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-11 11:10:19 +0100
commit58bdbe1c08ad88dd30d2a87f3be87170f3a2538a (patch)
tree221330d2153aec1881f8ae79dbe388d6af65ea67
parent55419c246adb8892e83179dcb34025cdc88ec6a8 (diff)
tc358840: disable CSI port TX1 when unusedtegrav6
For video widths <= 1920 only CSI port TX0 is used, so don't enable TX1. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/i2c/tc358840.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/i2c/tc358840.c b/drivers/media/i2c/tc358840.c
index 254e652d40e1..4bd71a3c52ef 100644
--- a/drivers/media/i2c/tc358840.c
+++ b/drivers/media/i2c/tc358840.c
@@ -561,7 +561,7 @@ static int enable_stream(struct v4l2_subdev *sd, bool enable)
{
struct tc358840_state *state = to_state(sd);
struct tc358840_platform_data *pdata = &state->pdata;
-
+ u16 csi_port = pdata->csi_port;
u32 sync_timeout_ctr;
int retries = 0;
@@ -571,6 +571,9 @@ static int enable_stream(struct v4l2_subdev *sd, bool enable)
goto out;
state->test_dl = false;
+ if (state->timings.bt.width <= 1920)
+ csi_port &= ~MASK_VTX1EN;
+
retry:
/* always start stream enable process with testimage turned off */
i2c_wr16_and_or(sd, CB_CTL, ~(u16)MASK_CB_EN, 0);
@@ -637,7 +640,7 @@ retry:
i2c_wr16_and_or(sd, CONFCTL0,
~(u16)(MASK_VTX0EN | MASK_VTX1EN | MASK_ABUFEN),
- enable ? ((pdata->csi_port & (MASK_VTX0EN | MASK_VTX1EN)) |
+ enable ? ((csi_port & (MASK_VTX0EN | MASK_VTX1EN)) |
MASK_ABUFEN | MASK_TX_MSEL | MASK_AUTOINDEX) :
(MASK_TX_MSEL | MASK_AUTOINDEX));

Privacy Policy