diff mbox

[13/21] usb: chipidea: msm: Allow core to get usb phy

Message ID 20160626072838.28082-14-stephen.boyd@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Stephen Boyd June 26, 2016, 7:28 a.m. UTC
The chipidea core gets the usb phy and initializes the phy at the
right point now so we don't need to get the phy in this driver.

Cc: Peter Chen <peter.chen@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
---
 drivers/usb/chipidea/ci_hdrc_msm.c | 21 ---------------------
 1 file changed, 21 deletions(-)

Comments

Peter Chen June 29, 2016, 6:48 a.m. UTC | #1
On Sun, Jun 26, 2016 at 12:28:30AM -0700, Stephen Boyd wrote:
> The chipidea core gets the usb phy and initializes the phy at the
> right point now so we don't need to get the phy in this driver.
> 
> Cc: Peter Chen <peter.chen@nxp.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
> ---
>  drivers/usb/chipidea/ci_hdrc_msm.c | 21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
> index 430856ef1be3..07cccd24a87f 100644
> --- a/drivers/usb/chipidea/ci_hdrc_msm.c
> +++ b/drivers/usb/chipidea/ci_hdrc_msm.c
> @@ -24,15 +24,6 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
>  		dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
>  		/* use AHB transactor, allow posted data writes */
>  		hw_write_id_reg(ci, HS_PHY_AHB_MODE, 0xffffffff, 0x8);
> -		usb_phy_init(ci->usb_phy);
> -		break;
> -	case CI_HDRC_CONTROLLER_STOPPED_EVENT:
> -		dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");
> -		/*
> -		 * Put the phy in non-driving mode. Otherwise host
> -		 * may not detect soft-disconnection.
> -		 */
> -		usb_phy_notify_disconnect(ci->usb_phy, USB_SPEED_UNKNOWN);
>  		break;
>  	default:
>  		dev_dbg(dev, "unknown ci_hdrc event\n");
> @@ -53,21 +44,9 @@ static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = {
>  static int ci_hdrc_msm_probe(struct platform_device *pdev)
>  {
>  	struct platform_device *plat_ci;
> -	struct usb_phy *phy;
>  
>  	dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n");
>  
> -	/*
> -	 * OTG(PHY) driver takes care of PHY initialization, clock management,
> -	 * powering up VBUS, mapping of registers address space and power
> -	 * management.
> -	 */
> -	phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
> -	if (IS_ERR(phy))
> -		return PTR_ERR(phy);
> -
> -	ci_hdrc_msm_platdata.usb_phy = phy;
> -
>  	plat_ci = ci_hdrc_add_device(&pdev->dev,
>  				pdev->resource, pdev->num_resources,
>  				&ci_hdrc_msm_platdata);
> -- 

Acked-by: Peter Chen <peter.chen@nxp.com>
Peter Chen June 29, 2016, 11:34 a.m. UTC | #2
On Wed, Jun 29, 2016 at 02:48:11PM +0800, Peter Chen wrote:
> On Sun, Jun 26, 2016 at 12:28:30AM -0700, Stephen Boyd wrote:
> > The chipidea core gets the usb phy and initializes the phy at the
> > right point now so we don't need to get the phy in this driver.
> > 
> > Cc: Peter Chen <peter.chen@nxp.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
> > ---
> >  drivers/usb/chipidea/ci_hdrc_msm.c | 21 ---------------------
> >  1 file changed, 21 deletions(-)
> > 
> > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
> > index 430856ef1be3..07cccd24a87f 100644
> > --- a/drivers/usb/chipidea/ci_hdrc_msm.c
> > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c
> > @@ -24,15 +24,6 @@ static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
> >  		dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
> >  		/* use AHB transactor, allow posted data writes */
> >  		hw_write_id_reg(ci, HS_PHY_AHB_MODE, 0xffffffff, 0x8);
> > -		usb_phy_init(ci->usb_phy);
> > -		break;
> > -	case CI_HDRC_CONTROLLER_STOPPED_EVENT:
> > -		dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");
> > -		/*
> > -		 * Put the phy in non-driving mode. Otherwise host
> > -		 * may not detect soft-disconnection.
> > -		 */
> > -		usb_phy_notify_disconnect(ci->usb_phy, USB_SPEED_UNKNOWN);
> >  		break;
> >  	default:
> >  		dev_dbg(dev, "unknown ci_hdrc event\n");
> > @@ -53,21 +44,9 @@ static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = {
> >  static int ci_hdrc_msm_probe(struct platform_device *pdev)
> >  {
> >  	struct platform_device *plat_ci;
> > -	struct usb_phy *phy;
> >  
> >  	dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n");
> >  
> > -	/*
> > -	 * OTG(PHY) driver takes care of PHY initialization, clock management,
> > -	 * powering up VBUS, mapping of registers address space and power
> > -	 * management.
> > -	 */
> > -	phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
> > -	if (IS_ERR(phy))
> > -		return PTR_ERR(phy);
> > -
> > -	ci_hdrc_msm_platdata.usb_phy = phy;
> > -
> >  	plat_ci = ci_hdrc_add_device(&pdev->dev,
> >  				pdev->resource, pdev->num_resources,
> >  				&ci_hdrc_msm_platdata);
> > -- 
> 

Wait, how about the UTMI PHY? You don't have a platform which needs
to get PHY through the phandle?
Stephen Boyd June 29, 2016, 7:31 p.m. UTC | #3
Quoting Peter Chen (2016-06-29 04:34:11)
> On Wed, Jun 29, 2016 at 02:48:11PM +0800, Peter Chen wrote:
> > On Sun, Jun 26, 2016 at 12:28:30AM -0700, Stephen Boyd wrote:
> > > @@ -53,21 +44,9 @@ static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = {
> > >  static int ci_hdrc_msm_probe(struct platform_device *pdev)
> > >  {
> > >     struct platform_device *plat_ci;
> > > -   struct usb_phy *phy;
> > >  
> > >     dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n");
> > >  
> > > -   /*
> > > -    * OTG(PHY) driver takes care of PHY initialization, clock management,
> > > -    * powering up VBUS, mapping of registers address space and power
> > > -    * management.
> > > -    */
> > > -   phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
> > > -   if (IS_ERR(phy))
> > > -           return PTR_ERR(phy);
> > > -
> > > -   ci_hdrc_msm_platdata.usb_phy = phy;
> > > -
> > >     plat_ci = ci_hdrc_add_device(&pdev->dev,
> > >                             pdev->resource, pdev->num_resources,
> > >                             &ci_hdrc_msm_platdata);
> > > -- 
> > 
> 
> Wait, how about the UTMI PHY? You don't have a platform which needs
> to get PHY through the phandle?

Sorry I don't understand the question. What is the UTMI PHY? We need to
get the phy through phandles. The only boards that are using ci_hdrc_msm
are DT enabled boards.
Peter Chen June 30, 2016, 1:43 a.m. UTC | #4
On Wed, Jun 29, 2016 at 12:31:18PM -0700, Stephen Boyd wrote:
> Quoting Peter Chen (2016-06-29 04:34:11)
> > On Wed, Jun 29, 2016 at 02:48:11PM +0800, Peter Chen wrote:
> > > On Sun, Jun 26, 2016 at 12:28:30AM -0700, Stephen Boyd wrote:
> > > > @@ -53,21 +44,9 @@ static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = {
> > > >  static int ci_hdrc_msm_probe(struct platform_device *pdev)
> > > >  {
> > > >     struct platform_device *plat_ci;
> > > > -   struct usb_phy *phy;
> > > >  
> > > >     dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n");
> > > >  
> > > > -   /*
> > > > -    * OTG(PHY) driver takes care of PHY initialization, clock management,
> > > > -    * powering up VBUS, mapping of registers address space and power
> > > > -    * management.
> > > > -    */
> > > > -   phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
> > > > -   if (IS_ERR(phy))
> > > > -           return PTR_ERR(phy);
> > > > -
> > > > -   ci_hdrc_msm_platdata.usb_phy = phy;
> > > > -
> > > >     plat_ci = ci_hdrc_add_device(&pdev->dev,
> > > >                             pdev->resource, pdev->num_resources,
> > > >                             &ci_hdrc_msm_platdata);
> > > > -- 
> > > 
> > 
> > Wait, how about the UTMI PHY? You don't have a platform which needs
> > to get PHY through the phandle?
> 
> Sorry I don't understand the question. What is the UTMI PHY? We need to
> get the phy through phandles. The only boards that are using ci_hdrc_msm
> are DT enabled boards.

UTMI PHY is the PHY inside the SoC, I just want to confirm all your PHYs
are at ulpi bus, if they are, you can do that, else, you may need above
way to get the PHY through PHY node.
diff mbox

Patch

diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
index 430856ef1be3..07cccd24a87f 100644
--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -24,15 +24,6 @@  static void ci_hdrc_msm_notify_event(struct ci_hdrc *ci, unsigned event)
 		dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
 		/* use AHB transactor, allow posted data writes */
 		hw_write_id_reg(ci, HS_PHY_AHB_MODE, 0xffffffff, 0x8);
-		usb_phy_init(ci->usb_phy);
-		break;
-	case CI_HDRC_CONTROLLER_STOPPED_EVENT:
-		dev_dbg(dev, "CI_HDRC_CONTROLLER_STOPPED_EVENT received\n");
-		/*
-		 * Put the phy in non-driving mode. Otherwise host
-		 * may not detect soft-disconnection.
-		 */
-		usb_phy_notify_disconnect(ci->usb_phy, USB_SPEED_UNKNOWN);
 		break;
 	default:
 		dev_dbg(dev, "unknown ci_hdrc event\n");
@@ -53,21 +44,9 @@  static struct ci_hdrc_platform_data ci_hdrc_msm_platdata = {
 static int ci_hdrc_msm_probe(struct platform_device *pdev)
 {
 	struct platform_device *plat_ci;
-	struct usb_phy *phy;
 
 	dev_dbg(&pdev->dev, "ci_hdrc_msm_probe\n");
 
-	/*
-	 * OTG(PHY) driver takes care of PHY initialization, clock management,
-	 * powering up VBUS, mapping of registers address space and power
-	 * management.
-	 */
-	phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
-	if (IS_ERR(phy))
-		return PTR_ERR(phy);
-
-	ci_hdrc_msm_platdata.usb_phy = phy;
-
 	plat_ci = ci_hdrc_add_device(&pdev->dev,
 				pdev->resource, pdev->num_resources,
 				&ci_hdrc_msm_platdata);