[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a6f0704e430453fc6bbbb49eabcd5518c6852f4c.camel@mediatek.com>
Date: Fri, 24 Dec 2021 17:38:58 +0800
From: Roger Lu <roger.lu@...iatek.com>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Enric Balletbo Serra <eballetbo@...il.com>,
Kevin Hilman <khilman@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Nicolas Boichat <drinkcat@...gle.com>,
Stephen Boyd <sboyd@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>
CC: Fan Chen <fan.chen@...iatek.com>,
HenryC Chen <HenryC.Chen@...iatek.com>,
YT Lee <yt.lee@...iatek.com>,
Xiaoqing Liu <Xiaoqing.Liu@...iatek.com>,
Charles Yang <Charles.Yang@...iatek.com>,
Angus Lin <Angus.Lin@...iatek.com>,
Mark Rutland <mark.rutland@....com>,
Nishanth Menon <nm@...com>, <devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: Re: [PATCH v16 4/7] soc: mediatek: SVS: add debug commands
Hi AngeloGioacchino,
Sorry for the late reply.
On Thu, 2021-10-21 at 10:52 +0200, AngeloGioacchino Del Regno wrote:
> Il 28/04/21 08:54, Roger Lu ha scritto:
> > The purpose of SVS is to help find the suitable voltages
> > for DVFS. Therefore, if SVS bank voltages are concerned
> > to be wrong, we can adjust SVS bank voltages by this patch.
> >
> > Signed-off-by: Roger Lu <roger.lu@...iatek.com>
> > ---
> > drivers/soc/mediatek/mtk-svs.c | 328 +++++++++++++++++++++++++++++++++
> > 1 file changed, 328 insertions(+)
> >
> > diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> > index 2d2153c92373..8794a2d87baa 100644
> > --- a/drivers/soc/mediatek/mtk-svs.c
> > +++ b/drivers/soc/mediatek/mtk-svs.c
> > @@ -6,6 +6,7 @@
> > #include <linux/bits.h>
> > #include <linux/clk.h>
> > #include <linux/completion.h>
> > +#include <linux/debugfs.h>
> > #include <linux/device.h>
> > #include <linux/init.h>
> > #include <linux/interrupt.h>
> > @@ -24,6 +25,7 @@
> > #include <linux/pm_runtime.h>
> > #include <linux/regulator/consumer.h>
> > #include <linux/reset.h>
> > +#include <linux/seq_file.h>
> > #include <linux/slab.h>
> > #include <linux/spinlock.h>
> > #include <linux/thermal.h>
> > @@ -62,6 +64,39 @@
> > #define SVSB_INTSTS_COMPLETE 0x1
> > #define SVSB_INTSTS_CLEAN 0x00ffffff
> >
> > +#define debug_fops_ro(name)
> > \
> > + static int svs_##name##_debug_open(struct inode *inode, \
> > + struct file *filp) \
> > + { \
> > + return single_open(filp, svs_##name##_debug_show, \
> > + inode->i_private); \
> > + } \
> > + static const struct file_operations svs_##name##_debug_fops = { \
> > + .owner = THIS_MODULE, \
> > + .open = svs_##name##_debug_open, \
> > + .read = seq_read, \
> > + .llseek = seq_lseek, \
> > + .release = single_release, \
> > + }
> > +
> > +#define debug_fops_rw(name)
> > \
> > + static int svs_##name##_debug_open(struct inode *inode, \
> > + struct file *filp) \
> > + { \
> > + return single_open(filp, svs_##name##_debug_show, \
> > + inode->i_private); \
> > + } \
> > + static const struct file_operations svs_##name##_debug_fops = { \
> > + .owner = THIS_MODULE, \
> > + .open = svs_##name##_debug_open, \
> > + .read = seq_read, \
> > + .write = svs_##name##_debug_write, \
> > + .llseek = seq_lseek, \
> > + .release = single_release, \
> > + }
> > +
> > +#define svs_dentry(name) {__stringify(name), &svs_##name##_debug_fops}
> > +
> > static DEFINE_SPINLOCK(mtk_svs_lock);
> >
> > /*
> > @@ -83,6 +118,7 @@ enum svsb_phase {
> > SVSB_PHASE_INIT01,
> > SVSB_PHASE_INIT02,
> > SVSB_PHASE_MON,
> > + SVSB_PHASE_NUM,
>
> I would move the addition of these last members in the previous (3/7) patch,
> where you introduce the driver in the first place.
>
> Also, I think that using _MAX instead would be better, as it is pretty
> much a common practice. So, this would become SVSB_PHASE_MAX.
Okay. I'll move it to previous (3/7) patch. Thanks for advice.
>
> > };
> >
> > enum svs_reg_index {
> > @@ -140,6 +176,7 @@ enum svs_reg_index {
> > SPARE2,
> > SPARE3,
> > THSLPEVEB,
> > + SVS_REG_NUM,
>
> ... and this would become SVS_REG_MAX
Okay. I'll move it to previous (3/7) patch. Thanks for advice.
>
> > };
> >
> > static const u32 svs_regs_v2[] = {
>
> Apart from that,
>
> Acked-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
>
Powered by blists - more mailing lists