Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4011315ybi; Mon, 10 Jun 2019 22:51:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqWhdnDv2zxYsYrS40xiJ82xYcbB0DBvC4kx4y2qBC/uD35ia3TE7ueK96MmGV06g38u/n X-Received: by 2002:a62:1ec1:: with SMTP id e184mr78921355pfe.185.1560232274332; Mon, 10 Jun 2019 22:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560232274; cv=none; d=google.com; s=arc-20160816; b=u6V1WCqEnvsdcd+z7u3Uf+1PH+3tID4iXeuZCnlvWcn+6WJz0kqgso4YcJ2scH7TR1 vbLl6+xszR66uODt027ZbBXfJ9N6OyczWXFl++mqkebFcOhLxWw7H/taMOoWyOOKwSUY vJZdgMYvB3KtUdISiU04wYx6udeH3F5yZNOQx4vpttGllw6Afwhu0tzDGRIrU/gOCyjF qGo3paS68xIlTccszqNytEZaPxjFTbQ+zeen4qkQWkffQCrtGz7pBHSVaLkKW7ch+5lF ZDUWly3k1XaANkwQ0qKynhowIQVcxce2f0futQV/TFUnjpY4T7xYoIlBCtNGWZdb4muK 4pLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=q7iZ0xT+hnvXr/PxVUXL6THt6ivlYKGlsoTT0LC6sfA=; b=aSzKocfnAlj7gITvqC4ZfsznM8QzXYBLPRdVP5UIzpkuPqfzh5P/02AQyyRpio83yY yC69k5CKjl3ijKnzDlYW4ZB9MrFoUC9b5YdUgGX/nHa4JZUMmq3xQo0GXOVxUCGbUkdc OKYlsfzO6Agm76l/rIfyVQVIuBZUuxANBobeAsyc7sTM/EdMoL/j1pEThVzFLeSPnTZ8 Ra5dVQ7JSgheDThy1KdX7BQgt0xsAFdoHvPxVM8g6/Wj/+5gHhungt/KMZ3Ic9AR6cA2 24gGUEoTnLJxMpMHcme2YhYwuyjR1yWCCZxhSaJwpinlqoGzSgc5rClB/2KDwt+2ZugE RYoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h44si1480977pje.107.2019.06.10.22.50.58; Mon, 10 Jun 2019 22:51:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403862AbfFKFsD (ORCPT + 99 others); Tue, 11 Jun 2019 01:48:03 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:62225 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2390485AbfFKFsB (ORCPT ); Tue, 11 Jun 2019 01:48:01 -0400 X-UUID: 8dd45107285d4157a64b8222a8fbe719-20190611 X-UUID: 8dd45107285d4157a64b8222a8fbe719-20190611 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1836222041; Tue, 11 Jun 2019 13:47:49 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 11 Jun 2019 13:47:48 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 11 Jun 2019 13:47:46 +0800 Message-ID: <1560232066.8487.119.camel@mhfsdcap03> Subject: Re: [PATCH v6 09/10] usb: roles: add USB Type-B GPIO connector driver From: Chunfeng Yun To: Andy Shevchenko CC: Rob Herring , Greg Kroah-Hartman , Heikki Krogerus , Mark Rutland , Matthias Brugger , Adam Thomson , Li Jun , "Badhri Jagan Sridharan" , Hans de Goede , Min Guo , devicetree , Linux Kernel Mailing List , USB , linux-arm Mailing List , "moderated list:ARM/Mediatek SoC support" , Biju Das , Linus Walleij , "Yu Chen" Date: Tue, 11 Jun 2019 13:47:46 +0800 In-Reply-To: References: <1559115828-19146-1-git-send-email-chunfeng.yun@mediatek.com> <1559115828-19146-10-git-send-email-chunfeng.yun@mediatek.com> <1559789630.8487.111.camel@mhfsdcap03> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-06-06 at 09:31 +0300, Andy Shevchenko wrote: > On Thu, Jun 6, 2019 at 5:53 AM Chunfeng Yun wrote: > > > > On Wed, 2019-06-05 at 11:45 +0300, Andy Shevchenko wrote: > > > On Wed, May 29, 2019 at 10:44 AM Chunfeng Yun wrote: > > > > > > > > Due to the requirement of usb-connector.txt binding, the old way > > > > using extcon to support USB Dual-Role switch is now deprecated > > > > when use Type-B connector. > > > > This patch introduces a driver of Type-B connector which typically > > > > uses an input GPIO to detect USB ID pin, and try to replace the > > > > function provided by extcon-usb-gpio driver > > > > > > > +static SIMPLE_DEV_PM_OPS(usb_conn_pm_ops, > > > > + usb_conn_suspend, usb_conn_resume); > > > > + > > > > +#define DEV_PMS_OPS (IS_ENABLED(CONFIG_PM_SLEEP) ? &usb_conn_pm_ops : NULL) > > > > > > Why this macro is needed? > > Want to set .pm as NULL when CONFIG_PM_SLEEP is not enabled. > > Doesn't SIMPLE_DEV_PM_OPS do this for you? Yes, you are right, it provides an empty dev_pm_ops struct, I'll remove DEV_PMS_OPS, thanks a lot >