From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.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 D4CA42E543B; Mon, 27 Oct 2025 09:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=195.140.195.201 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761556157; cv=pass; b=NakIAUKGKXLTezXFf8z28FOscRwK38cdAGE9en/8GrToq/TFmuLRUNorS8nS0s2P0heUPOaOj3xzD6Cznxk969sCuN/2/GZGRncLy69HXU3n3tGR6ylY0rm/oRjOHdX2xER5V5qB3S5MezJCyZ4KpFsuCikrhKRUnsUdbdsrVNs= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761556157; c=relaxed/simple; bh=y8AutCU30+MWyY3DKkOAXv+qDkXVpQGNsmkQOmX7zFY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MmSVKB6Pd2jAjAz0Cqu28T98xwWA1wRrsFdekrEW2OMgS1u7Tkbtwolkpe4/5TDQyKxl57AjXl/JgYB92oY1wzVp8tk+jaoHrBuDons7JgjekRya3IjAFiA9LOBa/Z7XngACinh+Ve1kaUiv0AOKdEHUnZ5lYa6DjDAVFlvMOU4= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b=u0ppOfKh; arc=pass smtp.client-ip=195.140.195.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=iki.fi header.i=@iki.fi header.b="u0ppOfKh" Received: from hillosipuli.retiisi.eu (91-158-51-183.elisa-laajakaista.fi [91.158.51.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sailus) by meesny.iki.fi (Postfix) with ESMTPSA id 4cw73r2GJFzySG; Mon, 27 Oct 2025 11:09:12 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1761556153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6j0r4WsWkcl7drnJIo9dfVk4tLcInytBpxeSXRluRoY=; b=u0ppOfKhIbYPDOLJpVQq8gxa3U9bimOoh0/8G/I/aVJ9CN8ZsiAuBtDPn+T1p3LrS6IlaV EMpn3kkU9AToKt6c2oY6U/M17Lh/6cLk3y7Enjz6oxjIC4uxwERVuhnv3l6uu/MPeJjGPT x4V8FFfdDKyyBilPlQZmIrUNfyRENDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1761556153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6j0r4WsWkcl7drnJIo9dfVk4tLcInytBpxeSXRluRoY=; b=xer77ERM/L33oNcBaUBUrrwtEIo8aOGILzir2DWeF0pn/gF6pVytnRg8ovQ0abkRZQHPOc 5CPpE6SsshcnTcIKswHIDFm+CKSDpgPy9VtD0yYBPT0PuWCFOoqvgTifLGSQTErznR/jse 5xnfCIXCNujOc+U2BnjN6SCmdwC33dU= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sailus smtp.mailfrom=sakari.ailus@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1761556153; a=rsa-sha256; cv=none; b=BKYzExpAnCTnDxGHURcSgwKCnRxJzZgNVzaIT42kMEDR31xeq6HA8845LUPLw7jOHP36KN Hdm0+NoDsO1i9p0gt7XD06aRNuRhS6h1/Pw9kUgJSFiP3v4wR/+3ZXUGFahn5c/jQ47fd8 3OTi7SV921Dcc+8hvNNgWGsikA6JZcM= Received: from valkosipuli.retiisi.eu (valkosipuli.local [192.168.4.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.eu (Postfix) with ESMTPS id 12251634C5B; Mon, 27 Oct 2025 11:09:12 +0200 (EET) Date: Mon, 27 Oct 2025 11:09:11 +0200 From: Sakari Ailus To: Frank Li Cc: Rui Miguel Silva , Laurent Pinchart , Martin Kepplinger , Purism Kernel Team , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Eugen Hristev , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Peng Fan , Alice Yuan , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Steve Longerbeam , Greg Kroah-Hartman , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-staging@lists.linux.dev Subject: Re: [PATCH v3 19/31] media: synopsys: csi2: Add phy interface support Message-ID: References: <20250821-95_cam-v3-0-c9286fbb34b9@nxp.com> <20250821-95_cam-v3-19-c9286fbb34b9@nxp.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250821-95_cam-v3-19-c9286fbb34b9@nxp.com> Hi Frank, On Thu, Aug 21, 2025 at 04:15:54PM -0400, Frank Li wrote: > Add standard phy interface support. > > Signed-off-by: Frank Li > --- > drivers/media/platform/synopsys/mipi-csi2.c | 91 +++++++++++++++++++++++++++-- > include/media/dw-mipi-csi2.h | 4 ++ > 2 files changed, 90 insertions(+), 5 deletions(-) > > diff --git a/drivers/media/platform/synopsys/mipi-csi2.c b/drivers/media/platform/synopsys/mipi-csi2.c > index 922b59670383db7c920625f8a149009fa4dc5f22..27d802b3c3937473c8e08defa661b55b0655f758 100644 > --- a/drivers/media/platform/synopsys/mipi-csi2.c > +++ b/drivers/media/platform/synopsys/mipi-csi2.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -268,7 +269,63 @@ static int csi2_get_active_lanes(struct dw_mipi_csi2_dev *csi2, unsigned int *la > return 0; > } > > -static int csi2_start(struct dw_mipi_csi2_dev *csi2) > +static int dw_csi2_get_dphy_configuration(struct dw_mipi_csi2_dev *csi2, > + union phy_configure_opts *opts, > + int bpp) > +{ > + struct phy_configure_opts_mipi_dphy *cfg = &opts->mipi_dphy; > + struct v4l2_subdev *source = csi2->src_sd; > + s64 link_freq; > + > + link_freq = v4l2_get_link_freq(source->ctrl_handler, Please rebase. > + bpp, > + csi2->data_lanes * 2); Fits on fewer lines. > + if (link_freq < 0) { > + dev_err(csi2->dev, "Unable to obtain link frequency: %d\n", > + (int)link_freq); > + return link_freq; > + } > + > + memset(cfg, 0x0, sizeof(*cfg)); > + cfg->hs_clk_rate = link_freq * 2; > + cfg->lanes = csi2->data_lanes; > + > + return 0; > +} -- Regards, Sakari Ailus