linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: <balbi@ti.com>, <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <tony@atomide.com>, <notasas@gmail.com>,
	Kishon Vijay Abraham I <kishon@ti.com>
Subject: [PATCH 5/5] usb: otg: twl4030: fix cold plug on OMAP3
Date: Wed, 13 Mar 2013 14:17:10 +0530	[thread overview]
Message-ID: <1363164430-19118-6-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1363164430-19118-1-git-send-email-kishon@ti.com>

Having twl4030_usb_phy_init() (detects if a cable is connected before
twl4030 is probed) in twl4030 probe makes cable connect events to be
missed by musb glue, since it gets loaded after twl4030. Having
twl4030_usb_phy_init as a usb_phy ops lets twl4030_usb_phy_init to be
called when glue is ready.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/otg/twl4030-usb.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
index 5b20bb4..4040124 100644
--- a/drivers/usb/otg/twl4030-usb.c
+++ b/drivers/usb/otg/twl4030-usb.c
@@ -565,8 +565,9 @@ static void twl4030_id_workaround_work(struct work_struct *work)
 	}
 }
 
-static void twl4030_usb_phy_init(struct twl4030_usb *twl)
+static int twl4030_usb_phy_init(struct usb_phy *phy)
 {
+	struct twl4030_usb *twl = phy_to_twl(phy);
 	enum omap_musb_vbus_id_status status;
 
 	/*
@@ -581,6 +582,7 @@ static void twl4030_usb_phy_init(struct twl4030_usb *twl)
 		omap_musb_mailbox(twl->linkstat);
 
 	sysfs_notify(&twl->dev->kobj, NULL, "vbus");
+	return 0;
 }
 
 static int twl4030_set_suspend(struct usb_phy *x, int suspend)
@@ -657,6 +659,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 	twl->phy.otg		= otg;
 	twl->phy.type		= USB_PHY_TYPE_USB2;
 	twl->phy.set_suspend	= twl4030_set_suspend;
+	twl->phy.init		= twl4030_usb_phy_init;
 
 	otg->phy		= &twl->phy;
 	otg->set_host		= twl4030_set_host;
@@ -696,8 +699,6 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 		return status;
 	}
 
-	twl4030_usb_phy_init(twl);
-
 	dev_info(&pdev->dev, "Initialized TWL4030 USB module\n");
 	return 0;
 }
-- 
1.7.10.4


  parent reply	other threads:[~2013-03-13  8:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13  8:47 [PATCH 0/5] usb: musb/otg: cleanup and fixes Kishon Vijay Abraham I
2013-03-13  8:47 ` [PATCH 1/5] usb: musb: omap: remove the check before calling otg_set_vbus Kishon Vijay Abraham I
2013-03-13  8:47 ` [PATCH 2/5] usb: musb: omap: always glue have the correct vbus/id status Kishon Vijay Abraham I
2013-03-13 21:59   ` Grazvydas Ignotas
2013-03-14  5:26     ` kishon
2013-03-13  8:47 ` [PATCH 3/5] usb: otg: twl4030: use devres API for regulator get and request irq Kishon Vijay Abraham I
2013-03-13  8:47 ` [PATCH 4/5] usb: musb: omap: add usb_phy_init in omap2430_musb_init Kishon Vijay Abraham I
2013-03-13  8:47 ` Kishon Vijay Abraham I [this message]
2013-03-13 22:00 ` [PATCH 0/5] usb: musb/otg: cleanup and fixes Grazvydas Ignotas
2013-03-20 13:12 ` Felipe Balbi
2013-03-20 15:22   ` kishon
2013-03-20 15:59     ` Felipe Balbi
2014-06-02  7:31 ` sarfaraz5286
2014-06-04  6:21   ` sarfaraz5286

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363164430-19118-6-git-send-email-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=notasas@gmail.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).