From patchwork Wed Sep 16 13:25:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 312427 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp441723ilg; Wed, 16 Sep 2020 05:59:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrQSCQ06ybYTZnlgQAe29n2fHuG+YfVVnfwlaRadlSc0l/hgDlinaT/XG+F0fQCPoi1fra X-Received: by 2002:a17:906:a88a:: with SMTP id ha10mr26783480ejb.532.1600261194535; Wed, 16 Sep 2020 05:59:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1600261194; cv=pass; d=google.com; s=arc-20160816; b=pY6p5c4aadQHwlljeRDt5X0Sdr37/kosPlNrBzTRwh1w75CJtaNFLrGKR8MF/ezEBb bj6tDBgg6EOOFyUeNs716uiDY/z5RkMQi19y0MXJAr/T07O75VRiTJIfuYQsN6ynHfvZ 0UbOGNnyNj5btVAr1AnPEKW0iblHlvDnLJe6hPRVmoSACoqUSGoAsh9b5TkEitc4UI6l tJg6wP/nGHt6pTDadX3J3PAYJvStW7zJvG5HuiMnwuRAFbu7DXN8EPx4+IjIxxdPJz6z gZNaE9s38W9xfsxN6uJQsJEyT09ovHEIfw3XcEBZz+3FkEOau5h/8cJpW9CgmbQ+MIOI XeHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=0vrWUjyfJfL5GNoteJflp9o+ejCHhKYInLq6pnuB3KU=; b=Zp193+3RB57o9hUfd1/fUExdtvNb887dHv2nbyydk1HXaPefRDSy3D2w9UBg/ql4WC /KujCy4Zm7XZiGMPbKR4HHiU4pQMZaHhSUP6le1YB+NFFovDqI97cI6MZeDfnS7E9oWk PPaS+B8gcyzkTtVLHfaLeCDFv0dIchSj35MNzCGI7xx/CgFL2SIp0+nqi8oAFMJO29m4 tFma5Z/85T5Rqb6+k0LIVXmb958Zf0sevlvceeT/Z1IxbSxWCQDIooYFZI36AL1p4uGI u3SYodxDrMZZSegiaWYuTQ2wyKrsQsH42Nwc4EBsZ/zQkdE/PwxKsrtiSaB2DTrwOHHj t4Tw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=kB90vujQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a1si11671805eju.696.2020.09.16.05.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 05:59:54 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=kB90vujQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D40F8232F; Wed, 16 Sep 2020 14:59:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="kB90vujQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 225BE8232F; Wed, 16 Sep 2020 14:59:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on060d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1f::60d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 64A7D8231E for ; Wed, 16 Sep 2020 14:59:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WNvlItG2n+35nXswU9BvjLrr5YmRLlG9qjyyuLQX2cCc1eE1xE0bC7AS++tYEZCvdWvKvvZxBA72sjy2EjYSWNhC+MBAMQ4CMW56x7zTdtBa0eywavYMFXfNJi+lTZDwyk0hW4qmcOXnE2rcRGpmVgQ2SHspGNvk+fCsYpxgUUYuBhxTfnSQIw6N2Enoa37owe2G2MhgxpbnF1EmgqjMswmWKUST50AjLDf2SwKb/cvchfXG3WCYhImgxwIUV/0/My1933gawae+ESu9ddr96y0borbp86z1RkGxxEibKB8rY+iJVVf3LHPCFQ0+EOW8G26JnkpiEX2IHca4GO1a5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0vrWUjyfJfL5GNoteJflp9o+ejCHhKYInLq6pnuB3KU=; b=k02xDlutyHuWXRPZv29/AtyxnyDrslMv+x8LMUyYU09bpMOnF1JSepOZDYf9bl2ASVirNNECY4UqLxiEIlfw6ICta3h7KylDw/Itvj0Gewq74mpapcjB9ro/969rMr1xhTp4/7x4qK52+++kRLYrNX0e+zI6Y83Swj4QX7osV+u5eH0CLfCtBUEFn2KYTyCA19k2vSD8X5eyHeGBUjIM/mJDJ6pujLgmUQzX2LxVdXANM086XC88why7TG9p5/3VuGEIOya1XmExxjo6Ls7ibvZCb2BE8Go57epOYvJ5J3l8+2YqkUPQtshVOZHcv4/zo7k8NKMBJXkxsUH4ZD8Bvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0vrWUjyfJfL5GNoteJflp9o+ejCHhKYInLq6pnuB3KU=; b=kB90vujQWtwhsPNF7PdHbqp6eKMLd+uA+dpQibs/QjcNrmHUjtqYCg70KQCywPUTa1lwdh+QDVmy86NPzzmWcFaerAr5lCJTr3SAl8LLxMlUFdXQOKOrM5H013WBlljk1Ly79LZct0olf+kWE2xpGcyeIEwDKSINaaQFfy2vQjU= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0401MB2373.eurprd04.prod.outlook.com (2603:10a6:4:4b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.18; Wed, 16 Sep 2020 12:59:39 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413%10]) with mapi id 15.20.3370.019; Wed, 16 Sep 2020 12:59:39 +0000 From: peng.fan@nxp.com To: sbabic@denx.de, lukma@denx.de, marex@denx.de Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Ye Li , Sherry Sun , Peng Fan Subject: [PATCH 01/16] usb: gadget: Add ep_config call back to usb_gadget_ops Date: Wed, 16 Sep 2020 21:25:22 +0800 Message-Id: <20200916132537.8313-2-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916132537.8313-1-peng.fan@nxp.com> References: <20200916132537.8313-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR03CA0131.apcprd03.prod.outlook.com (2603:1096:4:91::35) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR03CA0131.apcprd03.prod.outlook.com (2603:1096:4:91::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.5 via Frontend Transport; Wed, 16 Sep 2020 12:59:37 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5b044415-c186-4246-b930-08d85a405f2f X-MS-TrafficTypeDiagnostic: DB6PR0401MB2373: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m0pxeIk9Z4obJ6FhYlyfOZIa8A0umiVzgRs/OndD3bkHCa65M3t8Z/Mc3Rl4ZfQMuCecHqw2Zzk+jQHeyq6SPAI3T+KzRvtwojz4zHTaz5WKIZXAWmFuHlUS3WFXCvEzdpE/By8lb+FqE5AF1Zkz3xOrFnvKxzycRAJERU1q1RpQ+p8eNY3eS4Pu/9ael3u/50/oaV8DC0ZYli/t2JfOUpB9fk9bEH2pEGODNpO6f5paFjFXYYuXssrgQcMXeeOqKmnwbz51nZEwnH94A8vDg6rA9wjUXfSxL6w1aD49mDg180VxQzMXpx2dBDf7ixxbRljwkz3O7Hj85yp7XfRJPA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(366004)(376002)(136003)(39860400002)(396003)(54906003)(6666004)(9686003)(1076003)(6512007)(5660300002)(478600001)(52116002)(36756003)(6506007)(66946007)(26005)(6486002)(16526019)(186003)(956004)(316002)(66556008)(66476007)(2616005)(86362001)(83380400001)(8936002)(2906002)(4326008)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: WNc5tgToUSKMbd1jX2FR8zvfX7EWEdeOzu7J5YZxI1OxO0XrdWr7NjFyBXeVu94grleOqQ2xho5GNnKJfg2ixfWQhcoMBict70SmQO/bV2xWaUTRcBNWTVIq/MBYDkM3rcChX3OnfL1X9K4a2KgfHjuD+VeIytMQfTHwAGMCUyZ5byCXwu5rYz9yZVBPIDqOMoPBE2CJZ7I+wL2GVtkCa4yvZNWgSjce7q3bijFWnrTunBF6LAE0cX7YWb3VG3rAebOLDfoOkQhr4IFQ5tshp/DWEvwryPlu4MbwgrDA3zkrhU+jiMXpBzao5uN+hXmdJfQkvcKq5k63Nl0Nj7BZFTnPZkb69SYLQx60zTA0UgCHpcb5txLx3GQvbtDqyU36VJLfAJX8GbCOQCyUBw4dJF6J9gOHrYjyBF0YuV9CN4U9PtWn7R4zr5aRiFmKmtWIlqYwKo8YePbEiYgzTKORsr76KwS5mGLi8+vJB+8mBJnCXGWxADGvwfifBk1QSHbrYxG9QycG5fOzDNoXeQQkKx67+p8Ugpazwmf9PTiMQC0kuxa5pB9VCn3hkA/KDJYpsTwihebUDbaU7pG6Vp+RCDUQGkCgWER7+k2xGQiftQZEryJY4cgj17/4j7pihRNxZPqBZjwCyMCjW6LPoYw6nA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b044415-c186-4246-b930-08d85a405f2f X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 12:59:39.6673 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oSI4uPkiLwHeeq0jRKMiJoSQg5aPtVICp3pb36dAzaSjVqDBYv6CMkiHDQEcmArQGkBWQlXEvv75Um/phQA3tQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2373 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Ye Li Since some new fields in usb_ep structure been moved to usb_ss_ep. The CDNS3 gadget driver should replies on this operation to bind the usb_ss_ep with the endpoint descriptor when function layer uses usb_ep_autoconfig to add endpoint descriptors to gadget. So that CDNS3 driver can know the EP information and configure the EP once the set configuration request is received. Signed-off-by: Sherry Sun Signed-off-by: Ye Li Signed-off-by: Peng Fan --- drivers/usb/gadget/epautoconf.c | 4 ++++ include/linux/usb/gadget.h | 3 +++ 2 files changed, 7 insertions(+) -- 2.28.0 diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index e61fe5d114..3f8842976d 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -167,6 +167,10 @@ static int ep_matches( size = 64; put_unaligned(cpu_to_le16(size), &desc->wMaxPacketSize); } + + if (gadget->ops->ep_conf) + return gadget->ops->ep_conf(gadget, ep, desc); + return 1; } diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 06292ddeb6..8d54b91734 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -470,6 +470,9 @@ struct usb_gadget_ops { struct usb_ep *(*match_ep)(struct usb_gadget *, struct usb_endpoint_descriptor *, struct usb_ss_ep_comp_descriptor *); + int (*ep_conf)(struct usb_gadget *, + struct usb_ep *, + struct usb_endpoint_descriptor *); void (*udc_set_speed)(struct usb_gadget *gadget, enum usb_device_speed); };