[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <731a1382b969269ba0a482b766ac4dfb6fdc115d.camel@mediatek.com>
Date: Mon, 16 Jan 2023 07:27:38 +0000
From: Chunfeng Yun (云春峰)
<Chunfeng.Yun@...iatek.com>
To: "vkoul@...nel.org" <vkoul@...nel.org>
CC: "llvm@...ts.linux.dev" <llvm@...ts.linux.dev>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"nathan@...nel.org" <nathan@...nel.org>,
"kishon@...nel.org" <kishon@...nel.org>,
Eddie Hung (洪正鑫)
<Eddie.Hung@...iatek.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"linux-phy@...ts.infradead.org" <linux-phy@...ts.infradead.org>,
"trix@...hat.com" <trix@...hat.com>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>,
"ndesaulniers@...gle.com" <ndesaulniers@...gle.com>
Subject: Re: [PATCH v6 3/3] phy: mediatek: tphy: add debugfs files
On Fri, 2023-01-13 at 23:45 +0530, Vinod Koul wrote:
> On 04-01-23, 21:26, Chunfeng Yun wrote:
> > 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@...iatek.com>
> > ---
> > v6: no changes
> >
> > v5: using common debugfs config CONFIG_DEBUG_FS
> >
> > v4: fix build warning of sometimes uninitialized variable
> >
> > v3: fix typo of "debugfs" suggested by AngeloGioacchino
> >
> > v2: add CONFIG_PHY_MTK_TPHY_DEBUGFS suggested by AngeloGioacchino
> > ---
> > drivers/phy/mediatek/phy-mtk-tphy.c | 405
> > +++++++++++++++++++++++++++-
> > 1 file changed, 404 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c
> > b/drivers/phy/mediatek/phy-mtk-tphy.c
> > index e906a82791bd..923e5ee119f3 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;
> > struct regmap *type_sw;
> > u32 type_sw_reg;
> > u32 type_sw_index;
> > @@ -332,10 +336,391 @@ struct mtk_tphy {
> > const struct mtk_phy_pdata *pdata;
> > struct mtk_phy_instance **phys;
> > int nphys;
> > + struct dentry *dbgfs_root;
> > int src_ref_clk; /* MHZ, reference clock for slew rate
> > calibrate */
> > int src_coef; /* coefficient for slew rate calibrate */
> > };
> >
> > +#if IS_ENABLED(CONFIG_DEBUG_FS)
> > +
> >
> > <skip>
> >
> > +
> > +DEFINE_SHOW_ATTRIBUTE(tphy_type);
> > +
> > +static void tphy_debugfs_init(struct mtk_tphy *tphy, struct
> > mtk_phy_instance *inst)
> > +{
> > + char name[16];
> > +
> > + snprintf(name, sizeof(name) - 1, "phy.%d", inst->index);
>
> I wouold suggest driver name/ device name rather than phy.foo...
> again
> folks needs to see what is foo
Ok, I'll change it, thanks a lot
>
> <skip>
> >
> > static struct platform_driver mtk_tphy_driver = {
> > .probe = mtk_tphy_probe,
> > + .remove = mtk_tphy_remove,
> > .driver = {
> > .name = "mtk-tphy",
> > .of_match_table = mtk_tphy_id_table,
> > --
> > 2.18.0
>
>
Powered by blists - more mailing lists