summaryrefslogtreecommitdiff
path: root/drivers/staging/media/atomisp/pci/sh_css_mipi.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-11-16 09:13:32 +0000
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-11-16 14:37:10 +0000
commitec1804dadf362882f526b2f7e18893d8eb2bd1dd (patch)
treeb259eb1c3ded4bbd56010ac5c9b36af47dd28d0f /drivers/staging/media/atomisp/pci/sh_css_mipi.c
parentdc41f7df78af19ba56c689c6deb7efe5aa7e22b6 (diff)
media: atomisp: warn if mipi de-allocation failed
There's a note at the uninit function that warns about issues with mipi frames de-allocation. print a warning if the problem ever happens. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/sh_css_mipi.c')
-rw-r--r--drivers/staging/media/atomisp/pci/sh_css_mipi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/sh_css_mipi.c b/drivers/staging/media/atomisp/pci/sh_css_mipi.c
index 87f1df575d9f..cfaa4719177c 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_mipi.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_mipi.c
@@ -261,6 +261,17 @@ mipi_init(void)
ref_count_mipi_allocation[i] = 0;
}
+bool mipi_is_free(void)
+{
+ unsigned int i;
+
+ for (i = 0; i < N_CSI_PORTS; i++)
+ if (ref_count_mipi_allocation[i])
+ return false;
+
+ return true;
+}
+
int
calculate_mipi_buff_size(
struct ia_css_stream_config *stream_cfg,