From patchwork Mon Jun 27 04:43:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 12896056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DCB3BCCA485 for ; Mon, 27 Jun 2022 04:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=nNx1TNd02XU5nWbvCJwS79wPQDHEkqOQKTYwqrHRfuY=; b=AsT8tgUlr463OTNCUe/FVQK4xr vceU+CaZxS55Ou8iHFFpAYSNhZHHo5PjlAy//lX0uoge39CugHheY1D05IFEEQmsvFgeVQ4PdIj1/ Z80zGRjF7Wwnhs4R5/ImQwl88zQg0QxLl13hiONJ3CHnqH7ojTfIqVIFJICg1eE+GVXSq5g8c0G+X o/WmUz5ipmQ4puOIohaX39p2QE+7q/oB/pC/MBstVFHMtqdKU4F4+BH1XQJx7/hLrYI4zO4aoO3q6 eABoQtFy5G5V7EvZO6RHY0jFBU0AB+xsWQ1Lme3+QqO1fawFD8Yeism9xZEJZ1bD0Y2OoKuPXpnId pMwRxJbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5gbE-00FOZe-I0; Mon, 27 Jun 2022 04:43:48 +0000 Received: from mail-mw2nam12on2093.outbound.protection.outlook.com ([40.107.244.93] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5gbB-00FOYE-Hy; Mon, 27 Jun 2022 04:43:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fg+GaX0/o5Pv/+sdt9k9nmFks3ulUKcMyfMbA8gfDCcVvto+SOJeuEUBsbdjbApUDgBqm9ej0StNrizWFTLXd4YMixXFa8dpCwZ0jozDw/DPcbufuQUINhN44Hxg+Y4D+OqG3DJve8q8nMv3wMSRppTmnhpBSyhtmCghmHR6nEv0y1TNqxEfpTgNid4bnGRtC5w3y0bGGPIWEUo3DpCOIWE0lIaPNTVlbXxUSPHFXUq13I/c4YmVJGts3lXYsTCU9K+pjuQ51tAeg/xtgOPvlga687G7k//bYVy7B31Pmb3/AuyvngkdZ6j660RyYGQ44VVM5cgKcp35bWu/AN+J4A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nNx1TNd02XU5nWbvCJwS79wPQDHEkqOQKTYwqrHRfuY=; b=ImdVZYglIMvOmNTU6fj87eCRTT6cuf5augAMHctaVVcsccs8tPSx9kJdptvb04BMpNpBqQm3s3+BqrroBkw9H2reKuzDac7seAxwi1y7iktrFdFSfFijO4tJuqsfy81oJF2zhhAw1OmTbbKE57JrXbQWNhgXDtIp+IEopeGMvcjochUf+lLyn8nvrjutXG44QghLrZJCt8MyIJywaWabaPEw6uY6AfV8+ItN515ckTGeyTAFE/QydSjEmBGAWdByFyZOafqx3fuIhxl5d7O8x3neZ8iD0JJmGr0FKDSmi1HTu82fcFODxKiqa9UNDrRM1RyqlcU5Rh5ejYVeJtY//g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=analogixsemi.com; dmarc=pass action=none header.from=analogixsemi.com; dkim=pass header.d=analogixsemi.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Analogixsemi.onmicrosoft.com; s=selector2-Analogixsemi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nNx1TNd02XU5nWbvCJwS79wPQDHEkqOQKTYwqrHRfuY=; b=rR3Eauz/qmz7bk6zwRs4IzyK0RyOU3HhlvpNZxS8KEBKCP/YPPtH4dydWxTH4lwKjCxY1zSs0VwiOXZedQoUAAFmbCqONVD/EsHmNXXQ/NPI9KwX9Dv6kPQMuHW+7e0e92sknx80VffHJVb+ukrpwyhQITkqyeNdhmFzKx/zQPU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=analogixsemi.com; Received: from BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) by CY4PR04MB0630.namprd04.prod.outlook.com (2603:10b6:903:e9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Mon, 27 Jun 2022 04:43:39 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::ec96:5112:c2d5:9377]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::ec96:5112:c2d5:9377%8]) with mapi id 15.20.5373.018; Mon, 27 Jun 2022 04:43:38 +0000 From: Xin Ji To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , Matthias Brugger Cc: bliang@analogixsemi.com, qwen@analogixsemi.com, jli@analogixsemi.com, Xin Ji , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v11 1/3] usb: typec: tcpci: move tcpci.h to include/linux/usb/ Date: Mon, 27 Jun 2022 12:43:29 +0800 Message-Id: <20220627044331.2180641-1-xji@analogixsemi.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: TYBP286CA0003.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::15) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 54b8c7aa-76b8-4134-3d5b-08da57f79a5c X-MS-TrafficTypeDiagnostic: CY4PR04MB0630:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xBYihBaaTfA9p2v2wEbZSbQYyH8gR9eDknx4GEFNMAhPHF1aF2c+SK84Dj7PQr3DtKIS11+ABl+ZrijppYP3uiZzu31n/v0Ca3Fk7GEOzpjRpY2SWZosKlgy68DamPLGlhEko14TiWUMDeyvsL84YdgFnIVgARXPjpktUeCdDAE/uzDJG5bmUz7mOG/pA1Mz4WuM/o1XZXEgrg4n9YI9WYoJJ+BifZq0veDBgkPtc/tssLLUnQBAfA9Bs4LG33IJrrz9supws64LVuMXix3aqGhqXG+5oHx0dI7NhMdYmETLAZjl3jcFHhhiCqfxQIZlOVoijgCb/1YLPF3Tq70VoYe3b+eoZRX7netGUiaTTfTzJp9qgaNIUSATKjCfjr3o1N3Buwk8M1Up9XNJlMLXSF8kyKEwsKGPo4smG6xp/79CIIL9Z+cG6LA7n41uK3rlm4bJ2bYrLbFfykt8dKi5CF05bzg8Cj6Hsarjzn5N/Th0KMQ+5M68B8RbUMWpetPwpMZ92WBhAM4/1H2lFsJtE6bRNjbO5DW20yEyMptYkYm9vR4nHyKKv5ez33Q5V1qNGBWaf9aPQxGcyRaP9gvsGmR7RF1mTG9q/2UU9Tr7Fl6yzh37sOy026PelspKnezPhbSxhHAPpu6YCn9lMpunJbgOsnCbDQEWWN8IWQdotrUPNn9dfqrxDq1U6xQcdjYtvsrWklyAsE83Zph3XRjipLNXOlPAfFb/iQdhoa91aMGsIUfrJGtmDiL13yXhR/fMzNvaMxRhozgBGLazrX69x7DZlG+q0LX7w1ZZf+9gjsc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR04MB6739.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(136003)(346002)(376002)(396003)(39840400004)(2906002)(478600001)(38100700002)(8936002)(6486002)(36756003)(83380400001)(316002)(6512007)(26005)(66556008)(6506007)(2616005)(38350700002)(41300700001)(186003)(4326008)(66946007)(1076003)(6666004)(66476007)(110136005)(86362001)(5660300002)(8676002)(55236004)(52116002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NkY1WK8waCZ5ssqEYtHHxdJX+kIiJS3lRWgOEVml/6O8A2KJT18R20ikBT7XAo7Lm09BOyErkHjkHmHMgY8KbtZMpZ7+JqIlXEKnqcUxvgiBwaOu/IYDI3Bxm4lAa5NzmvaMmDn/pvFQT/v7tKfh/I3iPjaqEY5ZPnEo9RClngiyxnJFbSTW/qqwUm/HI/JZOparZIm1MF+UAuSqCyQaOO0j0huUALzBvRxzRCP/a54a71dumoG4aIATIEX/Ynmsr7lqxpKligyskmnuikyvfZCF6f0b00IXD2KC0pj/Sl+Myb63T1XcF6Hz4QqR4WNlfTXeyMCIfi0rqQHFrly3mV4kwYctC2MzU51GD/JwYfny3BiHOewLiYXBsoqRCcIAwndqk1B0RYRwgTVZb8q5ztCo7VkjgRO6e/gaGiKL7I0Orlv9kf1poSvLlJSyYYwjZGDdqbBA7Oszm0gVI8rOeg05T/AQPskEDHaPwoa7kg2xt46qXh17Mya5Lw1QdaAdZypBFZILZGs9jJ/zPXPT/71TpG6H32G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.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54b8c7aa-76b8-4134-3d5b-08da57f79a5c X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2022 04:43:38.6808 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b099b0b4-f26c-4cf5-9a0f-d5be9acab205 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ue6apeRhRwkA9LWxhS2u6qUVdgDJF2SvXQ9spcwxG6OqF2WA6x8pFg6BNkkGS8kshaK3t6P/UwaZXUrxT/TVtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR04MB0630 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220626_214345_678450_05D8CAF1 X-CRM114-Status: GOOD ( 10.30 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org USB PD controllers which consisting of a microcontroller (acting as the TCPM) and a port controller (TCPC) - may require that the driver for the PD controller accesses directly also the on-chip port controller in some cases. Move tcpci.h to include/linux/usb/ is convenience access TCPC registers. Signed-off-by: Xin Ji Reviewed-by: Heikki Krogerus Reviewed-by: Guenter Roeck Reviewed-by: AngeloGioacchino Del Regno --- V9 -> V10: Rebase on the latest code V8 -> V9 : Add more commit message V7 -> V8 : Fix Guanter's comment, remove unnecessary explain --- 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 f33e08eb7670..812784702d53 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 8a952eaf9016..1b7c31278ebb 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_PHYCTRL1 0x80 #define MT6360_REG_PHYCTRL3 0x82 #define MT6360_REG_PHYCTRL7 0x86 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