From patchwork Sun Mar 24 15:36:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 2326821 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B9DE73FDDA for ; Sun, 24 Mar 2013 15:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754097Ab3CXPhK (ORCPT ); Sun, 24 Mar 2013 11:37:10 -0400 Received: from mail-ea0-f169.google.com ([209.85.215.169]:50744 "EHLO mail-ea0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754049Ab3CXPhI (ORCPT ); Sun, 24 Mar 2013 11:37:08 -0400 Received: by mail-ea0-f169.google.com with SMTP id n15so364814ead.14 for ; Sun, 24 Mar 2013 08:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=jLD3HCnSRUi07kr0xWuYB4+PpXSADFOxOqmtJT5O8/c=; b=SSZgiKjkt9cvIZGQgHQsx+YstmQQBHLYsO6Fy/4gQOTFfEXy/k2wBmPHaIPy6MsTBr WRgECiy37jV4vmYtQS7jvFm4/dqsyZUPFfQYvvR4iiAqFMEJP2+JGNQjQ/ERrS6Ya4TB dT+Gr8mbCLqUGHcKcQxKW6N1TKYAI3mYMO3h+otmuniJb2LRBmWXfrGizCKbfDgbZVGc I96bE7V1VsMV2gHbTUIMjSdoRnQNvgk6zl+jlkX1JrYuILLfhAln+VTzwNYOD8y2wZpg /awq+mTzqIiDnbu9v1E2kKy1yK4XmIjCWocAm0BXWkY+vIj2IO8ONecF03IP58+E0kyL +VCw== X-Received: by 10.14.111.72 with SMTP id v48mr24972181eeg.11.1364139427473; Sun, 24 Mar 2013 08:37:07 -0700 (PDT) Received: from localhost.localdomain (ip-88-119-226-136.static.b4net.lt. [88.119.226.136]) by mx.google.com with ESMTPS id bc1sm2560964eeb.11.2013.03.24.08.37.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 Mar 2013 08:37:06 -0700 (PDT) From: Grazvydas Ignotas To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, Felipe Balbi , kishon , Grazvydas Ignotas Subject: [PATCHv3 3/3] usb: musb: gadget: use platform callback to enable vbus Date: Sun, 24 Mar 2013 17:36:55 +0200 Message-Id: <1364139415-16695-4-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364139415-16695-1-git-send-email-notasas@gmail.com> References: <1364139415-16695-1-git-send-email-notasas@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org On some platform configurations (like OMAP3+twl4030) it's the platform code that enables VBUS, not OTG transceiver, so call vbus platform callback instead, it will then call the transceiver if needed. This fixes a use case where USB cable is plugged first and gadget driver is loaded later after that. Signed-off-by: Grazvydas Ignotas --- drivers/usb/musb/musb_gadget.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index ff6ba3a..4be4865 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1848,9 +1848,8 @@ static int musb_gadget_start(struct usb_gadget *g, goto err; } - if ((musb->xceiv->last_event == USB_EVENT_ID) - && otg->set_vbus) - otg_set_vbus(otg, 1); + if (musb->xceiv->last_event == USB_EVENT_ID) + musb_platform_set_vbus(musb, 1); hcd->self.uses_pio_for_control = 1;