Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2018128imm; Fri, 7 Sep 2018 09:33:33 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYX41gcLv7eZI3xryRJt2GxgDUHlvkr3l8WpSmWW8vtK/Mf+bMy9YE3tfl1XB3LpLgxshdd X-Received: by 2002:a62:6c85:: with SMTP id h127-v6mr9450224pfc.65.1536338013138; Fri, 07 Sep 2018 09:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536338013; cv=none; d=google.com; s=arc-20160816; b=bb57qh/VaOgFT9szalTvHDg1UvcwqYiMfU0YwbJzW0kVqtWg+y3UvL61VZwYEH7atL UA4F4Ac56emRtZ9vLL/5tlc4D3uJ4aEaKz0SaPdd/VjTmzyEP0kM+efQj+X0/8BkFaDz zgXJMYR0Rrtw2q2TSox0kzWaPK4ZN0P03dK/8Gq3kOygtfvut6BI6uZVFsQi3jfYr1OR DH5VyT4QkTEo9S6jdJ/33P9zjlWTbjjrlto3MqqmEa0yV+S9v2ly2kEl/EmJQMQvgKiD uAdPK0Gz/l7Yh8DYcuEvc6fuoZ2BXpiOSKHXvd5r5CHQuWCBwqiBdUoyFnjdPDbvWdvH CLlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=q/iTA2d2KrpjnDGL1a1FzznXDMvDUZVnWXWH6jnmLSc=; b=gIUwYU2hAAZfFOekO2NAExfHaMfUnKa8V0wwpGKUvzJ38AdM9m5hyytKMBgGWbiuOc KIGO4cgGpr8XMhfnemWVs/frLmwTJHmmIFL1ulmHNKKfhRuxSyXJLWI35NXln8rFD8kS R7F2naugtFkdG/Ep75plEbB59gDnV31XfLIwcJWScUbJ+Je4gEEeiMjFU/t0B5X7BHAK 5YjqOzIrkLpb//MVw4b3Qq9ePDP5s9xLJMVCl9T/8EHYqisuYYhGCYRjhFQtr+RkOPDX OhxauvNtOp/yP0kGFrWPZlaye7KhAhWKzJDv4RtR0aU+Uuyt1epNZjmq2qrzoBskLNMr qk2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=l08EbGrW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3-v6si8965970pga.137.2018.09.07.09.33.17; Fri, 07 Sep 2018 09:33:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=l08EbGrW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729187AbeIGRgq (ORCPT + 99 others); Fri, 7 Sep 2018 13:36:46 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44985 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbeIGRgq (ORCPT ); Fri, 7 Sep 2018 13:36:46 -0400 Received: by mail-pg1-f195.google.com with SMTP id r1-v6so6963441pgp.11; Fri, 07 Sep 2018 05:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=q/iTA2d2KrpjnDGL1a1FzznXDMvDUZVnWXWH6jnmLSc=; b=l08EbGrWZ28ILFdgmBdhy3BVe9bUkitGV7AJm1ZmeQaHIh/JXLQCLFniuQaE6nOsJ2 AZNi7Cjs74MRwWbTXa1caOIuxzbGpVenkw6fNLnGT8rQsCYUOxznao+zw5UCH+lhQp6e GRGNpZQ9Fw4av2tqPmQ+NnBSoS3SCcVgdbYeuKCZIuc4lU4RVbX4wXRWkpPP3jMWVGVj 2Pmf/Hc/nzOKV/hxb8BaL6GK5qdvPCTmKhLvKsii3smTWbkl60NSQ9jmjhZLb4/5V+RF l4az3fiLlyOxiHaZYosQp+ZcIkGIA7F0POHqtmsAGu+fB8ua1v8d0wpooQOVGG+MvDcn NfBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=q/iTA2d2KrpjnDGL1a1FzznXDMvDUZVnWXWH6jnmLSc=; b=Q8wOfJiccc7rZhmR4FZkKaRBA6ImTYuSDF2GOg8ZqmUTw6gf61s4XY7doeaf6arj4v 03Y/8JbsmC2qckFCdEl1z9fLNT8CKZjU4FnCUYOIJMzWvtBIfSNhPVcyoT3sYymlvkXe cO3JwUecKen64BtVu0FgfyhqYL4NS/Dq4D0XAAqbx+u09bgbH9NO49zrg4xHkw8C9fCR SinfVc6AgItqN0FoY+kq10DjGDtYDkrJ6fmYoPLIkdwQxPk0vDDq07fxhDi3s8OwVwHo /GNhPU28DRq4MiO1td2Gg+WqjW8BeySz0ijPdkq80mfuBPocj0GBtH6x2AIR7OA97atF SPWA== X-Gm-Message-State: APzg51AmGzesQqiwdpt6x/Ac7Jkko/jPRblGSiuRXCjLe+jQ6fN/nLLN WQUhVj2BjKJS+sqPdDfjFoG/Jmcy X-Received: by 2002:a62:5047:: with SMTP id e68-v6mr8183084pfb.157.1536324956235; Fri, 07 Sep 2018 05:55:56 -0700 (PDT) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id y4-v6sm11188036pfn.123.2018.09.07.05.55.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 05:55:55 -0700 (PDT) Subject: Re: [PATCH] usb: typec: don't disable sink or source on initialization To: Heikki Krogerus , "Angus Ainslie (Purism)" Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180906192644.24587-1-angus@akkea.ca> <20180907103438.GI25121@kuha.fi.intel.com> From: Guenter Roeck Message-ID: <0adff11c-4836-4035-39a7-1cd2ea3ff74d@roeck-us.net> Date: Fri, 7 Sep 2018 05:55:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180907103438.GI25121@kuha.fi.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/07/2018 03:34 AM, Heikki Krogerus wrote: > +Guenter > > On Thu, Sep 06, 2018 at 01:26:44PM -0600, Angus Ainslie (Purism) wrote: >> 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. >> Seems to me that might violate the specification, and cause trouble for systems where vbus has to be off initially. It may be better to provide this kind of information as configuration parameter instead of imposing it on everyone. Guenter >> 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 */ I am personally in favor of standard multi-line comments. >> + ret = port->tcpc->set_vbus(port->tcpc, true, true); >> + port->vbus_source = true; >> + port->vbus_charge = true; >> return ret; >> } >