Commit 8bf30508 authored by Roger Lu's avatar Roger Lu Committed by Matthias Brugger

soc: mediatek: mtk-svs: keep svs alive if CONFIG_DEBUG_FS not supported

Some projects might not support CONFIG_DEBUG_FS but still needs svs to be
alive. Therefore, enclose debug cmd codes with CONFIG_DEBUG_FS to make sure
svs can be alive when CONFIG_DEBUG_FS not supported.
Signed-off-by: default avatarRoger Lu <roger.lu@mediatek.com>
Link: https://lore.kernel.org/r/20230111074528.29354-8-roger.lu@mediatek.comSigned-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
parent 37fa2aff
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
static DEFINE_SPINLOCK(svs_lock); static DEFINE_SPINLOCK(svs_lock);
#ifdef CONFIG_DEBUG_FS
#define debug_fops_ro(name) \ #define debug_fops_ro(name) \
static int svs_##name##_debug_open(struct inode *inode, \ static int svs_##name##_debug_open(struct inode *inode, \
struct file *filp) \ struct file *filp) \
...@@ -170,6 +171,7 @@ static DEFINE_SPINLOCK(svs_lock); ...@@ -170,6 +171,7 @@ static DEFINE_SPINLOCK(svs_lock);
} }
#define svs_dentry_data(name) {__stringify(name), &svs_##name##_debug_fops} #define svs_dentry_data(name) {__stringify(name), &svs_##name##_debug_fops}
#endif
/** /**
* enum svsb_phase - svs bank phase enumeration * enum svsb_phase - svs bank phase enumeration
...@@ -628,6 +630,7 @@ static int svs_adjust_pm_opp_volts(struct svs_bank *svsb) ...@@ -628,6 +630,7 @@ static int svs_adjust_pm_opp_volts(struct svs_bank *svsb)
return ret; return ret;
} }
#ifdef CONFIG_DEBUG_FS
static int svs_dump_debug_show(struct seq_file *m, void *p) static int svs_dump_debug_show(struct seq_file *m, void *p)
{ {
struct svs_platform *svsp = (struct svs_platform *)m->private; struct svs_platform *svsp = (struct svs_platform *)m->private;
...@@ -843,6 +846,7 @@ static int svs_create_debug_cmds(struct svs_platform *svsp) ...@@ -843,6 +846,7 @@ static int svs_create_debug_cmds(struct svs_platform *svsp)
return 0; return 0;
} }
#endif /* CONFIG_DEBUG_FS */
static u32 interpolate(u32 f0, u32 f1, u32 v0, u32 v1, u32 fx) static u32 interpolate(u32 f0, u32 f1, u32 v0, u32 v1, u32 fx)
{ {
...@@ -2444,11 +2448,13 @@ static int svs_probe(struct platform_device *pdev) ...@@ -2444,11 +2448,13 @@ static int svs_probe(struct platform_device *pdev)
goto svs_probe_iounmap; goto svs_probe_iounmap;
} }
#ifdef CONFIG_DEBUG_FS
ret = svs_create_debug_cmds(svsp); ret = svs_create_debug_cmds(svsp);
if (ret) { if (ret) {
dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret); dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret);
goto svs_probe_iounmap; goto svs_probe_iounmap;
} }
#endif
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment