[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <15b9b9e7-ae4f-2b40-4bf5-265534d4605e@ti.com>
Date: Fri, 5 Jan 2018 16:31:27 +0530
From: Kishon Vijay Abraham I <kishon@...com>
To: Manu Gautam <mgautam@...eaurora.org>
CC: Felipe Balbi <balbi@...nel.org>, <linux-arm-msm@...r.kernel.org>,
<linux-usb@...r.kernel.org>,
"open list:GENERIC PHY FRAMEWORK" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 14/16] phy: Add USB speed related PHY modes
Hi,
On Wednesday 03 January 2018 04:58 PM, Manu Gautam wrote:
> Add following USB speed related PHY modes:
> LS (Low Speed), FS (Full Speed), HS (High Speed), SS (Super Speed)
>
> Speed related information is required by some QCOM PHY drivers
> to program PHY monitor resume/remote-wakeup events in suspended
> state. Speed is needed in order to set correct polarity of wakeup
> events for detection. E.g. QUSB2 PHY monitors DP/DM line state
> depending on whether speed is LS or FS/HS to detect resume.
> Similarly QMP USB3 PHY in SS mode should monitor RX terminations
> attach/detach and LFPS events depending on SSPHY is active or not.
>
> Signed-off-by: Manu Gautam <mgautam@...eaurora.org>
> ---
> drivers/phy/phy-core.c | 15 +++++++++++++++
> include/linux/phy/phy.h | 32 ++++++++++++++++++++++++--------
> 2 files changed, 39 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index b4964b0..e4f0525 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -357,6 +357,21 @@ int phy_set_mode(struct phy *phy, enum phy_mode mode)
> }
> EXPORT_SYMBOL_GPL(phy_set_mode);
>
> +enum phy_mode phy_get_mode(struct phy *phy)
> +{
> + enum phy_mode ret;
> +
> + if (!phy || !phy->ops->get_mode)
> + return PHY_MODE_INVALID;
> +
> + mutex_lock(&phy->mutex);
> + ret = phy->ops->get_mode(phy);
Since get_mode only has to return the phy mode, there is no need for an ops
here. Just add phy_mode in phy_attrs in set_mode and return it here.
Thanks
Kishon
Powered by blists - more mailing lists