From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3B7E606A32C for ; Mon, 26 Oct 2026 22:50:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=gKL+/dvz; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jgHcbQI0 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=HYnAn28Krqdq1FOEuV57L5UpuomNn7AJ+tjgvExbOR0=; b=gKL+/dvzH3kFnmmw4Mo1r0mh05 vg4a0N6YvpmlYzM2s3GUhvijVqQCnITQN6rVSUESb4Xfo1kianc8/FEkb3yEx1CRzB6qc1Xe986DA mcwSFZXnrRVTgjxNznkfDgt5aHPV93Otro/pJY2LUG5ox3nvmqwYxrrJO8siorJadLrMMOlhdxDnr J+WnFQCNo5b+OHFbeODKcp072NVkgvDdbBW5Vny0I2bd9vPD1i9dnVSJYPMjUg+V1LlQLO2MLdQPV 0cYe/nSp7SxNMXkihv/T2g4NQ2lGzytm3rmUYx1aMPNq7IjMNqdtNXc95IHGSCByK1I+2h1eND661 vNlDIjPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xLTWD-00000003Ntb-2qbX; Mon, 26 Oct 2026 22:50:17 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xLTWD-00000003NtM-0fl5 for linux-phy@lists.infradead.org; Mon, 26 Oct 2026 22:50:17 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id E6BB543CC8; Mon, 26 Oct 2026 22:50:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F04AD1F01828; Mon, 26 Oct 2026 22:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793055016; bh=EVk+yjL8wX++W59cZlj03JU3r1mhQtWxs7tNqn9bqvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jgHcbQI09A3d3M0g/KmmtEpTADbCvZC/tSH0rghK+sXC66YowBmkjj4kU47nQ2esu I5bAe6PuHSTgGorvWHVYf0/Gw7cXB83ntq1USkuM6sq0T6JO55+t5UzaNkWDJjRCdu 1xokByT60JmhoChA/V3lAIiKCH6UZ8/1iYMdbAtCQSuNnodd9IYFQsrquAEYGOnYxo RUQxuhM1JuBd7AWT8f30BGBfBICItYko+hOX9ZIMdI+sU5L9A1i1pPBy5+6n+G9GTv ZaPextkgy1ow5F+QLR2iZ9wmCuOI8DxOPW6lOjqyckJnu5HE3ue2fe/aujQhJuPlsw gxOtMdeHbaBHA== From: Vladimir Zapolskiy To: Bjorn Andersson , Konrad Dybcio , Abel Vesa , Bryan O'Donoghue , Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, Vladimir Zapolskiy , Loic Poulain , Mauro Carvalho Chehab , linux-media@vger.kernel.org, Neil Armstrong , Manivannan Sadhasivam , linux-phy@lists.infradead.org, Conor Dooley , devicetree@vger.kernel.org Subject: [PATCH v2 3/7] media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources Date: Tue, 27 Oct 2026 00:49:53 +0200 Message-ID: <20261026224957.1115370-4-vz@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20261026224957.1115370-1-vz@kernel.org> References: <20261026224957.1115370-1-vz@kernel.org> X-Archived-By: MIME-Version: 1.0 X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 If CAMSS CSIPHYs are supported by the stand-alone CSI2 PHY driver only, there is no need to provide description of legacy CSIPHY resources in the CAMSS driver, therefore if CSIPHY resources are not given for some supported platform, use CAMSS CSIPHY port numbers as CSIPHY identifiers. Signed-off-by: Vladimir Zapolskiy --- drivers/media/platform/qcom/camss/camss-csiphy.c | 16 +++++++++++++--- drivers/media/platform/qcom/camss/camss.c | 8 ++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c index f99eea2ef228..8ecd514451d2 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -799,6 +799,11 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss, return ret; } +/* Fallback to generic SDM845 compatible formats for non-legacy CSIPHYs */ +static const struct csiphy_subdev_resources csiphy_res_phy = { + .formats = &csiphy_formats_sdm845, +}; + /* * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources * @camss: CAMSS structure @@ -808,7 +813,7 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss, */ int msm_csiphy_subdev_init(struct camss *camss, u8 port) { - const struct camss_subdev_resources *res = &camss->res->csiphy_res[port]; + const struct camss_subdev_resources *res = camss->res->csiphy_res; struct csiphy_device *csiphy = &camss->csiphy[port]; struct device *dev = camss->dev; struct device_node *ep, *remote; @@ -836,8 +841,13 @@ int msm_csiphy_subdev_init(struct camss *camss, u8 port) } csiphy->camss = camss; - csiphy->id = res->csiphy.id; - csiphy->res = &res->csiphy; + if (res) { + csiphy->id = res[port].csiphy.id; + csiphy->res = &res[port].csiphy; + } else { + csiphy->id = port; + csiphy->res = &csiphy_res_phy; + } snprintf(csiphy->name, ARRAY_SIZE(csiphy->name), "csi%d", csiphy->id); diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index c54185c93a8a..b0d60e70e4bb 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -4796,7 +4796,10 @@ static void camss_detect_legacy_phy(struct camss *camss) struct device_node *remote; struct device_node *ep; - camss->legacy_phy = true; + /* Legacy CSIPHY description implies the provided CSIPHY resources */ + camss->legacy_phy = !!camss->res->csiphy_res; + if (!camss->legacy_phy) + goto done; /* Find first remote-endpoint and determine if its a PHY */ for_each_endpoint_of_node(camss->dev->of_node, ep) { @@ -4810,6 +4813,7 @@ static void camss_detect_legacy_phy(struct camss *camss) break; } +done: dev_dbg(camss->dev, "legacy phy mode %s\n", camss->legacy_phy ? "true" : "false"); } @@ -4841,7 +4845,7 @@ static int camss_init_subdevices(struct camss *camss) if (ret < 0) { dev_err(camss->dev, "csiphy %d init fail\n", - res->csiphy_res[i].csiphy.id); + res->csiphy_res ? res->csiphy_res[i].csiphy.id : i); return ret; } } -- 2.51.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy