Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Peter <sven@kernel.org>
To: Sasha Finkelstein <k@chaosmail.tech>, Janne Grunau <j@jannau.net>,
	Vinod Koul <vkoul@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Ramzi Abdiche <abdicheramzi@gmail.com>
Subject: Re: [PATCH v2 4/5] phy: apple: atc: Add T8122 DisplayPort support
Date: Tue, 24 Nov 2026 12:46:50 +0100	[thread overview]
Message-ID: <977c6810-8c9b-42d5-8f98-d2b15dbabad7@kernel.org> (raw)
In-Reply-To: <20261122-t8122-phy-v2-4-8d5c8fdf31ba@chaosmail.tech>



On 22.11.26 13:28, Sasha Finkelstein wrote:
> From: Ramzi Abdiche <abdicheramzi@gmail.com>
> 
> Add DisplayPort AUX and lane setup for T8122-family PHYs.
> Select clock and lane settings by link rate and stop active
> lanes before orientation changes.
> 
> Signed-off-by: Ramzi Abdiche <abdicheramzi@gmail.com>
> Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
> ---

[...]

>   
> +struct atcphy_dp_ops {
> +	void (*enable_aux)(struct apple_atcphy *atcphy);
> +	void (*disable_aux)(struct apple_atcphy *atcphy);
> +	int (*set_rate)(struct apple_atcphy *atcphy, enum atcphy_dp_link_rate lr);
> +	int (*stop)(struct apple_atcphy *atcphy);
> +};

Couldn't we just make this part of atcphy_hw as well? That one already 
contains a bunch of variant-specific function pointers now and I don't 
see a reason why these here have to be separate.

> +
>   struct atcphy_hw {
>   	void (*configure_post_tunable)(struct apple_atcphy *atcphy, enum atcphy_mode mode);
>   	void (*configure_pipehandler_usb3_host)(struct apple_atcphy *atcphy);
> @@ -600,6 +733,7 @@ struct atcphy_hw {

[...]

>   static int atcphy_dp_configure_lane(struct apple_atcphy *atcphy, enum atcphy_lane lane,
>   				    const struct atcphy_dp_link_rate_configuration *cfg)
>   {
> @@ -1452,20 +2013,11 @@ static int atcphy_dp_configure_lane(struct apple_atcphy *atcphy, enum atcphy_lan
>   
>   	lockdep_assert_held(&atcphy->lock);
>   
> -	switch (lane) {
> -	case APPLE_ATCPHY_LANE_0:
> -		tx_shm = atcphy->regs.core + LN0_AUSPMA_TX_SHM;
> -		rx_shm = atcphy->regs.core + LN0_AUSPMA_RX_SHM;
> -		rx_top = atcphy->regs.core + LN0_AUSPMA_RX_TOP;
> -		break;
> -	case APPLE_ATCPHY_LANE_1:
> -		tx_shm = atcphy->regs.core + LN1_AUSPMA_TX_SHM;
> -		rx_shm = atcphy->regs.core + LN1_AUSPMA_RX_SHM;
> -		rx_top = atcphy->regs.core + LN1_AUSPMA_RX_TOP;
> -		break;
> -	default:
> +	if ((unsigned int)lane > APPLE_ATCPHY_LANE_1)
>   		return -EINVAL;
> -	}

This is a bit weird, that thing is an enum so why not just keep the 
switch? This is also the only place that checks if lane is valid before 
calling atcphy_lane_reg(). I don't think it's even possible to have an 
invalid value here so I'd maybe drop this check completely since it 
always passes or change atcphy_lane_reg() to be something like

	int atcphy_lane_reg(void __iomem **reg, ....)

and return an error and put the register into *reg.



Sven



  reply	other threads:[~2026-11-24 11:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 12:27 [PATCH v2 0/5] phy: apple: atc: Add M3 support Sasha Finkelstein
2026-11-22 12:27 ` [PATCH v2 1/5] dt-bindings: phy: atcphy: Add M3 series Sasha Finkelstein
2026-11-22 12:27 ` [PATCH v2 2/5] soc: apple: tunable: Allow passing NULL to tunable_apply Sasha Finkelstein
2026-11-22 12:27 ` [PATCH v2 3/5] phy: apple: atc: Add initial M3 series support Sasha Finkelstein
2026-11-24 11:33   ` Sven Peter
2026-11-22 12:28 ` [PATCH v2 4/5] phy: apple: atc: Add T8122 DisplayPort support Sasha Finkelstein
2026-11-24 11:46   ` Sven Peter [this message]
     [not found] ` <20261122-t8122-phy-v2-5-8d5c8fdf31ba@chaosmail.tech>
2026-11-22 20:23   ` [PATCH v2 5/5] phy: apple: atc: Split generation-specific code kernel test robot
2026-11-22 21:36   ` kernel test robot
2026-11-23 11:46   ` Sven Peter

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=977c6810-8c9b-42d5-8f98-d2b15dbabad7@kernel.org \
    --to=sven@kernel.org \
    --cc=abdicheramzi@gmail.com \
    --cc=asahi@lists.linux.dev \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=j@jannau.net \
    --cc=k@chaosmail.tech \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mani@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.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