Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3863277pxb; Mon, 1 Feb 2021 06:39:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwv1iiQVyT1JK9XmzNtbdJ94ByLl1YvWBig0VP6/Nz1j6m3qOxLOPps2Pu6sYHUBwrvvMmP X-Received: by 2002:a05:6402:27cf:: with SMTP id c15mr18732735ede.179.1612190361988; Mon, 01 Feb 2021 06:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612190361; cv=none; d=google.com; s=arc-20160816; b=aqEGEAiwyQzH0I1ytdYoo3QLVxM/uXqjEKuobQoa71mq1yZ4kUZ/c7GT68lQ6I+VWL YyGJUZphr1kUDLK1vLM2UJ4Fwa7yPEaPPpjrZ5qkgWCrtapE9imzMx0SQwVy98lKnfdL e84t1zGdN6eTlvMvOBVKA7Z2hDJjlexysm3E+WQIy+mQ9rEAOTABR8lNe55ju+99Tuhp Bn7t+oC04s+MTBLqo6IZdjTW8LlW0ftTO+6vB22XpvXYVbD5VZFz9SfNFqyPyBTR5nbI pwX7Yb9Uuo7mN/c/nn+MVYZpRSZmn2UglSnd59dviEE24tb741DYIbxu0VSKgrBfsbgS R5AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=4j6acUV2ux0MtEhMLcP8WGnHmWxcs/GCKuwEzepLUGQ=; b=t9M75GtkxIraOPlNJJY2ENUtXGd5SddMszFNtZPgxReA1FCaNbghqGqGFUBQ54YDRt Yy2MT7RjvAWwnksOYycOp8uqlTH9bD72Cq0S9cQpEAeY+8HESVkaJPrHLa4syqX7WQ4J sEvmpYYelexwfQQQxd0OV96xe1W8rqJU2MYoO5qCxykm2zN+M1zNAcJ+wBXhJxog26S5 6q1XvBCK2Gx2Qq2QfV5aX5qyjjpXO2XzvB84+AZyJ68vccsavX2ZcqVA0vJ3PSyIc0Xb 0ISsEgMSWQWT7y59I0dTaLk9YcBgyIlG9+ATqb7mjLoZm351bthuZok8+DF2zjqjSIXO 1h6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv30si1242208ejc.474.2021.02.01.06.38.56; Mon, 01 Feb 2021 06:39:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230438AbhBAOfO (ORCPT + 99 others); Mon, 1 Feb 2021 09:35:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbhBAOeh (ORCPT ); Mon, 1 Feb 2021 09:34:37 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55B4EC0613D6; Mon, 1 Feb 2021 06:33:57 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id AA4531F44612 Subject: Re: [PATCH 6/6] platform/chrome: cros_ec_typec: Set opmode to PD on SOP connected To: Benson Leung , heikki.krogerus@linux.intel.com, pmalani@chromium.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: groeck@chromium.org, bleung@google.com References: <20210129061406.2680146-1-bleung@chromium.org> <20210129061406.2680146-7-bleung@chromium.org> From: Enric Balletbo i Serra Message-ID: Date: Mon, 1 Feb 2021 15:33:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210129061406.2680146-7-bleung@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Benson, On 29/1/21 7:14, Benson Leung wrote: > When SOP Discovery is done, set the opmode to PD if status indicates > SOP is connected. > > SOP connected indicates a PD contract is in place, and is a solid > indication we have transitioned to PD power negotiation, either as > source or sink. > > Signed-off-by: Benson Leung Acked-by: Enric Balletbo i Serra > --- > drivers/platform/chrome/cros_ec_typec.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c > index 6bc6fafd54a4..a7778258d0a0 100644 > --- a/drivers/platform/chrome/cros_ec_typec.c > +++ b/drivers/platform/chrome/cros_ec_typec.c > @@ -900,6 +900,9 @@ static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num > dev_err(typec->dev, "Couldn't parse SOP Disc data, port: %d\n", port_num); > else > typec->ports[port_num]->sop_disc_done = true; > + > + if (resp.sop_connected) > + typec_set_pwr_opmode(typec->ports[port_num]->port, TYPEC_PWR_MODE_PD); > } > > if (resp.events & PD_STATUS_EVENT_SOP_PRIME_DISC_DONE && >