Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
@ 2020-03-07  1:25 Anson Huang
  2020-03-07  1:25 ` [PATCH V2 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Anson Huang @ 2020-03-07  1:25 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, linux, gregkh, tglx, m.felsch,
	andriy.shevchenko, arnd, robh, yuehaibing, ronald, krzk,
	leonard.crestez, aisheng.dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Add stubs for those i.MX SCU APIs to make those modules depending
on IMX_SCU can pass build when COMPILE_TEST is enabled.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
new patch.
---
 include/linux/firmware/imx/ipc.h | 11 +++++++++++
 include/linux/firmware/imx/sci.h | 19 +++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/include/linux/firmware/imx/ipc.h b/include/linux/firmware/imx/ipc.h
index 8910574..3fff0e2 100644
--- a/include/linux/firmware/imx/ipc.h
+++ b/include/linux/firmware/imx/ipc.h
@@ -34,6 +34,7 @@ struct imx_sc_rpc_msg {
 	uint8_t func;
 };
 
+#ifdef CONFIG_IMX_SCU
 /*
  * This is an function to send an RPC message over an IPC channel.
  * It is called by client-side SCFW API function shims.
@@ -55,4 +56,14 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp);
  * @return Returns an error code (0 = success, failed if < 0)
  */
 int imx_scu_get_handle(struct imx_sc_ipc **ipc);
+#else
+static inline int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp)
+{
+	return 0;
+}
+static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc)
+{
+	return 0;
+}
+#endif
 #endif /* _SC_IPC_H */
diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h
index 17ba4e4..4688b60 100644
--- a/include/linux/firmware/imx/sci.h
+++ b/include/linux/firmware/imx/sci.h
@@ -16,8 +16,27 @@
 #include <linux/firmware/imx/svc/misc.h>
 #include <linux/firmware/imx/svc/pm.h>
 
+#ifdef CONFIG_IMX_SCU
 int imx_scu_enable_general_irq_channel(struct device *dev);
 int imx_scu_irq_register_notifier(struct notifier_block *nb);
 int imx_scu_irq_unregister_notifier(struct notifier_block *nb);
 int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
+#else
+static inline int imx_scu_enable_general_irq_channel(struct device *dev)
+{
+	return 0;
+}
+static inline int imx_scu_irq_register_notifier(struct notifier_block *nb)
+{
+	return 0;
+}
+static inline int imx_scu_irq_unregister_notifier(struct notifier_block *nb)
+{
+	return 0;
+}
+static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable)
+{
+	return 0;
+}
+#endif
 #endif /* _SC_SCI_H */
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 2/7] firmware: imx: add COMPILE_TEST support
  2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
@ 2020-03-07  1:25 ` Anson Huang
  2020-03-07  1:25 ` [PATCH V2 3/7] rtc: add COMPILE_TEST support for i.MX SC RTC Anson Huang
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-03-07  1:25 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, linux, gregkh, tglx, m.felsch,
	andriy.shevchenko, arnd, robh, yuehaibing, ronald, krzk,
	leonard.crestez, aisheng.dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Add COMPILE_TEST support to i.MX SCU drivers for better compile
testing coverage.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
no change.
---
 drivers/firmware/imx/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/imx/Kconfig b/drivers/firmware/imx/Kconfig
index 1d2e5b8..116707a 100644
--- a/drivers/firmware/imx/Kconfig
+++ b/drivers/firmware/imx/Kconfig
@@ -12,7 +12,7 @@ config IMX_DSP
 
 config IMX_SCU
 	bool "IMX SCU Protocol driver"
-	depends on IMX_MBOX
+	depends on IMX_MBOX || COMPILE_TEST
 	help
 	  The System Controller Firmware (SCFW) is a low-level system function
 	  which runs on a dedicated Cortex-M core to provide power, clock, and
@@ -24,6 +24,6 @@ config IMX_SCU
 
 config IMX_SCU_PD
 	bool "IMX SCU Power Domain driver"
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	help
 	  The System Controller Firmware (SCFW) based power domain driver.
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 3/7] rtc: add COMPILE_TEST support for i.MX SC RTC
  2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
  2020-03-07  1:25 ` [PATCH V2 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
@ 2020-03-07  1:25 ` Anson Huang
  2020-03-07  1:25 ` [PATCH V2 4/7] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY Anson Huang
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-03-07  1:25 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, linux, gregkh, tglx, m.felsch,
	andriy.shevchenko, arnd, robh, yuehaibing, ronald, krzk,
	leonard.crestez, aisheng.dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Add COMPILE_TEST support to i.MX SC RTC driver for better compile
testing coverage.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
no change.
---
 drivers/rtc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index acaf6f98..a86768f 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1772,7 +1772,7 @@ config RTC_DRV_SNVS
 	   will be called "rtc-snvs".
 
 config RTC_DRV_IMX_SC
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	depends on HAVE_ARM_SMCCC
 	tristate "NXP i.MX System Controller RTC support"
 	help
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 4/7] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY
  2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
  2020-03-07  1:25 ` [PATCH V2 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
  2020-03-07  1:25 ` [PATCH V2 3/7] rtc: add COMPILE_TEST support for i.MX SC RTC Anson Huang
@ 2020-03-07  1:25 ` Anson Huang
  2020-03-07  1:25 ` [PATCH V2 5/7] input: keyboard: imx_sc_key: Fix build warning for !CONFIG_IMX_SCU case Anson Huang
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-03-07  1:25 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, linux, gregkh, tglx, m.felsch,
	andriy.shevchenko, arnd, robh, yuehaibing, ronald, krzk,
	leonard.crestez, aisheng.dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile
testing coverage.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
no change.
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 4706ff0..81e26f6 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -467,7 +467,7 @@ config KEYBOARD_IMX
 
 config KEYBOARD_IMX_SC_KEY
 	tristate "IMX SCU Key Driver"
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	help
 	  This is the system controller key driver for NXP i.MX SoCs with
 	  system controller inside.
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 5/7] input: keyboard: imx_sc_key: Fix build warning for !CONFIG_IMX_SCU case
  2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (2 preceding siblings ...)
  2020-03-07  1:25 ` [PATCH V2 4/7] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY Anson Huang
@ 2020-03-07  1:25 ` Anson Huang
  2020-03-07  1:25 ` [PATCH V2 6/7] watchdog: add COMPILE_TEST support for IMX_SC_WDT Anson Huang
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-03-07  1:25 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, linux, gregkh, tglx, m.felsch,
	andriy.shevchenko, arnd, robh, yuehaibing, ronald, krzk,
	leonard.crestez, aisheng.dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Fix below build warning when COMPILE_TEST is enabled while IMX_SCU is not:

drivers/input/keyboard/imx_sc_key.c: In function ‘imx_sc_check_for_events’:
drivers/input/keyboard/imx_sc_key.c:87:27: warning: ‘msg.state’ is used
uninitialized in this function [-Wuninitialized]
state = (bool)(msg.state & 0xff);
                             ^
AR      drivers/input/keyboard/built-in.a

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
new patch.
---
 drivers/input/keyboard/imx_sc_key.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c
index 9f809ae..26a12fb 100644
--- a/drivers/input/keyboard/imx_sc_key.c
+++ b/drivers/input/keyboard/imx_sc_key.c
@@ -72,6 +72,7 @@ static void imx_sc_check_for_events(struct work_struct *work)
 	hdr->func = IMX_SC_MISC_FUNC_GET_BUTTON_STATUS;
 	hdr->size = 1;
 
+	msg.state = 0;
 	error = imx_scu_call_rpc(priv->key_ipc_handle, &msg, true);
 	if (error) {
 		dev_err(&input->dev, "read imx sc key failed, error %d\n", error);
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 6/7] watchdog: add COMPILE_TEST support for IMX_SC_WDT
  2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (3 preceding siblings ...)
  2020-03-07  1:25 ` [PATCH V2 5/7] input: keyboard: imx_sc_key: Fix build warning for !CONFIG_IMX_SCU case Anson Huang
@ 2020-03-07  1:25 ` Anson Huang
  2020-03-07  1:25 ` [PATCH V2 7/7] thermal: add COMPILE_TEST support for IMX_SC_THERMAL Anson Huang
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-03-07  1:25 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, linux, gregkh, tglx, m.felsch,
	andriy.shevchenko, arnd, robh, yuehaibing, ronald, krzk,
	leonard.crestez, aisheng.dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Add COMPILE_TEST support to i.MX SC watchdog driver for better compile
testing coverage.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
no change.
---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 9ea2b43..6388154 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -712,7 +712,7 @@ config IMX2_WDT
 config IMX_SC_WDT
 	tristate "IMX SC Watchdog"
 	depends on HAVE_ARM_SMCCC
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	select WATCHDOG_CORE
 	help
 	  This is the driver for the system controller watchdog
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 7/7] thermal: add COMPILE_TEST support for IMX_SC_THERMAL
  2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (4 preceding siblings ...)
  2020-03-07  1:25 ` [PATCH V2 6/7] watchdog: add COMPILE_TEST support for IMX_SC_WDT Anson Huang
@ 2020-03-07  1:25 ` Anson Huang
  2020-03-09  0:00 ` [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Guenter Roeck
  2020-03-16  0:28 ` Shawn Guo
  7 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-03-07  1:25 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, linux, gregkh, tglx, m.felsch,
	andriy.shevchenko, arnd, robh, yuehaibing, ronald, krzk,
	leonard.crestez, aisheng.dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Add COMPILE_TEST support to i.MX SC thermal driver for better compile
testing coverage.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
---
no change.
---
 drivers/thermal/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 91af271..55c7641 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -254,7 +254,7 @@ config IMX_THERMAL
 
 config IMX_SC_THERMAL
 	tristate "Temperature sensor driver for NXP i.MX SoCs with System Controller"
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	depends on OF
 	help
 	  Support for Temperature Monitor (TEMPMON) found on NXP i.MX SoCs with
-- 
2.7.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (5 preceding siblings ...)
  2020-03-07  1:25 ` [PATCH V2 7/7] thermal: add COMPILE_TEST support for IMX_SC_THERMAL Anson Huang
@ 2020-03-09  0:00 ` Guenter Roeck
  2020-03-09  0:45   ` Anson Huang
  2020-03-16  0:28 ` Shawn Guo
  7 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2020-03-09  0:00 UTC (permalink / raw)
  To: Anson Huang, shawnguo, s.hauer, kernel, festevam,
	dmitry.torokhov, a.zummo, alexandre.belloni, rui.zhang,
	daniel.lezcano, amit.kucheria, wim, daniel.baluta, linux, gregkh,
	tglx, m.felsch, andriy.shevchenko, arnd, robh, yuehaibing,
	ronald, krzk, leonard.crestez, aisheng.dong, linux-arm-kernel,
	linux-kernel, linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

On 3/6/20 5:25 PM, Anson Huang wrote:
> Add stubs for those i.MX SCU APIs to make those modules depending
> on IMX_SCU can pass build when COMPILE_TEST is enabled.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> new patch.
> ---
>  include/linux/firmware/imx/ipc.h | 11 +++++++++++
>  include/linux/firmware/imx/sci.h | 19 +++++++++++++++++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/include/linux/firmware/imx/ipc.h b/include/linux/firmware/imx/ipc.h
> index 8910574..3fff0e2 100644
> --- a/include/linux/firmware/imx/ipc.h
> +++ b/include/linux/firmware/imx/ipc.h
> @@ -34,6 +34,7 @@ struct imx_sc_rpc_msg {
>  	uint8_t func;
>  };
>  
> +#ifdef CONFIG_IMX_SCU
>  /*
>   * This is an function to send an RPC message over an IPC channel.
>   * It is called by client-side SCFW API function shims.
> @@ -55,4 +56,14 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp);
>   * @return Returns an error code (0 = success, failed if < 0)
>   */
>  int imx_scu_get_handle(struct imx_sc_ipc **ipc);
> +#else
> +static inline int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp)
> +{
> +	return 0;
> +}
> +static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc)
> +{
> +	return 0;
> +}
> +#endif
>  #endif /* _SC_IPC_H */
> diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h
> index 17ba4e4..4688b60 100644
> --- a/include/linux/firmware/imx/sci.h
> +++ b/include/linux/firmware/imx/sci.h
> @@ -16,8 +16,27 @@
>  #include <linux/firmware/imx/svc/misc.h>
>  #include <linux/firmware/imx/svc/pm.h>
>  
> +#ifdef CONFIG_IMX_SCU
>  int imx_scu_enable_general_irq_channel(struct device *dev);
>  int imx_scu_irq_register_notifier(struct notifier_block *nb);
>  int imx_scu_irq_unregister_notifier(struct notifier_block *nb);
>  int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
> +#else
> +static inline int imx_scu_enable_general_irq_channel(struct device *dev)
> +{
> +	return 0;
> +}
> +static inline int imx_scu_irq_register_notifier(struct notifier_block *nb)
> +{
> +	return 0;
> +}
> +static inline int imx_scu_irq_unregister_notifier(struct notifier_block *nb)
> +{
> +	return 0;
> +}
> +static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable)
> +{
> +	return 0;
> +}

It would probably be more appropriate to return errors from the stub functions.

Guenter

> +#endif
>  #endif /* _SC_SCI_H */
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09  0:00 ` [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Guenter Roeck
@ 2020-03-09  0:45   ` Anson Huang
  0 siblings, 0 replies; 12+ messages in thread
From: Anson Huang @ 2020-03-09  0:45 UTC (permalink / raw)
  To: Guenter Roeck, shawnguo, s.hauer, kernel, festevam,
	dmitry.torokhov, a.zummo, alexandre.belloni, rui.zhang,
	daniel.lezcano, amit.kucheria, wim, Daniel Baluta, linux, gregkh,
	tglx, m.felsch, andriy.shevchenko, arnd, robh, yuehaibing,
	ronald, krzk, Leonard Crestez, Aisheng Dong, linux-arm-kernel,
	linux-kernel, linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: dl-linux-imx

Hi, Guenter

> Subject: Re: [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On 3/6/20 5:25 PM, Anson Huang wrote:
> > Add stubs for those i.MX SCU APIs to make those modules depending on
> > IMX_SCU can pass build when COMPILE_TEST is enabled.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > new patch.
> > ---
> >  include/linux/firmware/imx/ipc.h | 11 +++++++++++
> > include/linux/firmware/imx/sci.h | 19 +++++++++++++++++++
> >  2 files changed, 30 insertions(+)
> >
> > diff --git a/include/linux/firmware/imx/ipc.h
> > b/include/linux/firmware/imx/ipc.h
> > index 8910574..3fff0e2 100644
> > --- a/include/linux/firmware/imx/ipc.h
> > +++ b/include/linux/firmware/imx/ipc.h
> > @@ -34,6 +34,7 @@ struct imx_sc_rpc_msg {
> >  	uint8_t func;
> >  };
> >
> > +#ifdef CONFIG_IMX_SCU
> >  /*
> >   * This is an function to send an RPC message over an IPC channel.
> >   * It is called by client-side SCFW API function shims.
> > @@ -55,4 +56,14 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void
> *msg, bool have_resp);
> >   * @return Returns an error code (0 = success, failed if < 0)
> >   */
> >  int imx_scu_get_handle(struct imx_sc_ipc **ipc);
> > +#else
> > +static inline int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg,
> > +bool have_resp) {
> > +	return 0;
> > +}
> > +static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc) {
> > +	return 0;
> > +}
> > +#endif
> >  #endif /* _SC_IPC_H */
> > diff --git a/include/linux/firmware/imx/sci.h
> > b/include/linux/firmware/imx/sci.h
> > index 17ba4e4..4688b60 100644
> > --- a/include/linux/firmware/imx/sci.h
> > +++ b/include/linux/firmware/imx/sci.h
> > @@ -16,8 +16,27 @@
> >  #include <linux/firmware/imx/svc/misc.h>  #include
> > <linux/firmware/imx/svc/pm.h>
> >
> > +#ifdef CONFIG_IMX_SCU
> >  int imx_scu_enable_general_irq_channel(struct device *dev);  int
> > imx_scu_irq_register_notifier(struct notifier_block *nb);  int
> > imx_scu_irq_unregister_notifier(struct notifier_block *nb);  int
> > imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
> > +#else
> > +static inline int imx_scu_enable_general_irq_channel(struct device
> > +*dev) {
> > +	return 0;
> > +}
> > +static inline int imx_scu_irq_register_notifier(struct notifier_block
> > +*nb) {
> > +	return 0;
> > +}
> > +static inline int imx_scu_irq_unregister_notifier(struct
> > +notifier_block *nb) {
> > +	return 0;
> > +}
> > +static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8
> > +enable) {
> > +	return 0;
> > +}
> 
> It would probably be more appropriate to return errors from the stub
> functions.

Agreed, improve them in V3 patch series.

Thanks,
Anson

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (6 preceding siblings ...)
  2020-03-09  0:00 ` [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Guenter Roeck
@ 2020-03-16  0:28 ` Shawn Guo
  2020-03-16  0:54   ` Guenter Roeck
  7 siblings, 1 reply; 12+ messages in thread
From: Shawn Guo @ 2020-03-16  0:28 UTC (permalink / raw)
  To: Anson Huang
  Cc: s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, linux, gregkh, tglx, m.felsch,
	andriy.shevchenko, arnd, robh, yuehaibing, ronald, krzk,
	leonard.crestez, aisheng.dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog, Linux-imx

On Sat, Mar 07, 2020 at 09:25:53AM +0800, Anson Huang wrote:
> Add stubs for those i.MX SCU APIs to make those modules depending
> on IMX_SCU can pass build when COMPILE_TEST is enabled.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Already had such a patch from Peng Fan.

Shawn

> ---
> new patch.
> ---
>  include/linux/firmware/imx/ipc.h | 11 +++++++++++
>  include/linux/firmware/imx/sci.h | 19 +++++++++++++++++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/include/linux/firmware/imx/ipc.h b/include/linux/firmware/imx/ipc.h
> index 8910574..3fff0e2 100644
> --- a/include/linux/firmware/imx/ipc.h
> +++ b/include/linux/firmware/imx/ipc.h
> @@ -34,6 +34,7 @@ struct imx_sc_rpc_msg {
>  	uint8_t func;
>  };
>  
> +#ifdef CONFIG_IMX_SCU
>  /*
>   * This is an function to send an RPC message over an IPC channel.
>   * It is called by client-side SCFW API function shims.
> @@ -55,4 +56,14 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp);
>   * @return Returns an error code (0 = success, failed if < 0)
>   */
>  int imx_scu_get_handle(struct imx_sc_ipc **ipc);
> +#else
> +static inline int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp)
> +{
> +	return 0;
> +}
> +static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc)
> +{
> +	return 0;
> +}
> +#endif
>  #endif /* _SC_IPC_H */
> diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h
> index 17ba4e4..4688b60 100644
> --- a/include/linux/firmware/imx/sci.h
> +++ b/include/linux/firmware/imx/sci.h
> @@ -16,8 +16,27 @@
>  #include <linux/firmware/imx/svc/misc.h>
>  #include <linux/firmware/imx/svc/pm.h>
>  
> +#ifdef CONFIG_IMX_SCU
>  int imx_scu_enable_general_irq_channel(struct device *dev);
>  int imx_scu_irq_register_notifier(struct notifier_block *nb);
>  int imx_scu_irq_unregister_notifier(struct notifier_block *nb);
>  int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
> +#else
> +static inline int imx_scu_enable_general_irq_channel(struct device *dev)
> +{
> +	return 0;
> +}
> +static inline int imx_scu_irq_register_notifier(struct notifier_block *nb)
> +{
> +	return 0;
> +}
> +static inline int imx_scu_irq_unregister_notifier(struct notifier_block *nb)
> +{
> +	return 0;
> +}
> +static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable)
> +{
> +	return 0;
> +}
> +#endif
>  #endif /* _SC_SCI_H */
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  0:28 ` Shawn Guo
@ 2020-03-16  0:54   ` Guenter Roeck
  2020-03-16  1:12     ` Shawn Guo
  0 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2020-03-16  0:54 UTC (permalink / raw)
  To: Shawn Guo, Anson Huang
  Cc: s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	daniel.baluta, linux, gregkh, tglx, m.felsch, andriy.shevchenko,
	arnd, robh, yuehaibing, ronald, krzk, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, Linux-imx

On 3/15/20 5:28 PM, Shawn Guo wrote:
> On Sat, Mar 07, 2020 at 09:25:53AM +0800, Anson Huang wrote:
>> Add stubs for those i.MX SCU APIs to make those modules depending
>> on IMX_SCU can pass build when COMPILE_TEST is enabled.
>>
>> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> 
> Already had such a patch from Peng Fan.
> 

Did you follow the discussion and the conclusion that the only patch
really needed is patch 2/7 ?

Guenter

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  0:54   ` Guenter Roeck
@ 2020-03-16  1:12     ` Shawn Guo
  0 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2020-03-16  1:12 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Anson Huang, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	daniel.baluta, linux, gregkh, tglx, m.felsch, andriy.shevchenko,
	arnd, robh, yuehaibing, ronald, krzk, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, Linux-imx

On Sun, Mar 15, 2020 at 05:54:52PM -0700, Guenter Roeck wrote:
> On 3/15/20 5:28 PM, Shawn Guo wrote:
> > On Sat, Mar 07, 2020 at 09:25:53AM +0800, Anson Huang wrote:
> >> Add stubs for those i.MX SCU APIs to make those modules depending
> >> on IMX_SCU can pass build when COMPILE_TEST is enabled.
> >>
> >> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > 
> > Already had such a patch from Peng Fan.
> > 
> 
> Did you follow the discussion and the conclusion that the only patch
> really needed is patch 2/7 ?

Thanks for the reminding.  Just did.

Shawn

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, back to index

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-07  1:25 [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
2020-03-07  1:25 ` [PATCH V2 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
2020-03-07  1:25 ` [PATCH V2 3/7] rtc: add COMPILE_TEST support for i.MX SC RTC Anson Huang
2020-03-07  1:25 ` [PATCH V2 4/7] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY Anson Huang
2020-03-07  1:25 ` [PATCH V2 5/7] input: keyboard: imx_sc_key: Fix build warning for !CONFIG_IMX_SCU case Anson Huang
2020-03-07  1:25 ` [PATCH V2 6/7] watchdog: add COMPILE_TEST support for IMX_SC_WDT Anson Huang
2020-03-07  1:25 ` [PATCH V2 7/7] thermal: add COMPILE_TEST support for IMX_SC_THERMAL Anson Huang
2020-03-09  0:00 ` [PATCH V2 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Guenter Roeck
2020-03-09  0:45   ` Anson Huang
2020-03-16  0:28 ` Shawn Guo
2020-03-16  0:54   ` Guenter Roeck
2020-03-16  1:12     ` Shawn Guo

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git