mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>, Vinod Koul <vkoul@kernel.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
	Eddie Hung <eddie.hung@mediatek.com>,
	Tianping Fang <tianping.fang@mediatek.com>
Subject: Re: [PATCH v2 2/2] phy: mediatek: tphy: add debugfs files
Date: Thu, 6 Oct 2022 16:54:42 +0200	[thread overview]
Message-ID: <6dbfaee8-8c72-85b5-495d-dcb62f18c154@collabora.com> (raw)
In-Reply-To: <6ca1eb83b7a776fd6b7e58e6940eab5ce5f7fb63.camel@mediatek.com>

Il 06/10/22 16:42, Chunfeng Yun ha scritto:
> On Thu, 2022-09-29 at 11:02 +0200, AngeloGioacchino Del Regno wrote:
>> Il 29/09/22 10:09, Chunfeng Yun ha scritto:
>>> These debugfs files are mainly used to make eye diagram test
>>> easier,
>>> especially helpful to do HQA test for a new IC without efuse
>>> enabled.
>>>
>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
>>> ---
>>> v2: add CONFIG_PHY_MTK_TPHY_DEBUGFS suggested by AngeloGioacchino
>>> ---
>>>    drivers/phy/mediatek/Kconfig        |   5 +
>>>    drivers/phy/mediatek/phy-mtk-tphy.c | 403
>>> +++++++++++++++++++++++++++-
>>>    2 files changed, 407 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/phy/mediatek/Kconfig
>>> b/drivers/phy/mediatek/Kconfig
>>> index 3125ecb5d119..e9fdfe9f519f 100644
>>> --- a/drivers/phy/mediatek/Kconfig
>>> +++ b/drivers/phy/mediatek/Kconfig
>>> @@ -27,6 +27,11 @@ config PHY_MTK_TPHY
>>>    	  multi-ports is first version, otherwise is second version,
>>>    	  so you can easily distinguish them by banks layout.
>>>    
>>> +config PHY_MTK_TPHY_DEBUGFS
>>> +	bool "Add T-PHY Debugfs Files"
>>> +	help
>>> +	  Say Y here to add debugfs files mainly for T-PHY HQA test.
>>> +
>>>    config PHY_MTK_UFS
>>>    	tristate "MediaTek UFS M-PHY driver"
>>>    	depends on ARCH_MEDIATEK || COMPILE_TEST
>>> diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c
>>> b/drivers/phy/mediatek/phy-mtk-tphy.c
>>> index e906a82791bd..d9509e1314a4 100644
>>> --- a/drivers/phy/mediatek/phy-mtk-tphy.c
>>> +++ b/drivers/phy/mediatek/phy-mtk-tphy.c
>>> @@ -7,6 +7,7 @@
>>>    
>>>    #include <dt-bindings/phy/phy.h>
>>>    #include <linux/clk.h>
>>> +#include <linux/debugfs.h>
>>>    #include <linux/delay.h>
>>>    #include <linux/iopoll.h>
>>>    #include <linux/mfd/syscon.h>
>>> @@ -264,6 +265,8 @@
>>>    
>>>    #define TPHY_CLKS_CNT	2
>>>    
>>> +#define USER_BUF_LEN(count) min_t(size_t, 8, (count))
>>> +
>>>    enum mtk_phy_version {
>>>    	MTK_PHY_V1 = 1,
>>>    	MTK_PHY_V2,
>>> @@ -310,6 +313,7 @@ struct mtk_phy_instance {
>>>    	struct clk_bulk_data clks[TPHY_CLKS_CNT];
>>>    	u32 index;
>>>    	u32 type;
>>> +	struct dentry *dbgfs;
>>
>> Unused when !IS_ENABLED(CONFIG_PHY_MTK_TPHY_DEBUGFS)
> Yes, it will be NULL.
> 

I was meaning that you should ifdef that out...

Regards,
Angelo

>>
>>>    	struct regmap *type_sw;
>>>    	u32 type_sw_reg;
>>>    	u32 type_sw_index;
>>> @@ -332,10 +336,389 @@ struct mtk_tphy {
>>>    	const struct mtk_phy_pdata *pdata;
>>>    	struct mtk_phy_instance **phys;
>>>    	int nphys;
>>> +	struct dentry *dbgfs_root;
>>
>> Same here
>>
>>>    	int src_ref_clk; /* MHZ, reference clock for slew rate
>>> calibrate */
>>>    	int src_coef; /* coefficient for slew rate calibrate */
>>>    };
>>>    
>>> +#if IS_ENABLED(CONFIG_PHY_MTK_TPHY_DEBUGFS)
>>> +
>>
>> ..snip..
>>
>>> +
>>> +static void tphy_debufs_init(struct mtk_tphy *tphy, struct
>>> mtk_phy_instance *inst)
>>
>> Please fix typo "debufs" -> "debugfs",
> Will fix it, thanks a lot
> 
>> here and everywhere else.
>>
>> Apart from that, it looks good to me.
>>
>> Regards,
>> Angelo
> 

-- 
AngeloGioacchino Del Regno
Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718


  reply	other threads:[~2022-10-06 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29  8:09 [PATCH v2 1/2] phy: core: add debugfs root Chunfeng Yun
2022-09-29  8:09 ` [PATCH v2 2/2] phy: mediatek: tphy: add debugfs files Chunfeng Yun
2022-09-29  9:02   ` AngeloGioacchino Del Regno
2022-10-06 14:42     ` Chunfeng Yun
2022-10-06 14:54       ` AngeloGioacchino Del Regno [this message]
2022-10-10  8:01         ` Chunfeng Yun

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=6dbfaee8-8c72-85b5-495d-dcb62f18c154@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=eddie.hung@mediatek.com \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=tianping.fang@mediatek.com \
    --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

all inboxes | Powered by JetHome®