[PATCH] media: stm32: csi: add missing SBGGR 10/12/14 bit formats
Alain Volmat
alain.volmat at foss.st.com
Thu Dec 3 11:52:44 PST 2026
Hi,
thanks for this patch.
On Wed, Dec 02, 2026 at 08:24:05PM -0600, Weidong Wang via B4 Relay wrote:
> From: Weidong Wang <weidongw at illinois.edu>
>
> The stm32_csi_formats[] table lists SRGGB10_1X10, SRGGB12_1X12 and
> SRGGB14_1X14 twice each, as both the first and the last entry of the
> 10, 12 and 14 bit Bayer groups, while the SBGGR variants are absent.
> The 8 bit group correctly starts with SBGGR8_1X8.
>
> As a result the SBGGR 10, 12 and 14 bit media bus codes are not
> enumerated, and stm32_csi_set_pad_format() replaces them with the
> default format since they are not found in the table, so a sensor
> producing such formats cannot be used with the CSI.
>
> Replace the first SRGGB entry of each group with the SBGGR one.
>
> Found by a static analysis tool.
>
> The fix and this changelog were drafted with AI assistance (Claude Code,
> with a second review by OpenAI Codex), then reviewed by the submitter.
>
> Fixes: dcb0f4c16be5 ("media: stm32: csi: addition of the STM32 CSI driver")
> Signed-off-by: Weidong Wang <weidongw at illinois.edu>
Reviewed-by: Alain Volmat <alain.volmat at foss.st.com>
Regards,
Alain
> ---
> Testing:
> - Compile-tested on x86_64 (allmodconfig, W=1):
> drivers/media/platform/st/stm32/stm32-csi.o; no new warnings.
> - checkpatch.pl --strict: no errors or warnings.
> ---
> drivers/media/platform/st/stm32/stm32-csi.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/st/stm32/stm32-csi.c b/drivers/media/platform/st/stm32/stm32-csi.c
> index e71142634a17..e7e8b9f22a33 100644
> --- a/drivers/media/platform/st/stm32/stm32-csi.c
> +++ b/drivers/media/platform/st/stm32/stm32-csi.c
> @@ -228,17 +228,17 @@ static const struct stm32_csi_fmts stm32_csi_formats[] = {
> FMT_MBUS_DT_DTFMT_BPP(SGRBG8_1X8, RAW8, BPP8, 8),
> FMT_MBUS_DT_DTFMT_BPP(SRGGB8_1X8, RAW8, BPP8, 8),
> /* 10 bit */
> - FMT_MBUS_DT_DTFMT_BPP(SRGGB10_1X10, RAW10, BPP10, 10),
> + FMT_MBUS_DT_DTFMT_BPP(SBGGR10_1X10, RAW10, BPP10, 10),
> FMT_MBUS_DT_DTFMT_BPP(SGBRG10_1X10, RAW10, BPP10, 10),
> FMT_MBUS_DT_DTFMT_BPP(SGRBG10_1X10, RAW10, BPP10, 10),
> FMT_MBUS_DT_DTFMT_BPP(SRGGB10_1X10, RAW10, BPP10, 10),
> /* 12 bit */
> - FMT_MBUS_DT_DTFMT_BPP(SRGGB12_1X12, RAW12, BPP12, 12),
> + FMT_MBUS_DT_DTFMT_BPP(SBGGR12_1X12, RAW12, BPP12, 12),
> FMT_MBUS_DT_DTFMT_BPP(SGBRG12_1X12, RAW12, BPP12, 12),
> FMT_MBUS_DT_DTFMT_BPP(SGRBG12_1X12, RAW12, BPP12, 12),
> FMT_MBUS_DT_DTFMT_BPP(SRGGB12_1X12, RAW12, BPP12, 12),
> /* 14 bit */
> - FMT_MBUS_DT_DTFMT_BPP(SRGGB14_1X14, RAW14, BPP14, 14),
> + FMT_MBUS_DT_DTFMT_BPP(SBGGR14_1X14, RAW14, BPP14, 14),
> FMT_MBUS_DT_DTFMT_BPP(SGBRG14_1X14, RAW14, BPP14, 14),
> FMT_MBUS_DT_DTFMT_BPP(SGRBG14_1X14, RAW14, BPP14, 14),
> FMT_MBUS_DT_DTFMT_BPP(SRGGB14_1X14, RAW14, BPP14, 14),
>
> ---
> base-commit: 37760be5a04b538bbd25099000e37d3208c27efe
> change-id: 20261202-kbug-l1928-03ab5c3db9a5
>
> Best regards,
> --
> Weidong Wang <weidongw at illinois.edu>
>
>
More information about the linux-arm-kernel
mailing list