lkml.org 
[lkml]   [2013]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 1/4] phy: Add provision for tuning phy.
Hi,

On Tue, Dec 10, 2013 at 04:25:23PM +0530, Vivek Gautam wrote:
> Some PHY controllers may need to tune PHY post-initialization,
> so that the PHY consumers can call phy-tuning at appropriate
> point of time.
>
> Signed-off-by: vivek Gautam <gautam.vivek@samsung.com>
> ---
> drivers/phy/phy-core.c | 20 ++++++++++++++++++++
> include/linux/phy/phy.h | 7 +++++++
> 2 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 03cf8fb..68dbb90 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -239,6 +239,26 @@ out:
> }
> EXPORT_SYMBOL_GPL(phy_power_off);
>
> +int phy_tune(struct phy *phy)
> +{
> + int ret = -ENOTSUPP;
> +
> + mutex_lock(&phy->mutex);
> + if (phy->ops->tune) {
> + ret = phy->ops->tune(phy);
> + if (ret < 0) {
> + dev_err(&phy->dev, "phy tuning failed --> %d\n", ret);
> + goto out;
> + }
> + }
> +
> +out:
> + mutex_unlock(&phy->mutex);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL_GPL(phy_tune);

I think "setup" instead of "tune" is much more clear and reusable.

Thanks,

--
heikki


\
 
 \ /
  Last update: 2013-12-10 15:21    [W:0.127 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site