From patchwork Thu Sep 6 19:26:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10590999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14ACF13AC for ; Thu, 6 Sep 2018 19:33:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1BB62A092 for ; Thu, 6 Sep 2018 19:33:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5D692B042; Thu, 6 Sep 2018 19:33:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68D252A092 for ; Thu, 6 Sep 2018 19:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728220AbeIGAKi (ORCPT ); Thu, 6 Sep 2018 20:10:38 -0400 Received: from node.akkea.ca ([192.155.83.177]:40694 "EHLO node.akkea.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728011AbeIGAKi (ORCPT ); Thu, 6 Sep 2018 20:10:38 -0400 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 1BE145420F0; Thu, 6 Sep 2018 19:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1536262023; bh=pl8iQv5Xs8vqp2I/bTrbJRdWs0RmqcAX9AMOI1isexs=; h=From:To:Cc:Subject:Date; b=VL9jg9H+OwOUyklxa3z0FKhASmM4+MSttC5FOGcCB9N+W8N2uTLz1eg8Kef/b9vMq /SATYMgMeweMw+cvJ88gzPOACr2yWo4J0WRNkcERc3vNWaxTyq5Dt2SAyRRARFk0pN iN63/vPWdVkPKAGjZsoCPWRYneQWtKX0IqUm9pjE= X-Virus-Scanned: Debian amavisd-new at mail.akkea.ca Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TrWbLe468vYm; Thu, 6 Sep 2018 19:27:02 +0000 (UTC) Received: from localhost.localdomain (S010614dae980e3b8.cg.shawcable.net [68.147.236.72]) by node.akkea.ca (Postfix) with ESMTPSA id 4B6F45420EE; Thu, 6 Sep 2018 19:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1536262022; bh=pl8iQv5Xs8vqp2I/bTrbJRdWs0RmqcAX9AMOI1isexs=; h=From:To:Cc:Subject:Date; b=pysE7kyT3weFKa5CX3ngo3RsB06CwlH4Ga5JMR9Lh0iehRrQIfhj/I+5A4cJ2QZN1 BVyZWhyw8pe94KfSVnTJHRCE/IRiSRB/UHGB8NKMOeGYAynrszO/mMQSHbAgmbS5Om 2G2ompKUGbekpeWoIZhwfrWeCg8A78cd3vlyfp/4= From: "Angus Ainslie (Purism)" To: Heikki Krogerus Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "Angus Ainslie (Purism)" Subject: [PATCH] usb: typec: don't disable sink or source on initialization Date: Thu, 6 Sep 2018 13:26:44 -0600 Message-Id: <20180906192644.24587-1-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the board is being powered by USB disabling the source and sink can remove power from the board. Default to source and sink enabled. Signed-off-by: Angus Ainslie (Purism) --- drivers/usb/typec/tcpm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index ca7bedb46f7f..a1b819cf31da 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c @@ -2462,9 +2462,11 @@ static int tcpm_init_vbus(struct tcpm_port *port) { int ret; - ret = port->tcpc->set_vbus(port->tcpc, false, false); - port->vbus_source = false; - port->vbus_charge = false; + /* default to source and sink enabled in case USB is our only power + * source */ + ret = port->tcpc->set_vbus(port->tcpc, true, true); + port->vbus_source = true; + port->vbus_charge = true; return ret; }