Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239AbeAELBf (ORCPT + 1 other); Fri, 5 Jan 2018 06:01:35 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:54298 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbeAELBd (ORCPT ); Fri, 5 Jan 2018 06:01:33 -0500 Subject: Re: [PATCH v4 14/16] phy: Add USB speed related PHY modes To: Manu Gautam References: <1514978930-31341-1-git-send-email-mgautam@codeaurora.org> <1514978930-31341-15-git-send-email-mgautam@codeaurora.org> CC: Felipe Balbi , , , "open list:GENERIC PHY FRAMEWORK" From: Kishon Vijay Abraham I Message-ID: <15b9b9e7-ae4f-2b40-4bf5-265534d4605e@ti.com> Date: Fri, 5 Jan 2018 16:31:27 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1514978930-31341-15-git-send-email-mgautam@codeaurora.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 > --- > 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