linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: <gregkh@linuxfoundation.org>
Cc: <kishon@ti.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 11/22] usb: phy: twl4030-usb: Simplify phy init to use runtime PM
Date: Wed, 24 Sep 2014 19:17:09 +0530	[thread overview]
Message-ID: <1411566440-19169-12-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1411566440-19169-1-git-send-email-kishon@ti.com>

From: Tony Lindgren <tony@atomide.com>

We can now let the interrupt and delayed work do all that's
needed with runtime PM.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/phy/phy-twl4030-usb.c |   20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index bc28ecc..a292db0 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -471,16 +471,8 @@ static int twl4030_phy_power_on(struct phy *phy)
 	twl4030_usb_set_mode(twl, twl->usb_mode);
 	if (twl->usb_mode == T2_USB_MODE_ULPI)
 		twl4030_i2c_access(twl, 0);
+	schedule_delayed_work(&twl->id_workaround_work, 0);
 
-	/*
-	 * XXX When VBUS gets driven after musb goes to A mode,
-	 * ID_PRES related interrupts no longer arrive, why?
-	 * Register itself is updated fine though, so we must poll.
-	 */
-	if (twl->linkstat == OMAP_MUSB_ID_GROUND) {
-		cancel_delayed_work(&twl->id_workaround_work);
-		schedule_delayed_work(&twl->id_workaround_work, HZ);
-	}
 	return 0;
 }
 
@@ -612,16 +604,9 @@ static void twl4030_id_workaround_work(struct work_struct *work)
 static int twl4030_phy_init(struct phy *phy)
 {
 	struct twl4030_usb *twl = phy_get_drvdata(phy);
-	enum omap_musb_vbus_id_status status;
 
 	pm_runtime_get_sync(twl->dev);
-	status = twl4030_usb_linkstat(twl);
-	twl->linkstat = status;
-
-	if (status == OMAP_MUSB_ID_GROUND || status == OMAP_MUSB_VBUS_VALID)
-		omap_musb_mailbox(twl->linkstat);
-
-	sysfs_notify(&twl->dev->kobj, NULL, "vbus");
+	schedule_delayed_work(&twl->id_workaround_work, 0);
 	pm_runtime_mark_last_busy(twl->dev);
 	pm_runtime_put_autosuspend(twl->dev);
 
@@ -698,6 +683,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 	twl->dev		= &pdev->dev;
 	twl->irq		= platform_get_irq(pdev, 0);
 	twl->vbus_supplied	= false;
+	twl->linkstat		= -EINVAL;
 	twl->asleep		= 1;
 	twl->linkstat		= OMAP_MUSB_UNKNOWN;
 
-- 
1.7.9.5


  parent reply	other threads:[~2014-09-24 13:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 13:46 [GIT PULL 00/22] PHY: for 3.18 Kishon Vijay Abraham I
2014-09-24 13:46 ` [PATCH 01/22] phy: Renesas R-Car Gen2 PHY driver Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 02/22] phy: phy-omap-control: Remove unncessary site specific OOM messages Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 03/22] phy: phy-mvebu-sata: Add missing error check for devm_kzalloc Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 04/22] phy: phy-omap-usb2: Remove unncessary site specific OOM messages Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 05/22] phy: phy-ti-pipe3: " Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 06/22] phy: phy-spear1310-miphy: " Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 07/22] phy: phy-spear1340-miphy: " Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 08/22] phy: phy-spear1310-miphy: Use module_platform_driver to register driver Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 09/22] phy: phy-spear1340-miphy: " Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 10/22] usb: phy: twl4030-usb: Remove unused irq_enabled Kishon Vijay Abraham I
2014-09-24 13:47 ` Kishon Vijay Abraham I [this message]
2014-09-24 13:47 ` [PATCH 12/22] usb: phy: twl4030-usb: Move code from twl4030_phy_power to the runtime PM calls Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 13/22] usb: phy: twl4030-usb: Remove asleep and rely on runtime PM Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 14/22] usb: phy: twl4030-usb: Use mutex instead of spinlock for protecting the data Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 15/22] phy: phy-stih407-usb: Add usb picoPHY driver found on stih407 SoC family Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 16/22] phy: phy-stih407-usb: Add dt documentation for USB picophy " Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 17/22] MAINTAINERS: Add phy-stih407-usb.c file to ARCH/STI architecture Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 18/22] phy: phy-stih41x-usb: Add usb phy support for STiH41x SoCs Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 19/22] phy: phy-stih41x-usb: Add dt documentation for USB phy on STiH415/6 Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 20/22] MAINTAINERS: Add phy-stih41x-usb.c to ARCH/STI architecture Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 21/22] phy: exynos-dp-video: Use syscon support to control pmu register Kishon Vijay Abraham I
2014-09-24 13:47 ` [PATCH 22/22] phy: remove .owner field for drivers using module_platform_driver Kishon Vijay Abraham I
2014-09-25 12:17 ` [GIT PULL 00/22] PHY: for 3.18 Greg KH
2014-09-25 12:29   ` Kishon Vijay Abraham I

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=1411566440-19169-12-git-send-email-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).