diff options
| author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2023-07-31 16:24:36 +0300 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-08-10 07:58:37 +0200 |
| commit | b57a5fd2ccf2037be6749e339da5de9b20fdbff2 (patch) | |
| tree | f12b1a4c06f242885850ddc7f469e14ca33f62b4 | |
| parent | 905f88ccebb14e42bcd19455b0d9c0d4808f1897 (diff) | |
media: i2c: ds90ub960: Configure CSI-2 continuous clock
Use 'clock-noncontinuous' from DT to configure the
continuous/non-continuous clock setting for the TX ports.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
| -rw-r--r-- | drivers/media/i2c/ds90ub960.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index 4833b39b9178..b840c9160bf2 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -149,6 +149,7 @@ #define UB960_TR_CSI_CTL 0x33 #define UB960_TR_CSI_CTL_CSI_CAL_EN BIT(6) +#define UB960_TR_CSI_CTL_CSI_CONTS_CLOCK BIT(1) #define UB960_TR_CSI_CTL_CSI_ENABLE BIT(0) #define UB960_TR_CSI_CTL2 0x34 @@ -485,6 +486,7 @@ struct ub960_txport { u8 nport; /* TX port number, and index in priv->txport[] */ u32 num_data_lanes; + bool non_continous_clk; }; struct ub960_data { @@ -1133,6 +1135,9 @@ static int ub960_parse_dt_txport(struct ub960_data *priv, goto err_free_txport; } + txport->non_continous_clk = vep.bus.mipi_csi2.flags & + V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK; + txport->num_data_lanes = vep.bus.mipi_csi2.num_data_lanes; if (vep.nr_of_link_frequencies != 1) { @@ -1744,6 +1749,9 @@ static void ub960_init_tx_port(struct ub960_data *priv, csi_ctl |= (4 - txport->num_data_lanes) << 4; + if (!txport->non_continous_clk) + csi_ctl |= UB960_TR_CSI_CTL_CSI_CONTS_CLOCK; + ub960_txport_write(priv, nport, UB960_TR_CSI_CTL, csi_ctl); } |
