From: George Neacsu <geocausa@gmail.com>
To: Bryan O'Donoghue <bod@kernel.org>
Cc: Sergey Lebedev <lsa.uz@pm.me>,
Andre Gilerson <andre.gilerson@gmail.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
German Pablo Lindo <germanpapulindez@gmail.com>,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] media: i2c: imx681: Add C-PHY support
Date: Fri, 16 Oct 2026 17:08:53 +0100 [thread overview]
Message-ID: <20261016160853.193378-1-geocausa@gmail.com> (raw)
In-Reply-To: <11f1a19d-7d57-497f-826e-901f9f88b99b@kernel.org>
Hi Bryan,
The values come from two places on this machine: the Windows sensor
file, and a kernel debugger attached to Windows while it streamed. They
were then checked against the CCS definitions and on Linux. In detail:
1. The Windows sensor file. The Windows install on this Surface Pro 11
has a Qualcomm sensor module file for the IMX681 (SONY0681). A script
here parses its register tables: an init table of 364 writes and six
per-mode tables of 68 writes. Nothing from the file is
redistributed; only register values are used.
2. Windows observed live. With a second machine as kernel debugger, I
set a breakpoint in the Windows front sensor driver just before it
applies the mode table, started the stock Windows Camera app, and
dumped the 68 writes it sent. They match the file's 3840x2160 30 fps
mode exactly. That live table includes
0x0114 = 0x00 (CSI_LANE_MODE),
0x0306/0x0307 = 225, 0x030d = 3, 0x030e/0x030f = 375,
line length 6752, frame length 3554.
In separate debugger sessions I read the CSIPHY2 registers while
Windows streamed. The receiver was in C-PHY mode, and its settings
match Qualcomm's GPL 2.5 Gsps C-PHY table (121 registers, compared
from two snapshots).
CSI_SIGNALING_MODE = 0x03 is in the init table. I have it from the
file, but I did not catch Windows writing it live.
3. Why 0x03 means C-PHY. 0x0111 is CSI_SIGNALING_MODE and 0x0114
CSI_LANE_MODE in the MIPI CCS register map, as in
drivers/media/i2c/ccs/ccs-regs.h: 2 is CSI-2 D-PHY, 3 is CSI-2 C-PHY
(0 and 1 are the old CCP2 modes), and the lane mode is the lane or
trio count minus one. This agrees with the hardware: Sergey reads
back 0x02 and 0x01 on the Intel model while streaming two D-PHY
lanes; the Windows receiver here runs C-PHY on one trio; and under
Linux, with 0x03 and 0x00, the sensor streams into the PHY in C-PHY
mode.
4. The 2.4 Gsym/s is calculated, not measured: 19.2 MHz / 3 * 375 from
the OP PLL values Windows writes. The receiver does not report the
rate, and it locks over a wide range of settle counts, so a working
capture does not prove the exact value. It does fall in the 2.5 Gsps
bin that Windows programs into the receiver. Likewise,
6752 * 3554 * 30 = 719.9 MHz matches v8's pixel rate, and the pixel
PLL (225) is the one v8 already writes.
In the next version the commit message will say which values come from
the live Windows capture, which come only from the sensor file, which
are calculated, and what was checked on Linux. The extraction and
capture process will also be written up in the project repository and
linked. I will also read the CCS capability register 0x1602 (bit 3 =
C-PHY) here, and Sergey may be able to read it on the Intel model.
Thanks,
George
next prev parent reply other threads:[~2026-10-16 16:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 21:25 [PATCH RFC 0/2] media: imx681: C-PHY for the Surface Pro 11 (Snapdragon) George Neacsu via B4 Relay
2026-10-15 21:25 ` [PATCH RFC 1/2] dt-bindings: media: sony,imx681: Allow a C-PHY bus George Neacsu via B4 Relay
2026-10-16 15:59 ` Bryan O'Donoghue
2026-10-16 16:08 ` George Neacsu
2026-10-15 21:25 ` [PATCH RFC 2/2] media: i2c: imx681: Add C-PHY support George Neacsu via B4 Relay
2026-10-16 15:54 ` Bryan O'Donoghue
2026-10-16 16:08 ` George Neacsu [this message]
2026-10-16 7:00 ` [PATCH RFC 0/2] media: imx681: C-PHY for the Surface Pro 11 (Snapdragon) Sergey Lebedev
2026-10-16 14:55 ` George Neacsu
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=20261016160853.193378-1-geocausa@gmail.com \
--to=geocausa@gmail.com \
--cc=andre.gilerson@gmail.com \
--cc=bod@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=germanpapulindez@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lsa.uz@pm.me \
--cc=mchehab@kernel.org \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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