From nobody Sat Jul 25 20:07:52 2026 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010070.outbound.protection.outlook.com [52.101.201.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AECB3D9557; Tue, 14 Jul 2026 06:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.201.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784009927; cv=fail; b=E249Gk9JAZPExvQBloNL97BcJ7zPT5FuSQlEo+hobp5bNbt16VgdJrzpA/VIo2rgo7y++YDB0IGi7RHv74tsdkpbXd3Py/zXmAbyk5P6bYTTjjeeRgKb0FE7rNp9pk4PJXLCgjkbuWTMoBcuc5x+IBGKunLLLjziA05J3d7E9rs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784009927; c=relaxed/simple; bh=kyKenwSPiSBSRqJEWM8D92x3H2OJUXHaFJ3b8vbKHRU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o2QRR2kaFoKSJylcYa90XLEZvsTo+k8zCf/PaobXlPDjjcVTCImlbzUPwmAhHdopbIQTwi6dW3Sq793B8joTG8BVn9YpQ8iuGdEpTiYdz5CNrA9FTMhp5WJn2y+0G8ggpocR2XGETV3MeBrvkFFYATOLjmGTUG8umfxNiPWzaUw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=gb3e2bDw; arc=fail smtp.client-ip=52.101.201.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="gb3e2bDw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NmsINXnd9D8Ozj/qwqiPAyQx5lxexmNV7f5gHXGniBT6LT6McDq7Z0CsjqVpkGE3XQIrjoOzZWirU+XF9pzOaBnz/rdOulfWIx4GgDm2TL4c5KXivQe4B14K0Vwqep14Kzyg5PXIwM3HYol2WEv2aXnW1+w8rLkFdjzya1R2reAGoJbmT5cDCQ9AOW2H3ow8tBAW+qUQOncswNf7ECLDR2zd14UOOU/4snLL92d2XCLBuZH+x0fgkFPsR1eMj1tZbRVeYniE57cp7FjFHNsmHTOTBnmeEPYHZVK4dlfcb95gp5r5hpMX0bqrhWgU4+1+emnqyu8I3dqe/7xLlbkhvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=MttvbKYn3cGDyaU6G5ssvCuX7ABU7NSNQbJWOMl/lLI=; b=n8k0ZDMjaZ+4jOZDvNHtvc94W7st6iWd0KMHe3ieYY7yEdkliDJpSHSGX1pG5PE0r5sGTTbFsfQNuPj/I23r9vrwuW5a8Fa0+Yx4ja94JoEIF5Lt18QgjKY733dyuu511UWctan+35DVlEQM1M70DsmGHiGILfh8BvSMiBEo5ejTH061wRTe7INxxRXCNMhnQo+tJ+PL4J6APMPIW5jSPdS6m4e+Ixll6q6B5qk56yXePIIXHkss3cg+enJm+hnoeVi7LgEMQQijLZrs6SXnjAsXNqE5Jb0TP/iwf8UVsRkYHW2RWC7SdjrCTKS15jXfVba7eyRgd7hQiZ+BLNDNnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MttvbKYn3cGDyaU6G5ssvCuX7ABU7NSNQbJWOMl/lLI=; b=gb3e2bDw1mn63sg8iQydcjZD9Rb484/vbBMim2Dz8wSkq7V1hgfjcvP8JYZeXaiXWFFcSgeUhO2Ga2Q1hyFZnkrif3FMN0117QBn1V/K4bIfdAlaEPrPjJ6hNsJdxWJJ0qd49Ew1FwaST253SS7uwql+Z4NxV0iI11UumHVykUw= Received: from BN9PR03CA0313.namprd03.prod.outlook.com (2603:10b6:408:112::18) by MW6PR12MB8757.namprd12.prod.outlook.com (2603:10b6:303:239::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Tue, 14 Jul 2026 06:18:42 +0000 Received: from BN1PEPF00006003.namprd05.prod.outlook.com (2603:10b6:408:112:cafe::23) by BN9PR03CA0313.outlook.office365.com (2603:10b6:408:112::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Tue, 14 Jul 2026 06:18:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BN1PEPF00006003.mail.protection.outlook.com (10.167.243.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Tue, 14 Jul 2026 06:18:41 +0000 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 14 Jul 2026 01:18:38 -0500 Received: from xhdradheys41.xilinx.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Tue, 14 Jul 2026 01:18:36 -0500 From: Radhey Shyam Pandey To: , , , , CC: , , , , Radhey Shyam Pandey , Krzysztof Kozlowski Subject: [PATCH v3 1/3] dt-bindings: usb: ti,tps6598x: add TPS66993 compatible Date: Tue, 14 Jul 2026 11:48:17 +0530 Message-ID: <20260714061820.537792-2-radhey.shyam.pandey@amd.com> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20260714061820.537792-1-radhey.shyam.pandey@amd.com> References: <20260714061820.537792-1-radhey.shyam.pandey@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00006003:EE_|MW6PR12MB8757:EE_ X-MS-Office365-Filtering-Correlation-Id: 64f38024-99f5-458e-6205-08dee16fbfef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|82310400026|1800799024|36860700016|3023799007|22082099003|18002099003|56012099006|11063799006|13003099007; X-Microsoft-Antispam-Message-Info: 6ZmrqkGSiwehHiK1fQv0riLUA6heCnrOSmps7tjkJpu/EmUy9v4IKlee4F8mDFOOw1OuhpptKHA0CIjZhFiwkiV50IhPEMBdVDRXtoE+dV3HCpctIGAl/t6KgumiZRl0P9Tm8Rv0CHzc7g+yXvFaVoD59DiovlLDegLUlmiM9TMHVGKuyA9jd5CqSIGWJWD04/0Zn7jI0uvhOeoNY6JlMppsyJja5mEoN+1eO8as+9dlDPBzWhKhrQAhrgKv1ygP0Eufta4y1BlWYH36C3Uyp+6C4tEANfqhMegtI71P/PuwtsUf0m8dY/yBNLrZDJ/FUIDztn27YZ/jmjUt1D0WHCNJsGUiy4iwagPTEAnodHOmB6JmVVVt6TRbh/76UTO2qFfRzvJDZfF31tFi/eQEekejH1AscEYHgVAY+KfjjPTwE1YsitJ+vQGT0gcNBY6kfvEnW0lTL5PZQo2Z2MLIBRxyiIn7FiT1ySq20gjM/nPEN7OytGh51gDL2FbeYzSel5qIu3RMzCP6zH3iyn6CMDe/N98oQ7wHebbnCk2l5N8wxNKbqerL/SNLjjojKtAp46ZgLMBbV7RbaX0hKjhaDZSKKsxsg0r3PfaKxsykw1M+XKvY6cJoGzRaf+rOB1LWzM8Bz/9c15XS3txKzAC/1A== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(82310400026)(1800799024)(36860700016)(3023799007)(22082099003)(18002099003)(56012099006)(11063799006)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 14T/1wu9s960ViGidq+g3MF07NpzB7PhCY07Eq6FTNhS15M88f7gzBJ0N5xN5nOK0JdUJFkFBdss8f6a+boI2wRPzuKPOaBQOtwRAoGXU4r7q/eTowY1pRyq7w2lWBKscZwcUvDubhepG5arNzckCLEsLzzJeWRX8BniIPnTbn3ual06yArBtsngT26U3dqwoRHjS0tjAhjHeBU8cYAP7wEd0uyzzaUFO8T0mOn9tNEvLlxA6o6ej437XBqmakbsZNYCWGG+DVs2/70HXVf8SazDPjXzjB3a5s8E52MDc0xzVu3HMQKxaJn+zJgOorQrri6IOtTsRwr1UoVecs4nHJNvfI2TY1eOSm1a7vCWOhAqbCUf0FgeCd4aZtHqMO2ZBlu/2Vr/E9vBYim8Ij+IgABbqDkkUn2CuX6LTSPPArrQLzaYIwGoZQdV8g6PD1QW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 06:18:41.0524 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64f38024-99f5-458e-6205-08dee16fbfef X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00006003.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8757 Content-Type: text/plain; charset="utf-8" Add a ti,tps66993 compatible to explicitly identify TPS66993 devices. The TPS66993 is not host-interface compatible with TPS6598x, so a distinct compatible is required. On the AMD/Xilinx VEK385 Evaluation Board, the Texas Instruments TPS66993 acts as the USB Type-C/USB PD DRP controller for the MMI USB interface, handling CC signaling, connection detection, PD negotiation and power/data role swapping. Acked-by: Krzysztof Kozlowski Signed-off-by: Radhey Shyam Pandey --- Changes for v3: - Add Krzysztof acked-by tag. Changes for v2: - Rename the compatible to match the exact device (ti,tps66993) and in commit mention the usage of TPS66993 chip on VEK385 Evaluation Board. --- Documentation/devicetree/bindings/usb/ti,tps6598x.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/ti,tps6598x.yaml b/Docum= entation/devicetree/bindings/usb/ti,tps6598x.yaml index 1745e28b3110..2c589e9e712e 100644 --- a/Documentation/devicetree/bindings/usb/ti,tps6598x.yaml +++ b/Documentation/devicetree/bindings/usb/ti,tps6598x.yaml @@ -4,13 +4,14 @@ $id: http://devicetree.org/schemas/usb/ti,tps6598x.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# =20 -title: Texas Instruments 6598x Type-C Port Switch and Power Delivery contr= oller +title: Texas Instruments Type-C port switch and USB Power Delivery control= lers =20 maintainers: - Bryan O'Donoghue =20 description: | - Texas Instruments 6598x Type-C Port Switch and Power Delivery controller + Texas Instruments 6598x and 66993 Type-C Port Switch and Power Delivery + controller. =20 A variant of this controller known as Apple CD321x or Apple ACE is also present on hardware with Apple SoCs such as the M1. @@ -19,6 +20,7 @@ properties: compatible: enum: - ti,tps6598x + - ti,tps66993 - apple,cd321x - ti,tps25750 =20 --=20 2.49.1 From nobody Sat Jul 25 20:07:52 2026 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012055.outbound.protection.outlook.com [40.93.195.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5242736EAA4; Tue, 14 Jul 2026 06:18:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784009928; cv=fail; b=IqYm+Yxb7aGqidXgLJYFZNp4zzwOcxqBCY6p+SoRiFMsPJta+8/cv+cti2i8940weoDuNoh2qTkb5bjooiCoPjVZtlTXyKaVqjFHnuCpOol2WWK0L5kZv0jUhbZesQkfPrWBfM+9hs+WGQ4LO9+TcESHxceZbc1+U/X/pVE1unU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784009928; c=relaxed/simple; bh=23GmvdQw+j3DEDGceyDHBxVCzyAQjnny1R0LcoTdBIw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LYiqCvzz2zahq8fy6ifOTXPaAlo7hGRrwkVgyXNXhfffnTddQiu982qD7ZLIQQ7P1rWGWGm0HquIBIkZ52OF3qs8w55pzcSgFJxb3qd+ubXrx1t0jgWbcBzeQN+/VPbXoQKDv3jQUD4hzSaeiByCssQwyp7qzThHaeP0uhJ/oJw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=nxbyKMZl; arc=fail smtp.client-ip=40.93.195.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="nxbyKMZl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CNn1S4IwE58rNRZLQ/rj0abmm1UCIvcWke2uXBXHWL8bfVxwpB7MMpEyg+jfDUgzlyrZg7H3B2bOcWDG+MfurJd/AktNAqYOJPpVdfkdJtyueklAxdp+LNDFi0enBTuzpIN6pFBc7MIzHQZoxX/uaDb6eGrq0sOhFkG93UfGYl4B4ECYinc9EJAVkS7Iix0mpQv+fppm8vB2n9dV6vC10xsKJNvxbrsVapa9qeoZvDFCpyB5+eoIPcthr9CxmmeRp7P3T42JLK56Jzy4cLtP0GTFjfXJCd/VxsfyiEgbokcUQo+r0lqar693CQIER0NC74NWja+6tgKlGdcOjNOoOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=WKliloXlfaPyaKBa0RVlJ5vTtRW7fraoHqpYvBZrchc=; b=sy3tdPSSuAOUfNmoewxWwbeNgh3zTG1BZE4ekQyGVoKAbZXARHafdLje0eS/9fp56tD3uo4n2g1bPNoiJyse8t/AmLeZnMWXWS5c8cQJ5xJ3qVryEhQIK2+Rgd09X0Zdq8IeujA0JbqWyYfbtvluNhE1UhyR4sTml8ZAC8S4j9CeEi/0kbncbt3DLxdFeu0Toa0J8npuDpWAkqBswZ03FeVRaKVJO/DeygTZdkPWexbsUW7Zp0U+00ptvA4bub2sBuA8Z/r7DxrnNrOdnmJP2EarQjhYXg+GDl0UJray2JHaLe/rlWbfNUnNgKW2hrfw6HAATTvhwfUVJVqHxflH+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WKliloXlfaPyaKBa0RVlJ5vTtRW7fraoHqpYvBZrchc=; b=nxbyKMZlJNR8XtAkhGRqM68NA0VY3esvUeGjN3haWuL9s6xRrJB1IawkAOONh73r2mKKY+ommmasPx3mLnUQHFzL+HRfNQhTSo9kmI34aFnHdeP0vFdqNrq8PFZyi+KHBmCa/PExaSBxOKTBawqAgZ59IetSLuQoK7ifO5c65kg= Received: from MN0P221CA0016.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:52a::19) by CYYPR12MB8853.namprd12.prod.outlook.com (2603:10b6:930:cb::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Tue, 14 Jul 2026 06:18:43 +0000 Received: from BL6PEPF0001AB74.namprd02.prod.outlook.com (2603:10b6:208:52a:cafe::63) by MN0P221CA0016.outlook.office365.com (2603:10b6:208:52a::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Tue, 14 Jul 2026 06:18:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by BL6PEPF0001AB74.mail.protection.outlook.com (10.167.242.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Tue, 14 Jul 2026 06:18:43 +0000 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 14 Jul 2026 01:18:41 -0500 Received: from xhdradheys41.xilinx.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Tue, 14 Jul 2026 01:18:39 -0500 From: Radhey Shyam Pandey To: , , , , CC: , , , , Radhey Shyam Pandey Subject: [PATCH v3 2/3] usb: typec: tipd: add read_power_status callback to tipd_data Date: Tue, 14 Jul 2026 11:48:18 +0530 Message-ID: <20260714061820.537792-3-radhey.shyam.pandey@amd.com> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20260714061820.537792-1-radhey.shyam.pandey@amd.com> References: <20260714061820.537792-1-radhey.shyam.pandey@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB74:EE_|CYYPR12MB8853:EE_ X-MS-Office365-Filtering-Correlation-Id: 9aba0ddf-8eff-41fb-b1bd-08dee16fc148 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700016|23010399003|376014|11063799006|56012099006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: TbxenNXh0/OTNWRmU+IfYWYdIj4ak9yHHgEs4C+YsV5yJDfTQVz2RqRl3eG/it5ElVEPVbY0p7M4ZI7NmlSIz+o2mxcRphvGPJHJm6DxU3jpZKxINnBlMY5lQjkFJt1Y+3XXLbmBObpub78t4mU1ERG0KsidQ7bmWNwFE80NPbAXB1D21Oy+8EFpaseSlVrPrBfuGMRiKDSu5qM3Lgr34PX5akz4Xo9EqpjiuzS6oS3l0E9hPIZ0HjXNFJEOCDSsJgygdYTx8NBPzD5hWGeskFH/ZTuCrSzhm8wb8+NLeABFkXJQIGDI472T+4HVu3edWwUPw3uilz6KeQBGyu3LmRoDZ8f1tzdlJSZTHagezwccRI9ueHpQyZH4Sb/+UbI+sIja6KNw8UeXITeY+vmWiwo3yWknNxXHqCry1LHx3BXsM/fNCrNPdyTC39NtgAB5qbixw+F3Ne5Q7py0Pb0JC0t9pbQsAu4fYV2918nAA47Qf8tNGZct5s63zi/8wXwT/WHZU69+5k99rPsf1RmHd7q2DbV9dBGcpxbm+7fCdObRp1FsLdm2+JsdkSeRnuh74yGiW8nPxuSgWp9VvMfbmYKZ4LWv5aIGFL3CVJWmkqC8WQo1CTgJ4cFxmrovkud6dO7RUiKMfLASGYu3C5/OyGb5kOZWkJFB1XrSkjHgDpoWvw1wFuvTpXF46BwT9dhGk7QXK9cP0l708CKgKMr3Yw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(23010399003)(376014)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MNiOpPun43RNCHLS4y5WIcmDCD4TySx6c5dAzp8qbzfd3t9ohtiRzl7DizQ0HDS/Mq3G6r+IALzqdqwo0sBW1xkp+iWSvD34ag6ybL08jWbh7DbJsAxxAhJE4Logm7yxdezLLORpOyFxXYkvTFUyVge9npjUy/PVW5f7Wgw1B/y6KFjp4Sx+lfVIR3Z2ELAqRmdS9vphcxgMMcCc1+RVPEuqx3h7vPvyOsvyPcersQRuO8Iwlmu/D60J6H2Me20mA7kBRt/Ob1gThmcnknCRSbmkY/Wt9kovE9qGvGtvPM3w/djmHB3FZCTjpOCMsL9WYFB8s7iQQ8fnPDjexXvDhWk4E9B8Tg+9VllB9l2wSVj9dQPUOhF5jBcdJt4Fz7/w6+kyhZv4oqMUMTF2OMVTSvoyp004Wjl7bbv39VrizBNRbd65rtPk3E4o6XBY2tdc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 06:18:43.3142 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9aba0ddf-8eff-41fb-b1bd-08dee16fc148 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB74.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8853 Content-Type: text/plain; charset="utf-8" Convert direct tps6598x_read_power_status() calls to use an indirect read_power_status callback through tipd_data. This allows variants (e.g. TPS66993) to provide their own power status reading logic while keeping existing behavior unchanged for TPS6598x, CD321x, and TPS25750. Reviewed-by: Heikki Krogerus Signed-off-by: Radhey Shyam Pandey --- Changes for v3: - Add Heikki Krogerus reviewed-by tag. Changes for v2: - New patch to add TPS66993 driver support. --- drivers/usb/typec/tipd/core.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index b6335b36d384..9097b0d40a71 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -159,6 +159,7 @@ struct tipd_data { int (*init)(struct tps6598x *tps); int (*switch_power_state)(struct tps6598x *tps, u8 target_state); bool (*read_data_status)(struct tps6598x *tps); + bool (*read_power_status)(struct tps6598x *tps); int (*reset)(struct tps6598x *tps); int (*connect)(struct tps6598x *tps, u32 status); }; @@ -897,7 +898,7 @@ static irqreturn_t cd321x_interrupt(int irq, void *data) goto err_unlock; =20 if (event & APPLE_CD_REG_INT_POWER_STATUS_UPDATE) { - if (!tps6598x_read_power_status(tps)) + if (!tps->data->read_power_status(tps)) goto err_unlock; if (TPS_POWER_STATUS_PWROPMODE(tps->pwr_status) =3D=3D TYPEC_PWR_MODE_PD= ) { if (tps6598x_read_partner_identity(tps)) { @@ -952,7 +953,7 @@ static irqreturn_t tps25750_interrupt(int irq, void *da= ta) goto err_clear_ints; =20 if (event[0] & TPS_REG_INT_POWER_STATUS_UPDATE) - if (!tps6598x_read_power_status(tps)) + if (!tps->data->read_power_status(tps)) goto err_clear_ints; =20 if (event[0] & TPS_REG_INT_DATA_STATUS_UPDATE) @@ -1026,7 +1027,7 @@ static irqreturn_t tps6598x_interrupt(int irq, void *= data) goto err_unlock; =20 if ((event1[0] | event2[0]) & TPS_REG_INT_POWER_STATUS_UPDATE) - if (!tps6598x_read_power_status(tps)) + if (!tps->data->read_power_status(tps)) goto err_unlock; =20 if ((event1[0] | event2[0]) & TPS_REG_INT_DATA_STATUS_UPDATE) @@ -1839,7 +1840,7 @@ static int tps6598x_probe(struct i2c_client *client) =20 if (status & TPS_STATUS_PLUG_PRESENT) { ret =3D -EINVAL; - if (!tps6598x_read_power_status(tps)) + if (!tps->data->read_power_status(tps)) goto err_unregister_port; if (!tps->data->read_data_status(tps)) goto err_unregister_port; @@ -1981,6 +1982,7 @@ static const struct tipd_data cd321x_data =3D { .trace_status =3D trace_tps6598x_status, .init =3D cd321x_init, .read_data_status =3D cd321x_read_data_status, + .read_power_status =3D tps6598x_read_power_status, .reset =3D cd321x_reset, .switch_power_state =3D cd321x_switch_power_state, .connect =3D cd321x_connect, @@ -2000,6 +2002,7 @@ static const struct tipd_data tps6598x_data =3D { .apply_patch =3D tps6598x_apply_patch, .init =3D tps6598x_init, .read_data_status =3D tps6598x_read_data_status, + .read_power_status =3D tps6598x_read_power_status, .reset =3D tps6598x_reset, .connect =3D tps6598x_connect, }; @@ -2018,6 +2021,7 @@ static const struct tipd_data tps25750_data =3D { .apply_patch =3D tps25750_apply_patch, .init =3D tps25750_init, .read_data_status =3D tps6598x_read_data_status, + .read_power_status =3D tps6598x_read_power_status, .reset =3D tps25750_reset, .connect =3D tps6598x_connect, }; --=20 2.49.1 From nobody Sat Jul 25 20:07:52 2026 Received: from CH1PR05CU001.outbound.protection.outlook.com (mail-northcentralusazon11010056.outbound.protection.outlook.com [52.101.193.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D65073033E6; Tue, 14 Jul 2026 06:18:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.193.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784009934; cv=fail; b=LqiY0RaLzTJgCqjDDB9ibQ11cl5DPXAPG162g+Za9WAXqsKW80De3HAJ/OxVDI/JVlf/q0lORpq7y7Fe0S8OIR0cGifxOeA/f1qVNY2ueKlgRrkhEnb1LHSW+GDwDZO8twzzOU0u+TtEyLFnRjScz/zZ3d68UaHJ9Qsu8Zzcp0A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784009934; c=relaxed/simple; bh=wlKQefAHTXuOPslDybQRufCCjG5Ok+jeBG1R0uy239s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Kp6a6SvuSfOYOheiZe3wlhuXWaPwHhWY/ouBM2nE1sUF/OE8Y45hbZwlzAhHs9nlspY8YFdbhmEcvG5ct8p+rRpgC+pPWp04VW8RtyvOijlx8dUkGQuPqeeFzY34kK6YhkMVtLKQv3gYzctcFDOsrUi0/z6Gi53YzN49nohW/pk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=2QZKaU4x; arc=fail smtp.client-ip=52.101.193.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="2QZKaU4x" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cS/3pKICJlQL6rRP5s38/9xqWt6bF1Hkx8g1leNn7FV2uaVNqrBI1BAK9ShbbBK1S9n6rBInvRWRJbe1IC20dz9dxNilPh1UZxfaXqm+F2d06fjipk5Yplbi/gtXNNUHuI6ssE+X+/xAOMNcnvWyL8ytywjsvo231UxxIa/EWQKQfmvVT3tdqng5MmrzQ/7iv/8IzmxcJf2k99y5O/c0FDbEfy/cVigT80PzilTderxXxWlUWl6IRdOURiQRifR3GhA5fSSmprZNOlT5f9ypVB8Ki1BXl1XI7cNMwU+DT71a0DAfx55v04UaZHCEQkNz31Db1FXNFRJdezDdH7wkgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=9K0YpmS4dE4BF+6oS+fQ6oAmmaedPOgiPHr6NHW1xMQ=; b=YuNJUajtJrGsrEI6zzeaaawO/IDhMX1DhNIS06W8yDmIE9p8xtNgRm/yl3eO4l3lx+FcdtsYlLk9LDyddaKLv5cqjWbnp14WesgMNTK7SS1kAlWEGTKZRLrJabzJkmtkWJoNCfwGo/1sT90cODX7lMsVrpWPW3/wSRxwS4cJ1XR2QQUVY4PUK4chz50nnWg/ehse48eu2+vEzNSZLsORqHM/rEbX4gsjoHC1gyY0/RrM3WCDPYivwFhk2ZnuDRJEdf0//tepsq/K0yV5LRuGjoT+PPwvrH5h0TA0FtbpUm30DSTEkVI/MJKJC6lsi2RSwysPBa8ZGARe6Zvg01/ppg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9K0YpmS4dE4BF+6oS+fQ6oAmmaedPOgiPHr6NHW1xMQ=; b=2QZKaU4xxXbJaMGTe1GhX4Q43jdet9Fq3YIwMVER4rdES3AG2O8P2hUUjA1qNIPtSvPkGRK4HV6+XomC+GGkEzI+QyzGBYr+F0HWD7aBh9NHYHaJjs+Zb0PuinGUno6pEBwXWnz9yWLG1ZsFb9ilLYEN1o2SokAYSOME0KgJG1o= Received: from BN9PR03CA0752.namprd03.prod.outlook.com (2603:10b6:408:13a::7) by IA0PR12MB8982.namprd12.prod.outlook.com (2603:10b6:208:481::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Tue, 14 Jul 2026 06:18:48 +0000 Received: from BN1PEPF00006000.namprd05.prod.outlook.com (2603:10b6:408:13a:cafe::a1) by BN9PR03CA0752.outlook.office365.com (2603:10b6:408:13a::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Tue, 14 Jul 2026 06:18:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BN1PEPF00006000.mail.protection.outlook.com (10.167.243.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Tue, 14 Jul 2026 06:18:47 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 14 Jul 2026 01:18:45 -0500 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Mon, 13 Jul 2026 23:18:44 -0700 Received: from xhdradheys41.xilinx.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Tue, 14 Jul 2026 01:18:42 -0500 From: Radhey Shyam Pandey To: , , , , CC: , , , , Radhey Shyam Pandey Subject: [PATCH v3 3/3] usb: typec: tipd: add TPS66993 support Date: Tue, 14 Jul 2026 11:48:19 +0530 Message-ID: <20260714061820.537792-4-radhey.shyam.pandey@amd.com> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20260714061820.537792-1-radhey.shyam.pandey@amd.com> References: <20260714061820.537792-1-radhey.shyam.pandey@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00006000:EE_|IA0PR12MB8982:EE_ X-MS-Office365-Filtering-Correlation-Id: e3e3affe-0bf6-41f5-52bb-08dee16fc3e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|82310400026|36860700016|1800799024|3023799007|56012099006|18002099003|22082099003|11063799006; X-Microsoft-Antispam-Message-Info: qQInE45B41Azi/Mh5T21DT86dcd+NXwLaW89p1vCwF45JqxvJ0bg+RNgLYVItWDPcoJwKOsyg4EpNR2ggLYHZ/lo1t3wg8hCYIgWaHQaXRvtm2YKpv/RTNVM0yA8aoGM7DP2sGXV6loqGWTf9huT08uB5Wwynm5FtW4hFzFAWIufus43fM9KUksmuCQ5bpXiHE53WBdllwmZPKlCi9+t9dXD/5/0v0cwfu8zihPWJx85cTT9tVHAf75qf/oEJ3cGNy67s2ZKhCLN6k4+BkajmaIi1KJ13ardDd+q7U4KiP2KQKzZ+gGV076MjqsrTZ12y86BqgTjDcV74GG5WRpoXRrY72HZc3NTQwADcKmI8rKfQIv68K6IvSXuoUlZs/3xBTKxxAxp2ccHhhj3ZZJFWfpF3t+YnmxsCgjo0bd8DGxdjnL4KvZkEut7GnolupJ5/1dyMCNfj/rMoTuqQSGg2Rn/zlJ5swYmNmzr3Bp4euhJORHRqMkwSos6cHZ5x+E8c9xJ2ugcxn2mteYXs6l3TpZPUhnsmTy7fJI2s0QnehsGm5GLHzVG58jAV3bc4BXmUIP8ZNS85Xv7qmiO3WzrPMemqhTCAgUVXi4NJMenSlVmmei0F3kJbEyGUQb/07/DacNZWiu4dX8JuI2MzBrODcA6TdsQFwFB6/8iLiJXRg0sDVIeNDRgnZbgV84C6JZIfQ7qesuiEPt0zu599AzsuQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(82310400026)(36860700016)(1800799024)(3023799007)(56012099006)(18002099003)(22082099003)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: snZ6VXv7rIO1VT4SbCDqBUbsfD5ult4QbjH100KIOcMZuepzFefeNWh4Ab19XVo3NCZGcuVJcq6rVFskRDwJkoun7DTCNsqmP4QatLlv4Fn/AEg3KayG6BZc0rkJa85SGwtYZZDzzqlzrgCIeYcRUtf5NcMozLnKgU7nPkyZARCpWOCDj4rR6lzLZYlQRspP1IcNTX+P7kr+YH9z4TE1DI/8qmPcmro1JsQQRPWaR4qrm4WtXedBetpOxv6Uzhc+1wta4L4Lsm02JejuOkPXyvrAbLUBDo29q8tkhEfC79+eB1PQgqS/9khmtWlHLNi04+aGq1qOzm30PYjY8bsKxoLRw3YeBV/uHB5aN+elkjujK6dGhMN2A+nqDArjZHJEE1lTAyfxX5B4zudbjSRWMOLY+egbGCjUJMOV473R9arAvcnsXz7T4xgCsBhFg6I9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 06:18:47.7096 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3e3affe-0bf6-41f5-52bb-08dee16fc3e7 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00006000.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8982 Content-Type: text/plain; charset="utf-8" Derive power status from the STATUS register (0x1A) now that TPS66993 deprecates the Power_Status register (0x3F). Add support for the "APP1" mode string. TPS66993 controller is configured in polling mode and only type-c flip orientation feature is supported on AMD Versal AI Edge Gen 2 VEK385 Evaluation Kit. Signed-off-by: Radhey Shyam Pandey Reviewed-by: Heikki Krogerus --- Changes for v3: - Remove the unnecessary if (tps->data->trace_power_status) guard and call the trace callback unconditionally, since every tipd_data entry always provides it. Changes for v2: - New patch to add TPS66993 driver support. --- drivers/usb/typec/tipd/core.c | 64 +++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 9097b0d40a71..522f56742aa9 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -130,6 +130,7 @@ enum { TPS_MODE_BIST, TPS_MODE_DISC, TPS_MODE_PTCH, + TPS_MODE_APP1, }; =20 static const char *const modes[] =3D { @@ -138,6 +139,7 @@ static const char *const modes[] =3D { [TPS_MODE_BIST] =3D "BIST", [TPS_MODE_DISC] =3D "DISC", [TPS_MODE_PTCH] =3D "PTCH", + [TPS_MODE_APP1] =3D "APP1", }; =20 /* Unrecognized commands will be replaced with "!CMD" */ @@ -631,6 +633,34 @@ static bool tps6598x_read_power_status(struct tps6598x= *tps) return true; } =20 +/* + * TPS66993 deprecated Power_Status register (0x3F). BC1.2 is not supported + * and the remaining bits are redundant with STATUS register (0x1A). + * Synthesize pwr_status from the already-read STATUS register. + */ +static bool tps66993_read_power_status(struct tps6598x *tps) +{ + u16 pwr_status =3D 0; + + /* Same masks as TPS_POWER_STATUS_CONNECTION() / SOURCESINK() / PWROPMODE= () in tps6598x.h */ + if (tps->status & TPS_STATUS_PLUG_PRESENT) + pwr_status |=3D FIELD_PREP(TPS_POWER_STATUS_CONNECTION_MASK, 1); + + /* SOURCESINK: 1=3Dsink; STATUS.PortRole 1=3Dsource, opposite convention = */ + if (!TPS_STATUS_TO_TYPEC_PORTROLE(tps->status)) + pwr_status |=3D FIELD_PREP(TPS_POWER_STATUS_SOURCESINK_MASK, 1); + + if (TPS_STATUS_VBUS_STATUS(tps->status) =3D=3D TPS_STATUS_VBUS_STATUS_PD) + pwr_status |=3D FIELD_PREP(TPS_POWER_STATUS_TYPEC_CURRENT_MASK, + TPS_POWER_STATUS_TYPEC_CURRENT_PD); + + tps->pwr_status =3D pwr_status; + + tps->data->trace_power_status(pwr_status); + + return true; +} + static void tps6598x_handle_plug_event(struct tps6598x *tps, u32 status) { int ret; @@ -1026,6 +1056,8 @@ static irqreturn_t tps6598x_interrupt(int irq, void *= data) if (!tps6598x_read_status(tps, &status)) goto err_unlock; =20 + tps->status =3D status; + if ((event1[0] | event2[0]) & TPS_REG_INT_POWER_STATUS_UPDATE) if (!tps->data->read_power_status(tps)) goto err_unlock; @@ -1034,9 +1066,15 @@ static irqreturn_t tps6598x_interrupt(int irq, void = *data) if (!tps->data->read_data_status(tps)) goto err_unlock; =20 - /* Handle plug insert or removal */ - if ((event1[0] | event2[0]) & TPS_REG_INT_PLUG_EVENT) + /* + * Refresh power status before connect - needed for TPS66993 which + * synthesizes pwr_status from STATUS and never gets POWER_STATUS_UPDATE. + */ + if ((event1[0] | event2[0]) & TPS_REG_INT_PLUG_EVENT) { + if (!tps->data->read_power_status(tps)) + goto err_unlock; tps6598x_handle_plug_event(tps, status); + } =20 err_unlock: mutex_unlock(&tps->lock); @@ -1072,6 +1110,7 @@ static int tps6598x_check_mode(struct tps6598x *tps) =20 switch (ret) { case TPS_MODE_APP: + case TPS_MODE_APP1: case TPS_MODE_PTCH: return ret; case TPS_MODE_BOOT: @@ -1813,6 +1852,8 @@ static int tps6598x_probe(struct i2c_client *client) goto err_clear_mask; } =20 + tps->status =3D status; + /* * This fwnode has a "compatible" property, but is never populated as a * struct device. Instead we simply parse it to read the properties. @@ -2007,6 +2048,24 @@ static const struct tipd_data tps6598x_data =3D { .connect =3D tps6598x_connect, }; =20 +static const struct tipd_data tps66993_data =3D { + .irq_handler =3D tps6598x_interrupt, + .irq_mask1 =3D TPS_REG_INT_DATA_STATUS_UPDATE | + TPS_REG_INT_PLUG_EVENT, + .tps_struct_size =3D sizeof(struct tps6598x), + .register_port =3D tps6598x_register_port, + .unregister_port =3D tps6598x_unregister_port, + .trace_data_status =3D trace_tps6598x_data_status, + .trace_power_status =3D trace_tps6598x_power_status, + .trace_status =3D trace_tps6598x_status, + .apply_patch =3D tps6598x_apply_patch, + .init =3D tps6598x_init, + .read_data_status =3D tps6598x_read_data_status, + .read_power_status =3D tps66993_read_power_status, + .reset =3D tps6598x_reset, + .connect =3D tps6598x_connect, +}; + static const struct tipd_data tps25750_data =3D { .irq_handler =3D tps25750_interrupt, .irq_mask1 =3D TPS_REG_INT_POWER_STATUS_UPDATE | @@ -2028,6 +2087,7 @@ static const struct tipd_data tps25750_data =3D { =20 static const struct of_device_id tps6598x_of_match[] =3D { { .compatible =3D "ti,tps6598x", &tps6598x_data}, + { .compatible =3D "ti,tps66993", &tps66993_data}, { .compatible =3D "apple,cd321x", &cd321x_data}, { .compatible =3D "ti,tps25750", &tps25750_data}, {} --=20 2.49.1