Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1243102ybl; Wed, 14 Aug 2019 13:14:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/cL+APPY1zsuCRuaWAfXDNUECWI23GW4TtZh31pqmLFDHSGp/bydobyax8A1aW6zWDKpu X-Received: by 2002:a17:90a:21eb:: with SMTP id q98mr1342023pjc.23.1565813693994; Wed, 14 Aug 2019 13:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565813693; cv=none; d=google.com; s=arc-20160816; b=D4eRqE2HuRU58WgZLuRPxnbxCz+QY1nJu+8tzCOPCuzUH2comc7kTy/k5MStLlolaJ 3nxNfNFvA5rkRTK3uePyniwf1in/BPyIooEY1dNRkmpSVH9cVFbQm2h7WdwAOspLMRa5 achGL4f4y5gk90PCF6r/fuxwbw28zXSf9hf2rHIT/ccCYynhuyVsL38nvqB1jF8pVu+/ G42JFuM635nYfnaWBxWwaHdq1JpVQyxo5DCNnRwCgK05rKP9L5Kxf0lEvofZgGqseJzS TqHDlFsEAeVs5A7ekCEmw/oEa5IRT8DUvNh7rYBqiZpu+Y8258XHY8MUafPhX90Ll2io mzVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=baesCGH/f6622nKyTt3pYuyj9GQL9uGRdAZgpKFE0pg=; b=i+o4JjRiL2Kmp7427ObDNXT6W2Q4ueRJPi4jnOPAAGpJHyyqIhkXy4cRqi5NhTbyEC 70WCNTkqtNe+RXojuSBVVRrCdsD4E2zTqUK+JOIQZEotHtI2vURlewWXquUlpX0h55yg gehzoYJy2vpp/APzB5DheZAXogYLjgfOpAlNOjqs+den18e+IaZE/CNZPRCkAk1T+h1u NAm5Zm/0YM8gyjORNeNU/zXTF5EPamdY07/1xkt63LF0cv3fXUDdrF3vZyh/lCfhJIcn exVyV2xNXuC71egMNoG5sQ5z+c5myffYtK1ofMtOzLAAo9JGIdvCVtSKaKWlt6S2GCP1 FQzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nXecmtG4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si406396pgi.450.2019.08.14.13.14.37; Wed, 14 Aug 2019 13:14:53 -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=@chromium.org header.s=google header.b=nXecmtG4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729272AbfHNUMW (ORCPT + 99 others); Wed, 14 Aug 2019 16:12:22 -0400 Received: from mail-ot1-f44.google.com ([209.85.210.44]:41598 "EHLO mail-ot1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728519AbfHNUMW (ORCPT ); Wed, 14 Aug 2019 16:12:22 -0400 Received: by mail-ot1-f44.google.com with SMTP id o101so934862ota.8 for ; Wed, 14 Aug 2019 13:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=baesCGH/f6622nKyTt3pYuyj9GQL9uGRdAZgpKFE0pg=; b=nXecmtG4odunHeB6aXBTN0HKi7UMHEqpEKs1j6keLeZaCBgpHF5VklO2Y4bTIhuYGx 77N5DKPerrlC7WllHf34rtrK33Zn5+cdKLrTE5yXuDNzXuPBSqoV/6xoM109pN+cAxpJ /CtREKnKJm5FlnkbSvYaSYJkw/K0E+GJcQ66g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=baesCGH/f6622nKyTt3pYuyj9GQL9uGRdAZgpKFE0pg=; b=uCyHz8BaMEX/Vg22OoVoC0bxDU1ZMXftqjZTNhVw2rTrcwer27uqfmiH+R1rMgnFgH Wa2ILQSKlwyUQZfCgHsnNFcYBd9QwCPHPIHKgPyBxOc7yWBrPULNwJBP8so0Yu/Tc7lB Srhv5BPQeh2GfgTXyQSK3pwxJyPgadX/5AY5oZeorhoyBgWgGLzwRpEEVxqf5yT2m39O br1UCcWwg65oT05Fog74ncAloaIh4lRduQmu8nc3i3YjD/YQFWV0HrkrX+tZK9+hJWsF 0bjjfcG3mnJ3Fq/HHdhVHA4YKZRPoSPG14TiSAsd1wkXyXUn5TJ9smpI2DeGjyggeDDz lICA== X-Gm-Message-State: APjAAAUo8wlpkvgmIRS7C39joTbCU7wWDICZ4N5HEHpwCd8X4tE/Ciio 5sLw6E9Kam7uBEuWTyG2A1XzKSroUoM= X-Received: by 2002:a05:6830:1199:: with SMTP id u25mr651912otq.213.1565813540664; Wed, 14 Aug 2019 13:12:20 -0700 (PDT) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com. [209.85.167.171]) by smtp.gmail.com with ESMTPSA id u16sm245556otk.53.2019.08.14.13.12.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Aug 2019 13:12:19 -0700 (PDT) Received: by mail-oi1-f171.google.com with SMTP id k22so5583937oiw.11 for ; Wed, 14 Aug 2019 13:12:19 -0700 (PDT) X-Received: by 2002:aca:56d2:: with SMTP id k201mr761220oib.171.1565813538728; Wed, 14 Aug 2019 13:12:18 -0700 (PDT) MIME-Version: 1.0 References: <20190813060249.GD6670@kroah.com> In-Reply-To: <20190813060249.GD6670@kroah.com> From: Nick Crews Date: Wed, 14 Aug 2019 14:12:07 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Policy to keep USB ports powered in low-power states To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Enric Balletbo i Serra , linux-kernel , Daniel Kurtz Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the fast response! On Tue, Aug 13, 2019 at 12:02 AM Greg Kroah-Hartman wrote: > > 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 :) Thanks, should be good now. > > > 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? Unfortunately this is for USB 2.0 ports, so it's not type-C. Is the type-C code still worth looking at? > > thanks, > > greg k-h