linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paulk@sys-base.io>
To: "Kuba Szczodrzyński" <kuba@szczodrzynski.pl>
Cc: Maxime Ripard <mripard@kernel.org>,
	Samuel Holland <samuel@sholland.org>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/sun4i: Enable LVDS output on sun20i D1s/T113
Date: Wed, 25 Jun 2025 10:06:19 +0200	[thread overview]
Message-ID: <aFut-yuJS2lfWaE8@shepard> (raw)
In-Reply-To: <20250221161751.1278049-4-kuba@szczodrzynski.pl>

[-- Attachment #1: Type: text/plain, Size: 2574 bytes --]

Hi,

Some comments below.

On Fri 21 Feb 25, 17:17, Kuba Szczodrzyński wrote:
> The Allwinner D1s/T113 needs to use the combo D-PHY to enable LVDS
> output.
> 
> Enable LVDS support in the TCON and configure it using the PHY.
> 
> Signed-off-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
> ---
>  drivers/gpu/drm/sun4i/sun4i_tcon.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index ccf335a61..58230a552 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -171,6 +171,30 @@ static void sun6i_tcon_setup_lvds_phy(struct sun4i_tcon *tcon,
>  			  SUN6I_TCON0_LVDS_ANA0_EN_DRVD(val));
>  }
>  
> +static void sun20i_tcon_setup_lvds_dphy(struct sun4i_tcon *tcon,
> +					const struct drm_encoder *encoder)
> +{
> +	union phy_configure_opts opts = { };
> +
> +	if (!tcon->quirks->has_combo_dphy || !tcon->dphy)
> +		return;
> +
> +	phy_init(tcon->dphy);
> +	phy_set_mode(tcon->dphy, PHY_MODE_LVDS);
> +	phy_configure(tcon->dphy, &opts);
> +	phy_power_on(tcon->dphy);

While the callback doesn't have any return code (and it probably should, feel
free to fix that), the return codes for the phy_ calls should be checked and
the function aborted early in case of error.

> +}
> +
> +static void sun20i_tcon_disable_lvds_dphy(struct sun4i_tcon *tcon,
> +					  const struct drm_encoder *encoder)
> +{
> +	if (!tcon->quirks->has_combo_dphy || !tcon->dphy)
> +		return;
> +
> +	phy_power_off(tcon->dphy);
> +	phy_exit(tcon->dphy);

Same comment here.

> +}
> +
>  static void sun4i_tcon_lvds_set_status(struct sun4i_tcon *tcon,
>  				       const struct drm_encoder *encoder,
>  				       bool enabled)
> @@ -1550,8 +1574,12 @@ static const struct sun4i_tcon_quirks sun9i_a80_tcon_tv_quirks = {
>  
>  static const struct sun4i_tcon_quirks sun20i_d1_lcd_quirks = {
>  	.has_channel_0		= true,
> +	.has_combo_dphy		= true,
> +	.supports_lvds		= true,
>  	.dclk_min_div		= 1,
>  	.set_mux		= sun8i_r40_tcon_tv_set_mux,
> +	.setup_lvds_phy		= sun20i_tcon_setup_lvds_dphy,
> +	.disable_lvds_phy	= sun20i_tcon_disable_lvds_dphy,
>  };
>  
>  /* sun4i_drv uses this list to check if a device node is a TCON */
> -- 
> 2.25.1
> 
> 

-- 
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-06-25  8:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 16:17 [PATCH 0/5] drm/sun4i: Support LVDS on D1s/T113 combo D-PHY Kuba Szczodrzyński
2025-02-21 16:17 ` [PATCH 1/5] phy: allwinner: phy-sun6i-mipi-dphy: Support LVDS in " Kuba Szczodrzyński
2025-06-25  7:56   ` Paul Kocialkowski
2025-02-21 16:17 ` [PATCH 2/5] drm/sun4i: Support LVDS using MIPI DSI " Kuba Szczodrzyński
2025-06-25  8:03   ` Paul Kocialkowski
2025-06-25  8:36     ` Paul Kocialkowski
2025-02-21 16:17 ` [PATCH 3/5] drm/sun4i: Enable LVDS output on sun20i D1s/T113 Kuba Szczodrzyński
2025-06-25  8:06   ` Paul Kocialkowski [this message]
2025-02-21 16:17 ` [PATCH 4/5] riscv: dts: allwinner: d1s-t113: Add D-PHY to TCON LCD0 Kuba Szczodrzyński
2025-06-25  8:09   ` Paul Kocialkowski
2025-02-21 16:17 ` [PATCH 5/5] riscv: dts: allwinner: d1s-t113: Add LVDS0 pins Kuba Szczodrzyński
2025-06-25  8:24   ` Paul Kocialkowski
2025-06-25  8:35 ` [PATCH 0/5] drm/sun4i: Support LVDS on D1s/T113 combo D-PHY Paul Kocialkowski

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=aFut-yuJS2lfWaE8@shepard \
    --to=paulk@sys-base.io \
    --cc=airlied@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@szczodrzynski.pl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=wens@csie.org \
    /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;
as well as URLs for NNTP newsgroup(s).