From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76D48C433F5 for ; Tue, 12 Apr 2022 09:04:14 +0000 (UTC) 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:Cc:To:Subject:Message-ID:Date: MIME-Version:In-Reply-To:References:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jXM0iqCbhMjbYdB8fS66VNp1bOjXS+8HAzT9cAsLvIg=; b=lCnBRES81thXxLEJPyJhTdUXgf fTbkZEFdm7GixnbPqOMI0C6yilu0zVoWVq8Qt8iTqPyGxw2v7z24Dsh2GgCZVyoaj/aBS9g1N8Q+R 4y1KXvecvyDEHr9G8lZTfjUzrbPpx+OWPlbGXpHQkPNXt7+K6cfpQAPWJm0NoHokGVvxNJ5wTlSBx 6FfTnM8v2Q6F/yWM7u20uCTK3PXT0gm805uQIWU2YKw5ZxY4UQ0Sd/tSy2HMGWxJqlm3F6C15J/0N Y6wd5psuROxHOjyEscpVpj1jCpe9+TOtPXDmI8vqkXIdzqaXkzjjmNUdC8cDaCU9ClWpAJgYpTAKN PPPYwPoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neCRU-00ClwS-MA; Tue, 12 Apr 2022 09:04:08 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neCRR-00CluY-Aa for linux-mediatek@lists.infradead.org; Tue, 12 Apr 2022 09:04:07 +0000 Received: by mail-oi1-x22e.google.com with SMTP id k10so18434410oia.0 for ; Tue, 12 Apr 2022 02:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:user-agent:references:in-reply-to:mime-version:date:message-id :subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=sesqj42IAFm9WSWsTOqHdYA5Rorjo3bfN3YoTtq6JHYKWQqX1WmBP4uULeeni1uzGm /hfuD40g58GgUJw3f9vzeM8X+LkiE2vXLWO6yolkj181V2nTWeGDiebzZ91tyH5BpGPv zoQIBLJLMpiNHlQdyQc9zrY059t+bgc1gIWC7WwGslbm7t2nXtJJ5k723Eh4DT8Tb0QL GFGKkRRWR16wjNsMJ07818rU6oJfnetWzWgQauQeYKQj0z3lhi3ue8MXM9rZPV19+9rQ zqEOHIBojyGpj0ozyivfpOgZ5YZi4XuapP//Puf3rnOnvV42BlenzwpudpXnFaFyKAcx bC8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:user-agent:references:in-reply-to :mime-version:date:message-id:subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=qWy0su6J5L3ijUz8K7kn/Rd10hK5mrJ16XUMxbKZCSIj/0AusaFNp44ZjEyzMJetBb bpp0IyjUcoKfg7DECSnlos7c9J5/wxdbDdw62Sw+J2WA8tVzPzhMd0nuLOOWqSNoCDW5 QAuTsUCdNhKaJbL9WDFn0Fll0P5DiOIlwlNZM4Euh8NLaeso9V4k7FC+vhlij+zR0FXu WaL7nvAvkZ+C99/uyMvxdqUC2KWO83pK45m1wG3xSPUStEgpBU+PJv12GNys4hQakDW2 BHHh/pSUnkqtoqtN9hjaZioFZp29t75Z9hDjRbWokY+gli78ONLkHUinfXSrmqz2Iwpw anhQ== X-Gm-Message-State: AOAM532FjbSA4YAYQ1/+3hnsNZzg+alpA3XfpzIV4jxqwTEQhuplEnDU DoAvnzLusE6Tlr9la5xOd/u2FJ164UfhiOY4mX7UEw== X-Google-Smtp-Source: ABdhPJzzWwf0u6lyl2/9u7EvJbdiNju6WRex6OFE3yBhD7hT45+S39d1b5mmEOgGvzLwyVK+y4+UdItaHwgA6/SFgm8= X-Received: by 2002:a05:6808:159d:b0:2da:3946:ab3d with SMTP id t29-20020a056808159d00b002da3946ab3dmr1265654oiw.248.1649754242818; Tue, 12 Apr 2022 02:04:02 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 12 Apr 2022 02:04:02 -0700 From: Guillaume Ranquet User-Agent: meli 0.7.2 References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-18-granquet@baylibre.com> <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> In-Reply-To: <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> MIME-Version: 1.0 Date: Tue, 12 Apr 2022 02:04:02 -0700 Message-ID: Subject: Re: [PATCH v9 17/22] phy: phy-mtk-dp: Add driver for DP phy To: AngeloGioacchino Del Regno , vkoul@kernel.org, airlied@linux.ie, chunfeng.yun@mediatek.com, chunkuang.hu@kernel.org, ck.hu@mediatek.com, daniel@ffwll.ch, deller@gmx.de, jitao.shi@mediatek.com, kishon@ti.com, krzk+dt@kernel.org, maarten.lankhorst@linux.intel.com, matthias.bgg@gmail.com, mripard@kernel.org, p.zabel@pengutronix.de, robh+dt@kernel.org, tzimmermann@suse.de Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, markyacoub@google.com, Markus Schneider-Pargmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220412_020405_389455_2BA514A0 X-CRM114-Status: GOOD ( 21.85 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, 28 Mar 2022 10:20, AngeloGioacchino Del Regno wrote: >Il 28/03/22 00:39, Guillaume Ranquet ha scritto: >> From: Markus Schneider-Pargmann >> >> This is a new driver that supports the integrated DisplayPort phy for >> mediatek SoCs, especially the mt8195. The phy is integrated into the >> DisplayPort controller and will be created by the mtk-dp driver. This >> driver expects a struct regmap to be able to work on the same registers >> as the DisplayPort controller. It sets the device data to be the struct >> phy so that the DisplayPort controller can easily work with it. >> >> The driver does not have any devicetree bindings because the datasheet >> does not list the controller and the phy as distinct units. >> >> The interaction with the controller can be covered by the configure >> callback of the phy framework and its displayport parameters. >> >> Signed-off-by: Markus Schneider-Pargmann >> Signed-off-by: Guillaume Ranquet >> --- >> MAINTAINERS | 1 + >> drivers/phy/mediatek/Kconfig | 8 ++ >> drivers/phy/mediatek/Makefile | 1 + >> drivers/phy/mediatek/phy-mtk-dp.c | 201 ++++++++++++++++++++++++++++++ >> 4 files changed, 211 insertions(+) >> create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c >> > >..snip.. > >> diff --git a/drivers/phy/mediatek/phy-mtk-dp.c b/drivers/phy/mediatek/phy-mtk-dp.c >> new file mode 100644 >> index 000000000000..e5c5494f3636 >> --- /dev/null >> +++ b/drivers/phy/mediatek/phy-mtk-dp.c > >..snip.. > >> + >> +static int mtk_dp_phy_probe(struct platform_device *pdev) >> +{ >> + struct device *dev = &pdev->dev; >> + struct mtk_dp_phy *dp_phy; >> + struct phy *phy; >> + struct regmap *regs; >> + >> + regs = syscon_regmap_lookup_by_phandle(dev->of_node, "mediatek,dp-syscon"); >> + > >Please drop this blank line > >> + if (IS_ERR(regs)) >> + return PTR_ERR(regs); >> + >> + dp_phy = devm_kzalloc(dev, sizeof(*dp_phy), GFP_KERNEL); >> + if (!dp_phy) >> + return -ENOMEM; >> + >> + dp_phy->regs = regs; >> + >> + phy = devm_phy_create(dev, NULL, &mtk_dp_phy_dev_ops); >> + > >Same here > >> + if (IS_ERR(phy)) >> + return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY: %ld\n", PTR_ERR(phy)); >> + > >Using dev_err_probe automates printing the error, so the correct usage is: > >return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY\n"); > >> + phy_set_drvdata(phy, dp_phy); >> + >> + return 0; >> +} >> + >> +struct platform_driver mtk_dp_phy_driver = { >> + .probe = mtk_dp_phy_probe, >> + .driver = { >> + .name = "mediatek-dp-phy", >> + }, >> +}; >> +module_platform_driver(mtk_dp_phy_driver); > >Also, in your dt-binding, you mention a compatible for this driver, but I don't see >any, here. This means that you do know what to do, so please do it. > Following the comments from rob [1], I'll revert back to using platform_device_register_data() from v8. [1] https://lore.kernel.org/linux-mediatek/YkOPB5W7uXkOc72%2F@robh.at.kernel.org/ >Regards, >Angelo > >> + >> +MODULE_AUTHOR("Markus Schneider-Pargmann "); >> +MODULE_DESCRIPTION("MediaTek DP PHY Driver"); >> +MODULE_LICENSE("GPL"); > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A37AC433F5 for ; Tue, 12 Apr 2022 09:04:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40F8910E5BB; Tue, 12 Apr 2022 09:04:05 +0000 (UTC) Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D52E10E5BB for ; Tue, 12 Apr 2022 09:04:03 +0000 (UTC) Received: by mail-oi1-x22b.google.com with SMTP id z8so18381686oix.3 for ; Tue, 12 Apr 2022 02:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:user-agent:references:in-reply-to:mime-version:date:message-id :subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=sesqj42IAFm9WSWsTOqHdYA5Rorjo3bfN3YoTtq6JHYKWQqX1WmBP4uULeeni1uzGm /hfuD40g58GgUJw3f9vzeM8X+LkiE2vXLWO6yolkj181V2nTWeGDiebzZ91tyH5BpGPv zoQIBLJLMpiNHlQdyQc9zrY059t+bgc1gIWC7WwGslbm7t2nXtJJ5k723Eh4DT8Tb0QL GFGKkRRWR16wjNsMJ07818rU6oJfnetWzWgQauQeYKQj0z3lhi3ue8MXM9rZPV19+9rQ zqEOHIBojyGpj0ozyivfpOgZ5YZi4XuapP//Puf3rnOnvV42BlenzwpudpXnFaFyKAcx bC8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:user-agent:references:in-reply-to :mime-version:date:message-id:subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=I+Cu2MSi9o8m6ME/9PdG1+zkRkzLvEZoFL686cTr1GuGsaj4gzGUc/sFWDctbwfxqP x4WQtwL/vYrs8r+LFoE7hsx/BqhPbvsl0ENXcwbikzUr2KJWaRUQ837VrgI3M96F9pJJ bUB4GrtroEuKCc7hAxTiEoHE6mQKoG+0wIZcFBnsI4SuO3IAuLiAq3MSKYZnQ7oHM1bR TpgEwhVScIpegY8k9ln9HOMKnDkKJMIwyjVmG6vC25izbC5GW29/Fzf6xGp7sygK+O+1 Pyb2xginyl9CpdqbvHIGTWcDrkVK30B440l2J9oOGI/T3svSs5Bw7vysQ092N82joZMM lwtg== X-Gm-Message-State: AOAM533qQUUI2+9Edw1f2jUSpah5H3NQvM7bnJwfrgSIcuREeFtjeyPs RJ4js8CG92zBgcu32W3PSzI69ZiaJRYQJFQWbcOncQ== X-Google-Smtp-Source: ABdhPJzzWwf0u6lyl2/9u7EvJbdiNju6WRex6OFE3yBhD7hT45+S39d1b5mmEOgGvzLwyVK+y4+UdItaHwgA6/SFgm8= X-Received: by 2002:a05:6808:159d:b0:2da:3946:ab3d with SMTP id t29-20020a056808159d00b002da3946ab3dmr1265654oiw.248.1649754242818; Tue, 12 Apr 2022 02:04:02 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 12 Apr 2022 02:04:02 -0700 From: Guillaume Ranquet User-Agent: meli 0.7.2 References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-18-granquet@baylibre.com> <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> In-Reply-To: <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> MIME-Version: 1.0 Date: Tue, 12 Apr 2022 02:04:02 -0700 Message-ID: Subject: Re: [PATCH v9 17/22] phy: phy-mtk-dp: Add driver for DP phy To: AngeloGioacchino Del Regno , vkoul@kernel.org, airlied@linux.ie, chunfeng.yun@mediatek.com, chunkuang.hu@kernel.org, ck.hu@mediatek.com, daniel@ffwll.ch, deller@gmx.de, jitao.shi@mediatek.com, kishon@ti.com, krzk+dt@kernel.org, maarten.lankhorst@linux.intel.com, matthias.bgg@gmail.com, mripard@kernel.org, p.zabel@pengutronix.de, robh+dt@kernel.org, tzimmermann@suse.de Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Markus Schneider-Pargmann , linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, markyacoub@google.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, 28 Mar 2022 10:20, AngeloGioacchino Del Regno wrote: >Il 28/03/22 00:39, Guillaume Ranquet ha scritto: >> From: Markus Schneider-Pargmann >> >> This is a new driver that supports the integrated DisplayPort phy for >> mediatek SoCs, especially the mt8195. The phy is integrated into the >> DisplayPort controller and will be created by the mtk-dp driver. This >> driver expects a struct regmap to be able to work on the same registers >> as the DisplayPort controller. It sets the device data to be the struct >> phy so that the DisplayPort controller can easily work with it. >> >> The driver does not have any devicetree bindings because the datasheet >> does not list the controller and the phy as distinct units. >> >> The interaction with the controller can be covered by the configure >> callback of the phy framework and its displayport parameters. >> >> Signed-off-by: Markus Schneider-Pargmann >> Signed-off-by: Guillaume Ranquet >> --- >> MAINTAINERS | 1 + >> drivers/phy/mediatek/Kconfig | 8 ++ >> drivers/phy/mediatek/Makefile | 1 + >> drivers/phy/mediatek/phy-mtk-dp.c | 201 ++++++++++++++++++++++++++++++ >> 4 files changed, 211 insertions(+) >> create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c >> > >..snip.. > >> diff --git a/drivers/phy/mediatek/phy-mtk-dp.c b/drivers/phy/mediatek/phy-mtk-dp.c >> new file mode 100644 >> index 000000000000..e5c5494f3636 >> --- /dev/null >> +++ b/drivers/phy/mediatek/phy-mtk-dp.c > >..snip.. > >> + >> +static int mtk_dp_phy_probe(struct platform_device *pdev) >> +{ >> + struct device *dev = &pdev->dev; >> + struct mtk_dp_phy *dp_phy; >> + struct phy *phy; >> + struct regmap *regs; >> + >> + regs = syscon_regmap_lookup_by_phandle(dev->of_node, "mediatek,dp-syscon"); >> + > >Please drop this blank line > >> + if (IS_ERR(regs)) >> + return PTR_ERR(regs); >> + >> + dp_phy = devm_kzalloc(dev, sizeof(*dp_phy), GFP_KERNEL); >> + if (!dp_phy) >> + return -ENOMEM; >> + >> + dp_phy->regs = regs; >> + >> + phy = devm_phy_create(dev, NULL, &mtk_dp_phy_dev_ops); >> + > >Same here > >> + if (IS_ERR(phy)) >> + return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY: %ld\n", PTR_ERR(phy)); >> + > >Using dev_err_probe automates printing the error, so the correct usage is: > >return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY\n"); > >> + phy_set_drvdata(phy, dp_phy); >> + >> + return 0; >> +} >> + >> +struct platform_driver mtk_dp_phy_driver = { >> + .probe = mtk_dp_phy_probe, >> + .driver = { >> + .name = "mediatek-dp-phy", >> + }, >> +}; >> +module_platform_driver(mtk_dp_phy_driver); > >Also, in your dt-binding, you mention a compatible for this driver, but I don't see >any, here. This means that you do know what to do, so please do it. > Following the comments from rob [1], I'll revert back to using platform_device_register_data() from v8. [1] https://lore.kernel.org/linux-mediatek/YkOPB5W7uXkOc72%2F@robh.at.kernel.org/ >Regards, >Angelo > >> + >> +MODULE_AUTHOR("Markus Schneider-Pargmann "); >> +MODULE_DESCRIPTION("MediaTek DP PHY Driver"); >> +MODULE_LICENSE("GPL"); > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1784FC433F5 for ; Tue, 12 Apr 2022 09:04:09 +0000 (UTC) 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:Cc:To:Subject:Message-ID:Date: MIME-Version:In-Reply-To:References:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=BBHuQWa+tJ/MSDI6J7htszvkcdMqqCRfC4AM9ZgDkPw=; b=utZdLprf/KR54yz40lvAp+8XB6 oVYMWCa1s7SDd8u8RemnYyU/65Cl+cI3IlV6kmEB8v3XDZJFz3r8M0za7oH57kzMGt/nvHJBrB6WL NRogrgvs21/p4ydBDoXixGGjqYdFmHlmlDgTbaV/Qrs79lnUIO9Md0aC8ivH5Fu3x/Hl6vIcd0Vn9 +J1S6yiTclupJ+EoRcS0IMRjxcqdL2Tvx7TgZtNV/Rs83KQ4of/FV2aP7GazL+84EsCUrD/b9tLV7 JyohNuo8HpvvX3mp6OBxY3cEX+ieiBJV3ZCHC9ahnCg3UB+SI3Ye56FaksyX/0Wbt864Ye+nK3UUE FIWrr35A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neCRU-00ClwH-Gu; Tue, 12 Apr 2022 09:04:08 +0000 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neCRR-00Clua-03 for linux-phy@lists.infradead.org; Tue, 12 Apr 2022 09:04:06 +0000 Received: by mail-oi1-x231.google.com with SMTP id q129so18386622oif.4 for ; Tue, 12 Apr 2022 02:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:user-agent:references:in-reply-to:mime-version:date:message-id :subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=sesqj42IAFm9WSWsTOqHdYA5Rorjo3bfN3YoTtq6JHYKWQqX1WmBP4uULeeni1uzGm /hfuD40g58GgUJw3f9vzeM8X+LkiE2vXLWO6yolkj181V2nTWeGDiebzZ91tyH5BpGPv zoQIBLJLMpiNHlQdyQc9zrY059t+bgc1gIWC7WwGslbm7t2nXtJJ5k723Eh4DT8Tb0QL GFGKkRRWR16wjNsMJ07818rU6oJfnetWzWgQauQeYKQj0z3lhi3ue8MXM9rZPV19+9rQ zqEOHIBojyGpj0ozyivfpOgZ5YZi4XuapP//Puf3rnOnvV42BlenzwpudpXnFaFyKAcx bC8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:user-agent:references:in-reply-to :mime-version:date:message-id:subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=T/4qZxa5xwfWFpEtkolDQcfLuo6WpFQ0wleuHIj9mRUonqkIpBqnsGtRXw3fyIW40w r0fT5d1gPZztFowueyexyt3//I6N8wAlEhvPdxe+lLAV1aRY4rto3IMf04zkByvrxTZ5 VPKYf1Ev2JZA137Z++9K4PZpghLQy9EV82b6Ri9NBKuka12vD87Yxb59mnJ/S72mys7o r36YiqFxFhvQQdJ5Ziht05PAKLwJCl7qT0q3m+8t+ElvPFoM/brzoi24q1KYxQZaGujo dtY0gaWIy66q237K791vfkBO5UAtGi9VhsXsaTdSNe7kYyFwXOnop3Sp117lh6Zis30o 3upg== X-Gm-Message-State: AOAM531EJIi4swWsEEZcBNXLyAEM/b9A/Q+pk3PEqmchbcKmIIFUAQY1 9FHrE9uFl8RzL1fNNQtUDCGTQ2kwtszEV9pxYFBrAA== X-Google-Smtp-Source: ABdhPJzzWwf0u6lyl2/9u7EvJbdiNju6WRex6OFE3yBhD7hT45+S39d1b5mmEOgGvzLwyVK+y4+UdItaHwgA6/SFgm8= X-Received: by 2002:a05:6808:159d:b0:2da:3946:ab3d with SMTP id t29-20020a056808159d00b002da3946ab3dmr1265654oiw.248.1649754242818; Tue, 12 Apr 2022 02:04:02 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 12 Apr 2022 02:04:02 -0700 From: Guillaume Ranquet User-Agent: meli 0.7.2 References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-18-granquet@baylibre.com> <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> In-Reply-To: <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> MIME-Version: 1.0 Date: Tue, 12 Apr 2022 02:04:02 -0700 Message-ID: Subject: Re: [PATCH v9 17/22] phy: phy-mtk-dp: Add driver for DP phy To: AngeloGioacchino Del Regno , vkoul@kernel.org, airlied@linux.ie, chunfeng.yun@mediatek.com, chunkuang.hu@kernel.org, ck.hu@mediatek.com, daniel@ffwll.ch, deller@gmx.de, jitao.shi@mediatek.com, kishon@ti.com, krzk+dt@kernel.org, maarten.lankhorst@linux.intel.com, matthias.bgg@gmail.com, mripard@kernel.org, p.zabel@pengutronix.de, robh+dt@kernel.org, tzimmermann@suse.de Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, markyacoub@google.com, Markus Schneider-Pargmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220412_020405_082569_328B0126 X-CRM114-Status: GOOD ( 21.64 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Mon, 28 Mar 2022 10:20, AngeloGioacchino Del Regno wrote: >Il 28/03/22 00:39, Guillaume Ranquet ha scritto: >> From: Markus Schneider-Pargmann >> >> This is a new driver that supports the integrated DisplayPort phy for >> mediatek SoCs, especially the mt8195. The phy is integrated into the >> DisplayPort controller and will be created by the mtk-dp driver. This >> driver expects a struct regmap to be able to work on the same registers >> as the DisplayPort controller. It sets the device data to be the struct >> phy so that the DisplayPort controller can easily work with it. >> >> The driver does not have any devicetree bindings because the datasheet >> does not list the controller and the phy as distinct units. >> >> The interaction with the controller can be covered by the configure >> callback of the phy framework and its displayport parameters. >> >> Signed-off-by: Markus Schneider-Pargmann >> Signed-off-by: Guillaume Ranquet >> --- >> MAINTAINERS | 1 + >> drivers/phy/mediatek/Kconfig | 8 ++ >> drivers/phy/mediatek/Makefile | 1 + >> drivers/phy/mediatek/phy-mtk-dp.c | 201 ++++++++++++++++++++++++++++++ >> 4 files changed, 211 insertions(+) >> create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c >> > >..snip.. > >> diff --git a/drivers/phy/mediatek/phy-mtk-dp.c b/drivers/phy/mediatek/phy-mtk-dp.c >> new file mode 100644 >> index 000000000000..e5c5494f3636 >> --- /dev/null >> +++ b/drivers/phy/mediatek/phy-mtk-dp.c > >..snip.. > >> + >> +static int mtk_dp_phy_probe(struct platform_device *pdev) >> +{ >> + struct device *dev = &pdev->dev; >> + struct mtk_dp_phy *dp_phy; >> + struct phy *phy; >> + struct regmap *regs; >> + >> + regs = syscon_regmap_lookup_by_phandle(dev->of_node, "mediatek,dp-syscon"); >> + > >Please drop this blank line > >> + if (IS_ERR(regs)) >> + return PTR_ERR(regs); >> + >> + dp_phy = devm_kzalloc(dev, sizeof(*dp_phy), GFP_KERNEL); >> + if (!dp_phy) >> + return -ENOMEM; >> + >> + dp_phy->regs = regs; >> + >> + phy = devm_phy_create(dev, NULL, &mtk_dp_phy_dev_ops); >> + > >Same here > >> + if (IS_ERR(phy)) >> + return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY: %ld\n", PTR_ERR(phy)); >> + > >Using dev_err_probe automates printing the error, so the correct usage is: > >return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY\n"); > >> + phy_set_drvdata(phy, dp_phy); >> + >> + return 0; >> +} >> + >> +struct platform_driver mtk_dp_phy_driver = { >> + .probe = mtk_dp_phy_probe, >> + .driver = { >> + .name = "mediatek-dp-phy", >> + }, >> +}; >> +module_platform_driver(mtk_dp_phy_driver); > >Also, in your dt-binding, you mention a compatible for this driver, but I don't see >any, here. This means that you do know what to do, so please do it. > Following the comments from rob [1], I'll revert back to using platform_device_register_data() from v8. [1] https://lore.kernel.org/linux-mediatek/YkOPB5W7uXkOc72%2F@robh.at.kernel.org/ >Regards, >Angelo > >> + >> +MODULE_AUTHOR("Markus Schneider-Pargmann "); >> +MODULE_DESCRIPTION("MediaTek DP PHY Driver"); >> +MODULE_LICENSE("GPL"); > -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B2CEC433EF for ; Tue, 12 Apr 2022 09:05:23 +0000 (UTC) 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:Cc:To:Subject:Message-ID:Date: MIME-Version:In-Reply-To:References:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=vKQGspIAkwidXxRYPqtioxf9UC3dRV/GhpTr8S8ANpM=; b=yXmBSXdlHDzfT7CEqgtY3whvYT 5eYpmvmh3KgL5RLawAQHRRX9s/kPw4a06xhDqCCbCxjemxIYFvdv7VNLlc4Tw5Sz0PbUQXknSmTlJ t1f6GLjmx4frF5XOkvcInX9P+gZOKTtt0J4fIWrkdB2gmdMYxchSAbeTMDW7DsoF/k5hfdYRnlOmb s6MsyDd9kkz8nApVAGcTHjKBTBkXVfCMJiBSv485KyRgsY/4W6ar+qC6Z9z7UHuM9L9W09uKlDsQk u2cSzwy6ZfpuKFctC+sxZNzR63CervRPWBP0JBFU+thL4HDFPqSn6cr08FdJ/FvXMzSIZTwz12Bxd 7voG0DDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neCRX-00Clx2-O6; Tue, 12 Apr 2022 09:04:11 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neCRR-00Clul-Kh for linux-arm-kernel@lists.infradead.org; Tue, 12 Apr 2022 09:04:08 +0000 Received: by mail-oi1-x229.google.com with SMTP id e189so18360236oia.8 for ; Tue, 12 Apr 2022 02:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:user-agent:references:in-reply-to:mime-version:date:message-id :subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=sesqj42IAFm9WSWsTOqHdYA5Rorjo3bfN3YoTtq6JHYKWQqX1WmBP4uULeeni1uzGm /hfuD40g58GgUJw3f9vzeM8X+LkiE2vXLWO6yolkj181V2nTWeGDiebzZ91tyH5BpGPv zoQIBLJLMpiNHlQdyQc9zrY059t+bgc1gIWC7WwGslbm7t2nXtJJ5k723Eh4DT8Tb0QL GFGKkRRWR16wjNsMJ07818rU6oJfnetWzWgQauQeYKQj0z3lhi3ue8MXM9rZPV19+9rQ zqEOHIBojyGpj0ozyivfpOgZ5YZi4XuapP//Puf3rnOnvV42BlenzwpudpXnFaFyKAcx bC8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:user-agent:references:in-reply-to :mime-version:date:message-id:subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=IXWHjC5jpkC7svocc7U3uU96y6P9svGr/PGQW8nmokZAOcAw69tLmEdy43fDxKPBmY HbeNGTNM8oO8VNr6DkB+R5LckDTFN5+8JVA3VtRnVGiHMqT8foGHZqI/J8bezLsN7mZe XXUjREc71Ok+m0SkL+awNkbQRsI08OEb0OcqYnz9ZJnniLfRPJwqz9Ce0BFjU/sy7fac 9xemEzPH2LiCLLQlxoLV+ZuZGIQClyI16wDmE1Jb87rMlan/rmiqz/c6Ye9yq7zrZynW QwMVGHMF3fDvYyDjLyUzaAjh6HSLyOET023VRDFOh9b63uRoGa6TxpgQU5P9DqWQ3Cnb Cp9g== X-Gm-Message-State: AOAM533mp4NiuE497+f7+0Ycwz5r2H/ZnvCgIYmabnHcRjnJfhnHL2B/ wGdxL06DUKtn6q3eH8k4XSA9D43LETe2Zl19u3wfgA== X-Google-Smtp-Source: ABdhPJzzWwf0u6lyl2/9u7EvJbdiNju6WRex6OFE3yBhD7hT45+S39d1b5mmEOgGvzLwyVK+y4+UdItaHwgA6/SFgm8= X-Received: by 2002:a05:6808:159d:b0:2da:3946:ab3d with SMTP id t29-20020a056808159d00b002da3946ab3dmr1265654oiw.248.1649754242818; Tue, 12 Apr 2022 02:04:02 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 12 Apr 2022 02:04:02 -0700 From: Guillaume Ranquet User-Agent: meli 0.7.2 References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-18-granquet@baylibre.com> <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> In-Reply-To: <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> MIME-Version: 1.0 Date: Tue, 12 Apr 2022 02:04:02 -0700 Message-ID: Subject: Re: [PATCH v9 17/22] phy: phy-mtk-dp: Add driver for DP phy To: AngeloGioacchino Del Regno , vkoul@kernel.org, airlied@linux.ie, chunfeng.yun@mediatek.com, chunkuang.hu@kernel.org, ck.hu@mediatek.com, daniel@ffwll.ch, deller@gmx.de, jitao.shi@mediatek.com, kishon@ti.com, krzk+dt@kernel.org, maarten.lankhorst@linux.intel.com, matthias.bgg@gmail.com, mripard@kernel.org, p.zabel@pengutronix.de, robh+dt@kernel.org, tzimmermann@suse.de Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, markyacoub@google.com, Markus Schneider-Pargmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220412_020405_728833_DEAFAB40 X-CRM114-Status: GOOD ( 23.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 28 Mar 2022 10:20, AngeloGioacchino Del Regno wrote: >Il 28/03/22 00:39, Guillaume Ranquet ha scritto: >> From: Markus Schneider-Pargmann >> >> This is a new driver that supports the integrated DisplayPort phy for >> mediatek SoCs, especially the mt8195. The phy is integrated into the >> DisplayPort controller and will be created by the mtk-dp driver. This >> driver expects a struct regmap to be able to work on the same registers >> as the DisplayPort controller. It sets the device data to be the struct >> phy so that the DisplayPort controller can easily work with it. >> >> The driver does not have any devicetree bindings because the datasheet >> does not list the controller and the phy as distinct units. >> >> The interaction with the controller can be covered by the configure >> callback of the phy framework and its displayport parameters. >> >> Signed-off-by: Markus Schneider-Pargmann >> Signed-off-by: Guillaume Ranquet >> --- >> MAINTAINERS | 1 + >> drivers/phy/mediatek/Kconfig | 8 ++ >> drivers/phy/mediatek/Makefile | 1 + >> drivers/phy/mediatek/phy-mtk-dp.c | 201 ++++++++++++++++++++++++++++++ >> 4 files changed, 211 insertions(+) >> create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c >> > >..snip.. > >> diff --git a/drivers/phy/mediatek/phy-mtk-dp.c b/drivers/phy/mediatek/phy-mtk-dp.c >> new file mode 100644 >> index 000000000000..e5c5494f3636 >> --- /dev/null >> +++ b/drivers/phy/mediatek/phy-mtk-dp.c > >..snip.. > >> + >> +static int mtk_dp_phy_probe(struct platform_device *pdev) >> +{ >> + struct device *dev = &pdev->dev; >> + struct mtk_dp_phy *dp_phy; >> + struct phy *phy; >> + struct regmap *regs; >> + >> + regs = syscon_regmap_lookup_by_phandle(dev->of_node, "mediatek,dp-syscon"); >> + > >Please drop this blank line > >> + if (IS_ERR(regs)) >> + return PTR_ERR(regs); >> + >> + dp_phy = devm_kzalloc(dev, sizeof(*dp_phy), GFP_KERNEL); >> + if (!dp_phy) >> + return -ENOMEM; >> + >> + dp_phy->regs = regs; >> + >> + phy = devm_phy_create(dev, NULL, &mtk_dp_phy_dev_ops); >> + > >Same here > >> + if (IS_ERR(phy)) >> + return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY: %ld\n", PTR_ERR(phy)); >> + > >Using dev_err_probe automates printing the error, so the correct usage is: > >return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY\n"); > >> + phy_set_drvdata(phy, dp_phy); >> + >> + return 0; >> +} >> + >> +struct platform_driver mtk_dp_phy_driver = { >> + .probe = mtk_dp_phy_probe, >> + .driver = { >> + .name = "mediatek-dp-phy", >> + }, >> +}; >> +module_platform_driver(mtk_dp_phy_driver); > >Also, in your dt-binding, you mention a compatible for this driver, but I don't see >any, here. This means that you do know what to do, so please do it. > Following the comments from rob [1], I'll revert back to using platform_device_register_data() from v8. [1] https://lore.kernel.org/linux-mediatek/YkOPB5W7uXkOc72%2F@robh.at.kernel.org/ >Regards, >Angelo > >> + >> +MODULE_AUTHOR("Markus Schneider-Pargmann "); >> +MODULE_DESCRIPTION("MediaTek DP PHY Driver"); >> +MODULE_LICENSE("GPL"); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B2A0C433F5 for ; Tue, 12 Apr 2022 10:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232057AbiDLKR3 (ORCPT ); Tue, 12 Apr 2022 06:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377717AbiDLJ7T (ORCPT ); Tue, 12 Apr 2022 05:59:19 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96E24E38 for ; Tue, 12 Apr 2022 02:04:03 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id q189so18338575oia.9 for ; Tue, 12 Apr 2022 02:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:user-agent:references:in-reply-to:mime-version:date:message-id :subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=sesqj42IAFm9WSWsTOqHdYA5Rorjo3bfN3YoTtq6JHYKWQqX1WmBP4uULeeni1uzGm /hfuD40g58GgUJw3f9vzeM8X+LkiE2vXLWO6yolkj181V2nTWeGDiebzZ91tyH5BpGPv zoQIBLJLMpiNHlQdyQc9zrY059t+bgc1gIWC7WwGslbm7t2nXtJJ5k723Eh4DT8Tb0QL GFGKkRRWR16wjNsMJ07818rU6oJfnetWzWgQauQeYKQj0z3lhi3ue8MXM9rZPV19+9rQ zqEOHIBojyGpj0ozyivfpOgZ5YZi4XuapP//Puf3rnOnvV42BlenzwpudpXnFaFyKAcx bC8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:user-agent:references:in-reply-to :mime-version:date:message-id:subject:to:cc; bh=TaVLZyoZEENt9mm6XHe8rhxlLaPeM8tk8R1AgC2794g=; b=T+oahuFKcaX2nYu0c6le5y+1NdObwtHJRBBsWXchCnbS4MYRN7xXULTEouyMYxk/NX ZhIeTc+lTi+Jym6yCVgLN/Of+5XropkvzFlWiHc2UmGg2x2Tta7dLnS640oLZ2AvvEF8 mr6/DiMW9UIX6mmWZEBY0oRZhvzEj5hdas46aJK9i6JWUyFnalAqWB+KNjRo7AoIsM9j LiozqJ8hCmBZiJ4XHpuDCslfEwguXKrVaW2uExC3qnp/pu/nIXragNsUlegDN/wdqegU 1tKPegc+EfwFsUvA2GBDokL8lKbBlQZZNtNuKngXqiAFbgQdsWZRY2VRO9hnSnePCz0c QCWw== X-Gm-Message-State: AOAM5325tMroW7brwiNELMD6wixgjO+3NT5SpvAQgdnfU/1ohJt/7P2/ 1Chp2JP67Ba87lCwHaBwOlwhlf85na5irKVlcYzbQg== X-Google-Smtp-Source: ABdhPJzzWwf0u6lyl2/9u7EvJbdiNju6WRex6OFE3yBhD7hT45+S39d1b5mmEOgGvzLwyVK+y4+UdItaHwgA6/SFgm8= X-Received: by 2002:a05:6808:159d:b0:2da:3946:ab3d with SMTP id t29-20020a056808159d00b002da3946ab3dmr1265654oiw.248.1649754242818; Tue, 12 Apr 2022 02:04:02 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 12 Apr 2022 02:04:02 -0700 From: Guillaume Ranquet User-Agent: meli 0.7.2 References: <20220327223927.20848-1-granquet@baylibre.com> <20220327223927.20848-18-granquet@baylibre.com> <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> In-Reply-To: <4697e3af-86f7-83e0-1737-3f5000fc8d30@collabora.com> MIME-Version: 1.0 Date: Tue, 12 Apr 2022 02:04:02 -0700 Message-ID: Subject: Re: [PATCH v9 17/22] phy: phy-mtk-dp: Add driver for DP phy To: AngeloGioacchino Del Regno , vkoul@kernel.org, airlied@linux.ie, chunfeng.yun@mediatek.com, chunkuang.hu@kernel.org, ck.hu@mediatek.com, daniel@ffwll.ch, deller@gmx.de, jitao.shi@mediatek.com, kishon@ti.com, krzk+dt@kernel.org, maarten.lankhorst@linux.intel.com, matthias.bgg@gmail.com, mripard@kernel.org, p.zabel@pengutronix.de, robh+dt@kernel.org, tzimmermann@suse.de Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, markyacoub@google.com, Markus Schneider-Pargmann Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Mar 2022 10:20, AngeloGioacchino Del Regno wrote: >Il 28/03/22 00:39, Guillaume Ranquet ha scritto: >> From: Markus Schneider-Pargmann >> >> This is a new driver that supports the integrated DisplayPort phy for >> mediatek SoCs, especially the mt8195. The phy is integrated into the >> DisplayPort controller and will be created by the mtk-dp driver. This >> driver expects a struct regmap to be able to work on the same registers >> as the DisplayPort controller. It sets the device data to be the struct >> phy so that the DisplayPort controller can easily work with it. >> >> The driver does not have any devicetree bindings because the datasheet >> does not list the controller and the phy as distinct units. >> >> The interaction with the controller can be covered by the configure >> callback of the phy framework and its displayport parameters. >> >> Signed-off-by: Markus Schneider-Pargmann >> Signed-off-by: Guillaume Ranquet >> --- >> MAINTAINERS | 1 + >> drivers/phy/mediatek/Kconfig | 8 ++ >> drivers/phy/mediatek/Makefile | 1 + >> drivers/phy/mediatek/phy-mtk-dp.c | 201 ++++++++++++++++++++++++++++++ >> 4 files changed, 211 insertions(+) >> create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c >> > >..snip.. > >> diff --git a/drivers/phy/mediatek/phy-mtk-dp.c b/drivers/phy/mediatek/phy-mtk-dp.c >> new file mode 100644 >> index 000000000000..e5c5494f3636 >> --- /dev/null >> +++ b/drivers/phy/mediatek/phy-mtk-dp.c > >..snip.. > >> + >> +static int mtk_dp_phy_probe(struct platform_device *pdev) >> +{ >> + struct device *dev = &pdev->dev; >> + struct mtk_dp_phy *dp_phy; >> + struct phy *phy; >> + struct regmap *regs; >> + >> + regs = syscon_regmap_lookup_by_phandle(dev->of_node, "mediatek,dp-syscon"); >> + > >Please drop this blank line > >> + if (IS_ERR(regs)) >> + return PTR_ERR(regs); >> + >> + dp_phy = devm_kzalloc(dev, sizeof(*dp_phy), GFP_KERNEL); >> + if (!dp_phy) >> + return -ENOMEM; >> + >> + dp_phy->regs = regs; >> + >> + phy = devm_phy_create(dev, NULL, &mtk_dp_phy_dev_ops); >> + > >Same here > >> + if (IS_ERR(phy)) >> + return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY: %ld\n", PTR_ERR(phy)); >> + > >Using dev_err_probe automates printing the error, so the correct usage is: > >return dev_err_probe(dev, PTR_ERR(phy), "Failed to create DP PHY\n"); > >> + phy_set_drvdata(phy, dp_phy); >> + >> + return 0; >> +} >> + >> +struct platform_driver mtk_dp_phy_driver = { >> + .probe = mtk_dp_phy_probe, >> + .driver = { >> + .name = "mediatek-dp-phy", >> + }, >> +}; >> +module_platform_driver(mtk_dp_phy_driver); > >Also, in your dt-binding, you mention a compatible for this driver, but I don't see >any, here. This means that you do know what to do, so please do it. > Following the comments from rob [1], I'll revert back to using platform_device_register_data() from v8. [1] https://lore.kernel.org/linux-mediatek/YkOPB5W7uXkOc72%2F@robh.at.kernel.org/ >Regards, >Angelo > >> + >> +MODULE_AUTHOR("Markus Schneider-Pargmann "); >> +MODULE_DESCRIPTION("MediaTek DP PHY Driver"); >> +MODULE_LICENSE("GPL"); >