From patchwork Mon Oct 20 10:45:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 39042 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A80B7203C5 for ; Mon, 20 Oct 2014 10:46:19 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf2330606wgh.4 for ; Mon, 20 Oct 2014 03:46:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=MbrwNUnXzatkmF/3GhdQbFe+lML5W7mN5Jx3SDhDESQ=; b=AineuKIuvXpGuBXOZuyvV7oobKQpCynh5SBflmiV7m3a7YLwNR7PXijEN4Hdtn4LWS o2rT28r67w5+qQiiY4VDxoHz8hedV1n/jTyyALtw12UBfMPiExhxFV1bQuQ3PZnipRyu ROYNquHvTQWwJDo+DBxBHAknom2WcETZ8EaIQHTl2P78m0E+c7rWRjl4sKaO/5zLL4xp aSCZVO8878tZr4XVbcyWQKmDi6Rl3M1SibvpEWdhGuhci0o8a7Xq83x7b9pZWTD0+yJL C/jnWc2C+3kwiu97Cn3ptp1lokDJO17wnG1OIge/SyeW7rC35F4p6XEgP3hU9b4O+unR 2fIQ== X-Gm-Message-State: ALoCoQk1hUuibEvG63uU8C8iNWmwut8WmHyLYHAcXg3MhIt1hosUivYvZBFmuojGr51w4kzrnNKl X-Received: by 10.112.225.135 with SMTP id rk7mr3915351lbc.6.1413801978867; Mon, 20 Oct 2014 03:46:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.167 with SMTP id uf7ls428777lac.100.gmail; Mon, 20 Oct 2014 03:46:18 -0700 (PDT) X-Received: by 10.112.161.9 with SMTP id xo9mr2634385lbb.62.1413801978723; Mon, 20 Oct 2014 03:46:18 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id rm7si13715741lbb.55.2014.10.20.03.46.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Oct 2014 03:46:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id l4so3618967lbv.38 for ; Mon, 20 Oct 2014 03:46:18 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr26449974laa.71.1413801978645; Mon, 20 Oct 2014 03:46:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp278600lbz; Mon, 20 Oct 2014 03:46:17 -0700 (PDT) X-Received: by 10.68.249.133 with SMTP id yu5mr4586192pbc.31.1413801977188; Mon, 20 Oct 2014 03:46:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si7471476pdl.134.2014.10.20.03.46.16 for ; Mon, 20 Oct 2014 03:46:17 -0700 (PDT) Received-SPF: none (google.com: linux-samsung-soc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753657AbaJTKqP (ORCPT + 6 others); Mon, 20 Oct 2014 06:46:15 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:16259 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753522AbaJTKpw (ORCPT ); Mon, 20 Oct 2014 06:45:52 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDQ00MY8OP4PZ10@mailout2.w1.samsung.com>; Mon, 20 Oct 2014 11:48:40 +0100 (BST) X-AuditID: cbfec7f5-b7f956d000005ed7-49-5444e7df4eb9 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 81.92.24279.FD7E4445; Mon, 20 Oct 2014 11:45:51 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NDQ009U7OK7MS20@eusync4.samsung.com>; Mon, 20 Oct 2014 11:45:51 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Felipe Balbi , Kyungmin Park , Robert Baldyga , Paul Zimmerman , Krzysztof Kozlowski Subject: [PATCH v2 07/10] usb: dwc2/gadget: move phy control calls out of pullup() method Date: Mon, 20 Oct 2014 12:45:37 +0200 Message-id: <1413801940-31086-8-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1413801940-31086-1-git-send-email-m.szyprowski@samsung.com> References: <1413801940-31086-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMJMWRmVeSWpSXmKPExsVy+t/xa7r3n7uEGHRdFbI4eL/e4vULQ4uz TW/YLWac38dksWhZK7PF2iN32S22T5nOZPHg8E52Bw6Pvi2rGD227P/M6HH8xnYmj8+b5AJY orhsUlJzMstSi/TtErgy1j68xFSwnaeic9JXlgbGHVxdjJwcEgImEvO3nWWCsMUkLtxbz9bF yMUhJLCUUWL51zfsEE4fk8T1+ZuZQarYBAwlut52sYHYIgIOEkuW3gGzmQV+MkpMnmoDYgsL REt0/e1m7WLk4GARUJXonCMNEuYV8JDYsOgSK8QyOYn/L1eALeYU8JR482IaI4gtBFSzaflL lgmMvAsYGVYxiqaWJhcUJ6XnGukVJ+YWl+al6yXn525ihATU1x2MS49ZHWIU4GBU4uHdYeYS IsSaWFZcmXuIUYKDWUmEt/s2UIg3JbGyKrUoP76oNCe1+BAjEwenVAPjtshyrg0bHqXPKDe4 WG31OPXZgiXLLvWLaGpNjAqrMV6+6UO60ikj+6eWqyvvh04oVqrfrt5o1Sq1dltyfS/D/79n dZLW5vf5MgSu6Hx6VOXI7A2NxdsYi5RDGe+l2Jn8dZvauu9ImL0T+/znfvd3TnrPlnXe4Qrr 3EJznh1uHIu78ryu6icqsRRnJBpqMRcVJwIA/d8PZgYCAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch moves phy enable/disable calls from pullup() method to udc_start/stop functions. This solves the issue related to limited caller context for PHY functions, because they cannot be called from non-sleeping context. This is also a preparation for using soft-disconnect feature of udc controller in pullup() method. Signed-off-by: Marek Szyprowski Acked-by: Paul Zimmerman --- drivers/usb/dwc2/gadget.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 5eb2473031c4..98adf8d17493 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2919,6 +2919,8 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget, goto err; } + s3c_hsotg_phy_enable(hsotg); + dev_info(hsotg->dev, "bound driver %s\n", driver->driver.name); return 0; @@ -2955,6 +2957,8 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget, spin_unlock_irqrestore(&hsotg->lock, flags); + s3c_hsotg_phy_disable(hsotg); + regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); clk_disable(hsotg->clk); @@ -2989,13 +2993,11 @@ static int s3c_hsotg_pullup(struct usb_gadget *gadget, int is_on) spin_lock_irqsave(&hsotg->lock, flags); if (is_on) { - s3c_hsotg_phy_enable(hsotg); clk_enable(hsotg->clk); s3c_hsotg_core_init_disconnected(hsotg); s3c_hsotg_core_connect(hsotg); } else { clk_disable(hsotg->clk); - s3c_hsotg_phy_disable(hsotg); } hsotg->gadget.speed = USB_SPEED_UNKNOWN;