From patchwork Wed Aug 11 10:02:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 118786 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7BA2iOT001271 for ; Wed, 11 Aug 2010 10:02:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932810Ab0HKKCk (ORCPT ); Wed, 11 Aug 2010 06:02:40 -0400 Received: from smtp.nokia.com ([192.100.122.233]:30208 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753044Ab0HKKCj (ORCPT ); Wed, 11 Aug 2010 06:02:39 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o7BA1too016698; Wed, 11 Aug 2010 13:02:29 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Aug 2010 13:02:19 +0300 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Aug 2010 13:02:17 +0300 Received: from scadufax.research.nokia.com (esdhcp041223.research.nokia.com [172.21.41.223]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o7BA2AUH030946; Wed, 11 Aug 2010 13:02:11 +0300 From: felipe.balbi@nokia.com To: Greg KH Cc: Tony Lindgren , Linux OMAP Mailing List , Linux USB Mailing List , David Brownell , Felipe Balbi Subject: [PATCH] usb: otg: twl4030: fix wrong assumption of starting state Date: Wed, 11 Aug 2010 13:02:32 +0300 Message-Id: <1281520952-27981-1-git-send-email-felipe.balbi@nokia.com> X-Mailer: git-send-email 1.7.2.1.6.g61bf12 X-OriginalArrivalTime: 11 Aug 2010 10:02:17.0615 (UTC) FILETIME=[47D4F1F0:01CB393C] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 11 Aug 2010 10:02:45 +0000 (UTC) diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index 0e88885..05aaac1 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c @@ -550,6 +550,7 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) struct twl4030_usb_data *pdata = pdev->dev.platform_data; struct twl4030_usb *twl; int status, err; + u8 pwr; if (!pdata) { dev_dbg(&pdev->dev, "platform_data not available\n"); @@ -568,7 +569,10 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) twl->otg.set_peripheral = twl4030_set_peripheral; twl->otg.set_suspend = twl4030_set_suspend; twl->usb_mode = pdata->usb_mode; - twl->asleep = 1; + + pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); + + twl->asleep = (pwr & PHY_PWR_PHYPWD); /* init spinlock for workqueue */ spin_lock_init(&twl->lock);