lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/17] phy: samsung-ufs: ufs: Add SoC callbacks for calibration and clk data recovery
On Thu, Apr 04, 2024 at 01:25:52PM +0100, Peter Griffin wrote:
> diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
> index c567efafc30f..f57a2f2a415d 100644
> --- a/drivers/phy/samsung/phy-samsung-ufs.c
> +++ b/drivers/phy/samsung/phy-samsung-ufs.c
> @@ -46,7 +46,7 @@ static void samsung_ufs_phy_config(struct samsung_ufs_phy *phy,
> }
> }
>
> -static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
> +int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy, u8 lane)
> {
> struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
> const unsigned int timeout_us = 100000;
> @@ -98,8 +98,15 @@ static int samsung_ufs_phy_calibrate(struct phy *phy)
> }
> }
>
> - if (ufs_phy->ufs_phy_state == CFG_POST_PWR_HS)
> - err = samsung_ufs_phy_wait_for_lock_acq(phy);
> + for_each_phy_lane(ufs_phy, i) {
> + if (ufs_phy->ufs_phy_state == CFG_PRE_INIT &&
> + ufs_phy->drvdata->wait_for_cal)
> + err = ufs_phy->drvdata->wait_for_cal(phy, i);
> +
> + if (ufs_phy->ufs_phy_state == CFG_POST_PWR_HS &&
> + ufs_phy->drvdata->wait_for_cdr)
> + err = ufs_phy->drvdata->wait_for_cdr(phy, i);

The "err" value is only preserved from the last iteration in this loop.

regards,
dan carpenter

> + }
>
> /**
> * In Samsung ufshci, PHY need to be calibrated at different


\
 
 \ /
  Last update: 2024-04-17 11:52    [W:0.304 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site