Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3579456pxp; Tue, 8 Mar 2022 17:58:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxici2RDMfeHar5OSf1xwYwkZN7Hj0Ls581Nrl5spwfwXg/+5img9Nk+RDykjuEVHAfFAVx X-Received: by 2002:a17:902:a982:b0:14f:f55:a09a with SMTP id bh2-20020a170902a98200b0014f0f55a09amr20201847plb.33.1646791124949; Tue, 08 Mar 2022 17:58:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646791124; cv=none; d=google.com; s=arc-20160816; b=McDvrOfeK6wberOAo8E+KdMixPdumaaQYbrd7SzGhIWBsYP505GLA+3Vcag4tzQ870 9gmCsVauJ+tXQQNuUzukO/BhC+5Cqxzl6iEp3x0xhp20SP1mNBm3DclYBBu2CV1M2ZAi sL/4OUZIShRmMls3Y4wUQMc9NkXbYfGYNNSSiTp6OHLO5RF+/U1Nar1pldeDqQojzumu QjtEM3iPmJEBzsjgkGRvHRo95tubRtq+83XkqHQAHKeCCAUFhH67g+I4mjpDnxfuNQD+ yqkxzeIxTo/tGc05xJCFncSIE0m99nwbePztARxmteEmcRHS0oA/nGsNThBSrqHAWiSA fVxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JXhrv67z7cxiudNnqeOxqEIuKpACEtGFDAz2/DdGsRk=; b=dINc21CFSPl7R4RZx1d5+LtjW7G6UMGPPxJFyb1DRr/vkpMKWAj9ndZrCTxxvFdt0+ bV5IasqDSoOrv0OeAok/OXkB3z4tO+ErFVCQNCStOu6dxC44BPppefqss6HzJm7uwOd2 4Nlq3jxbVi9K/8mY3ALXI6yQshm+A7JBBsUsEbD3Wb6HCfFu7Mwuxhj53fbR5Nmc9kQv xCPJJN/GZMbm6Vu/igzH5V85i6pEznIqrYgK9KfKXH+81qBApVofEYc40uuxJ180Ts9s izy4TSvxQwwluM2oiyt4+mUFjwwlBn6FIRTcvt/BtfEODz+w1Df6HX2KSlsLwS+WFpJf xvRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=bkUMoPg4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k9-20020a634b49000000b003429e8817d3si505611pgl.92.2022.03.08.17.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:58:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=bkUMoPg4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 413FCC9A06; Tue, 8 Mar 2022 16:33:08 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbiCHHaN (ORCPT + 99 others); Tue, 8 Mar 2022 02:30:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238940AbiCHHaJ (ORCPT ); Tue, 8 Mar 2022 02:30:09 -0500 Received: from gateway34.websitewelcome.com (gateway34.websitewelcome.com [192.185.148.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 637E932EF8 for ; Mon, 7 Mar 2022 23:29:13 -0800 (PST) Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 4AB231817C3 for ; Tue, 8 Mar 2022 01:06:41 -0600 (CST) Received: from 162-215-252-75.unifiedlayer.com ([208.91.199.152]) by cmsmtp with SMTP id RTvdnY3Nt22u3RTvdnKmJU; Tue, 08 Mar 2022 01:06:41 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JXhrv67z7cxiudNnqeOxqEIuKpACEtGFDAz2/DdGsRk=; b=bkUMoPg4c22wQgIXq6b8gWZweo JDm0c18r2wV1cVvk2vAgV0JsSoyEy+5G0VRDekEvV98Wq8xdJANMvBtdC0HzWm+CR6A5EMD5BstBX 5zrd/v4cmYwlHsmOsqToDdJUmsZmBPe0E+1qUgn9XUq6dxNbwdOs4mjy89539GBr4E1RfF0xB+iJv /FsCQMYHgzJ2WZXJr/tnjc1ItiXmUano9DADLwNNmkjPCrQ9JJs+T7u99yYq9abBmszoqzZfpwqZp OIBqCFavcv9897eaML8/GVGzvoJeTOSXEuNOF0c82p6r755xUaF+oAB/p7eajc3szXLGfVpBWYfqs q0vV7sbg==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:38100) by bh-25.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nRTvc-000jqO-Gm; Tue, 08 Mar 2022 07:06:40 +0000 Message-ID: <142b1c42-a8d5-3885-0af0-e07c9d4dd887@roeck-us.net> Date: Mon, 7 Mar 2022 23:06:38 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v7 1/3] usb: typec: tcpci: move tcpci.h to include/linux/usb/ directory Content-Language: en-US To: Xin Ji Cc: Heikki Krogerus , Greg Kroah-Hartman , Matthias Brugger , bliang@analogixsemi.com, qwen@analogixsemi.com, jli@analogixsemi.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20220307090929.701137-1-xji@analogixsemi.com> <4252cd9d-a761-e064-58cf-eebc3b9d0bb7@roeck-us.net> <20220308022638.GA964343@anxtwsw-Precision-3640-Tower> From: Guenter Roeck In-Reply-To: <20220308022638.GA964343@anxtwsw-Precision-3640-Tower> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-BWhitelist: no X-Source-IP: 108.223.40.66 X-Source-L: No X-Exim-ID: 1nRTvc-000jqO-Gm X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 108-223-40-66.lightspeed.sntcca.sbcglobal.net [108.223.40.66]:38100 X-Source-Auth: linux@roeck-us.net X-Email-Count: 3 X-Source-Cap: cm9lY2s7YWN0aXZzdG07YmgtMjUud2ViaG9zdGJveC5uZXQ= X-Local-Domain: yes X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/7/22 18:26, Xin Ji wrote: > On Mon, Mar 07, 2022 at 06:49:03AM -0800, Guenter Roeck wrote: >> On 3/7/22 01:09, Xin Ji wrote: >>> Move tcpci.h as a global file, better for other USB Type-C driver >>> access. >>> >> >> The idea was to have tcpci compliant drivers in the tcpm/ subdirectory. >> If I recall correctly, the reason for having this driver elsewhere is >> that it doesn't support tcpm. That should be explained here. >> "better for other USB Type-C driver" is not a reason for moving >> a header file. >> >>> Fix compiling error after moving tcpci.h to include/linux/usb/. >>> >> I don't think this should be part of the commit description. >> >> Guenter > > Hi Guenter, OK, got it, this patch is recommended by Heikki, as our > driver will refer some TCPCI registers, he prefer to move tcpci.h in to > global directory. > The patch itself is fine. My concern is the description which, in my opinion, does not adequately explain the reason for the patch. Also, "Fix compiling error after moving tcpci.h to include/linux/usb/" sounds like a change log, which should not be part of the description either. Guenter > Hi Heikki, please help to give your opinion, thanks! > > Thanks, > Xin >> >>> Signed-off-by: Xin Ji >>> --- >>> drivers/usb/typec/tcpm/tcpci.c | 3 +-- >>> drivers/usb/typec/tcpm/tcpci_maxim.c | 3 +-- >>> drivers/usb/typec/tcpm/tcpci_mt6360.c | 3 +-- >>> drivers/usb/typec/tcpm/tcpci_rt1711h.c | 2 +- >>> {drivers/usb/typec/tcpm => include/linux/usb}/tcpci.h | 1 + >>> 5 files changed, 5 insertions(+), 7 deletions(-) >>> rename {drivers/usb/typec/tcpm => include/linux/usb}/tcpci.h (99%) >>> >>> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c >>> index e07d26a3cd8e..9c907296596f 100644 >>> --- a/drivers/usb/typec/tcpm/tcpci.c >>> +++ b/drivers/usb/typec/tcpm/tcpci.c >>> @@ -13,11 +13,10 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>> #include >>> -#include "tcpci.h" >>> - >>> #define PD_RETRY_COUNT_DEFAULT 3 >>> #define PD_RETRY_COUNT_3_0_OR_HIGHER 2 >>> #define AUTO_DISCHARGE_DEFAULT_THRESHOLD_MV 3500 >>> diff --git a/drivers/usb/typec/tcpm/tcpci_maxim.c b/drivers/usb/typec/tcpm/tcpci_maxim.c >>> index df2505570f07..4b6705f3d7b7 100644 >>> --- a/drivers/usb/typec/tcpm/tcpci_maxim.c >>> +++ b/drivers/usb/typec/tcpm/tcpci_maxim.c >>> @@ -11,11 +11,10 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>> #include >>> -#include "tcpci.h" >>> - >>> #define PD_ACTIVITY_TIMEOUT_MS 10000 >>> #define TCPC_VENDOR_ALERT 0x80 >>> diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c >>> index f1bd9e09bc87..9e0338bce7ef 100644 >>> --- a/drivers/usb/typec/tcpm/tcpci_mt6360.c >>> +++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c >>> @@ -11,10 +11,9 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>> -#include "tcpci.h" >>> - >>> #define MT6360_REG_VCONNCTRL1 0x8C >>> #define MT6360_REG_MODECTRL2 0x8F >>> #define MT6360_REG_SWRESET 0xA0 >>> diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c >>> index b56a0880a044..3291ca4948da 100644 >>> --- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c >>> +++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c >>> @@ -10,9 +10,9 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>> #include >>> -#include "tcpci.h" >>> #define RT1711H_VID 0x29CF >>> #define RT1711H_PID 0x1711 >>> diff --git a/drivers/usb/typec/tcpm/tcpci.h b/include/linux/usb/tcpci.h >>> similarity index 99% >>> rename from drivers/usb/typec/tcpm/tcpci.h >>> rename to include/linux/usb/tcpci.h >>> index b2edd45f13c6..20c0bedb8ec8 100644 >>> --- a/drivers/usb/typec/tcpm/tcpci.h >>> +++ b/include/linux/usb/tcpci.h >>> @@ -9,6 +9,7 @@ >>> #define __LINUX_USB_TCPCI_H >>> #include >>> +#include >>> #define TCPC_VENDOR_ID 0x0 >>> #define TCPC_PRODUCT_ID 0x2