From: Melih Emik <melihemik@noirlang.tr>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Hans de Goede <hansg@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, Melih Emik <melihemik@noirlang.tr>
Subject: [PATCH v2] atomisp: replace dbg_func parameter with dynamic debug
Date: Tue, 12 May 2026 21:09:58 +0300 [thread overview]
Message-ID: <20260512180958.18098-1-melihemik@noirlang.tr> (raw)
In-Reply-To: <CAHp75VebM9wwKpjnZKEGVvwA=TfmF4MDDuYssNAFWDnXsXyRTw@mail.gmail.com>
The dbg_func module parameter in atomisp_v4l2.c toggles the CSS
debug_print callback through a writable module parameter. Removing only
the parameter drops the runtime switch that users had through sysfs.
Keep the debug path available at runtime by routing CSS debug output
through dynamic debug instead. The callback remains installed, but its
output is controlled by the dynamic debug callsite. CSS error output
continues to use vprintk().
Remove the obsolete parameter, its global state and the unused get/set
helpers.
Signed-off-by: Melih Emik <melihemik@noirlang.tr>
---
.../media/atomisp/pci/atomisp_common.h | 1 -
.../media/atomisp/pci/atomisp_compat_css20.c | 47 ++++++-------------
.../media/atomisp/pci/atomisp_compat_css20.h | 3 --
.../staging/media/atomisp/pci/atomisp_v4l2.c | 6 ---
4 files changed, 15 insertions(+), 42 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_common.h b/drivers/staging/media/atomisp/pci/atomisp_common.h
index a2462fc306fb..145b35ad13cb 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_common.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_common.h
@@ -21,7 +21,6 @@
#include "ia_css.h"
extern int dbg_level;
-extern int dbg_func;
extern int pad_w;
extern int pad_h;
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index be5f37f4a6fd..fb18c204266b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -25,6 +25,7 @@
#include "sh_css_hrt.h"
#include "ia_css_isys.h"
+#include <linux/dynamic_debug.h>
#include <linux/io.h>
#include <linux/pm_runtime.h>
@@ -152,6 +153,19 @@ static int __printf(1, 0) atomisp_vprintk(const char *fmt, va_list args)
return 0;
}
+static int __printf(1, 0) atomisp_vpr_debug(const char *fmt, va_list args)
+{
+#if defined(CONFIG_DYNAMIC_DEBUG)
+ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, "CSS debug");
+
+ if (DYNAMIC_DEBUG_BRANCH(descriptor))
+ vprintk(fmt, args);
+#elif defined(DEBUG)
+ vprintk(fmt, args);
+#endif
+ return 0;
+}
+
void atomisp_load_uint32(hrt_address addr, uint32_t *data)
{
*data = atomisp_css2_hw_load_32(addr);
@@ -745,20 +759,6 @@ int atomisp_css_init(struct atomisp_device *isp)
return 0;
}
-static inline int __set_css_print_env(struct atomisp_device *isp, int opt)
-{
- int ret = 0;
-
- if (opt == 0)
- isp->css_env.isp_css_env.print_env.debug_print = NULL;
- else if (opt == 1)
- isp->css_env.isp_css_env.print_env.debug_print = atomisp_vprintk;
- else
- ret = -EINVAL;
-
- return ret;
-}
-
int atomisp_css_load_firmware(struct atomisp_device *isp)
{
int err;
@@ -783,8 +783,7 @@ int atomisp_css_load_firmware(struct atomisp_device *isp)
isp->css_env.isp_css_env.hw_access_env.load = atomisp_css2_hw_load;
isp->css_env.isp_css_env.hw_access_env.store = atomisp_css2_hw_store;
- __set_css_print_env(isp, dbg_func);
-
+ isp->css_env.isp_css_env.print_env.debug_print = atomisp_vpr_debug;
isp->css_env.isp_css_env.print_env.error_print = atomisp_vprintk;
/* load isp fw into ISP memory */
@@ -3360,22 +3359,6 @@ void atomisp_css_set_isp_config_applied_frame(struct atomisp_sub_device *asd,
asd->params.config.output_frame = output_frame;
}
-int atomisp_get_css_dbgfunc(void)
-{
- return dbg_func;
-}
-
-int atomisp_set_css_dbgfunc(struct atomisp_device *isp, int opt)
-{
- int ret;
-
- ret = __set_css_print_env(isp, opt);
- if (ret == 0)
- dbg_func = opt;
-
- return ret;
-}
-
void atomisp_en_dz_capt_pipe(struct atomisp_sub_device *asd, bool enable)
{
ia_css_en_dz_capt_pipe(
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.h b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.h
index 75781807544a..e1c0b7e77974 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.h
@@ -150,9 +150,6 @@ void atomisp_css_set_isp_config_id(struct atomisp_sub_device *asd,
void atomisp_css_set_isp_config_applied_frame(struct atomisp_sub_device *asd,
struct ia_css_frame *output_frame);
-int atomisp_get_css_dbgfunc(void);
-
-int atomisp_set_css_dbgfunc(struct atomisp_device *isp, int opt);
struct ia_css_dvs_grid_info *atomisp_css_get_dvs_grid_info(
struct ia_css_grid_info *grid_info);
#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 900a67552d6a..d4374b7fc1ba 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -48,12 +48,6 @@ int dbg_level;
module_param(dbg_level, int, 0644);
MODULE_PARM_DESC(dbg_level, "debug message level (default:0)");
-/* log function switch */
-int dbg_func = 1;
-module_param(dbg_func, int, 0644);
-MODULE_PARM_DESC(dbg_func,
- "log function switch non/printk (default:printk)");
-
/*
* Set to 16x16 since this is the amount of lines and pixels the sensor
* exports extra. If these are kept at the 10x8 that they were on, in yuv
--
2.54.0
next prev parent reply other threads:[~2026-05-12 18:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 19:32 [PATCH] atomisp: remove unused module parameter dbg_func Melih Emik
2026-05-12 4:26 ` Andy Shevchenko
2026-05-12 18:09 ` Melih Emik [this message]
2026-05-12 19:12 ` [PATCH v2] atomisp: replace dbg_func parameter with dynamic debug Andy Shevchenko
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=20260512180958.18098-1-melihemik@noirlang.tr \
--to=melihemik@noirlang.tr \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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