From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35EC7C4321A for ; Tue, 11 Jun 2019 05:48:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 170B22086D for ; Tue, 11 Jun 2019 05:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403871AbfFKFsE (ORCPT ); Tue, 11 Jun 2019 01:48:04 -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 > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chunfeng Yun Subject: Re: [PATCH v6 09/10] usb: roles: add USB Type-B GPIO connector driver Date: Tue, 11 Jun 2019 13:47:46 +0800 Message-ID: <1560232066.8487.119.camel@mhfsdcap03> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: devicetree@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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, T_DKIMWL_WL_HIGH,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB8E5C4321B for ; Tue, 11 Jun 2019 05:48:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 793C62086D for ; Tue, 11 Jun 2019 05:48:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IowO6jpK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 793C62086D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fw++YBbbm3noJTf1d2WxpzbBp79tSBEbgYXLxJqPges=; b=IowO6jpKwFLq7h C1FUoDVZuZSNxVjNrbK/BK42W8xFZifiJ9OjaXiuDuCqkwTDrDHPAV3rZnVTHirOYLitNHAgT01q1 iGEoHkhSW3dqfl6Njt3ON6tTbtNsZtkCh4RqRIBEVntn01RcCBrpJAThY2kSgK64WxE8GyYTb3ud9 sMjoxHNwpqL6a6h2+YMcj98O/pSb2ATrWnt4ftCCKtRGZKp2SCZw8YEPb4O2RqzWC8qbJ2C3gEgVl klbjTq1e4fEVNh+405iFqR4f3nwzPjXdtVg7ASlu348LZTkNRMqhp2LY+wZ3R5Qf2tAeeGCSQkIcG fF2bbBBN8e9oqlR6F13g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haZdY-0004zw-2w; Tue, 11 Jun 2019 05:48:00 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haZdV-0004zY-H2; Tue, 11 Jun 2019 05:47:58 +0000 X-UUID: ed9df2f352a9490188f89e4af398ed23-20190610 X-UUID: ed9df2f352a9490188f89e4af398ed23-20190610 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 480250836; Mon, 10 Jun 2019 21:47:51 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 22:47:50 -0700 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 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> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_224757_568305_FA5DE2F9 X-CRM114-Status: GOOD ( 13.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree , Heikki Krogerus , Hans de Goede , Greg Kroah-Hartman , Linus Walleij , USB , Yu Chen , Linux Kernel Mailing List , Biju Das , Badhri Jagan Sridharan , Rob Herring , "moderated list:ARM/Mediatek SoC support" , Min Guo , Matthias Brugger , Adam Thomson , linux-arm Mailing List , Li Jun Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel