Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp737936ybl; Tue, 13 Aug 2019 01:41:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzL8zxvGR2SfREbPHoDh/yLbOxqm9jfhcZa39mjKcBFMb8ns2cyF3ZU6VuJWTJ4jGI3dvzb X-Received: by 2002:a17:90a:fb98:: with SMTP id cp24mr1199817pjb.48.1565685712395; Tue, 13 Aug 2019 01:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565685712; cv=none; d=google.com; s=arc-20160816; b=DlwCCAcyAuESmtJUY30jKDnYWqK7KYpFLCsYd2UQQjhVWIGcjAkBGqKkJn2Hes8tfS KsmXc53lzOfVIAgqd1IlwKvWl9/EfX3r9TLDvUWNdnNW1gnwKNZub8Vh5ARISqc0Kr/d f2qHn+n9eEktcQ3CRAHVh3y6IJUwJbboAUKptXCTmxklNt7J0r+LJrRE4F7rtp0rs+rW zdqCtYsqniDWlyJjYs2X3PnsPvwD8ymqH/7dUxLw/g3eE8TFxuVVJfEty7potvv+G22M 0ZXqvAjjUL5plt9tmeMwTTzQoG4JlAAI5fjAmUCKf8gDIIs14EgEpJQUIjBwTD0OCFFJ 2MIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kJ96xqBqis4xHI+c7truTxjduXzoYlD8qHcJ3Kt4MEk=; b=CeqFlp3tjKMNqmiD5zbdNOOvXQgYwC60Dz3+p9ouBvPj1AeyErZN0v70PBcguelLyJ 1UVJDtoBXcq71y5BkgHqWQh+7JO2B+11R/yOCz7Pg6VsUnktDB0dF+ffcDzWxOycapLu 0Fq/w+oQ4lVTaB8l2w6zOJuSax67nMu+1HiGHXNss3GEXO6XTVs0VaDbPE9Nz108jJ8g 3/sDqMpcf9aTvupghTKMjKFrSVUMkmy3D5Kd6EG1pb+2+f7dH4Ajpqhfwk026UOXRA97 PNWwGi8Kw2P2UOESvvZhDAJfhmsW68QjggZmPeOiUV7E+sOVLLPdeUa3HBfeBzNY//A6 qPaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tQ5wZNjf; 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 e20si34628554pgn.181.2019.08.13.01.41.35; Tue, 13 Aug 2019 01:41:52 -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=pass header.i=@kernel.org header.s=default header.b=tQ5wZNjf; 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 S1727059AbfHMGCy (ORCPT + 99 others); Tue, 13 Aug 2019 02:02:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:43802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbfHMGCx (ORCPT ); Tue, 13 Aug 2019 02:02:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BEA88206C2; Tue, 13 Aug 2019 06:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565676172; bh=kJ96xqBqis4xHI+c7truTxjduXzoYlD8qHcJ3Kt4MEk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tQ5wZNjfM8txaVcLCJbol8woF3MjTlo5c7ZHjHbSyw9UphFSueGRsroKDQ1MrJA2+ 9g7Ctv7dt9LT0CxrtRwRZ+YxWvwiAE9qGtfM20EG8MjhTubDKDD9e/7QMacFnGhKCN oIA/kAkyV4yK9AcNtdYuOTIBX8jzYj/zbIInUGto= Date: Tue, 13 Aug 2019 08:02:49 +0200 From: Greg Kroah-Hartman To: Nick Crews Cc: linux-usb@vger.kernel.org, Enric Balletbo i Serra , linux-kernel , Daniel Kurtz Subject: Re: Policy to keep USB ports powered in low-power states Message-ID: <20190813060249.GD6670@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 12, 2019 at 06:08:43PM -0600, Nick Crews wrote: > Hi Greg! Hi! First off, please fix your email client to not send html so that vger does not reject your messages :) > I am working on a Chrome OS device that supports a policy called "USB Power > Share," which allows users to turn the laptop into a charge pack for their > phone. When the policy is enabled, power will be supplied to the USB ports > even when the system is in low power states such as S3 and S5. When > disabled, then no power will be supplied in S3 and S5. I wrote a driver > for this already as part > of drivers/platform/chrome/, but Enric Balletbo i Serra, the maintainer, > had the reasonable suggestion of trying to move this into the USB subsystem. Correct suggestion. > Has anything like this been done before? Do you have any preliminary > thoughts on this before I start writing code? A few things that I haven't > figured out yet: > - How to make this feature only available on certain devices. Using device > tree? Kconfig? Making a separate driver just for this device that plugs > into the USB core? > - The feature is only supported on some USB ports, so we need a way of > filtering on a per-port basis. Look at the drivers/usb/typec/ code, I think that should do everything you need here as this is a typec standard functionality, right? thanks, greg k-h