From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 411214FD78B for ; Fri, 16 Oct 2026 16:08:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792166938; cv=none; b=i8sT0YqntHticeZPWScl+/OZEAEDJuw+yByxurUYjNjJUMbROqF142YgXFFEVWe1fLVrnFubhMoM9ZB2pipgRSNtYr+XtJPq1vyfvw19F4VJ7wp7p+rJiOrE6J6+HoyiXs6fGBY4tjqg8whOMZbOYhhczqQa9Yuvly2ckmXaAtI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792166938; c=relaxed/simple; bh=n1Dj36+CCyvzyVqupK5U7F0BlEQjzHPDpXfS7N5ssjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uTKEA5tGvDpyd8wXheHQ2Omspq7wASe/OcXFhjDHuvyHeSu5E/RtMpp9HweLZe1WAUOviOiPZI+INAFYTJEy1SUGqtjFztHfWR15sDM00Nzp/am+tSJcSUXamxQtY6OzL0qTeB4SYsd3ywvdoK0CGZlCFrosJs2LLHlIa3dgNVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=plBJ3L2c; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="plBJ3L2c" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-48e011d370dso12900f8f.0 for ; Fri, 16 Oct 2026 09:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792166935; x=1792771735; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Y3yD2VSIymN6B+DlBxpDWOb8du1EZz/KqBX+LpXERvI=; b=plBJ3L2cKz9ck7x8jQY/AJnAoCNaJpqUeraxps9+iq8TyggaQSor+T41+rIo2UpUbl LFzrQ4OwkVQ9X+mAVjoQahekWOgSAHpElKluF9sEiB0Qk4Cr0l6eifAgaSLjRpLsDuYs alPjoHIIC2dEpRPfm3fNtPpXL50C9Jn/xrZj6A7HqsrZEszNd7UvPifLaoB7JlQj4eMz FcNYmQK2hphreYd5h4ecCojoxYF6ScjWYHEFzXuLj2a4M2vUlXB4uLkEI/gya7NF4ugw Oif8oM1Efal/FbnD/SMmEs1UaX2s1Kj+lSgViTuZVM546ORqVIITcjuSPRbuLFmvcTx1 WTpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792166935; x=1792771735; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Y3yD2VSIymN6B+DlBxpDWOb8du1EZz/KqBX+LpXERvI=; b=vzsGR1ZNbrwzvuLBbkGBT1fj3stKs8n5GWF9dT1I0IJ9NwkvZapFCjJg6PQ17PxXLB qg/VnJEJGpxgqsfqBIZA5vyhVbGP8MESjlbcZc9ToD+idpF6GVSXc9dVJBfaO0aK20sa COua9ANWkcvh6zl7HRgomNYt/7aznfrNhHS93sZdJNeb44mNroxgQ5rcbV1ZloFT+CoT 4nAp30S94mr4ZYkZbgKZVMUTAbnsg1imL939UCHdUoU/W34PKh6zsIWLoG1us/lK4jFN 9KfD7Soe+/pRBjRf1KIkPwy4tAm22QRylGVz9eeTmFgNYZ9CJHcozrtxVN9cuZu1Vf/3 nFaA== X-Forwarded-Encrypted: i=1; AKwUvBw/Y68+wQ/C8EssySig26GLvpZgi6Qg8rte7qwrEAraiTgPZuQD3AWu+VwQy//8HQEnNAk/rVQJ5adO@vger.kernel.org X-Gm-Message-State: AFq9FYJZzrqtLYHefi87gm8OICol/6ey9VTlp7aZo858jzTd/2nR8AMw JbBY+GZPizMvpRfpyehEd9yyVBujexuXf+GWERUQgJ2Cujflzz4iFffV X-Gm-Gg: AYBFou3RFW/e1M/V7kW6i+3oFxJqEySKxtOHx886bnMI+p1cljq6Sr2FKC0U5IXM2f2 PLei55ZyA/Tnoisf66laIeb2/p30hlWHP2F+Bk7jEazL1q8Ya3ektO3yUqmpFeJ7lDTRrG3LW3W f8s/Vd+M5HVFts7J0apX1GKPxG6YihKxXSJPyy+8AnY76dAjO/669yw00DLNl1wuHf1kd78vA/L bsXuE4yYelnyKqmnoVdIWTgG8fpIc8eBRIgUie46Bof4CqnPGVVL7ZkmAWoXTcpYOwBa44TlYUq Mw/Ey4PFnKwuSilCho4DaYZRXZgvPTMoDUTQXOLdep+RS/6lNKgifdSVXlLGHBzSZSE8URfZ9Ip h/1VloPOTG2MT1dxqG+PSYaQ5zCQu5yYc7OqlE/GK2Z2ZA2/cTNzaelRz3n6eyyDIALFQYrc8UJ J2HiMN1v+8X532zAMJAkxITcehpou6FGotE1bAnjd8tuq0QEyczIATja07nrcj8mSroH/GChLJQ CaZ2wqIGwAMdZflEdK1weE/h6cD7T513VkcuWbQlsKGghhWxpVFfEIwg2Hrb18JwewE6XQQwVAt 3ShZie8= X-Received: by 2002:adf:f491:0:b0:488:7d08:edbc with SMTP id ffacd0b85a97d-48e07bc120cmr65033f8f.24.1792166935169; Fri, 16 Oct 2026 09:08:55 -0700 (PDT) Received: from SP11X1e.cable.virginm.net (cpc99340-croy26-2-0-cust244.19-2.cable.virginm.net. [80.193.62.245]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48dfd471b06sm6766200f8f.5.2026.10.16.09.08.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2026 09:08:54 -0700 (PDT) From: George Neacsu To: Bryan O'Donoghue Cc: Sergey Lebedev , Andre Gilerson , Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , German Pablo Lindo , 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 Message-ID: <20261016160853.193378-1-geocausa@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <11f1a19d-7d57-497f-826e-901f9f88b99b@kernel.org> References: <20261015-imx681-x1e-v1-0-fd22f5f3b0c5@gmail.com> <20261015-imx681-x1e-v1-2-fd22f5f3b0c5@gmail.com> <11f1a19d-7d57-497f-826e-901f9f88b99b@kernel.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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