mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Baluta <daniel.baluta@nxp.com>
To: Peng Fan <peng.fan@nxp.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>
Cc: "festevam@gmail.com" <festevam@gmail.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"olof@lixom.net" <olof@lixom.net>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	Leonard Crestez <leonard.crestez@nxp.com>,
	Abel Vesa <abel.vesa@nxp.com>,
	"krzk@kernel.org" <krzk@kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"daniel.baluta@gmail.com" <daniel.baluta@gmail.com>
Subject: Re: [PATCH V4 1/2] firmware: imx: add dummy functions
Date: Thu, 20 Feb 2020 07:44:20 +0000	[thread overview]
Message-ID: <a5134838-53d4-97f0-d126-b94164871763@nxp.com> (raw)
In-Reply-To: <1582179843-14375-2-git-send-email-peng.fan@nxp.com>

On 20.02.2020 08:24, Peng Fan wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> IMX_SCU_SOC could be enabled with COMPILE_TEST, however there is
> no dummy functions when CONFIG_IMX_SCU not defined. Then there
> will be build failure.
>
> So add dummy functions to avoid build failure for COMPILE_TEST
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>   include/linux/firmware/imx/ipc.h      | 13 +++++++++++++
>   include/linux/firmware/imx/sci.h      | 22 ++++++++++++++++++++++
>   include/linux/firmware/imx/svc/misc.h | 19 +++++++++++++++++++
>   3 files changed, 54 insertions(+)
>
> diff --git a/include/linux/firmware/imx/ipc.h b/include/linux/firmware/imx/ipc.h
> index 6312c8cb084a..30475082f472 100644
> --- a/include/linux/firmware/imx/ipc.h
> +++ b/include/linux/firmware/imx/ipc.h
> @@ -35,6 +35,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.
> @@ -56,4 +57,16 @@ 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 -ENOTSUPP;
> +}
> +
> +static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc)
> +{
> +	return -ENOTSUPP;
> +}
> +#endif
>   #endif /* _SC_IPC_H */
> diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h
> index 17ba4e405129..7ea875b186e3 100644
> --- a/include/linux/firmware/imx/sci.h
> +++ b/include/linux/firmware/imx/sci.h
> @@ -16,8 +16,30 @@
>   #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 -ENOTSUPP;
> +}
> +
> +static inline int imx_scu_irq_register_notifier(struct notifier_block *nb)
> +{
> +	return -ENOTSUPP;
> +}
> +
> +static inline int imx_scu_irq_unregister_notifier(struct notifier_block *nb)
> +{
> +	return -ENOTSUPP;
> +}
> +
> +static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable)
> +{
> +	return -ENOTSUPP;
> +}
> +#endif
>   #endif /* _SC_SCI_H */
> diff --git a/include/linux/firmware/imx/svc/misc.h b/include/linux/firmware/imx/svc/misc.h
> index 031dd4d3c766..3f4a0f526b73 100644
> --- a/include/linux/firmware/imx/svc/misc.h
> +++ b/include/linux/firmware/imx/svc/misc.h
> @@ -46,6 +46,7 @@ enum imx_misc_func {
>    * Control Functions
>    */
>   
> +#ifdef CONFIG_IMX_SCU
>   int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource,
>   			    u8 ctrl, u32 val);
>   
> @@ -54,5 +55,23 @@ int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource,
>   
>   int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
>   			bool enable, u64 phys_addr);
> +#else
Functions for dummy case below should be static inline.
> +int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource,
> +			    u8 ctrl, u32 val)
> +{
> +	return -ENOTSUPP;
> +}
> +
> +int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource,
> +			    u8 ctrl, u32 *val)
> +{
> +	return -ENOTSUPP;
> +}
>   
> +int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
> +			bool enable, u64 phys_addr)
> +{
> +	return -ENOTSUPP;
> +}
> +#endif
>   #endif /* _SC_MISC_API_H */



  reply	other threads:[~2020-02-20  7:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20  6:24 [PATCH V4 0/2] soc: imx: increase build coverage for imx8 soc driver peng.fan
2020-02-20  6:24 ` [PATCH V4 1/2] firmware: imx: add dummy functions peng.fan
2020-02-20  7:44   ` Daniel Baluta [this message]
2020-02-20  7:46     ` Peng Fan
2020-02-20  6:24 ` [PATCH V4 2/2] soc: imx: increase build coverage for imx8m soc driver peng.fan

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=a5134838-53d4-97f0-d126-b94164871763@nxp.com \
    --to=daniel.baluta@nxp.com \
    --cc=abel.vesa@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=daniel.baluta@gmail.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=peng.fan@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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

all inboxes | Powered by JetHome®