diff mbox series

[v3,13/15] media: qcom: camss: Support RDI3 for VFE 17x

Message ID 20230823104444.1954663-14-bryan.odonoghue@linaro.org
State Superseded
Headers show
Series [v3,01/15] media: qcom: camss: Amalgamate struct resource with struct resource_ispif | expand

Commit Message

Bryan O'Donoghue Aug. 23, 2023, 10:44 a.m. UTC
Some VFEs have four RDIs apiece. Right now the ISR code has a hard-coded
value which tops-out at RDI2 meaning only three RDIs can be utilised in
practice.

Extend out the various routines in camss-vfe-17x.c to support the higher
RDI count.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/camss/camss-vfe-170.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Laurent Pinchart Aug. 28, 2023, 7:03 p.m. UTC | #1
Hi Bryan,

Thank you for the patch.

On Wed, Aug 23, 2023 at 11:44:42AM +0100, Bryan O'Donoghue wrote:
> Some VFEs have four RDIs apiece. Right now the ISR code has a hard-coded
> value which tops-out at RDI2 meaning only three RDIs can be utilised in
> practice.
> 
> Extend out the various routines in camss-vfe-17x.c to support the higher
> RDI count.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/qcom/camss/camss-vfe-170.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-vfe-170.c b/drivers/media/platform/qcom/camss/camss-vfe-170.c
> index 8aa921400ded0..c2487a8196db7 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe-170.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe-170.c
> @@ -210,7 +210,8 @@ static void vfe_global_reset(struct vfe_device *vfe)
>  			 GLOBAL_RESET_CMD_IDLE_CGC	|
>  			 GLOBAL_RESET_CMD_RDI0		|
>  			 GLOBAL_RESET_CMD_RDI1		|
> -			 GLOBAL_RESET_CMD_RDI2;
> +			 GLOBAL_RESET_CMD_RDI2		|
> +			 GLOBAL_RESET_CMD_RDI3;
>  
>  	writel_relaxed(BIT(31), vfe->base + VFE_IRQ_MASK_0);
>  
> @@ -344,7 +345,7 @@ static void vfe_violation_read(struct vfe_device *vfe)
>  static irqreturn_t vfe_isr(int irq, void *dev)
>  {
>  	struct vfe_device *vfe = dev;
> -	u32 status0, status1, vfe_bus_status[3];
> +	u32 status0, status1, vfe_bus_status[VFE_LINE_NUM_MAX];
>  	int i, wm;
>  
>  	status0 = readl_relaxed(vfe->base + VFE_IRQ_STATUS_0);
> @@ -353,7 +354,7 @@ static irqreturn_t vfe_isr(int irq, void *dev)
>  	writel_relaxed(status0, vfe->base + VFE_IRQ_CLEAR_0);
>  	writel_relaxed(status1, vfe->base + VFE_IRQ_CLEAR_1);
>  
> -	for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++) {
> +	for (i = VFE_LINE_RDI0; i < vfe->line_num; i++) {
>  		vfe_bus_status[i] = readl_relaxed(vfe->base + VFE_BUS_IRQ_STATUS(i));
>  		writel_relaxed(vfe_bus_status[i], vfe->base + VFE_BUS_IRQ_CLEAR(i));
>  	}
> @@ -367,11 +368,11 @@ static irqreturn_t vfe_isr(int irq, void *dev)
>  	if (status0 & STATUS_0_RESET_ACK)
>  		vfe->isr_ops.reset_ack(vfe);
>  
> -	for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++)
> +	for (i = VFE_LINE_RDI0; i < vfe->line_num; i++)
>  		if (status0 & STATUS_0_RDI_REG_UPDATE(i))
>  			vfe->isr_ops.reg_update(vfe, i);
>  
> -	for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++)
> +	for (i = VFE_LINE_RDI0; i < vfe->line_num; i++)
>  		if (status0 & STATUS_1_RDI_SOF(i))
>  			vfe->isr_ops.sof(vfe, i);
>
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/camss/camss-vfe-170.c b/drivers/media/platform/qcom/camss/camss-vfe-170.c
index 8aa921400ded0..c2487a8196db7 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe-170.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe-170.c
@@ -210,7 +210,8 @@  static void vfe_global_reset(struct vfe_device *vfe)
 			 GLOBAL_RESET_CMD_IDLE_CGC	|
 			 GLOBAL_RESET_CMD_RDI0		|
 			 GLOBAL_RESET_CMD_RDI1		|
-			 GLOBAL_RESET_CMD_RDI2;
+			 GLOBAL_RESET_CMD_RDI2		|
+			 GLOBAL_RESET_CMD_RDI3;
 
 	writel_relaxed(BIT(31), vfe->base + VFE_IRQ_MASK_0);
 
@@ -344,7 +345,7 @@  static void vfe_violation_read(struct vfe_device *vfe)
 static irqreturn_t vfe_isr(int irq, void *dev)
 {
 	struct vfe_device *vfe = dev;
-	u32 status0, status1, vfe_bus_status[3];
+	u32 status0, status1, vfe_bus_status[VFE_LINE_NUM_MAX];
 	int i, wm;
 
 	status0 = readl_relaxed(vfe->base + VFE_IRQ_STATUS_0);
@@ -353,7 +354,7 @@  static irqreturn_t vfe_isr(int irq, void *dev)
 	writel_relaxed(status0, vfe->base + VFE_IRQ_CLEAR_0);
 	writel_relaxed(status1, vfe->base + VFE_IRQ_CLEAR_1);
 
-	for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++) {
+	for (i = VFE_LINE_RDI0; i < vfe->line_num; i++) {
 		vfe_bus_status[i] = readl_relaxed(vfe->base + VFE_BUS_IRQ_STATUS(i));
 		writel_relaxed(vfe_bus_status[i], vfe->base + VFE_BUS_IRQ_CLEAR(i));
 	}
@@ -367,11 +368,11 @@  static irqreturn_t vfe_isr(int irq, void *dev)
 	if (status0 & STATUS_0_RESET_ACK)
 		vfe->isr_ops.reset_ack(vfe);
 
-	for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++)
+	for (i = VFE_LINE_RDI0; i < vfe->line_num; i++)
 		if (status0 & STATUS_0_RDI_REG_UPDATE(i))
 			vfe->isr_ops.reg_update(vfe, i);
 
-	for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++)
+	for (i = VFE_LINE_RDI0; i < vfe->line_num; i++)
 		if (status0 & STATUS_1_RDI_SOF(i))
 			vfe->isr_ops.sof(vfe, i);