mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "angelogioacchino.delregno@collabora.com" 
	<angelogioacchino.delregno@collabora.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org" 
	<linux-mediatek@lists.infradead.org>,
	"wenst@chromium.org" <wenst@chromium.org>,
	"kernel@collabora.com" <kernel@collabora.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"amergnat@baylibre.com" <amergnat@baylibre.com>,
	"ehristev@collabora.com" <ehristev@collabora.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"nfraprado@collabora.com" <nfraprado@collabora.com>
Subject: Re: [PATCH v7 08/11] drm/mediatek: dp: Move PHY registration to new function
Date: Thu, 27 Jul 2023 03:27:03 +0000	[thread overview]
Message-ID: <1533c98764b34896fc959bb03b748830f97437d0.camel@mediatek.com> (raw)
In-Reply-To: <20230725073234.55892-9-angelogioacchino.delregno@collabora.com>

Hi, Angelo:

On Tue, 2023-07-25 at 09:32 +0200, AngeloGioacchino Del Regno wrote:
> In preparation for adding support for eDP, move the PHY registration
> code to a new mtk_dp_register_phy() function for better readability.
> 
> This commit brings no functional changes.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Signed-off-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> Tested-by: Chen-Yu Tsai <wenst@chromium.org>
> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dp.c | 43 +++++++++++++++++++--------
> ----
>  1 file changed, 26 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c
> b/drivers/gpu/drm/mediatek/mtk_dp.c
> index c1d1a882f1db..1b4219e6a00b 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -2478,6 +2478,29 @@ static int mtk_dp_register_audio_driver(struct
> device *dev)
>  	return PTR_ERR_OR_ZERO(mtk_dp->audio_pdev);
>  }
>  
> +static int mtk_dp_register_phy(struct mtk_dp *mtk_dp)
> +{
> +	struct device *dev = mtk_dp->dev;
> +
> +	mtk_dp->phy_dev = platform_device_register_data(dev, "mediatek-
> dp-phy",
> +							PLATFORM_DEVID_
> AUTO,
> +							&mtk_dp->regs,
> +							sizeof(struct
> regmap *));
> +	if (IS_ERR(mtk_dp->phy_dev))
> +		return dev_err_probe(dev, PTR_ERR(mtk_dp->phy_dev),
> +				     "Failed to create device mediatek-
> dp-phy\n");
> +
> +	mtk_dp_get_calibration_data(mtk_dp);
> +
> +	mtk_dp->phy = devm_phy_get(&mtk_dp->phy_dev->dev, "dp");
> +	if (IS_ERR(mtk_dp->phy)) {
> +		platform_device_unregister(mtk_dp->phy_dev);
> +		return dev_err_probe(dev, PTR_ERR(mtk_dp->phy), "Failed
> to get phy\n");
> +	}
> +
> +	return 0;
> +}
> +
>  static int mtk_dp_probe(struct platform_device *pdev)
>  {
>  	struct mtk_dp *mtk_dp;
> @@ -2536,23 +2559,9 @@ static int mtk_dp_probe(struct platform_device
> *pdev)
>  		}
>  	}
>  
> -	mtk_dp->phy_dev = platform_device_register_data(dev, "mediatek-
> dp-phy",
> -							PLATFORM_DEVID_
> AUTO,
> -							&mtk_dp->regs,
> -							sizeof(struct
> regmap *));
> -	if (IS_ERR(mtk_dp->phy_dev))
> -		return dev_err_probe(dev, PTR_ERR(mtk_dp->phy_dev),
> -				     "Failed to create device mediatek-
> dp-phy\n");
> -
> -	mtk_dp_get_calibration_data(mtk_dp);
> -
> -	mtk_dp->phy = devm_phy_get(&mtk_dp->phy_dev->dev, "dp");
> -
> -	if (IS_ERR(mtk_dp->phy)) {
> -		platform_device_unregister(mtk_dp->phy_dev);
> -		return dev_err_probe(dev, PTR_ERR(mtk_dp->phy),
> -				     "Failed to get phy\n");
> -	}
> +	ret = mtk_dp_register_phy(mtk_dp);
> +	if (ret)
> +		return ret;
>  
>  	mtk_dp->bridge.funcs = &mtk_dp_bridge_funcs;
>  	mtk_dp->bridge.of_node = dev->of_node;

  reply	other threads:[~2023-07-27  3:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  7:32 [PATCH v7 00/11] MediaTek DisplayPort: support eDP and aux-bus AngeloGioacchino Del Regno
2023-07-25  7:32 ` [PATCH v7 01/11] drm/mediatek: dp: Add missing error checks in mtk_dp_parse_capabilities AngeloGioacchino Del Regno
2023-07-27  3:36   ` CK Hu (胡俊光)
2023-07-25  7:32 ` [PATCH v7 02/11] drm/mediatek: dp: Move AUX and panel poweron/off sequence to function AngeloGioacchino Del Regno
2023-07-25  7:32 ` [PATCH v7 03/11] drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer() AngeloGioacchino Del Regno
2023-07-25  7:32 ` [PATCH v7 04/11] drm/mediatek: dp: Use devm variant of drm_bridge_add() AngeloGioacchino Del Regno
2023-07-25  7:32 ` [PATCH v7 05/11] drm/mediatek: dp: Move AUX_P0 setting to mtk_dp_initialize_aux_settings() AngeloGioacchino Del Regno
2023-07-25  7:32 ` [PATCH v7 06/11] drm/mediatek: dp: Enable event interrupt only when bridge attached AngeloGioacchino Del Regno
2023-07-27  2:53   ` CK Hu (胡俊光)
2023-07-25  7:32 ` [PATCH v7 07/11] drm/mediatek: dp: Avoid mutex locks if audio is not supported/enabled AngeloGioacchino Del Regno
2023-07-25  7:32 ` [PATCH v7 08/11] drm/mediatek: dp: Move PHY registration to new function AngeloGioacchino Del Regno
2023-07-27  3:27   ` CK Hu (胡俊光) [this message]
2023-07-25  7:32 ` [PATCH v7 09/11] drm/mediatek: dp: Add support for embedded DisplayPort aux-bus AngeloGioacchino Del Regno
2023-08-25 12:01   ` Michael Walle
2023-08-25 14:02     ` Nícolas F. R. A. Prado
2023-08-25 15:42       ` Michael Walle
2023-08-25 20:36         ` Nícolas F. R. A. Prado
2023-08-29 13:30           ` Michael Walle
2023-08-29 18:19             ` Nícolas F. R. A. Prado
2023-08-30 11:11               ` Michael Walle
2023-08-31  7:12                 ` Chen-Yu Tsai
2023-09-01 10:00                   ` Michael Walle
2023-09-01 15:00                     ` Chen-Yu Tsai
2023-07-25  7:32 ` [PATCH v7 10/11] drm/mediatek: dp: Add .wait_hpd_asserted() for AUX bus AngeloGioacchino Del Regno
2023-07-25  7:32 ` [PATCH v7 11/11] drm/mediatek: dp: Don't register HPD interrupt handler for eDP case AngeloGioacchino Del Regno
2023-07-27  2:55   ` CK Hu (胡俊光)

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=1533c98764b34896fc959bb03b748830f97437d0.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=amergnat@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ehristev@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nfraprado@collabora.com \
    --cc=wenst@chromium.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

all inboxes | Powered by JetHome®