* [PATCH v2] media: imx: remove code for non-existing config IMX_GPT_ICAP
@ 2022-11-23 7:52 Lukas Bulwahn
2022-11-23 8:28 ` Tommaso Merciai
2022-12-16 17:23 ` Philipp Zabel
0 siblings, 2 replies; 3+ messages in thread
From: Lukas Bulwahn @ 2022-11-23 7:52 UTC (permalink / raw)
To: Tommaso Merciai, Steve Longerbeam, Philipp Zabel,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
NXP Linux Team, linux-media, linux-staging, linux-arm-kernel
Cc: kernel-janitors, linux-kernel, Lukas Bulwahn
There never was a config IMX_GPT_ICAP in the repository. So remove the code
conditional on this config and simplify the callers that just called empty
functions.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
v1: https://lore.kernel.org/all/20221122132330.30408-1-lukas.bulwahn@gmail.com/
v1 -> v2:
- addressed Tommaso's feedback: remove braces for single statement blocks
drivers/staging/media/imx/imx-media-fim.c | 57 +----------------------
1 file changed, 1 insertion(+), 56 deletions(-)
diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c
index 3a9182933508..fb6590dcfc36 100644
--- a/drivers/staging/media/imx/imx-media-fim.c
+++ b/drivers/staging/media/imx/imx-media-fim.c
@@ -187,54 +187,6 @@ static void frame_interval_monitor(struct imx_media_fim *fim,
send_fim_event(fim, error_avg);
}
-#ifdef CONFIG_IMX_GPT_ICAP
-/*
- * Input Capture method of measuring frame intervals. Not subject
- * to interrupt latency.
- */
-static void fim_input_capture_handler(int channel, void *dev_id,
- ktime_t timestamp)
-{
- struct imx_media_fim *fim = dev_id;
- unsigned long flags;
-
- spin_lock_irqsave(&fim->lock, flags);
-
- frame_interval_monitor(fim, timestamp);
-
- if (!completion_done(&fim->icap_first_event))
- complete(&fim->icap_first_event);
-
- spin_unlock_irqrestore(&fim->lock, flags);
-}
-
-static int fim_request_input_capture(struct imx_media_fim *fim)
-{
- init_completion(&fim->icap_first_event);
-
- return mxc_request_input_capture(fim->icap_channel,
- fim_input_capture_handler,
- fim->icap_flags, fim);
-}
-
-static void fim_free_input_capture(struct imx_media_fim *fim)
-{
- mxc_free_input_capture(fim->icap_channel, fim);
-}
-
-#else /* CONFIG_IMX_GPT_ICAP */
-
-static int fim_request_input_capture(struct imx_media_fim *fim)
-{
- return 0;
-}
-
-static void fim_free_input_capture(struct imx_media_fim *fim)
-{
-}
-
-#endif /* CONFIG_IMX_GPT_ICAP */
-
/*
* In case we are monitoring the first frame interval after streamon
* (when fim->num_skip = 0), we need a valid fim->last_ts before we
@@ -434,15 +386,8 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim,
update_fim_nominal(fim, fi);
spin_unlock_irqrestore(&fim->lock, flags);
- if (icap_enabled(fim)) {
- ret = fim_request_input_capture(fim);
- if (ret)
- goto out;
- fim_acquire_first_ts(fim);
- }
- } else {
if (icap_enabled(fim))
- fim_free_input_capture(fim);
+ fim_acquire_first_ts(fim);
}
fim->stream_on = on;
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] media: imx: remove code for non-existing config IMX_GPT_ICAP
2022-11-23 7:52 [PATCH v2] media: imx: remove code for non-existing config IMX_GPT_ICAP Lukas Bulwahn
@ 2022-11-23 8:28 ` Tommaso Merciai
2022-12-16 17:23 ` Philipp Zabel
1 sibling, 0 replies; 3+ messages in thread
From: Tommaso Merciai @ 2022-11-23 8:28 UTC (permalink / raw)
To: Lukas Bulwahn
Cc: Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
linux-media, linux-staging, linux-arm-kernel, kernel-janitors,
linux-kernel
Hi Lukas,
On Wed, Nov 23, 2022 at 08:52:16AM +0100, Lukas Bulwahn wrote:
> There never was a config IMX_GPT_ICAP in the repository. So remove the code
> conditional on this config and simplify the callers that just called empty
> functions.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> v1: https://lore.kernel.org/all/20221122132330.30408-1-lukas.bulwahn@gmail.com/
>
> v1 -> v2:
> - addressed Tommaso's feedback: remove braces for single statement blocks
>
> drivers/staging/media/imx/imx-media-fim.c | 57 +----------------------
> 1 file changed, 1 insertion(+), 56 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c
> index 3a9182933508..fb6590dcfc36 100644
> --- a/drivers/staging/media/imx/imx-media-fim.c
> +++ b/drivers/staging/media/imx/imx-media-fim.c
> @@ -187,54 +187,6 @@ static void frame_interval_monitor(struct imx_media_fim *fim,
> send_fim_event(fim, error_avg);
> }
>
> -#ifdef CONFIG_IMX_GPT_ICAP
> -/*
> - * Input Capture method of measuring frame intervals. Not subject
> - * to interrupt latency.
> - */
> -static void fim_input_capture_handler(int channel, void *dev_id,
> - ktime_t timestamp)
> -{
> - struct imx_media_fim *fim = dev_id;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&fim->lock, flags);
> -
> - frame_interval_monitor(fim, timestamp);
> -
> - if (!completion_done(&fim->icap_first_event))
> - complete(&fim->icap_first_event);
> -
> - spin_unlock_irqrestore(&fim->lock, flags);
> -}
> -
> -static int fim_request_input_capture(struct imx_media_fim *fim)
> -{
> - init_completion(&fim->icap_first_event);
> -
> - return mxc_request_input_capture(fim->icap_channel,
> - fim_input_capture_handler,
> - fim->icap_flags, fim);
> -}
> -
> -static void fim_free_input_capture(struct imx_media_fim *fim)
> -{
> - mxc_free_input_capture(fim->icap_channel, fim);
> -}
> -
> -#else /* CONFIG_IMX_GPT_ICAP */
> -
> -static int fim_request_input_capture(struct imx_media_fim *fim)
> -{
> - return 0;
> -}
> -
> -static void fim_free_input_capture(struct imx_media_fim *fim)
> -{
> -}
> -
> -#endif /* CONFIG_IMX_GPT_ICAP */
> -
> /*
> * In case we are monitoring the first frame interval after streamon
> * (when fim->num_skip = 0), we need a valid fim->last_ts before we
> @@ -434,15 +386,8 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim,
> update_fim_nominal(fim, fi);
> spin_unlock_irqrestore(&fim->lock, flags);
>
> - if (icap_enabled(fim)) {
> - ret = fim_request_input_capture(fim);
> - if (ret)
> - goto out;
> - fim_acquire_first_ts(fim);
> - }
> - } else {
> if (icap_enabled(fim))
> - fim_free_input_capture(fim);
> + fim_acquire_first_ts(fim);
> }
>
> fim->stream_on = on;
> --
> 2.17.1
>
Looks good to me.
Reviewed-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Thanks & Regards,
Tommaso
--
Tommaso Merciai
Embedded Linux Engineer
tommaso.merciai@amarulasolutions.com
__________________________________
Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@amarulasolutions.com
www.amarulasolutions.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] media: imx: remove code for non-existing config IMX_GPT_ICAP
2022-11-23 7:52 [PATCH v2] media: imx: remove code for non-existing config IMX_GPT_ICAP Lukas Bulwahn
2022-11-23 8:28 ` Tommaso Merciai
@ 2022-12-16 17:23 ` Philipp Zabel
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Zabel @ 2022-12-16 17:23 UTC (permalink / raw)
To: Lukas Bulwahn, Tommaso Merciai, Steve Longerbeam,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
NXP Linux Team, linux-media, linux-staging, linux-arm-kernel
Cc: kernel-janitors, linux-kernel
On Mi, 2022-11-23 at 08:52 +0100, Lukas Bulwahn wrote:
> There never was a config IMX_GPT_ICAP in the repository. So remove the code
> conditional on this config and simplify the callers that just called empty
> functions.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-16 17:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-23 7:52 [PATCH v2] media: imx: remove code for non-existing config IMX_GPT_ICAP Lukas Bulwahn
2022-11-23 8:28 ` Tommaso Merciai
2022-12-16 17:23 ` Philipp Zabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox