media: stm32-dcmipp: fix STM32 DCMIPP camera interface driver

media: dcmipp: check for JPEG format only if format is supported.
In case of a non supported format given from application the format is
setted to the default one and thus no need to check.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Change-Id: I4193e1fec6b19c3da11123a830b1c32bf56eb490
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/257566
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Philippe CORNU <philippe.cornu@foss.st.com>
Reviewed-by: Hugues FRUCHET <hugues.fruchet@st.com>
Tested-by: Hugues FRUCHET <hugues.fruchet@st.com>
This commit is contained in:
Alain Volmat
2022-06-23 16:57:25 +02:00
committed by Eric Fourmont
parent fe1cef635b
commit 2da2535a8d
3 changed files with 10 additions and 7 deletions

View File

@ -11740,6 +11740,15 @@ T: git git://linuxtv.org/media_tree.git
F: Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml
F: drivers/media/platform/stm32/stm32-dcmi.c
MEDIA DRIVERS FOR STM32 - DCMIPP
M: Hugues Fruchet <hugues.fruchet@foss.st.com>
M: Alain Volmat <alain.volmat@foss.st.com>
L: linux-media@vger.kernel.org
S: Supported
T: git git://linuxtv.org/media_tree.git
F: Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml
F: drivers/media/platform/stm32/stm32-dcmipp/*
MEDIA INPUT INFRASTRUCTURE (V4L/DVB)
M: Mauro Carvalho Chehab <mchehab@kernel.org>
L: linux-media@vger.kernel.org

View File

@ -48,7 +48,6 @@ struct dcmipp_device {
/* Hardware resources */
struct reset_control *rstc;
void __iomem *regs;
struct clk *mclk;
struct clk *kclk;
/* The pipeline configuration */
@ -621,7 +620,6 @@ static __maybe_unused int dcmipp_runtime_suspend(struct device *dev)
struct dcmipp_device *dcmipp = dev_get_drvdata(dev);
clk_disable_unprepare(dcmipp->kclk);
clk_disable_unprepare(dcmipp->mclk);
return 0;
}
@ -631,10 +629,6 @@ static __maybe_unused int dcmipp_runtime_resume(struct device *dev)
struct dcmipp_device *dcmipp = dev_get_drvdata(dev);
int ret;
ret = clk_prepare_enable(dcmipp->mclk);
if (ret)
dev_err(dev, "%s: Failed to prepare_enable clock\n", __func__);
ret = clk_prepare_enable(dcmipp->kclk);
if (ret)
dev_err(dev, "%s: Failed to prepare_enable k clock\n", __func__);

View File

@ -234,7 +234,7 @@ static void dcmipp_par_adjust_fmt(struct dcmipp_par_device *par,
fmt->code = fmt_default.code;
/* Exclude JPEG if BT656 bus is selected */
if (vpix->code_sink == MEDIA_BUS_FMT_JPEG_1X8 &&
if (vpix && vpix->code_sink == MEDIA_BUS_FMT_JPEG_1X8 &&
par->ved.bus_type == V4L2_MBUS_BT656)
fmt->code = fmt_default.code;