Re: [PATCH 08/17] media: camss: csid-170: set the right HALF_CMD when disabled

From: Robert Foss
Date: Thu May 20 2021 - 08:19:28 EST


Hey Jonathan,

On Tue, 11 May 2021 at 20:08, Jonathan Marek <jonathan@xxxxxxxx> wrote:
>
> Use the "HALT_CMD_RESUME_AT_FRAME_BOUNDARY" define instead of a "1" which
> is otherwise confusing, and add a "HALT_CMD_HALT_AT_FRAME_BOUNDARY" which
> is set when disabling.
>
> Fixes: eebe6d00e9bf ("media: camss: Add support for CSID hardware version Titan 170")
> Signed-off-by: Jonathan Marek <jonathan@xxxxxxxx>
> ---
> drivers/media/platform/qcom/camss/camss-csid-170.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-csid-170.c b/drivers/media/platform/qcom/camss/camss-csid-170.c
> index af134ded241d..9f6334fd68fc 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid-170.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid-170.c
> @@ -105,7 +105,8 @@
> #define CSID_RDI_CTRL(rdi) ((IS_LITE ? 0x208 : 0x308)\
> + 0x100 * (rdi))
> #define RDI_CTRL_HALT_CMD 0
> -#define ALT_CMD_RESUME_AT_FRAME_BOUNDARY 1
> +#define HALT_CMD_HALT_AT_FRAME_BOUNDARY 0
> +#define HALT_CMD_RESUME_AT_FRAME_BOUNDARY 1
> #define RDI_CTRL_HALT_MODE 2
>
> #define CSID_RDI_FRM_DROP_PATTERN(rdi) ((IS_LITE ? 0x20C : 0x30C)\
> @@ -443,7 +444,10 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable)
> val |= 1 << CSI2_RX_CFG1_MISR_EN;
> writel_relaxed(val, csid->base + CSID_CSI2_RX_CFG1);
>
> - val = 1 << RDI_CTRL_HALT_CMD;
> + if (enable)
> + val = HALT_CMD_RESUME_AT_FRAME_BOUNDARY << RDI_CTRL_HALT_CMD;
> + else
> + val = HALT_CMD_HALT_AT_FRAME_BOUNDARY << RDI_CTRL_HALT_CMD;
> writel_relaxed(val, csid->base + CSID_RDI_CTRL(0));

Reviewed-by: Robert Foss <robert.foss@xxxxxxxxxx>