summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/ccs
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2020-06-18 12:39:44 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-12-07 15:53:34 +0100
commitae502e08f45e47460406ab5c5fd2167a1011499a (patch)
tree8b743d89ffc86319778debce13e8b8db9765eea9 /drivers/media/i2c/ccs
parent585e17c98407e1c2ec7735f37379e96cf0f74e3a (diff)
media: ccs-pll: Add support for decoupled OP domain calculation
Add support for decoupled OP domain clock calculation. This means that the number of VT and OP domain clocks are no longer dependent on the number of CSI-2 lanes in the lane speed mode. The support also replaces the existing quirk flag to calculate OP domain clocks per lane. Also support decoupled OP domain calculation in the CCS driver. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/i2c/ccs')
-rw-r--r--drivers/media/i2c/ccs/ccs-core.c14
-rw-r--r--drivers/media/i2c/ccs/ccs-quirk.c5
2 files changed, 15 insertions, 4 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index a0d73e0fa31a..855e51675864 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -3206,10 +3206,18 @@ static int ccs_probe(struct i2c_client *client)
sensor->pll.csi2.lanes = sensor->hwcfg.lanes;
if (CCS_LIM(sensor, CLOCK_CALCULATION) &
CCS_CLOCK_CALCULATION_LANE_SPEED) {
- sensor->pll.vt_lanes =
- CCS_LIM(sensor, NUM_OF_VT_LANES) + 1;
- sensor->pll.op_lanes = sensor->pll.vt_lanes;
sensor->pll.flags |= CCS_PLL_FLAG_LANE_SPEED_MODEL;
+ if (CCS_LIM(sensor, CLOCK_CALCULATION) &
+ CCS_CLOCK_CALCULATION_LINK_DECOUPLED) {
+ sensor->pll.vt_lanes =
+ CCS_LIM(sensor, NUM_OF_VT_LANES) + 1;
+ sensor->pll.op_lanes =
+ CCS_LIM(sensor, NUM_OF_OP_LANES) + 1;
+ sensor->pll.flags |= CCS_PLL_FLAG_LINK_DECOUPLED;
+ } else {
+ sensor->pll.vt_lanes = sensor->pll.csi2.lanes;
+ sensor->pll.op_lanes = sensor->pll.csi2.lanes;
+ }
}
sensor->pll.ext_clk_freq_hz = sensor->hwcfg.ext_clk;
sensor->pll.scale_n = CCS_LIM(sensor, SCALER_N_MIN);
diff --git a/drivers/media/i2c/ccs/ccs-quirk.c b/drivers/media/i2c/ccs/ccs-quirk.c
index 4fe8c6f70579..e3d4c7a275bc 100644
--- a/drivers/media/i2c/ccs/ccs-quirk.c
+++ b/drivers/media/i2c/ccs/ccs-quirk.c
@@ -190,7 +190,10 @@ static int jt8ev1_post_streamoff(struct ccs_sensor *sensor)
static int jt8ev1_init(struct ccs_sensor *sensor)
{
- sensor->pll.flags |= CCS_PLL_FLAG_OP_PIX_CLOCK_PER_LANE;
+ sensor->pll.flags |= CCS_PLL_FLAG_LANE_SPEED_MODEL |
+ CCS_PLL_FLAG_LINK_DECOUPLED;
+ sensor->pll.vt_lanes = 1;
+ sensor->pll.op_lanes = sensor->pll.csi2.lanes;
return 0;
}