media: ccs-pll: Differentiate between CSI-2 D-PHY and C-PHY
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 22 Jun 2020 10:37:45 +0000 (12:37 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 7 Dec 2020 14:39:38 +0000 (15:39 +0100)
Differentiate between CSI-2 D-PHY and C-PHY. This does not yet include
support for C-PHY.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/ccs-pll.c
drivers/media/i2c/ccs-pll.h
drivers/media/i2c/ccs/ccs-core.c

index da97a2b917171f43290522449d398e8de9d78aaa..c6435ed0597ed74ac49a87dd3caf145eeb894b4c 100644 (file)
@@ -430,7 +430,7 @@ int ccs_pll_calculate(struct device *dev, const struct ccs_pll_limits *lim,
                pll->binning_vertical);
 
        switch (pll->bus_type) {
-       case CCS_PLL_BUS_TYPE_CSI2:
+       case CCS_PLL_BUS_TYPE_CSI2_DPHY:
                /* CSI transfers 2 bits per clock per lane; thus times 2 */
                op_pll_fr->pll_op_clk_freq_hz = pll->link_freq * 2
                        * (pll->csi2.lanes / lane_op_clock_ratio);
index 578c9272688a6a50ae0dc0f864a8d2fc032516f4..d06a80c4fc52bd8e29db478e9567f42e0f875d9f 100644 (file)
@@ -13,7 +13,8 @@
 #define CCS_PLL_H
 
 /* CSI-2 or CCP-2 */
-#define CCS_PLL_BUS_TYPE_CSI2                                  0x00
+#define CCS_PLL_BUS_TYPE_CSI2_DPHY                             0x00
+#define CCS_PLL_BUS_TYPE_CSI2_CPHY                             0x01
 
 /* op pix clock is for all lanes in total normally */
 #define CCS_PLL_FLAG_OP_PIX_CLOCK_PER_LANE                     (1 << 0)
index dbb31d2001fbb76d958e80be702619b6ef4a4f62..a422a523057e48835b5de7bd77e9c27b862d8aa8 100644 (file)
@@ -3200,7 +3200,7 @@ static int ccs_probe(struct i2c_client *client)
        sensor->scale_m = CCS_LIM(sensor, SCALER_N_MIN);
 
        /* prepare PLL configuration input values */
-       sensor->pll.bus_type = CCS_PLL_BUS_TYPE_CSI2;
+       sensor->pll.bus_type = CCS_PLL_BUS_TYPE_CSI2_DPHY;
        sensor->pll.csi2.lanes = sensor->hwcfg.lanes;
        sensor->pll.ext_clk_freq_hz = sensor->hwcfg.ext_clk;
        sensor->pll.scale_n = CCS_LIM(sensor, SCALER_N_MIN);