Re: [PATCH 1/2] dt-bindings: media: qcom,glymur-camss: Use CSIPHY indices for ports

From: Bryan O'Donoghue

Date: Thu Nov 05 2026 - 11:14:55 EST


On 05/11/2026 14:01, Loic Poulain wrote:
The CSIPHYs are connected to the CAMSS input ports, which can then be
multiplexed and routed to different CSIDs. The mux identifies its PHY
inputs using the hardware PHY IDs, so the CSIPHY4 is identified as the
CAMSS PHY4 input. In this configuration, PHY2 and PHY3 inputs are not
connected.
I could not find that information in Glymur HPG, but maybe I looked
wrong. CSID Wrapper lists CSID 0-2, not 0, 1 and 4, but again maybe I am
looking at wrong device description/interface...
Yes, there are three CSIDs (CSID0-2) and two CSID_LITEs
(CSID_LITE0-1). These blocks select the PHY source to be routed by
programming their PHY ID (PHY ID = PHY index + 1), as defined by the
PHY_NUM_SEL field in CSI2_RX_CFG0.

If the CAMSS port ID matches the PHY index, the port ID can be used
directly as a routing reference, which keeps the implementation
straightforward.

Alternatively, exposing logical port IDs such as { 0, 1, 2 } also
makes sense. In that case, the driver would simply maintain an
internal mapping table, for example mapping DT/logical ports { 0, 1, 2
} to PHY indices { 0, 1, 4 }.

The media-graph informs which PHY connects to which CSID. The port-number in the DT really only identifies the fact a PHY input exists - it should be considered a mux in front of the set of CSIDs with the media-graph being the route.

Since the route is runtime selectable, the media-graph is the boss, not DT.

You can try this on any CAMSS device right now, PHYs connect independently to CSI decoders.

PHY_NUM_SEL is derived in the driver, not taken directly from the port number: the port indexes csiphy_res[] and csiphy_res[port].csiphy.id is the hardware PHY index, e.g. port@3 on x1e is CSIPHY4.

More work should be done to represent the fact-of-life - the mux. This was discussed extensively in the standalone PHY series.

The ports being numbered with the PHYs was a consequence of the PHYs living inside the CAMSS node - which we have the opportunity now to break with and should.

Port number in DT should just be a linear 0-X for the number of PHY inputs. Which CSI decoder that port routes to is still a runtime selection.

Honestly I don’t see much value in continuing to treat port numbers as hardware mappings in DT now that standalone PHYs have landed.

---
bod