Skip to content

Commit f01241f

Browse files
Alain Volmatfourmone
authored andcommitted
media: stm32: dcmipp: reverse SWAPCYCLE behavior on MP13
The STM32MP13 dcmipp does not embed a SWAPYUV bit to exchange the Y and V component (compared to other dcmipp implementation) hence in case of parallel input the SWAPCYCLE behavior should also take care of this point to avoid getting swapped Y and U component when capturing from the DUMP pipe. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Change-Id: Ia531b67ec2387208bb0381db4e1691242f7bb6a2 Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/461924 Reviewed-by: Hugues FRUCHET <hugues.fruchet@st.com> Tested-by: Alain VOLMAT <alain.volmat@st.com> Reviewed-by: Alain VOLMAT <alain.volmat@st.com> Reviewed-by: Philippe CORNU <philippe.cornu@foss.st.com> ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com> ACI: CIBUILD <MDG-smet-aci-builds@list.st.com> Domain-Review: Philippe CORNU <philippe.cornu@foss.st.com>
1 parent a283845 commit f01241f

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-input.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,22 @@ static int dcmipp_inp_configure_parallel(struct dcmipp_inp_device *inp,
394394
val |= vpix->prcr_format << DCMIPP_PRCR_FORMAT_SHIFT;
395395

396396
/* swap cycles */
397-
if (vpix->prcr_swapcycles)
398-
val |= DCMIPP_PRCR_SWAPCYCLES;
397+
/*
398+
* PPCR SWAPYUV is not available on STM32MP13 so behavior regarding
399+
* to SWAPCYCLES should be reversed compared to other platforms for
400+
* YUV422 format
401+
*/
402+
if (of_device_is_compatible(inp->dev->of_node, "st,stm32mp13-dcmipp") &&
403+
(src_fmt->code == MEDIA_BUS_FMT_YUYV8_2X8 ||
404+
src_fmt->code == MEDIA_BUS_FMT_YVYU8_2X8 ||
405+
src_fmt->code == MEDIA_BUS_FMT_UYVY8_2X8 ||
406+
src_fmt->code == MEDIA_BUS_FMT_VYUY8_2X8)) {
407+
if (!vpix->prcr_swapcycles)
408+
val |= DCMIPP_PRCR_SWAPCYCLES;
409+
} else {
410+
if (vpix->prcr_swapcycles)
411+
val |= DCMIPP_PRCR_SWAPCYCLES;
412+
}
399413

400414
reg_write(inp, DCMIPP_PRCR, val);
401415

0 commit comments

Comments
 (0)