Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15329317rwb; Mon, 28 Nov 2022 10:16:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf4COvSFpJX/pL+lPXlbmV/ttaQsD+wNXvfkNn0CahNHCqz4rR0MIPQlCmQ/HktwKslebC39 X-Received: by 2002:a50:ed90:0:b0:46a:e6e3:b3cf with SMTP id h16-20020a50ed90000000b0046ae6e3b3cfmr11867026edr.333.1669659389000; Mon, 28 Nov 2022 10:16:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669659388; cv=none; d=google.com; s=arc-20160816; b=f1PYGoljDniLqTuAW58EGXMv6aGG8V0HndCk1RTYJARhXCGusJsgm9+N8ul8wPDWAh gYDSRmcmY+7WzNsSTOoJLMlGLpO0fJoe9RUCRZuh1whzTmhic6KSeXbqQJDTNoNkt5ay 5iFymm1PtiVhPYStKSe4RwWR6Ql4UYzbkaH0knxodgGsaSp3nkQwBNQjX1djVMCMdeWU f/NDpDOnlANW04y2I/80EUESo5iDzmik3+ubXlhI8bLuQzXKARlh7yWC+wLQjytb/aTv Y+ZPTLU5vhxxHwC1Bme5TciXiGsaY3+qGs7k0G/0M9ytHj1DETFVRntv8ekRYxIdW+Rr cJSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=uWr9BsF5eXVkjF1lihfNadM8eLlnHm/DZvhOmYHJ7fM=; b=g7q0fNUUz0lYJ1f415xKRQiZPTD0+rZWsvozayU5JnQpuDB0XXprD/gAQK7GF6SHac 3B9VveKclLnOrZ56AZnNQKCHFk8dhE2TJZ3zQbikES3dnvxEIhRKZEcwXxZKfPDuKnfa H5qtwCggys2PnjcMZL8NXsDV5foPtgc0V/zbizlpxvGvATbIGibRDf12JocKFDVsr8H9 gaKV1fpA7+RstiAAOatdn65H1RvNqNi4awf973LAuMZjfecUkNKgQQkowr5Xh3XJLQZF 8MftTspb1YlZBfP2nxqG1adyn98qssQrZh1Vmn/apxL8m6lESK4fUY47OFk/ZFo3bQWS bYIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm1 header.b=jZXbponI; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Pc6gXiIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mm6-20020a170906cc4600b00783df65ae5esi7501209ejb.683.2022.11.28.10.16.08; Mon, 28 Nov 2022 10:16:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm1 header.b=jZXbponI; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Pc6gXiIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232786AbiK1QXa (ORCPT + 84 others); Mon, 28 Nov 2022 11:23:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbiK1QXK (ORCPT ); Mon, 28 Nov 2022 11:23:10 -0500 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 127B3C7D; Mon, 28 Nov 2022 08:23:10 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 1E60B320094D; Mon, 28 Nov 2022 11:23:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 28 Nov 2022 11:23:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1669652588; x=1669738988; bh=uWr9BsF5eX VkjF1lihfNadM8eLlnHm/DZvhOmYHJ7fM=; b=jZXbponIVf1yUF32HALm/So70R rISSObGj4jgPDy93wzxCditX9XRRVQZtVB3EVKT5RPH3Z+pnzAus5cQUXx4pq5fy XE0Q9OBAtCuUu6DbmRXKjaNpK5CUc72qVzONqOn6Mg6KzJxb/RR152lgEnt1Wb+d BueJQoEY/eSBXT2WDs2V039y/2qOgGF/qFDrneUKK5OCGz48nneRE60uc07rSK8V qtX67wg4iySsqDzFdpxp3eu22c/7ew97uJ7inYPMcnTfqjZ247wrQYWxWc5Qa9Bh ffVIomW0sHzpX/O+WyFznLTLhbTwHhWzkYAKSYlwu1XD/nf3zpTdkoJqhI3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1669652588; x=1669738988; bh=uWr9BsF5eXVkjF1lihfNadM8eLlnHm/DZvh OmYHJ7fM=; b=Pc6gXiIq7s46GiP1ajhamIfDFABRpEHXlxrOwQtSjWz/eedlisc 1EE8EGB83NBQPcmzLBzqfxuEML1GEiH8fwGyEsCKavPbkpGfEy5P0r/Z2B7p0t/f IrGnWXZk3RMZJgnGuJWm00S5iMpaIY6dNw+6WAmaV0aeuRAefDnohpi1JuJ9pOuS pqucN5NDMXRsavqBXRoKeELtYbbRKdNBETYhCVVWckb5pTb1nf56tCY6gZgsPRIL VsWVyuVhB0nYY6sB3TC3ZmQJcPYUGgVS6IQ05gSsT2CEb+MedjSRrzGkc0UmSkKr 7zXN2k8vTlE7LYfYxyL1U0COJSNevxbJ0qg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrjedvgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuvhgvnhcurfgv thgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrthhtvghrnh epleduffeiheeuvedtffevtdeuleeljeduudfgtedtvefhfeffvdfghfejhefgleelnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhvvghnse hsvhgvnhhpvghtvghrrdguvghv X-ME-Proxy: Feedback-ID: i51094778:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Nov 2022 11:23:07 -0500 (EST) From: Sven Peter To: Heikki Krogerus , Greg Kroah-Hartman Cc: Sven Peter , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev Subject: [PATCH] usb: typec: tipd: Set mode of operation for USB Type-C connector Date: Mon, 28 Nov 2022 17:23:04 +0100 Message-Id: <20221128162304.80125-1-sven@svenpeter.dev> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham 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 Forward the mode of operation to the typec subsystem such that it can configure the mux correctly. Signed-off-by: Sven Peter --- drivers/usb/typec/tipd/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 982bd2cad931..46a4d8b128f0 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "tps6598x.h" @@ -257,6 +258,7 @@ static int tps6598x_connect(struct tps6598x *tps, u32 status) typec_set_orientation(tps->port, TYPEC_ORIENTATION_REVERSE); else typec_set_orientation(tps->port, TYPEC_ORIENTATION_NORMAL); + typec_set_mode(tps->port, TYPEC_STATE_USB); tps6598x_set_data_role(tps, TPS_STATUS_TO_TYPEC_DATAROLE(status), true); tps->partner = typec_register_partner(tps->port, &desc); @@ -280,6 +282,7 @@ static void tps6598x_disconnect(struct tps6598x *tps, u32 status) typec_set_pwr_role(tps->port, TPS_STATUS_TO_TYPEC_PORTROLE(status)); typec_set_vconn_role(tps->port, TPS_STATUS_TO_TYPEC_VCONN(status)); typec_set_orientation(tps->port, TYPEC_ORIENTATION_NONE); + typec_set_mode(tps->port, TYPEC_STATE_SAFE); tps6598x_set_data_role(tps, TPS_STATUS_TO_TYPEC_DATAROLE(status), false); power_supply_changed(tps->psy); -- 2.25.1