linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] phy: qcom-mipi-csi2: Add a CSI2 MIPI DPHY driver
@ 2025-07-10 16:16 Bryan O'Donoghue
  2025-07-10 16:16 ` [PATCH 1/2] dt-bindings: phy: qcom: Add MIPI CSI2 C-PHY/DPHY Combo schema Bryan O'Donoghue
  2025-07-10 16:16 ` [PATCH 2/2] phy: qcom-mipi-csi2: Add a CSI2 MIPI D-PHY driver Bryan O'Donoghue
  0 siblings, 2 replies; 33+ messages in thread
From: Bryan O'Donoghue @ 2025-07-10 16:16 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Bryan O'Donoghue, Vladimir Zapolskiy, linux-arm-msm,
	linux-phy, linux-media, devicetree, linux-kernel,
	Bryan O'Donoghue

This short series adds a CSI2 MIPI PHY driver, initially supporting D-PHY
mode. The core logic and init sequences come directly from CAMSS and are
working on at least five separate x1e devices.

The rationale to instantiate CSI2 PHYs as standalone devices instead of as
sub-nodes of CAMSS is as follows.

1. Precedence
   CAMSS has a dedicated I2C bus called CCI Camera Control Interface.
   We model this controller as its own separate device in devicetree.
   This makes sense and CCI/I2C is a well defined bus type already modelled
   in Linux.

   MIPI CSI2 PHY devices similarly fit into a well defined separate
   bus/device structure.

   Contrast to another CAMSS component such as VFE, CSID or TPG these
   components only interact with other CAMSS inputs/outputs unlike CSIPHY
   which interacts with non-SoC components.

2. Hardware pinouts and rails
   The CSI2 PHY has its own data/clock lanes out from the SoC and indeed
   has its own incoming power-rails.

3. Other devicetree schemas
   There are several examples throughout the kernel of CSI PHYs modeled as
   standalone devices which one assumes follows the same reasoning as given
   above.

I've been working on this on-and-off since the end of April:
Link: https://lore.kernel.org/linux-media/c5cf0155-f839-4db9-b865-d39b56bb1e0a@linaro.org

There is another proposal to have the PHYs be subdevices of CAMSS but, I
believe we should go with a "full fat" PHY to match best practices in
drivers/phy/qualcomm/*.

Using the standard PHY API and the parameter passing that goes with it
allows us to move away from custom interfaces in CAMSS and to conform more
clearly to established PHY paradigms such as the QMP combo PHY.

Looking at existing compat strings I settled on
"qcom,x1e80100-mipi-csi2-combo-phy" deliberately omitting reference to the
fact the PHY is built on a four nano-meter process node, which seems to
match recent submissions to QMP PHY.

My first pass at this driver included support for the old two phase
devices:

Link: https://git.codelinaro.org/bryan.odonoghue/kernel/-/commit/a504c28d109296c93470340cfe7281231f573bcb#b6e59ed7db94c9da22e492bb03fcda6a4300983c

I realised that the device tree schema changes required to support a
comprehensive conversion of all CAMSS to this driver would be an
almost certainly be unacceptable ABI break or at the very least an enormous
amount of work and verification so I instead aimed to support just one new
SoC in the submission.

I've retained the callback indirections give us scope to add in another type of
future PHY including potentially adding in the 2PH later on.

This driver is tested and working on x1e/Hamoa and has been tested as not
breaking sc8280xp/Makena and sm8250/Kona.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
Bryan O'Donoghue (2):
      dt-bindings: phy: qcom: Add MIPI CSI2 C-PHY/DPHY Combo schema
      phy: qcom-mipi-csi2: Add a CSI2 MIPI D-PHY driver

 .../phy/qcom,x1e80100-mipi-csi2-combo-phy.yaml     |  95 ++++
 MAINTAINERS                                        |  11 +
 drivers/phy/qualcomm/Kconfig                       |  11 +
 drivers/phy/qualcomm/Makefile                      |   6 +
 drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c | 491 +++++++++++++++++++++
 drivers/phy/qualcomm/phy-qcom-mipi-csi2-core.c     | 281 ++++++++++++
 drivers/phy/qualcomm/phy-qcom-mipi-csi2.h          | 101 +++++
 7 files changed, 996 insertions(+)
---
base-commit: 2b0b621d5db55cf01bb200e6e6976b4ff4810544
change-id: 20250710-x1e-csi2-phy-f6434b651d3a

Best regards,
-- 
Bryan O'Donoghue <bryan.odonoghue@linaro.org>


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2025-08-12 16:08 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10 16:16 [PATCH 0/2] phy: qcom-mipi-csi2: Add a CSI2 MIPI DPHY driver Bryan O'Donoghue
2025-07-10 16:16 ` [PATCH 1/2] dt-bindings: phy: qcom: Add MIPI CSI2 C-PHY/DPHY Combo schema Bryan O'Donoghue
2025-07-10 23:08   ` Rob Herring
2025-07-14 14:13   ` Vladimir Zapolskiy
2025-07-14 14:42     ` Bryan O'Donoghue
2025-07-15  6:40       ` Vladimir Zapolskiy
2025-07-15  8:52         ` Bryan O'Donoghue
2025-07-10 16:16 ` [PATCH 2/2] phy: qcom-mipi-csi2: Add a CSI2 MIPI D-PHY driver Bryan O'Donoghue
2025-07-10 17:08   ` Konrad Dybcio
2025-07-11  9:14     ` Bryan O'Donoghue
2025-07-11 11:29       ` Konrad Dybcio
2025-07-14 14:16   ` Vladimir Zapolskiy
2025-07-14 14:43     ` Bryan O'Donoghue
2025-07-14 14:58       ` Vladimir Zapolskiy
2025-07-14 15:17         ` Bryan O'Donoghue
2025-07-14 15:26           ` Konrad Dybcio
2025-07-14 15:30           ` Vladimir Zapolskiy
2025-07-15  0:13             ` Bryan O'Donoghue
2025-07-15  6:35               ` Vladimir Zapolskiy
2025-07-15  9:01                 ` Konrad Dybcio
2025-07-15  9:20                   ` Vladimir Zapolskiy
2025-07-15  9:33                     ` Konrad Dybcio
2025-07-21 15:46                       ` neil.armstrong
2025-07-21 16:16                         ` Bryan O'Donoghue
2025-07-21 16:22                           ` Bryan O'Donoghue
2025-07-21 16:29                             ` Bryan O'Donoghue
2025-07-22  8:32                           ` Neil Armstrong
2025-07-22  9:08                             ` Bryan O'Donoghue
2025-07-22  9:59                               ` Neil Armstrong
2025-07-22 10:37                                 ` Bryan O'Donoghue
2025-08-12 13:39   ` neil.armstrong
2025-08-12 15:05     ` Bryan O'Donoghue
2025-08-12 16:08       ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).