From patchwork Tue Jul 12 09:05:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Ji X-Patchwork-Id: 590291 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18ECAC43334 for ; Tue, 12 Jul 2022 09:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230294AbiGLJFs (ORCPT ); Tue, 12 Jul 2022 05:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbiGLJFr (ORCPT ); Tue, 12 Jul 2022 05:05:47 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2118.outbound.protection.outlook.com [40.107.92.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F0532B8D; Tue, 12 Jul 2022 02:05:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OPY5N8hI9l3yNCvX1KZ7jdz5ZoeimYHwbSBfevqp+jB3dxZqaNzofq3Bib1S2cslLEjXqeXQjIacQvMsCzR8IcnNzHXi3fh1yHkkQLlNAVsDH2HrLsMm1wrUs2smS88pF2dudb16U18gNvVIq8Z2iBB4qVy6CgVoQOh9I2emirRGssWEfXHwA6AH+GKDJPoclo1hC8qBa4qBPB5Zagi82VL4f620/zbmG8dnBf49InIhr4MVkEtP3z7CdP5PyhpOB9GuDviaosGPeRDLIJU7wIdIVtCFMSs+jxoL20QGw/5JOAoqHS/zCu+D6/ZLzFUDwslCpCSL2ajjIEUyNWwMsw== 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=7OrNlacPEv/vCIDmcNrp3k4RuoYFPiHnnnIw4QQW+2U=; b=kLUGRRHUt5jaIc8lULn4sPw3yYmEqYw6GdZeeE4ImAujLeBEqx7MOM2j522HkRi9m7I5QR03uodp5JDHZHm7WXvOXXEl/zZCp/EydkQeXEU/gLCrwqMHs7F4UpFdC8+KdQeIuqxgk5QfiZyi5ZW9uMauy3Pw1zkPLoChIczkPJP6gKe1FfhLOT67E1cnSpgjKA9wEwwodFuJYVz+dJhIvGJHmJwp5yGacuSkcn7vnntMoPoEdppVdZo/FS2knYHAcuA7MiyZ2EXyyOqZu1OO2cDLK7H5gAzrQWj4LKiDN+Z1cUNajTlQ2mXVwtkYpeLHr0Mcnke9pBGYkXmryfyQ1A== 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=7OrNlacPEv/vCIDmcNrp3k4RuoYFPiHnnnIw4QQW+2U=; b=T0iQ+hDnGtpveLE5XQfrxDbgMStAeZ8j0yAi11EP+HQGKIaxXX40mpDX2CPz/ZhexOO9h8E8iNEcQN9AA7wRSh3D33gWKlLH3xCbdw6VPuXWC6HqQHlPor1o5qBJoBpiVH5hAELg1/GNMgxr7hC3cGNMmzX9VGd1Sw02C5iqjL4= 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 BN6PR04MB0658.namprd04.prod.outlook.com (2603:10b6:404:d2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Tue, 12 Jul 2022 09:05:45 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::f02d:f2e:cba9:223b]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::f02d:f2e:cba9:223b%5]) with mapi id 15.20.5417.026; Tue, 12 Jul 2022 09:05:45 +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 v16 1/3] usb: typec: tcpci: move tcpci.h to include/linux/usb/ Date: Tue, 12 Jul 2022 17:05:31 +0800 Message-Id: <20220712090534.2783494-1-xji@analogixsemi.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: TYWPR01CA0049.jpnprd01.prod.outlook.com (2603:1096:400:17f::20) 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: 83f6e4d4-c00e-44b8-944e-08da63e5b462 X-MS-TrafficTypeDiagnostic: BN6PR04MB0658:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F8YIimGcKWnBuywol47NbMN0Yztj0IkxjwNZx9CpJkS3oJfGBvHU6+9N6F4uuB+1LBVjPwnMKKWhmBSNFckLhqzQQ6y8ZCgRnmhR0YNYPtyRLFVEFhOHkoNM0ZotQS3AUKI+KiSLX5Va9JT6FMkho0QlZ8Ah6+oC36cwknK40PWomOh5Qd/FmQFX0e0ok+n0NXzxWGeICiLD0b+4uOtXLWw9FlzVq8SvE5pfu/qjoyUEQx65sdQblmf8Y4S/XttnwnRMs8gk+IW/GdNKMbZZ1DHBRbHV454kOt8BbWRjzdM57gXsG7FQlkl7z0/fv6ivo8RWsLTgs3WneagOYq3yhSlc3lpT1l8Nw7Yu7v5PuS5f/Gu0azOuvc7iMJVbcBkljBJFk1TIGol4FYLdnLWaRaWHTwPNvX003suXf9/hEgVAB5Sh5HtViQ0wZMTuQ7CAUOstBK6SF38dRacC3MM+/ypWsKHqQgLTkNj4i6NZ6OI0xKuxfOTzZvEjM1k7rGrbcomhMMaWydcOclgc1zcRhw/kAes47fxzuW7c+dLUTNfVW/vglfNASvdjYtDeGtFO6cFv2qSK4kitN+2JzZnCSDq5NA6oYotDoRokB+/tFAA7q0LMPFcQqOgEYvZxpnA3wwyKLv4s1RHWLr3KOifKLxdWmAo90uQ3rLWrMVWC2r8K6hShrfITxvqXvta4Eu7lp+hv5F49Uej4uID3SevmANjX2W6kdkStl5qMtyIkatprHBuADoRZJaB0sQd/zSPQLO6JLz3ajkhk6zGVT/4b5ZBlb8KFN6+ZiszirouSVBzNZm4cTPmzzy0ku5Z5nIwk 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)(346002)(39840400004)(376002)(396003)(136003)(366004)(4326008)(66476007)(66556008)(38350700002)(8676002)(6506007)(66946007)(186003)(8936002)(83380400001)(52116002)(6666004)(26005)(41300700001)(6512007)(55236004)(6486002)(38100700002)(316002)(2616005)(1076003)(478600001)(110136005)(2906002)(86362001)(36756003)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OP6XZ2kVhB7EeB7wBDbMmTObkVAFx+1rWBA/8aegjJtEh6PmOD7MGP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ojsw3GBeeSDrHFi+bwn6WI6Zq0Hrz8KtVEp+Nz9mekJZIwaCU7ngJH2XuFpk6nzhikjqLQGf2vT7xx0Hba0TkUbkhGoMpSioajcLHOps+DGEkcnRrM2Qg6dCVJs2ohPTfFxyDW1BkEzpo2fBy4fTDHhvutw2dAR67qj8MX2GzU5GlzrTAxwXNu7uCVuFHTn96iJen/UZ2VatIbs41DV7DyFrY3f5tDnXEY4wgah/t+s7mlEvHAr2JNLMqZHDEwn147pT6PouuZZZWpkCHfftyb0YC+Kf1b771I9Td4l78s89ZVQlkNfarexEPq/GkiSow+XDAzgyL75XV+QXk3p0Q0E1/BvZy398IN5Q/+AZYBAqBlTVqxKI+8V41s7rz4xdGmeshYGGcp/blI2dWD/CYAzQT97kLYZrUaw6XmZfs2lXGpSHWkuwdINPkxABQ1vTKkx65MxE7gxUfM+ X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83f6e4d4-c00e-44b8-944e-08da63e5b462 X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 09:05:45.3241 (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: gHTyhcBRi+OE/iuk2ZZY8C6//SFG28VeQHgcvAZrjkfZehnReqDWmAppsyL/95p3rAA+pBmouD09QoqQ4oiqTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR04MB0658 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.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. Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Signed-off-by: Xin Ji --- 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