From patchwork Fri Oct 17 17:16:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38991 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 4CF99202DB for ; Fri, 17 Oct 2014 17:20:19 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf718974wgh.8 for ; Fri, 17 Oct 2014 10:20: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:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=jpMRffeSFidGOPPYbsnkVtkmPfOgk3yqgfmXsgU6Srs=; b=bd6wue2seUl16/v+OtniY8MLsqo8AAL5z7Miy87jLteU+wsQ6pS0nvluqs4D+bddkO tyKBmWfjIqnm+A2U65Ojh8y6NI2azpILR3bkZ96ZkKzDPdFEeDh6BgTiPovclsuN+YY3 q/n6912SoeWwJi9Xq12uHaJc1EfgNdz1grDrpb6+t3m9ishIipQq9jS5vv3wT6TYVNXb EuCyl7GMVeBJ8KIPSnwTmnch3fQ2S1FLBlYLBAxXMBy2WOwiFpNIaqoZIkHC9kVvzSxr iLw/HVd8620/OLuV/kcTyG+mxWCc+ZuNTGES3kUtBQwOKS60ta4BR3MrUDqjkpmIzxxm o0ng== X-Gm-Message-State: ALoCoQlzRtigkNXOfEmzy42UKz6ZROLfKvr2stjQHzzESFtIXnHq9FakJ27wQGPlMsVI732/3dkM X-Received: by 10.112.140.132 with SMTP id rg4mr652293lbb.12.1413566418520; Fri, 17 Oct 2014 10:20:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.130 with SMTP id z2ls279518laa.61.gmail; Fri, 17 Oct 2014 10:20:18 -0700 (PDT) X-Received: by 10.112.142.200 with SMTP id ry8mr10444719lbb.26.1413566418378; Fri, 17 Oct 2014 10:20: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 v1si2978496laz.94.2014.10.17.10.20.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:20: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 l4so1049364lbv.10 for ; Fri, 17 Oct 2014 10:20:18 -0700 (PDT) X-Received: by 10.112.12.35 with SMTP id v3mr10249980lbb.80.1413566418297; Fri, 17 Oct 2014 10:20: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 c5csp268461lbz; Fri, 17 Oct 2014 10:20:17 -0700 (PDT) X-Received: by 10.68.135.198 with SMTP id pu6mr9882578pbb.106.1413566416728; Fri, 17 Oct 2014 10:20:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gv6si1574384pac.208.2014.10.17.10.20.16 for ; Fri, 17 Oct 2014 10:20:16 -0700 (PDT) Received-SPF: none (google.com: linux-usb-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 S1753425AbaJQRUK (ORCPT + 3 others); Fri, 17 Oct 2014 13:20:10 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:55769 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753127AbaJQRRt (ORCPT ); Fri, 17 Oct 2014 13:17:49 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHHdr9011703; Fri, 17 Oct 2014 12:17:39 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHdO1000722; Fri, 17 Oct 2014 12:17:39 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:17:39 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHcbR002946; Fri, 17 Oct 2014 12:17:39 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Greg KH , , Paul Zimmerman , , , , , , , Robert Jarzmik , Felipe Balbi Subject: [PATCH 14/67] usb: gadget: pxa27x_udc: transfer mach_info into pxa_udc Date: Fri, 17 Oct 2014 12:16:21 -0500 Message-ID: <1413566234-13537-15-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413566234-13537-1-git-send-email-balbi@ti.com> References: <1413566234-13537-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.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: , From: Robert Jarzmik Convert the mach info, and store the udc_command in the pxa_udc control structure. It is to be noticed that the udc_is_connected() in mach info is not transfered. This was not used, as mioa701 machine doesn't need it, balloon3 doesn't really use it, and most importantly the current driver never uses it. Signed-off-by: Robert Jarzmik Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/pxa27x_udc.c | 10 +++++----- drivers/usb/gadget/udc/pxa27x_udc.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index d583197..5280f64 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -1510,11 +1510,11 @@ static void dplus_pullup(struct pxa_udc *udc, int on) { if (udc->gpiod) { gpiod_set_value(udc->gpiod, on); - } else if (udc->mach && udc->mach->udc_command) { + } else if (udc->udc_command) { if (on) - udc->mach->udc_command(PXA2XX_UDC_CMD_CONNECT); + udc->udc_command(PXA2XX_UDC_CMD_CONNECT); else - udc->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT); + udc->udc_command(PXA2XX_UDC_CMD_DISCONNECT); } udc->pullup_on = on; } @@ -1605,7 +1605,7 @@ static int pxa_udc_pullup(struct usb_gadget *_gadget, int is_active) { struct pxa_udc *udc = to_gadget_udc(_gadget); - if (!udc->gpiod && !udc->mach->udc_command) + if (!udc->gpiod && !udc->udc_command) return -EOPNOTSUPP; dplus_pullup(udc, is_active); @@ -2426,7 +2426,7 @@ static int pxa_udc_probe(struct platform_device *pdev) return retval; udc->gpiod = gpio_to_desc(mach->gpio_pullup); } - udc->mach = mach; + udc->udc_command = mach->udc_command; } regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); diff --git a/drivers/usb/gadget/udc/pxa27x_udc.h b/drivers/usb/gadget/udc/pxa27x_udc.h index f025693..11e1423 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.h +++ b/drivers/usb/gadget/udc/pxa27x_udc.h @@ -420,7 +420,7 @@ struct udc_stats { * @usb_gadget: udc gadget structure * @driver: bound gadget (zero, g_ether, g_mass_storage, ...) * @dev: device - * @mach: machine info, used to activate specific GPIO + * @udc_command: machine specific function to activate D+ pullup * @gpiod: gpio descriptor of gpio for D+ pullup (or NULL if none) * @transceiver: external transceiver to handle vbus sense and D+ pullup * @ep0state: control endpoint state machine state @@ -447,7 +447,7 @@ struct pxa_udc { struct usb_gadget gadget; struct usb_gadget_driver *driver; struct device *dev; - struct pxa2xx_udc_mach_info *mach; + void (*udc_command)(int); struct gpio_desc *gpiod; struct usb_phy *transceiver;