From patchwork Thu Mar 14 05:50:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 2267661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 2583C3FC8A for ; Thu, 14 Mar 2013 05:57:41 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UG184-0002mT-6R; Thu, 14 Mar 2013 05:55:04 +0000 Received: from co9ehsobe004.messaging.microsoft.com ([207.46.163.27] helo=co9outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UG14h-0000xm-4I for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2013 05:51:36 +0000 Received: from mail215-co9-R.bigfish.com (10.236.132.225) by CO9EHSOBE009.bigfish.com (10.236.130.72) with Microsoft SMTP Server id 14.1.225.23; Thu, 14 Mar 2013 05:51:33 +0000 Received: from mail215-co9 (localhost [127.0.0.1]) by mail215-co9-R.bigfish.com (Postfix) with ESMTP id 0B6582201E6; Thu, 14 Mar 2013 05:51:33 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h1354h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) Received: from mail215-co9 (localhost.localdomain [127.0.0.1]) by mail215-co9 (MessageSwitch) id 1363240291108847_4455; Thu, 14 Mar 2013 05:51:31 +0000 (UTC) Received: from CO9EHSMHS011.bigfish.com (unknown [10.236.132.241]) by mail215-co9.bigfish.com (Postfix) with ESMTP id 0D3D148004C; Thu, 14 Mar 2013 05:51:31 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS011.bigfish.com (10.236.130.21) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 14 Mar 2013 05:51:30 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.2.328.11; Thu, 14 Mar 2013 05:51:29 +0000 Received: from localhost.localdomain (nchen-desktop.ap.freescale.net [10.192.242.40]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r2E5ohls001281; Wed, 13 Mar 2013 22:51:25 -0700 From: Peter Chen To: Subject: [PATCH 09/14] usb: pch_udc: using common vbus_active Date: Thu, 14 Mar 2013 13:50:37 +0800 Message-ID: <1363240242-25775-10-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1363240242-25775-1-git-send-email-peter.chen@freescale.com> References: <1363240242-25775-1-git-send-email-peter.chen@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130314_015135_558966_02ED328A X-CRM114-Status: GOOD ( 11.34 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.46.163.27 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: stigge@antcom.de, kgene.kim@samsung.com, eric.y.miao@gmail.com, alexander.shishkin@linux.intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, haojian.zhuang@gmail.com, chao.xie@marvell.com, ben-linux@fluff.org, yuxu@marvell.com, leoli@freescale.com, plagnioj@jcrosoft.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Using common vbus_active to indicate vbus status CC: Felipe Balbi Signed-off-by: Peter Chen --- drivers/usb/gadget/pch_udc.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c index a787a8e..f49d0d2 100644 --- a/drivers/usb/gadget/pch_udc.c +++ b/drivers/usb/gadget/pch_udc.c @@ -333,7 +333,6 @@ struct pch_vbus_gpio_data { * @registered: driver regsitered with system * @suspended: driver in suspended state * @connected: gadget driver associated - * @vbus_session: required vbus_session state * @set_cfg_not_acked: pending acknowledgement 4 setup * @waiting_zlp_ack: pending acknowledgement 4 ZLP * @data_requests: DMA pool for data requests @@ -361,7 +360,6 @@ struct pch_udc_dev { registered:1, suspended:1, connected:1, - vbus_session:1, set_cfg_not_acked:1, waiting_zlp_ack:1; struct pci_pool *data_requests; @@ -614,7 +612,7 @@ static inline void pch_udc_vbus_session(struct pch_udc_dev *dev, { if (is_active) { pch_udc_reconnect(dev); - dev->vbus_session = 1; + dev->gadget.vbus_active = 1; } else { if (dev->driver && dev->driver->disconnect) { spin_unlock(&dev->lock); @@ -622,7 +620,7 @@ static inline void pch_udc_vbus_session(struct pch_udc_dev *dev, spin_lock(&dev->lock); } pch_udc_set_disconnect(dev); - dev->vbus_session = 0; + dev->gadget.vbus_active = 0; } } @@ -2745,7 +2743,7 @@ static void pch_udc_dev_isr(struct pch_udc_dev *dev, u32 dev_intr) } vbus = pch_vbus_gpio_get_value(dev); - if ((dev->vbus_session == 0) + if ((dev->gadget.vbus_active == 0) && (vbus != 1)) { if (dev->driver && dev->driver->disconnect) { spin_unlock(&dev->lock); @@ -2753,7 +2751,7 @@ static void pch_udc_dev_isr(struct pch_udc_dev *dev, u32 dev_intr) spin_lock(&dev->lock); } pch_udc_reconnect(dev); - } else if ((dev->vbus_session == 0) + } else if ((dev->gadget.vbus_active == 0) && (vbus == 1) && !dev->vbus_gpio.intr) schedule_work(&dev->vbus_gpio.irq_work_fall);