From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 589F640DB43; Fri, 16 Oct 2026 10:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792148270; cv=none; b=pthTrgPgYjyAKtqgP+pNlUyQPXXykwEWK3YXJUO7cDMCZQn3Ivb3+XXti8kb7lLM0bkEZJeKKOwFMgWU81EjWSaANN6Cb5VP9z7sBe54dAFMw6zd+LSsGbpdjc/gEKxFLQocKz4igmLhHcAxuNDwRcuseMtd6xazsj1c7B2DYHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792148270; c=relaxed/simple; bh=eectjYrIhTFeSa6cmyJxGwjidsaxuV0RwoviEysySwc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PidCKlXEth5tFOt8SCt70SLqCOf9YdxL4mgOACFjW5l2aFw7oe/dF4lqV5yozDw0wnWm4qk6BtvmzpkqtaY2kN5KeTzvRG9HMnKdQa3anpILWX5W3Yr4ehT+H2WPEb843VOuZubkilDV4qhJuEiffXvJ54glY8wAmeRYNEY+uPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kiAQiMCt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kiAQiMCt" Received: by smtp.kernel.org (Postfix) with ESMTPS id DEA74C2BCFB; Fri, 16 Oct 2026 10:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1792148270; bh=eectjYrIhTFeSa6cmyJxGwjidsaxuV0RwoviEysySwc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=kiAQiMCtt25Kj0fGr+iH8SVNmUYyQVKmV5J/kCrgbus5z+3HKl9EpRApK0vjpRxnK 4+rwkjd/iHe7dGAUcSCyGMFRYTY/1w5x2QZh0DWQa40QnWhtXPsYPYJyrQt1tjHSeW LmXjzfq5zfUhI1Aei3qLszVVB4DWxvITgxCJ899nRusahCNkrD90VPjZ5h8tQjJICe PYV5ZCUKDRITzxu964YWjCZfJVG0dJRmdSHCWQHJolgLaA3J5ZCASvwODtmSnaHhoc zOEd9qOxs8eZtku1AHJtQjnUofrS1PbFjZQ2b9gxBr4Ya+O5fklFxXO7PWJETETIP9 nRklGKAIgCO9g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC3AFCC6B38; Fri, 16 Oct 2026 10:57:49 +0000 (UTC) From: George Neacsu via B4 Relay Date: Fri, 16 Oct 2026 11:57:48 +0100 Subject: [PATCH RFC v2 1/4] phy: Add MIPI C-PHY mode and configuration options Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261016-x1e-cphy-rfc-v2-1-377654253193@gmail.com> References: <20261016-x1e-cphy-rfc-v2-0-377654253193@gmail.com> In-Reply-To: <20261016-x1e-cphy-rfc-v2-0-377654253193@gmail.com> To: Bryan O'Donoghue , Vinod Koul , David Heidelberg Cc: Neil Armstrong , Vladimir Zapolskiy , Loic Poulain , Konrad Dybcio , Nihal Kumar Gupta , Vikram Sharma , Suresh Vankadara , tjose@qti.qualcomm.com, Mauro Carvalho Chehab , Manivannan Sadhasivam , linux-phy@lists.infradead.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , George Neacsu X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1792148268; l=2835; i=geocausa@gmail.com; s=20261015; h=from:subject:message-id; bh=QHFBcJBpxdO8b73RCl5n/HzgmWhLoMZI00dLXopfdHo=; b=wzpKJT0trhBnts5TniNxrXAprJYbXQP8/TrfwHSkfA39zj/74K4SYjYLoFmuIow+xK8VQPSGo 0vSUe2fMjeOD6DgVoDlwdni+i/fj3FrfBobWmztRxNV7/pI2lLDgzUI X-Developer-Key: i=geocausa@gmail.com; a=ed25519; pk=KyQk/iWbxsikewDBh0SwlHI51RvAqahD3loqmRp9DVI= X-Endpoint-Received: by B4 Relay for geocausa@gmail.com/20261015 with auth_id=1199 X-Original-From: George Neacsu Reply-To: geocausa@gmail.com From: George Neacsu The generic PHY framework has a mode and configuration options for MIPI D-PHY but none for C-PHY, so a CSI-2 receiver has no way to ask a PHY that does both for C-PHY. Add PHY_MODE_MIPI_CPHY and struct phy_configure_opts_mipi_cphy. The options are the two values a receiver knows: the symbol rate on each trio and the number of trios. The first user is the Qualcomm CSI2 PHY, whose X1E80100 instances carry the C-PHY front camera of the Surface Pro 11. Reviewed-by: Bryan O'Donoghue Assisted-by: Claude:claude-opus-5-5 Signed-off-by: George Neacsu --- include/linux/phy/phy-mipi-cphy.h | 27 +++++++++++++++++++++++++++ include/linux/phy/phy.h | 5 +++++ 2 files changed, 32 insertions(+) diff --git a/include/linux/phy/phy-mipi-cphy.h b/include/linux/phy/phy-mipi-cphy.h new file mode 100644 index 000000000..ef6af61de --- /dev/null +++ b/include/linux/phy/phy-mipi-cphy.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __PHY_MIPI_CPHY_H_ +#define __PHY_MIPI_CPHY_H_ + +/** + * 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 on each trio, in symbols per second. + */ + unsigned long long symbol_rate; + + /** + * @trios: + * + * Number of active trios. + */ + unsigned char trios; +}; + +#endif /* __PHY_MIPI_CPHY_H_ */ diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index c480d6cb4..f12337834 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,7 @@ enum phy_mode { PHY_MODE_PCIE, PHY_MODE_ETHERNET, PHY_MODE_MIPI_DPHY, + PHY_MODE_MIPI_CPHY, PHY_MODE_SATA, PHY_MODE_LVDS, PHY_MODE_DP, @@ -69,6 +71,8 @@ union phy_notify { * * @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 +82,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.53.0