* [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100
@ 2026-10-16 10:57 ` George Neacsu via B4 Relay
2026-10-16 10:57 ` [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options George Neacsu via B4 Relay
` (4 more replies)
0 siblings, 5 replies; 18+ messages in thread
From: George Neacsu via B4 Relay @ 2026-10-16 10:57 UTC (permalink / raw)
To: Bryan O'Donoghue, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel, Bryan O'Donoghue,
George Neacsu
Hi Bryan, Vinod, David,
The Snapdragon Surface Pro 11's front camera, an IMX681, is on CSIPHY2
over one MIPI C-PHY trio. linux-next has the CSI2 PHY driver and the CAMSS
PHY API path, and C-PHY is the piece still missing for this camera. This
series adds the PHY side:
1. PHY_MODE_MIPI_CPHY and C-PHY configuration options in the generic PHY
framework, because CAMSS had no way to ask the PHY for C-PHY;
2. C-PHY configuration helpers, the analogue of
phy_mipi_dphy_get_default_config_for_hsclk();
3. a rename of the D-PHY init sequence in qcom-mipi-csi2;
4. C-PHY in qcom-mipi-csi2, with the X1E80100 sequence taken from
Qualcomm's GPL-2.0 downstream header.
v2 is on next-20261015 and applies there on its own. The two CAMSS
patches from v1 (the CSID 680 PHY type select, and C-PHY in
csiphy_stream_on()) build on David's "media: camss: Add support for C-PHY
configuration on Qualcomm platforms" v9, which is not in linux-next yet,
so I have left them out and will send them on top of David's series:
https://lore.kernel.org/all/20260617-qcom-cphy-v9-0-83da8a8e4e44@ixit.cz/
Tested on the Surface Pro 11 (X1E80100) with David's v9 and those two
patches on top, through the upstream stack: CSI2 PHY nodes as in Bryan's
x1e80100 camera DT v7, and CAMSS in PHY API mode, with raw capture over
RDI:
- front IMX681 (Sergey's and Andre's v8 driver plus its C-PHY RFC) on
CSIPHY2, one C-PHY trio at 2.4 Gsym/s: 3844x2640 at 30 fps, and the
sensor's colour bars are byte-identical to the pattern captured with an
out-of-tree driver. The settle count is now computed (28 at a 400 MHz
timer), and any value from 6 to 48 gives the same frames;
- rear OV13858 on CSIPHY1, four D-PHY lanes: 29.9 fps with the same
settle count as before the series.
The kernel was 7.1.5, with linux-next's CAMSS and CSI2 PHY built as
modules; the test build needed shims only for API differences.
Open question, from Nihal: the X1E table is Qualcomm's 2.5 Gsps one, and
downstream picks C-PHY settings by symbol rate. I would keep a single
table here and add selection by rate when a second rate is needed,
unless you would rather have the structure now.
Thanks,
George
---
Changes in v2:
- Rebase on next-20261015, PHY patches only; the CAMSS patches follow
David's series (Bryan)
- phy: rename lanes to trios (Loic), make symbol_rate unsigned long long
so 32-bit can hold rates above 4.29 Gsym/s, and keep Bryan's R-b for
that patch
- phy: new patch with the C-PHY helpers (Bryan, Loic)
- qcom-mipi-csi2: new patch renaming init_seq/lane_array_size to
dphy_init_seq/dphy_lane_array_size (Bryan)
- qcom-mipi-csi2: rename the C-PHY table to lane_regs_v2_1_2_cphy and
shorten its comment (Konrad)
- qcom-mipi-csi2: no separate bus_type; the endpoint sets phy_mode and
set_mode() checks against it (Nihal)
- qcom-mipi-csi2: if/else instead of the ternaries, one declaration per
line, and lanes_enable() split into lane mask and polarity helpers
instead of the goto (Bryan, Nihal)
- qcom-mipi-csi2: configure() uses the helpers and keeps the link
frequency, so clocks scale as for D-PHY
- qcom-mipi-csi2: compute the C-PHY settle count instead of the fixed
table value; blank lines between the per-trio blocks; fsleep() for the
sequence delays (Nihal)
- qcom-mipi-csi2: drop the video-interfaces.h include, no longer needed
- Link to v1: https://lore.kernel.org/r/20261015-x1e-cphy-rfc-v1-0-1f3fa9af940a@gmail.com
---
George Neacsu (4):
phy: Add MIPI C-PHY mode and configuration options
phy: Add MIPI C-PHY configuration helpers
phy: qcom-mipi-csi2: Rename the D-PHY init sequence
phy: qcom-mipi-csi2: Add C-PHY support for X1E80100
drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c | 220 ++++++++++++++++++---
drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c | 53 ++++-
drivers/phy/qualcomm/phy-qcom-mipi-csi2.h | 6 +-
include/linux/phy/phy-mipi-cphy.h | 88 +++++++++
include/linux/phy/phy.h | 5 +
5 files changed, 339 insertions(+), 33 deletions(-)
---
base-commit: b810335a0699d1810683796b0e3ffe8827ddfe6c
change-id: 20261015-x1e-cphy-rfc-201860c8097f
Best regards,
--
George Neacsu <geocausa@gmail.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options
2026-10-16 10:57 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100 George Neacsu via B4 Relay
@ 2026-10-16 10:57 ` George Neacsu via B4 Relay
2026-10-16 11:35 ` Nihal Kumar Gupta
2026-10-16 14:16 ` Loic Poulain
2026-10-16 10:57 ` [PATCH RFC v2 2/4] phy: Add MIPI C-PHY configuration helpers George Neacsu via B4 Relay
` (3 subsequent siblings)
4 siblings, 2 replies; 18+ messages in thread
From: George Neacsu via B4 Relay @ 2026-10-16 10:57 UTC (permalink / raw)
To: Bryan O'Donoghue, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel, Bryan O'Donoghue,
George Neacsu
From: George Neacsu <geocausa@gmail.com>
The generic PHY framework has a mode and configuration options for MIPI
D-PHY but none for C-PHY, so a CSI-2 receiver has no way to ask a PHY
that does both for C-PHY. Add PHY_MODE_MIPI_CPHY and struct
phy_configure_opts_mipi_cphy. The options are the two values a receiver
knows: the symbol rate on each trio and the number of trios.
The first user is the Qualcomm CSI2 PHY, whose X1E80100 instances carry
the C-PHY front camera of the Surface Pro 11.
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: George Neacsu <geocausa@gmail.com>
---
include/linux/phy/phy-mipi-cphy.h | 27 +++++++++++++++++++++++++++
include/linux/phy/phy.h | 5 +++++
2 files changed, 32 insertions(+)
diff --git a/include/linux/phy/phy-mipi-cphy.h b/include/linux/phy/phy-mipi-cphy.h
new file mode 100644
index 000000000..ef6af61de
--- /dev/null
+++ b/include/linux/phy/phy-mipi-cphy.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __PHY_MIPI_CPHY_H_
+#define __PHY_MIPI_CPHY_H_
+
+/**
+ * struct phy_configure_opts_mipi_cphy - MIPI C-PHY configuration set
+ *
+ * This structure is used to represent the configuration state of a
+ * MIPI C-PHY phy.
+ */
+struct phy_configure_opts_mipi_cphy {
+ /**
+ * @symbol_rate:
+ *
+ * Symbol rate on each trio, in symbols per second.
+ */
+ unsigned long long symbol_rate;
+
+ /**
+ * @trios:
+ *
+ * Number of active trios.
+ */
+ unsigned char trios;
+};
+
+#endif /* __PHY_MIPI_CPHY_H_ */
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index c480d6cb4..f12337834 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -19,6 +19,7 @@
#include <linux/phy/phy-dp.h>
#include <linux/phy/phy-hdmi.h>
#include <linux/phy/phy-lvds.h>
+#include <linux/phy/phy-mipi-cphy.h>
#include <linux/phy/phy-mipi-dphy.h>
#include <linux/phy/phy-thunderbolt.h>
@@ -42,6 +43,7 @@ enum phy_mode {
PHY_MODE_PCIE,
PHY_MODE_ETHERNET,
PHY_MODE_MIPI_DPHY,
+ PHY_MODE_MIPI_CPHY,
PHY_MODE_SATA,
PHY_MODE_LVDS,
PHY_MODE_DP,
@@ -69,6 +71,8 @@ union phy_notify {
*
* @mipi_dphy: Configuration set applicable for phys supporting
* the MIPI_DPHY phy mode.
+ * @mipi_cphy: Configuration set applicable for phys supporting
+ * the MIPI_CPHY phy mode.
* @dp: Configuration set applicable for phys supporting
* the DisplayPort protocol.
* @lvds: Configuration set applicable for phys supporting
@@ -78,6 +82,7 @@ union phy_notify {
*/
union phy_configure_opts {
struct phy_configure_opts_mipi_dphy mipi_dphy;
+ struct phy_configure_opts_mipi_cphy mipi_cphy;
struct phy_configure_opts_dp dp;
struct phy_configure_opts_lvds lvds;
struct phy_configure_opts_hdmi hdmi;
--
2.53.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH RFC v2 2/4] phy: Add MIPI C-PHY configuration helpers
2026-10-16 10:57 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100 George Neacsu via B4 Relay
2026-10-16 10:57 ` [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options George Neacsu via B4 Relay
@ 2026-10-16 10:57 ` George Neacsu via B4 Relay
2026-10-16 11:06 ` Bryan O'Donoghue
2026-10-16 10:57 ` [PATCH RFC v2 3/4] phy: qcom-mipi-csi2: Rename the D-PHY init sequence George Neacsu via B4 Relay
` (2 subsequent siblings)
4 siblings, 1 reply; 18+ messages in thread
From: George Neacsu via B4 Relay @ 2026-10-16 10:57 UTC (permalink / raw)
To: Bryan O'Donoghue, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel, George Neacsu
From: George Neacsu <geocausa@gmail.com>
A CSI-2 receiver knows the link frequency of its transmitter, and by the
V4L2 convention a C-PHY link frequency is half the symbol rate on each
trio. Add helpers so that the receiver and the PHY do not each open-code
that conversion, as phy_mipi_dphy_get_default_config_for_hsclk() does
for D-PHY:
- phy_mipi_cphy_get_default_config_for_link_freq() fills a
configuration from a link frequency and a trio count;
- phy_mipi_cphy_config_validate() checks for a symbol rate and one to
three trios;
- phy_mipi_cphy_link_freq() gives the link frequency of a configuration.
They are small enough to be inline, so no new Kconfig symbol is needed.
Suggested-by: Bryan O'Donoghue <bod@kernel.org>
Suggested-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: George Neacsu <geocausa@gmail.com>
---
include/linux/phy/phy-mipi-cphy.h | 61 +++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/include/linux/phy/phy-mipi-cphy.h b/include/linux/phy/phy-mipi-cphy.h
index ef6af61de..f6746dcb0 100644
--- a/include/linux/phy/phy-mipi-cphy.h
+++ b/include/linux/phy/phy-mipi-cphy.h
@@ -2,6 +2,10 @@
#ifndef __PHY_MIPI_CPHY_H_
#define __PHY_MIPI_CPHY_H_
+#include <linux/errno.h>
+
+#define PHY_MIPI_CPHY_MAX_TRIOS 3
+
/**
* struct phy_configure_opts_mipi_cphy - MIPI C-PHY configuration set
*
@@ -24,4 +28,61 @@ struct phy_configure_opts_mipi_cphy {
unsigned char trios;
};
+/**
+ * phy_mipi_cphy_config_validate() - Validate a MIPI C-PHY configuration
+ * @cfg: configuration to check
+ *
+ * Return: 0 if @cfg has a symbol rate and one to three trios, -EINVAL
+ * otherwise.
+ */
+static inline int
+phy_mipi_cphy_config_validate(const struct phy_configure_opts_mipi_cphy *cfg)
+{
+ if (!cfg->symbol_rate)
+ return -EINVAL;
+
+ if (cfg->trios < 1 || cfg->trios > PHY_MIPI_CPHY_MAX_TRIOS)
+ return -EINVAL;
+
+ return 0;
+}
+
+/**
+ * phy_mipi_cphy_get_default_config_for_link_freq() - C-PHY configuration
+ * from a link frequency
+ * @link_freq: link frequency in Hz
+ * @trios: number of active trios
+ * @cfg: configuration to fill
+ *
+ * A C-PHY link frequency is half the symbol rate on each trio, the
+ * convention V4L2 uses for the link frequency of a C-PHY transmitter.
+ *
+ * Return: 0 on success, -EINVAL if the resulting configuration is invalid.
+ */
+static inline int
+phy_mipi_cphy_get_default_config_for_link_freq(unsigned long long link_freq,
+ unsigned int trios,
+ struct phy_configure_opts_mipi_cphy *cfg)
+{
+ if (trios > PHY_MIPI_CPHY_MAX_TRIOS)
+ return -EINVAL;
+
+ cfg->symbol_rate = link_freq * 2;
+ cfg->trios = trios;
+
+ return phy_mipi_cphy_config_validate(cfg);
+}
+
+/**
+ * phy_mipi_cphy_link_freq() - Link frequency of a MIPI C-PHY configuration
+ * @cfg: configuration
+ *
+ * Return: the link frequency in Hz, half the symbol rate on each trio.
+ */
+static inline unsigned long long
+phy_mipi_cphy_link_freq(const struct phy_configure_opts_mipi_cphy *cfg)
+{
+ return cfg->symbol_rate / 2;
+}
+
#endif /* __PHY_MIPI_CPHY_H_ */
--
2.53.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH RFC v2 3/4] phy: qcom-mipi-csi2: Rename the D-PHY init sequence
2026-10-16 10:57 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100 George Neacsu via B4 Relay
2026-10-16 10:57 ` [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options George Neacsu via B4 Relay
2026-10-16 10:57 ` [PATCH RFC v2 2/4] phy: Add MIPI C-PHY configuration helpers George Neacsu via B4 Relay
@ 2026-10-16 10:57 ` George Neacsu via B4 Relay
2026-10-16 11:07 ` Bryan O'Donoghue
2026-10-16 10:57 ` [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100 George Neacsu via B4 Relay
2026-10-16 11:02 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY " Bryan O'Donoghue
4 siblings, 1 reply; 18+ messages in thread
From: George Neacsu via B4 Relay @ 2026-10-16 10:57 UTC (permalink / raw)
To: Bryan O'Donoghue, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel, George Neacsu
From: George Neacsu <geocausa@gmail.com>
The init sequence and its size describe the D-PHY mode only. Call them
dphy_init_seq and dphy_lane_array_size, so that a C-PHY sequence can sit
next to them under matching names.
No functional change.
Suggested-by: Bryan O'Donoghue <bod@kernel.org>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: George Neacsu <geocausa@gmail.com>
---
drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c | 8 ++++----
drivers/phy/qualcomm/phy-qcom-mipi-csi2.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
index 966d79c98..b2d4ec3e8 100644
--- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
+++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
@@ -246,8 +246,8 @@ phy_qcom_mipi_csi2_gen2_config_lanes(struct mipi_csi2phy_device *csi2phy,
u8 settle_cnt)
{
const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy);
- const struct mipi_csi2phy_lane_regs *r = regs->init_seq;
- int i, array_size = regs->lane_array_size;
+ const struct mipi_csi2phy_lane_regs *r = regs->dphy_init_seq;
+ int i, array_size = regs->dphy_lane_array_size;
u32 val;
for (i = 0; i < array_size; i++, r++) {
@@ -372,8 +372,8 @@ static struct mipi_csi2_genpd x1e_genpds[] = {
const struct mipi_csi2phy_soc_cfg mipi_csi2_dphy_4nm_x1e = {
.ops = &phy_qcom_mipi_csi2_ops_3ph_1_0,
.reg_info = {
- .init_seq = lane_regs_x1e80100,
- .lane_array_size = ARRAY_SIZE(lane_regs_x1e80100),
+ .dphy_init_seq = lane_regs_x1e80100,
+ .dphy_lane_array_size = ARRAY_SIZE(lane_regs_x1e80100),
.common_regs_offset = 0x1000,
},
.supply_names = (const char **)x1e_supplies,
diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
index 7e55ae007..0d6031a4d 100644
--- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
+++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
@@ -48,8 +48,8 @@ struct mipi_csi2phy_lane_regs {
};
struct mipi_csi2phy_device_regs {
- const struct mipi_csi2phy_lane_regs *init_seq;
- const int lane_array_size;
+ const struct mipi_csi2phy_lane_regs *dphy_init_seq;
+ const int dphy_lane_array_size;
const u32 common_regs_offset;
};
--
2.53.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100
2026-10-16 10:57 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100 George Neacsu via B4 Relay
` (2 preceding siblings ...)
2026-10-16 10:57 ` [PATCH RFC v2 3/4] phy: qcom-mipi-csi2: Rename the D-PHY init sequence George Neacsu via B4 Relay
@ 2026-10-16 10:57 ` George Neacsu via B4 Relay
2026-10-16 11:15 ` Bryan O'Donoghue
` (2 more replies)
2026-10-16 11:02 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY " Bryan O'Donoghue
4 siblings, 3 replies; 18+ messages in thread
From: George Neacsu via B4 Relay @ 2026-10-16 10:57 UTC (permalink / raw)
To: Bryan O'Donoghue, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel, George Neacsu
From: George Neacsu <geocausa@gmail.com>
The CSI2 PHY schema already allows bus-type C-PHY, but the driver
rejects it. Accept it on SoCs that provide a C-PHY sequence, with up to
three trios and no lane polarities. The endpoint's bus-type now sets the
PHY mode, set_mode() only accepts that mode, and in C-PHY mode
configure() takes the symbol rate and keeps the matching link frequency,
so clock scaling works as for D-PHY.
lanes_enable() picks the sequence for the mode and is split into
helpers: the CTRL5 lane mask, where the trios are the odd bits and the
D-PHY data lanes the even ones plus the clock bit, and the D-PHY lane
polarities. The settle count is computed in both modes. With a C-PHY
link frequency of half the symbol rate, the unit interval in the
existing formula is one symbol, which is also how David Heidelberg's
CAMSS C-PHY series computes it. Sequence delays now use fsleep(), as
the C-PHY sequence waits 3 ms after its reset exit.
The X1E80100 sequence is Qualcomm's for the v2.1.2 3PH PHY at 2.5 Gsps,
taken from the downstream camera driver's GPL-2.0
cam_csiphy_2_1_2_hwreg.h (csiphy_3ph_v2_1_2_reg, datarate_212_2p5Gsps
and the 3PH reset exit), as the D-PHY sequence above it is. Its three
settle count entries are the ones downstream marks as such.
Tested on the Surface Pro 11 (X1E80100) with an IMX681 on CSIPHY2, one
trio at 2.4 Gsym/s, and raw capture through CSID1 and an RDI interface,
with David's CAMSS C-PHY series and two CAMSS patches on top:
3844x2640 at 30 fps, and the sensor's colour bars are byte-identical to
the same pattern captured with an out-of-tree driver. The timer runs at
400 MHz and the computed settle count is 28; forcing anything from 6 to
48 gives the same frames. D-PHY is unchanged: an OV13858 on CSIPHY1
over four lanes streams at 29.9 fps with the same settle count as
before.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: George Neacsu <geocausa@gmail.com>
---
drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c | 216 ++++++++++++++++++---
drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c | 53 ++++-
drivers/phy/qualcomm/phy-qcom-mipi-csi2.h | 2 +
3 files changed, 242 insertions(+), 29 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
index b2d4ec3e8..39e48e7ac 100644
--- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
+++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
@@ -161,6 +161,137 @@ mipi_csi2phy_lane_regs lane_regs_x1e80100[] = {
{.reg_addr = 0x0c64, .reg_data = 0x7f, .param_type = CSIPHY_SKEW_CAL},
};
+/* Qualcomm's 2.5 Gsps settings, from the GPL-2.0 cam_csiphy_2_1_2_hwreg.h */
+static const struct
+mipi_csi2phy_lane_regs lane_regs_v2_1_2_cphy[] = {
+ /* Power up lanes 3ph mode */
+ {.reg_addr = 0x101c, .reg_data = 0x7a, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x1018, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ /* datarate_212_2p5Gsps: AFE settings */
+ {.reg_addr = 0x0268, .reg_data = 0xf1, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0294, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0288, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0278, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x026c, .reg_data = 0x3d, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x028c, .reg_data = 0x30, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0270, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0274, .reg_data = 0x03, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ {.reg_addr = 0x0668, .reg_data = 0xf1, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0694, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0688, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0678, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x066c, .reg_data = 0x3d, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x068c, .reg_data = 0x30, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0670, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0674, .reg_data = 0x03, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ {.reg_addr = 0x0a68, .reg_data = 0xf1, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a94, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a88, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a78, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a6c, .reg_data = 0x3d, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a8c, .reg_data = 0x30, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a70, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a74, .reg_data = 0x03, .delay_us = 10, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ /* csiphy_3ph_v2_1_2_reg */
+ {.reg_addr = 0x02f4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x02f8, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x02fc, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x02f0, .reg_data = 0xef, .delay_us = 3, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ {.reg_addr = 0x06f4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x06f8, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x06fc, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x06f0, .reg_data = 0xef, .delay_us = 3, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ {.reg_addr = 0x0af4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0af8, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0afc, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0af0, .reg_data = 0xef, .delay_us = 3, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ /* datarate_212_2p5Gsps, then csiphy_3ph_v2_1_2_reg */
+ {.reg_addr = 0x020c, .reg_data = 0x22, .param_type = CSIPHY_SETTLE_CNT_LOWER_BYTE},
+ {.reg_addr = 0x0208, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0210, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0214, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0204, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x02e4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x02e8, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x02ec, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0218, .reg_data = 0x3e, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x021c, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0220, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0224, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0228, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x022c, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0264, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0244, .reg_data = 0xb2, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0310, .reg_data = 0x35, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x02bc, .reg_data = 0xd0, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0254, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0240, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0260, .reg_data = 0xa8, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0284, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0290, .reg_data = 0x02, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ /* datarate_212_2p5Gsps, then csiphy_3ph_v2_1_2_reg */
+ {.reg_addr = 0x060c, .reg_data = 0x22, .param_type = CSIPHY_SETTLE_CNT_LOWER_BYTE},
+ {.reg_addr = 0x0608, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0610, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0614, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0604, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x06e4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x06e8, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x06ec, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0618, .reg_data = 0x3e, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x061c, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0620, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0624, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0628, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x062c, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0664, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0644, .reg_data = 0xb2, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0710, .reg_data = 0x35, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x06bc, .reg_data = 0xd0, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0654, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0640, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0660, .reg_data = 0xa8, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0684, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0690, .reg_data = 0x02, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ /* datarate_212_2p5Gsps, then csiphy_3ph_v2_1_2_reg */
+ {.reg_addr = 0x0a0c, .reg_data = 0x22, .param_type = CSIPHY_SETTLE_CNT_LOWER_BYTE},
+ {.reg_addr = 0x0a08, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a10, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a14, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a04, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0ae4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0ae8, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0aec, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a18, .reg_data = 0x3e, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a1c, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a20, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a24, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a28, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a2c, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a64, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a44, .reg_data = 0xb2, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0b10, .reg_data = 0x35, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0abc, .reg_data = 0xd0, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a54, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a40, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a60, .reg_data = 0xa8, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a84, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
+ {.reg_addr = 0x0a90, .reg_data = 0x02, .param_type = CSIPHY_DEFAULT_PARAMS},
+
+ /* csiphy_reset_exit_reg_2_1_2, 3PH */
+ {.reg_addr = 0x1000, .reg_data = 0x0e, .delay_us = 3048,
+ .param_type = CSIPHY_DEFAULT_PARAMS},
+};
+
static inline const struct mipi_csi2phy_device_regs *
csi2phy_dev_to_regs(struct mipi_csi2phy_device *csi2phy)
{
@@ -246,9 +377,18 @@ phy_qcom_mipi_csi2_gen2_config_lanes(struct mipi_csi2phy_device *csi2phy,
u8 settle_cnt)
{
const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy);
- const struct mipi_csi2phy_lane_regs *r = regs->dphy_init_seq;
- int i, array_size = regs->dphy_lane_array_size;
+ const struct mipi_csi2phy_lane_regs *r;
+ int array_size;
u32 val;
+ int i;
+
+ if (csi2phy->phy_mode == PHY_MODE_MIPI_CPHY) {
+ r = regs->cphy_init_seq;
+ array_size = regs->cphy_lane_array_size;
+ } else {
+ r = regs->dphy_init_seq;
+ array_size = regs->dphy_lane_array_size;
+ }
for (i = 0; i < array_size; i++, r++) {
switch (r->param_type) {
@@ -264,38 +404,41 @@ phy_qcom_mipi_csi2_gen2_config_lanes(struct mipi_csi2phy_device *csi2phy,
}
writel(val, csi2phy->base + r->reg_addr);
if (r->delay_us)
- udelay(r->delay_us);
+ fsleep(r->delay_us);
}
}
-static int phy_qcom_mipi_csi2_lanes_enable(struct mipi_csi2phy_device *csi2phy,
- struct mipi_csi2phy_stream_cfg *cfg)
+/*
+ * CSI_COMMON_CTRL5 is a physical lane power-up bitmap:
+ * - Bits [0,2,4,6] → D-PHY data lanes(LN0, LN2, LN4, LN6)
+ * - Bits [1,3,5] → C-PHY trio lanes(LN1, LN3, LN5)
+ * - Bit [7] → D-PHY clock lane(LNCK) dedicated clock enable
+ */
+static u8 phy_qcom_mipi_csi2_lane_mask(struct mipi_csi2phy_device *csi2phy,
+ struct mipi_csi2phy_stream_cfg *cfg)
{
- const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy);
struct mipi_csi2phy_lanes_cfg *lane_cfg = &cfg->lane_cfg;
- u8 settle_cnt;
- u8 val;
+ u8 lane_mask = 0;
+ u8 offset = 0;
int i;
- if (cfg->link_freq <= 0)
- return -EINVAL;
-
- settle_cnt = phy_qcom_mipi_csi2_settle_cnt_calc(cfg->link_freq, csi2phy->timer_clk_rate);
- if (!settle_cnt)
- return -ENODEV;
+ if (csi2phy->phy_mode == PHY_MODE_MIPI_CPHY)
+ offset = 1;
+ else
+ lane_mask = BIT(lane_cfg->clk.pos);
- /*
- * CSI_COMMON_CTRL5 is a physical lane power-up bitmap:
- * - Bits [0,2,4,6] → D-PHY data lanes(LN0, LN2, LN4, LN6)
- * - Bits [1,3,5] → C-PHY trio lanes(LN1, LN3, LN5)
- * - Bit [7] → D-PHY clock lane(LNCK) dedicated clock enable
- */
- val = BIT(lane_cfg->clk.pos);
for (i = 0; i < cfg->num_data_lanes; i++)
- val |= BIT(lane_cfg->data[i].pos * 2);
+ lane_mask |= BIT(lane_cfg->data[i].pos * 2 + offset);
- writel(val, csi2phy->base +
- CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 5));
+ return lane_mask;
+}
+
+static void
+phy_qcom_mipi_csi2_dphy_lane_polarities(struct mipi_csi2phy_device *csi2phy,
+ struct mipi_csi2phy_stream_cfg *cfg)
+{
+ struct mipi_csi2phy_lanes_cfg *lane_cfg = &cfg->lane_cfg;
+ int i;
/* Lane configuration for polarity @ CSIPHY-base + CTRL9 */
for (i = 0; i < cfg->num_data_lanes; i++) {
@@ -308,6 +451,29 @@ static int phy_qcom_mipi_csi2_lanes_enable(struct mipi_csi2phy_device *csi2phy,
if (lane_cfg->clk.pol)
writel(BIT(2), csi2phy->base + CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(lane_cfg->clk.pos));
+}
+
+static int phy_qcom_mipi_csi2_lanes_enable(struct mipi_csi2phy_device *csi2phy,
+ struct mipi_csi2phy_stream_cfg *cfg)
+{
+ const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy);
+ u8 settle_cnt;
+ u8 val;
+ int i;
+
+ if (cfg->link_freq <= 0)
+ return -EINVAL;
+
+ settle_cnt = phy_qcom_mipi_csi2_settle_cnt_calc(cfg->link_freq, csi2phy->timer_clk_rate);
+ if (!settle_cnt)
+ return -ENODEV;
+
+ val = phy_qcom_mipi_csi2_lane_mask(csi2phy, cfg);
+ writel(val, csi2phy->base +
+ CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 5));
+
+ if (csi2phy->phy_mode == PHY_MODE_MIPI_DPHY)
+ phy_qcom_mipi_csi2_dphy_lane_polarities(csi2phy, cfg);
val = CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B;
writel(val, csi2phy->base +
@@ -374,6 +540,8 @@ const struct mipi_csi2phy_soc_cfg mipi_csi2_dphy_4nm_x1e = {
.reg_info = {
.dphy_init_seq = lane_regs_x1e80100,
.dphy_lane_array_size = ARRAY_SIZE(lane_regs_x1e80100),
+ .cphy_init_seq = lane_regs_v2_1_2_cphy,
+ .cphy_lane_array_size = ARRAY_SIZE(lane_regs_v2_1_2_cphy),
.common_regs_offset = 0x1000,
},
.supply_names = (const char **)x1e_supplies,
diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c
index c0a4fa20e..1185561a1 100644
--- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c
+++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c
@@ -96,6 +96,25 @@ phy_qcom_mipi_csi2_set_clock_rates(struct mipi_csi2phy_device *csi2phy,
return ret;
}
+static int
+phy_qcom_mipi_csi2_configure_cphy(struct mipi_csi2phy_device *csi2phy,
+ struct phy_configure_opts_mipi_cphy *cphy_cfg)
+{
+ struct mipi_csi2phy_stream_cfg *stream_cfg = &csi2phy->stream_cfg;
+ int ret;
+
+ ret = phy_mipi_cphy_config_validate(cphy_cfg);
+ if (ret)
+ return ret;
+
+ if (cphy_cfg->trios != stream_cfg->num_data_lanes)
+ return -EINVAL;
+
+ stream_cfg->link_freq = phy_mipi_cphy_link_freq(cphy_cfg);
+
+ return 0;
+}
+
static int phy_qcom_mipi_csi2_configure(struct phy *phy,
union phy_configure_opts *opts)
{
@@ -104,6 +123,9 @@ static int phy_qcom_mipi_csi2_configure(struct phy *phy,
struct mipi_csi2phy_stream_cfg *stream_cfg = &csi2phy->stream_cfg;
int ret;
+ if (csi2phy->phy_mode == PHY_MODE_MIPI_CPHY)
+ return phy_qcom_mipi_csi2_configure_cphy(csi2phy, &opts->mipi_cphy);
+
ret = phy_mipi_dphy_config_validate(dphy_cfg);
if (ret)
return ret;
@@ -124,10 +146,13 @@ static int phy_qcom_mipi_csi2_set_mode(struct phy *phy,
{
struct mipi_csi2phy_device *csi2phy = phy_get_drvdata(phy);
- if (mode != PHY_MODE_MIPI_DPHY)
+ if (mode != PHY_MODE_MIPI_DPHY && mode != PHY_MODE_MIPI_CPHY)
return -EOPNOTSUPP;
- csi2phy->phy_mode = mode;
+ /* The endpoint's bus-type sets the mode; only that one is accepted. */
+ if (mode != csi2phy->phy_mode)
+ return -EINVAL;
+
return 0;
}
@@ -258,6 +283,7 @@ static int phy_qcom_mipi_csi2_parse_routing(struct mipi_csi2phy_device *csi2phy)
struct fwnode_handle *ep;
int num_polarities;
int num_data_lanes;
+ int max_lanes;
u32 bus_type;
int i, ret;
@@ -278,14 +304,26 @@ static int phy_qcom_mipi_csi2_parse_routing(struct mipi_csi2phy_device *csi2phy)
bus_type = MEDIA_BUS_TYPE_CSI2_DPHY;
fwnode_property_read_u32(ep, "bus-type", &bus_type);
- if (bus_type != MEDIA_BUS_TYPE_CSI2_DPHY) {
+ switch (bus_type) {
+ case MEDIA_BUS_TYPE_CSI2_DPHY:
+ csi2phy->phy_mode = PHY_MODE_MIPI_DPHY;
+ max_lanes = CSI2_MAX_DATA_LANES;
+ break;
+ case MEDIA_BUS_TYPE_CSI2_CPHY:
+ if (csi2phy->soc_cfg->reg_info.cphy_init_seq) {
+ csi2phy->phy_mode = PHY_MODE_MIPI_CPHY;
+ max_lanes = PHY_MIPI_CPHY_MAX_TRIOS;
+ break;
+ }
+ fallthrough;
+ default:
ret = -EOPNOTSUPP;
dev_err(dev, "Unsupported bus-type %u\n", bus_type);
goto out_put;
}
num_data_lanes = fwnode_property_count_u32(ep, "data-lanes");
- if (num_data_lanes < 1 || num_data_lanes > CSI2_MAX_DATA_LANES) {
+ if (num_data_lanes < 1 || num_data_lanes > max_lanes) {
ret = -EINVAL;
dev_err(dev, "Invalid data-lanes count: %d\n", num_data_lanes);
goto out_put;
@@ -302,6 +340,11 @@ static int phy_qcom_mipi_csi2_parse_routing(struct mipi_csi2phy_device *csi2phy)
/* lane-polarities: optional, up to num_data_lanes + 1 entries */
memset(lane_polarities, 0x00, sizeof(lane_polarities));
num_polarities = fwnode_property_count_u32(ep, "lane-polarities");
+ if (num_polarities > 0 && bus_type == MEDIA_BUS_TYPE_CSI2_CPHY) {
+ ret = -EINVAL;
+ dev_err(dev, "lane-polarities do not apply to C-PHY\n");
+ goto out_put;
+ }
if (num_polarities > 0) {
if (num_polarities != stream_cfg->num_data_lanes + 1) {
ret = -EINVAL;
@@ -322,7 +365,7 @@ static int phy_qcom_mipi_csi2_parse_routing(struct mipi_csi2phy_device *csi2phy)
csi2phy->stream_cfg.lane_cfg.clk.pol = lane_polarities[0];
for (i = 0; i < csi2phy->stream_cfg.num_data_lanes; i++) {
- if (data_lanes[i] < 1 || data_lanes[i] > CSI2_MAX_DATA_LANES) {
+ if (data_lanes[i] < 1 || data_lanes[i] > max_lanes) {
dev_err(dev, "Invalid lane %d\n", data_lanes[i]);
ret = -EINVAL;
goto out_put;
diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
index 0d6031a4d..f49f334fd 100644
--- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
+++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
@@ -50,6 +50,8 @@ struct mipi_csi2phy_lane_regs {
struct mipi_csi2phy_device_regs {
const struct mipi_csi2phy_lane_regs *dphy_init_seq;
const int dphy_lane_array_size;
+ const struct mipi_csi2phy_lane_regs *cphy_init_seq;
+ const int cphy_lane_array_size;
const u32 common_regs_offset;
};
--
2.53.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100
2026-10-16 10:57 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100 George Neacsu via B4 Relay
` (3 preceding siblings ...)
2026-10-16 10:57 ` [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100 George Neacsu via B4 Relay
@ 2026-10-16 11:02 ` Bryan O'Donoghue
2026-10-16 11:32 ` George Neacsu
4 siblings, 1 reply; 18+ messages in thread
From: Bryan O'Donoghue @ 2026-10-16 11:02 UTC (permalink / raw)
To: geocausa, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel, Bryan O'Donoghue
On 16/10/2026 11:57, George Neacsu via B4 Relay wrote:
> Hi Bryan, Vinod, David,
Small point of order here - this is not really @ RFC status.
Don't resend but an RFC contains stuff you don't really expect to be
merged. OTOH you're basically submitting this series for inclusion => !RFC.
> The Snapdragon Surface Pro 11's front camera, an IMX681, is on CSIPHY2
> over one MIPI C-PHY trio. linux-next has the CSI2 PHY driver and the CAMSS
> PHY API path, and C-PHY is the piece still missing for this camera. This
> series adds the PHY side:
>
> 1. PHY_MODE_MIPI_CPHY and C-PHY configuration options in the generic PHY
> framework, because CAMSS had no way to ask the PHY for C-PHY;
> 2. C-PHY configuration helpers, the analogue of
> phy_mipi_dphy_get_default_config_for_hsclk();
> 3. a rename of the D-PHY init sequence in qcom-mipi-csi2;
> 4. C-PHY in qcom-mipi-csi2, with the X1E80100 sequence taken from
> Qualcomm's GPL-2.0 downstream header.
>
> v2 is on next-20261015 and applies there on its own. The two CAMSS
> patches from v1 (the CSID 680 PHY type select, and C-PHY in
> csiphy_stream_on()) build on David's "media: camss: Add support for C-PHY
> configuration on Qualcomm platforms" v9, which is not in linux-next yet,
> so I have left them out and will send them on top of David's series:
> https://lore.kernel.org/all/20260617-qcom-cphy-v9-0-83da8a8e4e44@ixit.cz/
>
> Tested on the Surface Pro 11 (X1E80100) with David's v9 and those two
> patches on top, through the upstream stack: CSI2 PHY nodes as in Bryan's
> x1e80100 camera DT v7, and CAMSS in PHY API mode, with raw capture over
> RDI:
> - front IMX681 (Sergey's and Andre's v8 driver plus its C-PHY RFC) on
> CSIPHY2, one C-PHY trio at 2.4 Gsym/s: 3844x2640 at 30 fps, and the
> sensor's colour bars are byte-identical to the pattern captured with an
> out-of-tree driver. The settle count is now computed (28 at a 400 MHz
> timer), and any value from 6 to 48 gives the same frames;
> - rear OV13858 on CSIPHY1, four D-PHY lanes: 29.9 fps with the same
> settle count as before the series.
> The kernel was 7.1.5, with linux-next's CAMSS and CSI2 PHY built as
> modules; the test build needed shims only for API differences.
What's this ?
"It builds" I can verify myself, "it works" is the thing. Just slow down
and get something you can test on hardware.
> Open question, from Nihal: the X1E table is Qualcomm's 2.5 Gsps one, and
> downstream picks C-PHY settings by symbol rate. I would keep a single
> table here and add selection by rate when a second rate is needed,
> unless you would rather have the structure now.
---
bod
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 2/4] phy: Add MIPI C-PHY configuration helpers
2026-10-16 10:57 ` [PATCH RFC v2 2/4] phy: Add MIPI C-PHY configuration helpers George Neacsu via B4 Relay
@ 2026-10-16 11:06 ` Bryan O'Donoghue
0 siblings, 0 replies; 18+ messages in thread
From: Bryan O'Donoghue @ 2026-10-16 11:06 UTC (permalink / raw)
To: geocausa, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel
On 16/10/2026 11:57, George Neacsu via B4 Relay wrote:
> From: George Neacsu <geocausa@gmail.com>
>
> A CSI-2 receiver knows the link frequency of its transmitter, and by the
> V4L2 convention a C-PHY link frequency is half the symbol rate on each
> trio. Add helpers so that the receiver and the PHY do not each open-code
> that conversion, as phy_mipi_dphy_get_default_config_for_hsclk() does
> for D-PHY:
>
> - phy_mipi_cphy_get_default_config_for_link_freq() fills a
> configuration from a link frequency and a trio count;
> - phy_mipi_cphy_config_validate() checks for a symbol rate and one to
> three trios;
> - phy_mipi_cphy_link_freq() gives the link frequency of a configuration.
>
> They are small enough to be inline, so no new Kconfig symbol is needed.
>
> Suggested-by: Bryan O'Donoghue <bod@kernel.org>
> Suggested-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: George Neacsu <geocausa@gmail.com>
> ---
> include/linux/phy/phy-mipi-cphy.h | 61 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 61 insertions(+)
>
> diff --git a/include/linux/phy/phy-mipi-cphy.h b/include/linux/phy/phy-mipi-cphy.h
> index ef6af61de..f6746dcb0 100644
> --- a/include/linux/phy/phy-mipi-cphy.h
> +++ b/include/linux/phy/phy-mipi-cphy.h
> @@ -2,6 +2,10 @@
> #ifndef __PHY_MIPI_CPHY_H_
> #define __PHY_MIPI_CPHY_H_
>
> +#include <linux/errno.h>
> +
> +#define PHY_MIPI_CPHY_MAX_TRIOS 3
> +
> /**
> * struct phy_configure_opts_mipi_cphy - MIPI C-PHY configuration set
> *
> @@ -24,4 +28,61 @@ struct phy_configure_opts_mipi_cphy {
> unsigned char trios;
> };
>
> +/**
> + * phy_mipi_cphy_config_validate() - Validate a MIPI C-PHY configuration
> + * @cfg: configuration to check
> + *
> + * Return: 0 if @cfg has a symbol rate and one to three trios, -EINVAL
> + * otherwise.
> + */
> +static inline int
> +phy_mipi_cphy_config_validate(const struct phy_configure_opts_mipi_cphy *cfg)
> +{
> + if (!cfg->symbol_rate)
> + return -EINVAL;
> +
> + if (cfg->trios < 1 || cfg->trios > PHY_MIPI_CPHY_MAX_TRIOS)
> + return -EINVAL;
> +
> + return 0;
> +}
> +
> +/**
> + * phy_mipi_cphy_get_default_config_for_link_freq() - C-PHY configuration
> + * from a link frequency
> + * @link_freq: link frequency in Hz
> + * @trios: number of active trios
> + * @cfg: configuration to fill
> + *
> + * A C-PHY link frequency is half the symbol rate on each trio, the
> + * convention V4L2 uses for the link frequency of a C-PHY transmitter.
> + *
> + * Return: 0 on success, -EINVAL if the resulting configuration is invalid.
> + */
> +static inline int
> +phy_mipi_cphy_get_default_config_for_link_freq(unsigned long long link_freq,
> + unsigned int trios,
> + struct phy_configure_opts_mipi_cphy *cfg)
> +{
> + if (trios > PHY_MIPI_CPHY_MAX_TRIOS)
> + return -EINVAL;
> +
> + cfg->symbol_rate = link_freq * 2;
> + cfg->trios = trios;
> +
> + return phy_mipi_cphy_config_validate(cfg);
> +}
> +
> +/**
> + * phy_mipi_cphy_link_freq() - Link frequency of a MIPI C-PHY configuration
> + * @cfg: configuration
> + *
> + * Return: the link frequency in Hz, half the symbol rate on each trio.
> + */
> +static inline unsigned long long
> +phy_mipi_cphy_link_freq(const struct phy_configure_opts_mipi_cphy *cfg)
> +{
> + return cfg->symbol_rate / 2;
> +}
> +
> #endif /* __PHY_MIPI_CPHY_H_ */
>
> --
> 2.53.0
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 3/4] phy: qcom-mipi-csi2: Rename the D-PHY init sequence
2026-10-16 10:57 ` [PATCH RFC v2 3/4] phy: qcom-mipi-csi2: Rename the D-PHY init sequence George Neacsu via B4 Relay
@ 2026-10-16 11:07 ` Bryan O'Donoghue
0 siblings, 0 replies; 18+ messages in thread
From: Bryan O'Donoghue @ 2026-10-16 11:07 UTC (permalink / raw)
To: geocausa, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel
On 16/10/2026 11:57, George Neacsu via B4 Relay wrote:
> From: George Neacsu <geocausa@gmail.com>
>
> The init sequence and its size describe the D-PHY mode only. Call them
> dphy_init_seq and dphy_lane_array_size, so that a C-PHY sequence can sit
> next to them under matching names.
>
> No functional change.
>
> Suggested-by: Bryan O'Donoghue <bod@kernel.org>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: George Neacsu <geocausa@gmail.com>
> ---
> drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c | 8 ++++----
> drivers/phy/qualcomm/phy-qcom-mipi-csi2.h | 4 ++--
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> index 966d79c98..b2d4ec3e8 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> @@ -246,8 +246,8 @@ phy_qcom_mipi_csi2_gen2_config_lanes(struct mipi_csi2phy_device *csi2phy,
> u8 settle_cnt)
> {
> const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy);
> - const struct mipi_csi2phy_lane_regs *r = regs->init_seq;
> - int i, array_size = regs->lane_array_size;
> + const struct mipi_csi2phy_lane_regs *r = regs->dphy_init_seq;
> + int i, array_size = regs->dphy_lane_array_size;
> u32 val;
>
> for (i = 0; i < array_size; i++, r++) {
> @@ -372,8 +372,8 @@ static struct mipi_csi2_genpd x1e_genpds[] = {
> const struct mipi_csi2phy_soc_cfg mipi_csi2_dphy_4nm_x1e = {
> .ops = &phy_qcom_mipi_csi2_ops_3ph_1_0,
> .reg_info = {
> - .init_seq = lane_regs_x1e80100,
> - .lane_array_size = ARRAY_SIZE(lane_regs_x1e80100),
> + .dphy_init_seq = lane_regs_x1e80100,
> + .dphy_lane_array_size = ARRAY_SIZE(lane_regs_x1e80100),
> .common_regs_offset = 0x1000,
> },
> .supply_names = (const char **)x1e_supplies,
> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> index 7e55ae007..0d6031a4d 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> @@ -48,8 +48,8 @@ struct mipi_csi2phy_lane_regs {
> };
>
> struct mipi_csi2phy_device_regs {
> - const struct mipi_csi2phy_lane_regs *init_seq;
> - const int lane_array_size;
> + const struct mipi_csi2phy_lane_regs *dphy_init_seq;
> + const int dphy_lane_array_size;
> const u32 common_regs_offset;
> };
>
>
> --
> 2.53.0
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100
2026-10-16 10:57 ` [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100 George Neacsu via B4 Relay
@ 2026-10-16 11:15 ` Bryan O'Donoghue
2026-10-16 11:35 ` Nihal Kumar Gupta
2026-10-16 12:24 ` David Heidelberg
2 siblings, 0 replies; 18+ messages in thread
From: Bryan O'Donoghue @ 2026-10-16 11:15 UTC (permalink / raw)
To: geocausa, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel
On 16/10/2026 11:57, George Neacsu via B4 Relay wrote:
> From: George Neacsu <geocausa@gmail.com>
>
> The CSI2 PHY schema already allows bus-type C-PHY, but the driver
> rejects it. Accept it on SoCs that provide a C-PHY sequence, with up to
> three trios and no lane polarities. The endpoint's bus-type now sets the
> PHY mode, set_mode() only accepts that mode, and in C-PHY mode
> configure() takes the symbol rate and keeps the matching link frequency,
> so clock scaling works as for D-PHY.
>
> lanes_enable() picks the sequence for the mode and is split into
> helpers: the CTRL5 lane mask, where the trios are the odd bits and the
> D-PHY data lanes the even ones plus the clock bit, and the D-PHY lane
> polarities. The settle count is computed in both modes. With a C-PHY
> link frequency of half the symbol rate, the unit interval in the
> existing formula is one symbol, which is also how David Heidelberg's
> CAMSS C-PHY series computes it. Sequence delays now use fsleep(), as
> the C-PHY sequence waits 3 ms after its reset exit.
>
> The X1E80100 sequence is Qualcomm's for the v2.1.2 3PH PHY at 2.5 Gsps,
> taken from the downstream camera driver's GPL-2.0
> cam_csiphy_2_1_2_hwreg.h (csiphy_3ph_v2_1_2_reg, datarate_212_2p5Gsps
> and the 3PH reset exit), as the D-PHY sequence above it is. Its three
> settle count entries are the ones downstream marks as such.
>
> Tested on the Surface Pro 11 (X1E80100) with an IMX681 on CSIPHY2, one
> trio at 2.4 Gsym/s, and raw capture through CSID1 and an RDI interface,
> with David's CAMSS C-PHY series and two CAMSS patches on top:
> 3844x2640 at 30 fps, and the sensor's colour bars are byte-identical to
> the same pattern captured with an out-of-tree driver. The timer runs at
> 400 MHz and the computed settle count is 28; forcing anything from 6 to
> 48 gives the same frames. D-PHY is unchanged: an OV13858 on CSIPHY1
> over four lanes streams at 29.9 fps with the same settle count as
> before.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: George Neacsu <geocausa@gmail.com>
> ---
> drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c | 216 ++++++++++++++++++---
> drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c | 53 ++++-
> drivers/phy/qualcomm/phy-qcom-mipi-csi2.h | 2 +
> 3 files changed, 242 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> index b2d4ec3e8..39e48e7ac 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> @@ -161,6 +161,137 @@ mipi_csi2phy_lane_regs lane_regs_x1e80100[] = {
> {.reg_addr = 0x0c64, .reg_data = 0x7f, .param_type = CSIPHY_SKEW_CAL},
> };
>
> +/* Qualcomm's 2.5 Gsps settings, from the GPL-2.0 cam_csiphy_2_1_2_hwreg.h */
> +static const struct
> +mipi_csi2phy_lane_regs lane_regs_v2_1_2_cphy[] = {
> + /* Power up lanes 3ph mode */
> + {.reg_addr = 0x101c, .reg_data = 0x7a, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x1018, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + /* datarate_212_2p5Gsps: AFE settings */
> + {.reg_addr = 0x0268, .reg_data = 0xf1, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0294, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0288, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0278, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x026c, .reg_data = 0x3d, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x028c, .reg_data = 0x30, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0270, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0274, .reg_data = 0x03, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + {.reg_addr = 0x0668, .reg_data = 0xf1, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0694, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0688, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0678, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x066c, .reg_data = 0x3d, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x068c, .reg_data = 0x30, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0670, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0674, .reg_data = 0x03, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + {.reg_addr = 0x0a68, .reg_data = 0xf1, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a94, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a88, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a78, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a6c, .reg_data = 0x3d, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a8c, .reg_data = 0x30, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a70, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a74, .reg_data = 0x03, .delay_us = 10, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + /* csiphy_3ph_v2_1_2_reg */
> + {.reg_addr = 0x02f4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x02f8, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x02fc, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x02f0, .reg_data = 0xef, .delay_us = 3, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + {.reg_addr = 0x06f4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x06f8, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x06fc, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x06f0, .reg_data = 0xef, .delay_us = 3, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + {.reg_addr = 0x0af4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0af8, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0afc, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0af0, .reg_data = 0xef, .delay_us = 3, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + /* datarate_212_2p5Gsps, then csiphy_3ph_v2_1_2_reg */
> + {.reg_addr = 0x020c, .reg_data = 0x22, .param_type = CSIPHY_SETTLE_CNT_LOWER_BYTE},
> + {.reg_addr = 0x0208, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0210, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0214, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0204, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x02e4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x02e8, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x02ec, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0218, .reg_data = 0x3e, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x021c, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0220, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0224, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0228, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x022c, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0264, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0244, .reg_data = 0xb2, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0310, .reg_data = 0x35, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x02bc, .reg_data = 0xd0, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0254, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0240, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0260, .reg_data = 0xa8, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0284, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0290, .reg_data = 0x02, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + /* datarate_212_2p5Gsps, then csiphy_3ph_v2_1_2_reg */
> + {.reg_addr = 0x060c, .reg_data = 0x22, .param_type = CSIPHY_SETTLE_CNT_LOWER_BYTE},
> + {.reg_addr = 0x0608, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0610, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0614, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0604, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x06e4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x06e8, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x06ec, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0618, .reg_data = 0x3e, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x061c, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0620, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0624, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0628, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x062c, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0664, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0644, .reg_data = 0xb2, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0710, .reg_data = 0x35, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x06bc, .reg_data = 0xd0, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0654, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0640, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0660, .reg_data = 0xa8, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0684, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0690, .reg_data = 0x02, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + /* datarate_212_2p5Gsps, then csiphy_3ph_v2_1_2_reg */
> + {.reg_addr = 0x0a0c, .reg_data = 0x22, .param_type = CSIPHY_SETTLE_CNT_LOWER_BYTE},
> + {.reg_addr = 0x0a08, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a10, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a14, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a04, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0ae4, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0ae8, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0aec, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a18, .reg_data = 0x3e, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a1c, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a20, .reg_data = 0x41, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a24, .reg_data = 0x7f, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a28, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a2c, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a64, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a44, .reg_data = 0xb2, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0b10, .reg_data = 0x35, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0abc, .reg_data = 0xd0, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a54, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a40, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a60, .reg_data = 0xa8, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a84, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a90, .reg_data = 0x02, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + /* csiphy_reset_exit_reg_2_1_2, 3PH */
> + {.reg_addr = 0x1000, .reg_data = 0x0e, .delay_us = 3048,
> + .param_type = CSIPHY_DEFAULT_PARAMS},
> +};
> +
> static inline const struct mipi_csi2phy_device_regs *
> csi2phy_dev_to_regs(struct mipi_csi2phy_device *csi2phy)
> {
> @@ -246,9 +377,18 @@ phy_qcom_mipi_csi2_gen2_config_lanes(struct mipi_csi2phy_device *csi2phy,
> u8 settle_cnt)
> {
> const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy);
> - const struct mipi_csi2phy_lane_regs *r = regs->dphy_init_seq;
> - int i, array_size = regs->dphy_lane_array_size;
> + const struct mipi_csi2phy_lane_regs *r;
> + int array_size;
> u32 val;
> + int i;
> +
> + if (csi2phy->phy_mode == PHY_MODE_MIPI_CPHY) {
> + r = regs->cphy_init_seq;
> + array_size = regs->cphy_lane_array_size;
> + } else {
> + r = regs->dphy_init_seq;
> + array_size = regs->dphy_lane_array_size;
> + }
>
> for (i = 0; i < array_size; i++, r++) {
> switch (r->param_type) {
> @@ -264,38 +404,41 @@ phy_qcom_mipi_csi2_gen2_config_lanes(struct mipi_csi2phy_device *csi2phy,
> }
> writel(val, csi2phy->base + r->reg_addr);
> if (r->delay_us)
> - udelay(r->delay_us);
> + fsleep(r->delay_us);
Here's one that is trying to sneak in under the radar.
A change like this needs a distinct patch with a description why instead
of inlined in a "make CPHY work" patch.
A delay is a delay is a delay - changing the nature of that delay is a
functional change in itself which is ! a CPHY thing.
> }
> }
>
> -static int phy_qcom_mipi_csi2_lanes_enable(struct mipi_csi2phy_device *csi2phy,
> - struct mipi_csi2phy_stream_cfg *cfg)
> +/*
> + * CSI_COMMON_CTRL5 is a physical lane power-up bitmap:
> + * - Bits [0,2,4,6] → D-PHY data lanes(LN0, LN2, LN4, LN6)
> + * - Bits [1,3,5] → C-PHY trio lanes(LN1, LN3, LN5)
> + * - Bit [7] → D-PHY clock lane(LNCK) dedicated clock enable
> + */
> +static u8 phy_qcom_mipi_csi2_lane_mask(struct mipi_csi2phy_device *csi2phy,
> + struct mipi_csi2phy_stream_cfg *cfg)
> {
> - const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy);
> struct mipi_csi2phy_lanes_cfg *lane_cfg = &cfg->lane_cfg;
> - u8 settle_cnt;
> - u8 val;
> + u8 lane_mask = 0;
> + u8 offset = 0;
> int i;
>
> - if (cfg->link_freq <= 0)
> - return -EINVAL;
> -
> - settle_cnt = phy_qcom_mipi_csi2_settle_cnt_calc(cfg->link_freq, csi2phy->timer_clk_rate);
> - if (!settle_cnt)
> - return -ENODEV;
To make the decomposition more readable, please bundle the deomp into
its own precursor patch "add helper function x"
> + if (csi2phy->phy_mode == PHY_MODE_MIPI_CPHY)
> + offset = 1;
> + else
> + lane_mask = BIT(lane_cfg->clk.pos);
>
> - /*
> - * CSI_COMMON_CTRL5 is a physical lane power-up bitmap:
> - * - Bits [0,2,4,6] → D-PHY data lanes(LN0, LN2, LN4, LN6)
> - * - Bits [1,3,5] → C-PHY trio lanes(LN1, LN3, LN5)
> - * - Bit [7] → D-PHY clock lane(LNCK) dedicated clock enable
> - */
> - val = BIT(lane_cfg->clk.pos);
> for (i = 0; i < cfg->num_data_lanes; i++)
> - val |= BIT(lane_cfg->data[i].pos * 2);
> + lane_mask |= BIT(lane_cfg->data[i].pos * 2 + offset);
>
> - writel(val, csi2phy->base +
> - CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 5));
> + return lane_mask;
> +}
> +
> +static void
> +phy_qcom_mipi_csi2_dphy_lane_polarities(struct mipi_csi2phy_device *csi2phy,
> + struct mipi_csi2phy_stream_cfg *cfg)
> +{
> + struct mipi_csi2phy_lanes_cfg *lane_cfg = &cfg->lane_cfg;
> + int i;
>
> /* Lane configuration for polarity @ CSIPHY-base + CTRL9 */
> for (i = 0; i < cfg->num_data_lanes; i++) {
> @@ -308,6 +451,29 @@ static int phy_qcom_mipi_csi2_lanes_enable(struct mipi_csi2phy_device *csi2phy,
>
> if (lane_cfg->clk.pol)
> writel(BIT(2), csi2phy->base + CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(lane_cfg->clk.pos));
> +}
> +
> +static int phy_qcom_mipi_csi2_lanes_enable(struct mipi_csi2phy_device *csi2phy,
> + struct mipi_csi2phy_stream_cfg *cfg)
> +{
> + const struct mipi_csi2phy_device_regs *regs = csi2phy_dev_to_regs(csi2phy);
> + u8 settle_cnt;
> + u8 val;
> + int i;
> +
> + if (cfg->link_freq <= 0)
> + return -EINVAL;
> +
> + settle_cnt = phy_qcom_mipi_csi2_settle_cnt_calc(cfg->link_freq, csi2phy->timer_clk_rate);
> + if (!settle_cnt)
> + return -ENODEV;
> +
> + val = phy_qcom_mipi_csi2_lane_mask(csi2phy, cfg);
> + writel(val, csi2phy->base +
> + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->common_regs_offset, 5));
> +
> + if (csi2phy->phy_mode == PHY_MODE_MIPI_DPHY)
> + phy_qcom_mipi_csi2_dphy_lane_polarities(csi2phy, cfg);
>
> val = CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B;
> writel(val, csi2phy->base +
> @@ -374,6 +540,8 @@ const struct mipi_csi2phy_soc_cfg mipi_csi2_dphy_4nm_x1e = {
> .reg_info = {
> .dphy_init_seq = lane_regs_x1e80100,
> .dphy_lane_array_size = ARRAY_SIZE(lane_regs_x1e80100),
> + .cphy_init_seq = lane_regs_v2_1_2_cphy,
> + .cphy_lane_array_size = ARRAY_SIZE(lane_regs_v2_1_2_cphy),
> .common_regs_offset = 0x1000,
> },
> .supply_names = (const char **)x1e_supplies,
> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c
> index c0a4fa20e..1185561a1 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c
> @@ -96,6 +96,25 @@ phy_qcom_mipi_csi2_set_clock_rates(struct mipi_csi2phy_device *csi2phy,
> return ret;
> }
>
> +static int
> +phy_qcom_mipi_csi2_configure_cphy(struct mipi_csi2phy_device *csi2phy,
> + struct phy_configure_opts_mipi_cphy *cphy_cfg)
> +{
> + struct mipi_csi2phy_stream_cfg *stream_cfg = &csi2phy->stream_cfg;
> + int ret;
> +
> + ret = phy_mipi_cphy_config_validate(cphy_cfg);
> + if (ret)
> + return ret;
> +
> + if (cphy_cfg->trios != stream_cfg->num_data_lanes)
> + return -EINVAL;
> +
> + stream_cfg->link_freq = phy_mipi_cphy_link_freq(cphy_cfg);
> +
> + return 0;
> +}
> +
> static int phy_qcom_mipi_csi2_configure(struct phy *phy,
> union phy_configure_opts *opts)
> {
> @@ -104,6 +123,9 @@ static int phy_qcom_mipi_csi2_configure(struct phy *phy,
> struct mipi_csi2phy_stream_cfg *stream_cfg = &csi2phy->stream_cfg;
> int ret;
>
> + if (csi2phy->phy_mode == PHY_MODE_MIPI_CPHY)
> + return phy_qcom_mipi_csi2_configure_cphy(csi2phy, &opts->mipi_cphy);
> +
> ret = phy_mipi_dphy_config_validate(dphy_cfg);
> if (ret)
> return ret;
> @@ -124,10 +146,13 @@ static int phy_qcom_mipi_csi2_set_mode(struct phy *phy,
> {
> struct mipi_csi2phy_device *csi2phy = phy_get_drvdata(phy);
>
> - if (mode != PHY_MODE_MIPI_DPHY)
> + if (mode != PHY_MODE_MIPI_DPHY && mode != PHY_MODE_MIPI_CPHY)
> return -EOPNOTSUPP;
>
> - csi2phy->phy_mode = mode;
> + /* The endpoint's bus-type sets the mode; only that one is accepted. */
> + if (mode != csi2phy->phy_mode)
> + return -EINVAL;
> +
> return 0;
> }
>
> @@ -258,6 +283,7 @@ static int phy_qcom_mipi_csi2_parse_routing(struct mipi_csi2phy_device *csi2phy)
> struct fwnode_handle *ep;
> int num_polarities;
> int num_data_lanes;
> + int max_lanes;
> u32 bus_type;
> int i, ret;
>
> @@ -278,14 +304,26 @@ static int phy_qcom_mipi_csi2_parse_routing(struct mipi_csi2phy_device *csi2phy)
> bus_type = MEDIA_BUS_TYPE_CSI2_DPHY;
> fwnode_property_read_u32(ep, "bus-type", &bus_type);
>
> - if (bus_type != MEDIA_BUS_TYPE_CSI2_DPHY) {
> + switch (bus_type) {
> + case MEDIA_BUS_TYPE_CSI2_DPHY:
> + csi2phy->phy_mode = PHY_MODE_MIPI_DPHY;
> + max_lanes = CSI2_MAX_DATA_LANES;
> + break;
> + case MEDIA_BUS_TYPE_CSI2_CPHY:
> + if (csi2phy->soc_cfg->reg_info.cphy_init_seq) {
> + csi2phy->phy_mode = PHY_MODE_MIPI_CPHY;
> + max_lanes = PHY_MIPI_CPHY_MAX_TRIOS;
> + break;
> + }
> + fallthrough;
> + default:
> ret = -EOPNOTSUPP;
> dev_err(dev, "Unsupported bus-type %u\n", bus_type);
> goto out_put;
> }
>
> num_data_lanes = fwnode_property_count_u32(ep, "data-lanes");
> - if (num_data_lanes < 1 || num_data_lanes > CSI2_MAX_DATA_LANES) {
> + if (num_data_lanes < 1 || num_data_lanes > max_lanes) {
> ret = -EINVAL;
> dev_err(dev, "Invalid data-lanes count: %d\n", num_data_lanes);
> goto out_put;
> @@ -302,6 +340,11 @@ static int phy_qcom_mipi_csi2_parse_routing(struct mipi_csi2phy_device *csi2phy)
> /* lane-polarities: optional, up to num_data_lanes + 1 entries */
> memset(lane_polarities, 0x00, sizeof(lane_polarities));
> num_polarities = fwnode_property_count_u32(ep, "lane-polarities");
> + if (num_polarities > 0 && bus_type == MEDIA_BUS_TYPE_CSI2_CPHY) {
> + ret = -EINVAL;
> + dev_err(dev, "lane-polarities do not apply to C-PHY\n");
> + goto out_put;
> + }
> if (num_polarities > 0) {
> if (num_polarities != stream_cfg->num_data_lanes + 1) {
> ret = -EINVAL;
> @@ -322,7 +365,7 @@ static int phy_qcom_mipi_csi2_parse_routing(struct mipi_csi2phy_device *csi2phy)
> csi2phy->stream_cfg.lane_cfg.clk.pol = lane_polarities[0];
>
> for (i = 0; i < csi2phy->stream_cfg.num_data_lanes; i++) {
> - if (data_lanes[i] < 1 || data_lanes[i] > CSI2_MAX_DATA_LANES) {
> + if (data_lanes[i] < 1 || data_lanes[i] > max_lanes) {
> dev_err(dev, "Invalid lane %d\n", data_lanes[i]);
> ret = -EINVAL;
> goto out_put;
> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> index 0d6031a4d..f49f334fd 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2.h
> @@ -50,6 +50,8 @@ struct mipi_csi2phy_lane_regs {
> struct mipi_csi2phy_device_regs {
> const struct mipi_csi2phy_lane_regs *dphy_init_seq;
> const int dphy_lane_array_size;
> + const struct mipi_csi2phy_lane_regs *cphy_init_seq;
> + const int cphy_lane_array_size;
> const u32 common_regs_offset;
> };
>
>
> --
> 2.53.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100
2026-10-16 11:02 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY " Bryan O'Donoghue
@ 2026-10-16 11:32 ` George Neacsu
2026-10-16 13:27 ` Bryan O'Donoghue
0 siblings, 1 reply; 18+ messages in thread
From: George Neacsu @ 2026-10-16 11:32 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: Vinod Koul, David Heidelberg, Neil Armstrong, Vladimir Zapolskiy,
Loic Poulain, Konrad Dybcio, Nihal Kumar Gupta, Vikram Sharma,
Suresh Vankadara, tjose, Mauro Carvalho Chehab,
Manivannan Sadhasivam, linux-phy, linux-media, linux-arm-msm,
linux-kernel
Hi Bryan,
On 16/10/2026 12:02, Bryan O'Donoghue wrote:
> Small point of order here - this is not really @ RFC status.
Understood, v3 drops the RFC prefix.
>> The kernel was 7.1.5, with linux-next's CAMSS and CSI2 PHY built as
>> modules; the test build needed shims only for API differences.
>
> What's this ?
>
> "It builds" I can verify myself, "it works" is the thing. Just slow down
> and get something you can test on hardware.
Fair point. The frames in the cover letter were captured on the
hardware, but the kernel underneath was the 7.1.5 one this machine runs
day to day, with linux-next's CAMSS and CSI2 PHY sources built as modules
for it. That is not the same as running linux-next. Before v3 I will
boot an actual linux-next kernel on the Surface Pro 11, retest both
cameras there, and say exactly what was run.
For 4/4 I will also move the fsleep() change into its own patch with the
reasoning, and put the lanes_enable() decomposition in a precursor
patch, as you asked. Thanks for the reviews of 2/4 and 3/4.
Thanks,
George
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100
2026-10-16 10:57 ` [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100 George Neacsu via B4 Relay
2026-10-16 11:15 ` Bryan O'Donoghue
@ 2026-10-16 11:35 ` Nihal Kumar Gupta
2026-10-16 12:05 ` Konrad Dybcio
2026-10-16 12:24 ` David Heidelberg
2 siblings, 1 reply; 18+ messages in thread
From: Nihal Kumar Gupta @ 2026-10-16 11:35 UTC (permalink / raw)
To: geocausa, Bryan O'Donoghue, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Vikram Sharma, Suresh Vankadara, tjose, Mauro Carvalho Chehab,
Manivannan Sadhasivam, linux-phy, linux-media, linux-arm-msm,
linux-kernel
On 16-10-2026 16:27, George Neacsu via B4 Relay wrote:
> + {.reg_addr = 0x0a54, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a40, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a60, .reg_data = 0xa8, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a84, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0a90, .reg_data = 0x02, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + /* csiphy_reset_exit_reg_2_1_2, 3PH */
> + {.reg_addr = 0x1000, .reg_data = 0x0e, .delay_us = 3048,
> + .param_type = CSIPHY_DEFAULT_PARAMS},
> +};
> +
I checked the register settings and they look good to me.
Can we write the delay value in hex as well, to keep the table
formatting consistent.
--
Regards,
Nihal Kumar Gupta
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options
2026-10-16 10:57 ` [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options George Neacsu via B4 Relay
@ 2026-10-16 11:35 ` Nihal Kumar Gupta
2026-10-16 14:16 ` Loic Poulain
1 sibling, 0 replies; 18+ messages in thread
From: Nihal Kumar Gupta @ 2026-10-16 11:35 UTC (permalink / raw)
To: geocausa, Bryan O'Donoghue, Vinod Koul, David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Vikram Sharma, Suresh Vankadara, tjose, Mauro Carvalho Chehab,
Manivannan Sadhasivam, linux-phy, linux-media, linux-arm-msm,
linux-kernel, Bryan O'Donoghue
On 16-10-2026 16:27, George Neacsu via B4 Relay wrote:
> The first user is the Qualcomm CSI2 PHY, whose X1E80100 instances carry
> the C-PHY front camera of the Surface Pro 11.
>
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: George Neacsu <geocausa@gmail.com>
Reviewed-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
--
Regards,
Nihal Kumar Gupta
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100
2026-10-16 11:35 ` Nihal Kumar Gupta
@ 2026-10-16 12:05 ` Konrad Dybcio
2026-10-16 12:25 ` Nihal Kumar Gupta
0 siblings, 1 reply; 18+ messages in thread
From: Konrad Dybcio @ 2026-10-16 12:05 UTC (permalink / raw)
To: Nihal Kumar Gupta, geocausa, Bryan O'Donoghue, Vinod Koul,
David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Vikram Sharma,
Suresh Vankadara, tjose, Mauro Carvalho Chehab,
Manivannan Sadhasivam, linux-phy, linux-media, linux-arm-msm,
linux-kernel
On 10/16/26 1:35 PM, Nihal Kumar Gupta wrote:
>
>
> On 16-10-2026 16:27, George Neacsu via B4 Relay wrote:
>> + {.reg_addr = 0x0a54, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
>> + {.reg_addr = 0x0a40, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
>> + {.reg_addr = 0x0a60, .reg_data = 0xa8, .param_type = CSIPHY_DEFAULT_PARAMS},
>> + {.reg_addr = 0x0a84, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
>> + {.reg_addr = 0x0a90, .reg_data = 0x02, .param_type = CSIPHY_DEFAULT_PARAMS},
>> +
>> + /* csiphy_reset_exit_reg_2_1_2, 3PH */
>> + {.reg_addr = 0x1000, .reg_data = 0x0e, .delay_us = 3048,
>> + .param_type = CSIPHY_DEFAULT_PARAMS},
>> +};
>> +
> I checked the register settings and they look good to me.
>
> Can we write the delay value in hex as well, to keep the table
> formatting consistent.
I don't think delay in hex makes sense to a human reader
Konrad
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100
2026-10-16 10:57 ` [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100 George Neacsu via B4 Relay
2026-10-16 11:15 ` Bryan O'Donoghue
2026-10-16 11:35 ` Nihal Kumar Gupta
@ 2026-10-16 12:24 ` David Heidelberg
2 siblings, 0 replies; 18+ messages in thread
From: David Heidelberg @ 2026-10-16 12:24 UTC (permalink / raw)
To: geocausa, Bryan O'Donoghue, Vinod Koul
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel
On 16/10/2026 12:57, George Neacsu via B4 Relay wrote:
> From: George Neacsu <geocausa@gmail.com>
>
> The CSI2 PHY schema already allows bus-type C-PHY, but the driver
> rejects it. Accept it on SoCs that provide a C-PHY sequence, with up to
> three trios and no lane polarities. The endpoint's bus-type now sets the
> PHY mode, set_mode() only accepts that mode, and in C-PHY mode
> configure() takes the symbol rate and keeps the matching link frequency,
> so clock scaling works as for D-PHY.
>
> lanes_enable() picks the sequence for the mode and is split into
> helpers: the CTRL5 lane mask, where the trios are the odd bits and the
> D-PHY data lanes the even ones plus the clock bit, and the D-PHY lane
> polarities. The settle count is computed in both modes. With a C-PHY
> link frequency of half the symbol rate, the unit interval in the
> existing formula is one symbol, which is also how David Heidelberg's
> CAMSS C-PHY series computes it. Sequence delays now use fsleep(), as
> the C-PHY sequence waits 3 ms after its reset exit.
>
> The X1E80100 sequence is Qualcomm's for the v2.1.2 3PH PHY at 2.5 Gsps,
> taken from the downstream camera driver's GPL-2.0
> cam_csiphy_2_1_2_hwreg.h (csiphy_3ph_v2_1_2_reg, datarate_212_2p5Gsps
> and the 3PH reset exit), as the D-PHY sequence above it is. Its three
> settle count entries are the ones downstream marks as such.
>
> Tested on the Surface Pro 11 (X1E80100) with an IMX681 on CSIPHY2, one
> trio at 2.4 Gsym/s, and raw capture through CSID1 and an RDI interface,
> with David's CAMSS C-PHY series and two CAMSS patches on top:
> 3844x2640 at 30 fps, and the sensor's colour bars are byte-identical to
> the same pattern captured with an out-of-tree driver. The timer runs at
> 400 MHz and the computed settle count is 28; forcing anything from 6 to
> 48 gives the same frames. D-PHY is unchanged: an OV13858 on CSIPHY1
> over four lanes streams at 29.9 fps with the same settle count as
> before.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: George Neacsu <geocausa@gmail.com>
> ---
> drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c | 216 ++++++++++++++++++---
> drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c | 53 ++++-
> drivers/phy/qualcomm/phy-qcom-mipi-csi2.h | 2 +
> 3 files changed, 242 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> index b2d4ec3e8..39e48e7ac 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> @@ -161,6 +161,137 @@ mipi_csi2phy_lane_regs lane_regs_x1e80100[] = {
> {.reg_addr = 0x0c64, .reg_data = 0x7f, .param_type = CSIPHY_SKEW_CAL},
> };
>
> +/* Qualcomm's 2.5 Gsps settings, from the GPL-2.0 cam_csiphy_2_1_2_hwreg.h */
> +static const struct
> +mipi_csi2phy_lane_regs lane_regs_v2_1_2_cphy[] = {
> + /* Power up lanes 3ph mode */
> + {.reg_addr = 0x101c, .reg_data = 0x7a, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x1018, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + /* datarate_212_2p5Gsps: AFE settings */
> + {.reg_addr = 0x0268, .reg_data = 0xf1, .param_type = CSIPHY_DEFAULT_PARAMS},
as you can see repeating pattern (e.g. another lane), please use macros.
I would suggest something like I did in
https://lore.kernel.org/all/20260729-qcom-cphy-v9-6-1f8d9fdab037@ixit.cz/
David
> + {.reg_addr = 0x0294, .reg_data = 0x01, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0288, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0278, .reg_data = 0x20, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x026c, .reg_data = 0x3d, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x028c, .reg_data = 0x30, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0270, .reg_data = 0x00, .param_type = CSIPHY_DEFAULT_PARAMS},
> + {.reg_addr = 0x0274, .reg_data = 0x03, .param_type = CSIPHY_DEFAULT_PARAMS},
> +
> + {.reg_addr = 0x0668, .reg_data = 0xf1, .param_type = CSIPHY_DEFAULT_PARAMS},
^ (reference)
David
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100
2026-10-16 12:05 ` Konrad Dybcio
@ 2026-10-16 12:25 ` Nihal Kumar Gupta
0 siblings, 0 replies; 18+ messages in thread
From: Nihal Kumar Gupta @ 2026-10-16 12:25 UTC (permalink / raw)
To: Konrad Dybcio, geocausa, Bryan O'Donoghue, Vinod Koul,
David Heidelberg
Cc: Neil Armstrong, Vladimir Zapolskiy, Loic Poulain, Vikram Sharma,
Suresh Vankadara, tjose, Mauro Carvalho Chehab,
Manivannan Sadhasivam, linux-phy, linux-media, linux-arm-msm,
linux-kernel
On 16-10-2026 17:35, Konrad Dybcio wrote:
>> Can we write the delay value in hex as well, to keep the table
>> formatting consistent.
> I don't think delay in hex makes sense to a human reader
Okay, that's fine.
--
Regards,
Nihal Kumar Gupta
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100
2026-10-16 11:32 ` George Neacsu
@ 2026-10-16 13:27 ` Bryan O'Donoghue
2026-10-16 14:55 ` George Neacsu
0 siblings, 1 reply; 18+ messages in thread
From: Bryan O'Donoghue @ 2026-10-16 13:27 UTC (permalink / raw)
To: George Neacsu
Cc: Vinod Koul, David Heidelberg, Neil Armstrong, Vladimir Zapolskiy,
Loic Poulain, Konrad Dybcio, Nihal Kumar Gupta, Vikram Sharma,
Suresh Vankadara, tjose, Mauro Carvalho Chehab,
Manivannan Sadhasivam, linux-phy, linux-media, linux-arm-msm,
linux-kernel
On 16/10/2026 12:32, George Neacsu wrote:
>>> The kernel was 7.1.5, with linux-next's CAMSS and CSI2 PHY built as
>>> modules; the test build needed shims only for API differences.
>> What's this ?
>>
>> "It builds" I can verify myself, "it works" is the thing. Just slow down
>> and get something you can test on hardware.
> Fair point. The frames in the cover letter were captured on the
> hardware, but the kernel underneath was the 7.1.5 one this machine runs
> day to day, with linux-next's CAMSS and CSI2 PHY sources built as modules
> for it. That is not the same as running linux-next. Before v3 I will
> boot an actual linux-next kernel on the Surface Pro 11, retest both
> cameras there, and say exactly what was run.
>
> For 4/4 I will also move the fsleep() change into its own patch with the
> reasoning, and put the lanes_enable() decomposition in a precursor
> patch, as you asked. Thanks for the reviews of 2/4 and 3/4.
>
> Thanks,
> George
The bit I'm a bit alarmed about is "stuff was stubbed" which makes me
wonder if what lands in -next can then said to be actually verified
meaningfully.
Could you git rebase linux-stable/master for your 7.1.5 tree maybe ?
---
bod
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options
2026-10-16 10:57 ` [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options George Neacsu via B4 Relay
2026-10-16 11:35 ` Nihal Kumar Gupta
@ 2026-10-16 14:16 ` Loic Poulain
1 sibling, 0 replies; 18+ messages in thread
From: Loic Poulain @ 2026-10-16 14:16 UTC (permalink / raw)
To: geocausa
Cc: Bryan O'Donoghue, Vinod Koul, David Heidelberg,
Neil Armstrong, Vladimir Zapolskiy, Konrad Dybcio,
Nihal Kumar Gupta, Vikram Sharma, Suresh Vankadara, tjose,
Mauro Carvalho Chehab, Manivannan Sadhasivam, linux-phy,
linux-media, linux-arm-msm, linux-kernel, Bryan O'Donoghue
On Fri, Oct 16, 2026 at 12:57 PM George Neacsu via B4 Relay
<devnull+geocausa.gmail.com@kernel.org> wrote:
>
> From: George Neacsu <geocausa@gmail.com>
>
> The generic PHY framework has a mode and configuration options for MIPI
> D-PHY but none for C-PHY, so a CSI-2 receiver has no way to ask a PHY
> that does both for C-PHY. Add PHY_MODE_MIPI_CPHY and struct
> phy_configure_opts_mipi_cphy. The options are the two values a receiver
> knows: the symbol rate on each trio and the number of trios.
>
> The first user is the Qualcomm CSI2 PHY, whose X1E80100 instances carry
> the C-PHY front camera of the Surface Pro 11.
>
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: George Neacsu <geocausa@gmail.com>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> ---
> include/linux/phy/phy-mipi-cphy.h | 27 +++++++++++++++++++++++++++
> include/linux/phy/phy.h | 5 +++++
> 2 files changed, 32 insertions(+)
>
> diff --git a/include/linux/phy/phy-mipi-cphy.h b/include/linux/phy/phy-mipi-cphy.h
> new file mode 100644
> index 000000000..ef6af61de
> --- /dev/null
> +++ b/include/linux/phy/phy-mipi-cphy.h
> @@ -0,0 +1,27 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef __PHY_MIPI_CPHY_H_
> +#define __PHY_MIPI_CPHY_H_
> +
> +/**
> + * struct phy_configure_opts_mipi_cphy - MIPI C-PHY configuration set
> + *
> + * This structure is used to represent the configuration state of a
> + * MIPI C-PHY phy.
> + */
> +struct phy_configure_opts_mipi_cphy {
> + /**
> + * @symbol_rate:
> + *
> + * Symbol rate on each trio, in symbols per second.
> + */
> + unsigned long long symbol_rate;
> +
> + /**
> + * @trios:
> + *
> + * Number of active trios.
> + */
> + unsigned char trios;
> +};
> +
> +#endif /* __PHY_MIPI_CPHY_H_ */
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index c480d6cb4..f12337834 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -19,6 +19,7 @@
> #include <linux/phy/phy-dp.h>
> #include <linux/phy/phy-hdmi.h>
> #include <linux/phy/phy-lvds.h>
> +#include <linux/phy/phy-mipi-cphy.h>
> #include <linux/phy/phy-mipi-dphy.h>
> #include <linux/phy/phy-thunderbolt.h>
>
> @@ -42,6 +43,7 @@ enum phy_mode {
> PHY_MODE_PCIE,
> PHY_MODE_ETHERNET,
> PHY_MODE_MIPI_DPHY,
> + PHY_MODE_MIPI_CPHY,
> PHY_MODE_SATA,
> PHY_MODE_LVDS,
> PHY_MODE_DP,
> @@ -69,6 +71,8 @@ union phy_notify {
> *
> * @mipi_dphy: Configuration set applicable for phys supporting
> * the MIPI_DPHY phy mode.
> + * @mipi_cphy: Configuration set applicable for phys supporting
> + * the MIPI_CPHY phy mode.
> * @dp: Configuration set applicable for phys supporting
> * the DisplayPort protocol.
> * @lvds: Configuration set applicable for phys supporting
> @@ -78,6 +82,7 @@ union phy_notify {
> */
> union phy_configure_opts {
> struct phy_configure_opts_mipi_dphy mipi_dphy;
> + struct phy_configure_opts_mipi_cphy mipi_cphy;
> struct phy_configure_opts_dp dp;
> struct phy_configure_opts_lvds lvds;
> struct phy_configure_opts_hdmi hdmi;
>
> --
> 2.53.0
>
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100
2026-10-16 13:27 ` Bryan O'Donoghue
@ 2026-10-16 14:55 ` George Neacsu
0 siblings, 0 replies; 18+ messages in thread
From: George Neacsu @ 2026-10-16 14:55 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: Vinod Koul, David Heidelberg, Neil Armstrong, Vladimir Zapolskiy,
Loic Poulain, Konrad Dybcio, Nihal Kumar Gupta, Vikram Sharma,
Suresh Vankadara, tjose, Mauro Carvalho Chehab,
Manivannan Sadhasivam, linux-phy, linux-media, linux-arm-msm,
linux-kernel
Hi Bryan,
On 16/10/2026 14:27, Bryan O'Donoghue wrote:
> The bit I'm a bit alarmed about is "stuff was stubbed" which makes me
> wonder if what lands in -next can then said to be actually verified
> meaningfully.
>
> Could you git rebase linux-stable/master for your 7.1.5 tree maybe ?
Rather than rebasing the 7.1.5 tree, I built next-20261015 itself and
booted it on the Surface Pro 11, with nothing stubbed. On top of it:
this series as v3 will post it, David's v9, the two CAMSS patches from
v1, and the sensor patches under review (IMX681 v8 with its C-PHY RFC,
OV13858 power-on v3 and its DT support). The board DT is out of tree and
follows your x1e80100 camera DT v7.
On that kernel:
- front IMX681 on CSIPHY2, one trio at 2.4 Gsym/s: 3844x2640 at
30.01 fps, and the sensor's colour bars are byte-identical to the
reference capture from the out-of-tree driver;
- rear OV13858 on CSIPHY1, four D-PHY lanes: 29.90 fps;
- the settle count reads back 0x1c in all three trio registers, which
is the computed value.
The same boot also turned up a NULL dereference in the CAMSS TPG test
pattern control, unrelated to this series. I will send a fix for it
separately.
v3 will describe exactly this setup.
Thanks,
George
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2026-10-16 14:55 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <K9h_NQSPlrzzoVDIqqNPGT6KDZNScVi2mlqy6yNs8VOOS_I4KXf0QLy4k3Cwo2qKhnfL_qUK5wnY4h6wX24L4A==@protonmail.internalid>
2026-10-16 10:57 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY for X1E80100 George Neacsu via B4 Relay
2026-10-16 10:57 ` [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options George Neacsu via B4 Relay
2026-10-16 11:35 ` Nihal Kumar Gupta
2026-10-16 14:16 ` Loic Poulain
2026-10-16 10:57 ` [PATCH RFC v2 2/4] phy: Add MIPI C-PHY configuration helpers George Neacsu via B4 Relay
2026-10-16 11:06 ` Bryan O'Donoghue
2026-10-16 10:57 ` [PATCH RFC v2 3/4] phy: qcom-mipi-csi2: Rename the D-PHY init sequence George Neacsu via B4 Relay
2026-10-16 11:07 ` Bryan O'Donoghue
2026-10-16 10:57 ` [PATCH RFC v2 4/4] phy: qcom-mipi-csi2: Add C-PHY support for X1E80100 George Neacsu via B4 Relay
2026-10-16 11:15 ` Bryan O'Donoghue
2026-10-16 11:35 ` Nihal Kumar Gupta
2026-10-16 12:05 ` Konrad Dybcio
2026-10-16 12:25 ` Nihal Kumar Gupta
2026-10-16 12:24 ` David Heidelberg
2026-10-16 11:02 ` [PATCH RFC v2 0/4] phy: qcom-mipi-csi2: C-PHY " Bryan O'Donoghue
2026-10-16 11:32 ` George Neacsu
2026-10-16 13:27 ` Bryan O'Donoghue
2026-10-16 14:55 ` George Neacsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®