diff mbox

[MEDIA] i.MX6: Fix MIPI CSI-2 LP-11 check

Message ID m3k1zul2uu.fsf@t19.piap.pl (mailing list archive)
State New, archived
Headers show

Commit Message

Krzysztof Hałasa Oct. 17, 2017, 6:12 a.m. UTC
Bitmask for the MIPI CSI-2 data PHY status doesn't seem to be correct.
Fix it.

Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>

Comments

Philipp Zabel Oct. 17, 2017, 3:25 p.m. UTC | #1
On Tue, 2017-10-17 at 08:12 +0200, Krzysztof Hałasa wrote:
> Bitmask for the MIPI CSI-2 data PHY status doesn't seem to be correct.
> Fix it.
> 
> Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
> 
> --- a/drivers/staging/media/imx/imx6-mipi-csi2.c
> +++ b/drivers/staging/media/imx/imx6-mipi-csi2.c
> @@ -252,8 +252,8 @@ static int csi2_dphy_wait_stopstate(struct csi2_dev *csi2)
>  	u32 mask, reg;
>  	int ret;
>  
> -	mask = PHY_STOPSTATECLK |
> -		((csi2->bus.num_data_lanes - 1) << PHY_STOPSTATEDATA_BIT);
> +	mask = PHY_STOPSTATECLK | (((1 << csi2->bus.num_data_lanes) - 1) <<
> +				   PHY_STOPSTATEDATA_BIT);
>  
>  	ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg,
>  				 (reg & mask) == mask, 0, 500000);

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
Steve Longerbeam Oct. 17, 2017, 4:54 p.m. UTC | #2
On 10/16/2017 11:12 PM, Krzysztof Hałasa wrote:
> Bitmask for the MIPI CSI-2 data PHY status doesn't seem to be correct.
> Fix it.
>
> Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
>
> --- a/drivers/staging/media/imx/imx6-mipi-csi2.c
> +++ b/drivers/staging/media/imx/imx6-mipi-csi2.c
> @@ -252,8 +252,8 @@ static int csi2_dphy_wait_stopstate(struct csi2_dev *csi2)
>   	u32 mask, reg;
>   	int ret;
>   
> -	mask = PHY_STOPSTATECLK |
> -		((csi2->bus.num_data_lanes - 1) << PHY_STOPSTATEDATA_BIT);
> +	mask = PHY_STOPSTATECLK | (((1 << csi2->bus.num_data_lanes) - 1) <<
> +				   PHY_STOPSTATEDATA_BIT);
>   
>   	ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg,
>   				 (reg & mask) == mask, 0, 500000);
>

Thanks for catching.

Reviewed-by: Steve Longerbeam <steve_longerbeam@mentor.com>
diff mbox

Patch

--- a/drivers/staging/media/imx/imx6-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx6-mipi-csi2.c
@@ -252,8 +252,8 @@  static int csi2_dphy_wait_stopstate(struct csi2_dev *csi2)
 	u32 mask, reg;
 	int ret;
 
-	mask = PHY_STOPSTATECLK |
-		((csi2->bus.num_data_lanes - 1) << PHY_STOPSTATEDATA_BIT);
+	mask = PHY_STOPSTATECLK | (((1 << csi2->bus.num_data_lanes) - 1) <<
+				   PHY_STOPSTATEDATA_BIT);
 
 	ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg,
 				 (reg & mask) == mask, 0, 500000);