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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 8C456C04AB5 for ; Thu, 6 Jun 2019 06:31:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D82D20883 for ; Thu, 6 Jun 2019 06:31:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eAykI5I2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbfFFGbt (ORCPT ); Thu, 6 Jun 2019 02:31:49 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34444 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbfFFGbt (ORCPT ); Thu, 6 Jun 2019 02:31:49 -0400 Received: by mail-pl1-f194.google.com with SMTP id i2so516983plt.1; Wed, 05 Jun 2019 23:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZuYL6lN4ovNLZelnmpwF2tE/28tuu9kcDrW6nhfoTIY=; b=eAykI5I2cit6kpAF5jKD+nZ+aVqSXA3rMhKtgNRgXHtVFldg6wBTALZUH+Fj1//dcO qvBs7E48tli/uSpkLJ9vpSavSok1SXWOCmVAw2ihUDXP4fW3ZO8EKJBv09sHO1nTngW1 ZxglCPmZw2XWGuaZiJx/v4jpvzkJqGG/yKzITiB91BHPg7PRB8nUMOgj/US0LkccUlQi 5o1CSPZ4iD4eSpqoNYNYRRijiwD12ZV3luQUBMdYROiAtu7ZSwWWj3yoswcHPQr+mM6z jT0MFhki13yCIcTqLcPywQQJQpCq4FG1t49eCJXz9w7a5TpuFkHlcTaY4gyLGOiZQaER QmXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZuYL6lN4ovNLZelnmpwF2tE/28tuu9kcDrW6nhfoTIY=; b=lTMLrmSixKAf2p2KjMCNp/hvKkvoPf8enedePUI6m2bTnBdD0xUqyaGHSl1efKwU9G sYfWsYKQWF6bvkNWLiwxOWpHpzUrWMkRCopJvfudWmLxLx6q2Mnr67oZNAfO//eGy3QH qb197/7svE+QpJqpjK/vlmJAaIiZbtmj3KYfzowDYq8N2JZ8PFpRrCn5liKA4f1Yb1Sv lI01fO3l5C9f0fnmSjC36UMhDpU0SrGWlamb6HX0YInZs2mm7cjK+E4PPuYZcN6peEUf cGW+amiRirN/vGY2PmD1JB1CYGpzApTOPYyDM31oRMa24QD+rI0OFazy54/sGq/wcypy jh9g== X-Gm-Message-State: APjAAAWnDCJtSdhyjsNDQSu8/SWVg081M3BRvMw2Ouu5Bo/gJXXYt1+6 RBwvqUw5MqNUHiW55+I20rnUtBE5bumm7kB7gno= X-Google-Smtp-Source: APXvYqzmTJjr3etXxZab8gtdLS3HlllT9X2yzuaibx9FNwUj6+wOU1xURYpITcK+CDPHMjIoMhfLuS/5NDX9FVoeE7w= X-Received: by 2002:a17:902:ab90:: with SMTP id f16mr47819648plr.262.1559802708652; Wed, 05 Jun 2019 23:31:48 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <1559789630.8487.111.camel@mhfsdcap03> From: Andy Shevchenko Date: Thu, 6 Jun 2019 09:31:37 +0300 Message-ID: Subject: Re: [PATCH v6 09/10] usb: roles: add USB Type-B GPIO connector driver To: Chunfeng Yun 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH v6 09/10] usb: roles: add USB Type-B GPIO connector driver Date: Thu, 6 Jun 2019 09:31:37 +0300 Message-ID: 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" Return-path: In-Reply-To: <1559789630.8487.111.camel@mhfsdcap03> Sender: linux-kernel-owner@vger.kernel.org To: Chunfeng Yun 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, 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? -- With Best Regards, Andy Shevchenko 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=-1.0 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 B5BE2C28D1A for ; Thu, 6 Jun 2019 06:31:54 +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 8D17F2070B for ; Thu, 6 Jun 2019 06:31:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="o74ruPyR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eAykI5I2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D17F2070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/P/IuGoESTcEnb+4xNbul8C/+IMcn7AV8wJPsCYDcG8=; b=o74ruPyR1GJsyh E3Hzx+aXAkuo8llj/pZS2iUJNDdEEOh2XvNvcYwrOTZlKbiJrJ9Qqm+AFx8NBNmH2WdRgGbJobmrB Jc8M6uiDREVD7PsOMd+xx57UTn34xFlbB1wk4zRddo/+3dT3PW+eRRxHOGGsaaYK0L75MtAD4Nwrw wRu07NPZp1ZnFE9mYR6xNRqhJNzuLfyBiAg1fAv+TxPFL+liohIqmt2UKjQTUSGYqTWrw4Xao/5kA dj/HDON8qwJsgR3ITA+9ypsc6636rOcqtw9JX+wK5/yUmv4GXoKo4RwyrWaVtLOtyHFxtKmfRu/WP IU9o7o6199I6GcIc8Yfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYlwG-0001gY-Bx; Thu, 06 Jun 2019 06:31:52 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYlwD-0001X0-LV; Thu, 06 Jun 2019 06:31:51 +0000 Received: by mail-pl1-x641.google.com with SMTP id a93so505876pla.7; Wed, 05 Jun 2019 23:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZuYL6lN4ovNLZelnmpwF2tE/28tuu9kcDrW6nhfoTIY=; b=eAykI5I2cit6kpAF5jKD+nZ+aVqSXA3rMhKtgNRgXHtVFldg6wBTALZUH+Fj1//dcO qvBs7E48tli/uSpkLJ9vpSavSok1SXWOCmVAw2ihUDXP4fW3ZO8EKJBv09sHO1nTngW1 ZxglCPmZw2XWGuaZiJx/v4jpvzkJqGG/yKzITiB91BHPg7PRB8nUMOgj/US0LkccUlQi 5o1CSPZ4iD4eSpqoNYNYRRijiwD12ZV3luQUBMdYROiAtu7ZSwWWj3yoswcHPQr+mM6z jT0MFhki13yCIcTqLcPywQQJQpCq4FG1t49eCJXz9w7a5TpuFkHlcTaY4gyLGOiZQaER QmXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZuYL6lN4ovNLZelnmpwF2tE/28tuu9kcDrW6nhfoTIY=; b=EwWoaqGV5IsstnnrXo9ubqWAk5b5gal+OXKOJzceFanB9N1T6/XuOlMYf1vmO1PU0d +OuwtDisRZW1xW0iG3WmLi/3u1qPqwAo0UQq2fvH2+UrY7bOBeXmZxxKczTcIq4Xj/iZ 423Efq/JLKi+Xwi5kA+b/mY9u+fxPkBOP9JaxhFMi2k1bZxvggzbVF6GKVUNGBH16+f7 m5juH9tuKD+6OGjS+mCG64r7aQKbZAO+4mrMFHKRC8dk5HVO6JdJ7bJs/K04Qme298Qa EveJpgELbPNJVMKUXEMnrtVfwvN7hWfHT1KBN1+kyPWJu8w0BZXopuZ6xsL4Hr0rXjER 8dqA== X-Gm-Message-State: APjAAAWhgRPFMRil372V3KKfv46YqtdFqkbrh63mB6aQigqX/td1XCh0 GaGnnyXMsA6odfj77PmUB3iUQ/e/oKgKX9x3q7O949yT X-Google-Smtp-Source: APXvYqzmTJjr3etXxZab8gtdLS3HlllT9X2yzuaibx9FNwUj6+wOU1xURYpITcK+CDPHMjIoMhfLuS/5NDX9FVoeE7w= X-Received: by 2002:a17:902:ab90:: with SMTP id f16mr47819648plr.262.1559802708652; Wed, 05 Jun 2019 23:31:48 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <1559789630.8487.111.camel@mhfsdcap03> From: Andy Shevchenko Date: Thu, 6 Jun 2019 09:31:37 +0300 Message-ID: Subject: Re: [PATCH v6 09/10] usb: roles: add USB Type-B GPIO connector driver To: Chunfeng Yun X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190605_233149_706452_66D4FDC0 X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 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, 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? -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel