From: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
To: Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Bryan O'Donoghue <bod@kernel.org>
Cc: Vikram Sharma <vikram.sharma@oss.qualcomm.com>,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
Subject: [PATCH RFC 1/6] phy: core: Add MIPI C-PHY configurations
Date: Sat, 17 Oct 2026 22:43:08 +0530 [thread overview]
Message-ID: <20261017-cphy_support-v1-1-8b0e1237ce95@oss.qualcomm.com> (raw)
In-Reply-To: <20261017-cphy_support-v1-0-8b0e1237ce95@oss.qualcomm.com>
MIPI CSI-2 receivers can be connected through C-PHY as well as D-PHY.
C-PHY uses trios instead of lanes and needs mode-specific timings passed
to the PHY provider.
Add PHY_MODE_MIPI_CPHY and C-PHY configure option carrying the link rate,
trio count and C-PHY prepare/preamble timing.
Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
---
include/linux/phy/phy.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index c480d6cb42c500a295eef3bdf42fbc6d36f54bf8..c3784b679f3a26686324286d407cfa9d258579f1 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -47,6 +47,7 @@ enum phy_mode {
PHY_MODE_DP,
PHY_MODE_HDMI,
PHY_MODE_TBT,
+ PHY_MODE_MIPI_CPHY,
};
enum phy_media {
@@ -64,11 +65,56 @@ union phy_notify {
enum phy_ufs_state ufs_state;
};
+/**
+ * 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 per trio, in symbols per second.
+ */
+ u64 symbol_rate;
+
+ /**
+ * @trios:
+ *
+ * Number of active C-PHY trios.
+ *
+ * Minimum value: 1
+ * Maximum value: 3
+ */
+ unsigned int trios;
+
+ /**
+ * @t_prepare_ns:
+ *
+ * C-PHY T_PREPARE timing value, in nanoseconds.
+ * Time the transmitter drives the LP-00 state before
+ * starting the HS preamble sequence.
+ */
+ u32 t_prepare_ns;
+
+ /**
+ * @t_preamble_ns:
+ *
+ * C-PHY T_PREAMBLE timing value, in nanoseconds.
+ * Duration of the HS preamble sequence transmitted
+ * before the first payload symbol.
+ */
+ u32 t_preamble_ns;
+};
+
/**
* union phy_configure_opts - Opaque generic phy configuration
*
* @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 +124,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.34.1
next prev parent reply other threads:[~2026-10-17 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 17:13 [PATCH RFC 0/6] phy/media: Add generic MIPI C-PHY support to CSI-2 stack Nihal Kumar Gupta
2026-10-17 17:13 ` Nihal Kumar Gupta [this message]
2026-10-17 17:13 ` [PATCH RFC 2/6] media: qcom: camss: Add C-PHY timing fields and get config from sensor Nihal Kumar Gupta
2026-10-17 17:13 ` [PATCH RFC 3/6] phy: qcom: mipi-csi2: Split D-PHY register settings Nihal Kumar Gupta
2026-10-17 17:13 ` [PATCH RFC 4/6] phy: qcom: mipi-csi2: Accept C-PHY mode and add register sequence Nihal Kumar Gupta
2026-10-17 17:13 ` [PATCH RFC 5/6] phy: qcom: mipi-csi2: Add C-PHY settle calculation Nihal Kumar Gupta
2026-10-17 17:13 ` [PATCH RFC 6/6] phy: qcom: mipi-csi2: Add lane mask calculation for C-PHY Nihal Kumar Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261017-cphy_support-v1-1-8b0e1237ce95@oss.qualcomm.com \
--to=nihal.gupta@oss.qualcomm.com \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mani@kernel.org \
--cc=mchehab@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=vikram.sharma@oss.qualcomm.com \
--cc=vkoul@kernel.org \
--cc=vladimir.zapolskiy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®