Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp648687imm; Fri, 27 Jul 2018 03:45:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfCOJNiYeQ6pzNt9+Wr/tyFThAEPni9QW9ko9nAtANi9UJjz2B7DPhjO8tDmEkBYkKOEbgl X-Received: by 2002:a62:1f06:: with SMTP id f6-v6mr6169552pff.140.1532688324972; Fri, 27 Jul 2018 03:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532688324; cv=none; d=google.com; s=arc-20160816; b=YWBgLjwq1XrOwk/q8eCNxF3YR0fT8JxPg5vIc1ZNdd74TUcUWzIWwthwYZLfDd7ENm ia5Xf6lox4UI994iye5FZgpLxsaDSyZ9S9PFTTQ0Ss61Oc40C1lpJwNNX+SlYKORI2xO ggaRRGTdpRCXzVFXIvCnKsapcfKI8Na4dubtPjqpFKoYafchWCmEeZYEgqNL5jXXvPG3 IC2FvHvTMxSRWFXGeFRTDMpAAJh8H/FM1P8NQRni3JYP9vabhRfev1Xf8eWqi4omJX1r ZTshf5TyKXrKTY/cMRI1gUZ2DykyiHg6O9Uc7E9i825jBwhoDfCIuFXcn8IySF2VXOet v3Tw== 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:cc:references:to:subject:arc-authentication-results; bh=xNDqoGAC3ARDxLMyq/ATNnEc89OAWhFa6tM5gCB2FeM=; b=cv9jtELz0L48gOfAhxYznxz4cOpOHBVKpbsyyxAt61L2fzwSL7aPudRQ3mCNIN0MX0 AQQq3w6tlgzO0FJ6JsU/Yta79bgurQHMHBciFWIGO11tP2GSTBkN/BuYmB0qXB/l8OMo Ow+jUAZoF90YaTdhEc4kr2d8+8pFO5PYRAfrJcJ0LsSnLwwkYapwLQ2WwMZRklVJH08O VfWkXuKkW6sZO7Q5MVQ5HGXpIIMf6uhkIi9LeZ64Ix1gLcBLl4cJLBC9NZu27rxmaiGc 2dwRSX0BbIi3v0PEUJR3t3Dam21xFjHFjrVPlMQsXdW+Z6NLMkblfJ1Tp+z4DSzvvaeI UY/A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s124-v6si3917694pfb.1.2018.07.27.03.45.10; Fri, 27 Jul 2018 03:45:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730564AbeG0MFn (ORCPT + 99 others); Fri, 27 Jul 2018 08:05:43 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:52402 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729539AbeG0MFn (ORCPT ); Fri, 27 Jul 2018 08:05:43 -0400 Received: from [148.252.241.226] (helo=[10.35.4.103]) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1fj0EN-0004Ke-Ca; Fri, 27 Jul 2018 11:44:19 +0100 Subject: Re: [alsa-devel] [PATCH 0/4] usb-audio: Add UAC3 Power Domains To: Takashi Iwai References: <20180719112215.4219-1-jorge.sanjuan@codethink.co.uk> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org From: Jorge Message-ID: <59bd0814-e41e-667d-62d1-78194e7a8127@codethink.co.uk> Date: Fri, 27 Jul 2018 11:44:18 +0100 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: 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 19/07/18 12:56, Takashi Iwai wrote: > On Thu, 19 Jul 2018 13:22:11 +0200, > Jorge Sanjuan wrote: >> >> This patchset add support for UAC3 Power Domains. This feature >> of the USB audio class 3 allows the host to notify the device >> what it is making use of so power comsumption can be optimized. >> >> This proposal implements this feature for Power Domains >> that include an Input/Output Terminal associated to an >> audio Streaming interface. This is the main usage of this >> feature according to the spec. For that reason, the logic >> for the Power Domain state change has been implemented >> within the ALSA PCMs logic and the suspend/resume callbacks >> of the usb_driver. The behaviour would be as follows: >> >> * Power Domain State D0: A Power Domain will reach this state >> only when the audio substream associated to that domain is >> being used (i,e. Audio playback/capture is happening). >> * Power Domain State D1: This is the Idle state where the driver >> is going to always want to be in order to reduce power >> consumption. >> * Power Domain State D2: This state is only set when the usb driver >> asumes the device is not going to be used anymore and hence, it >> wont care about getting any interrupts from the device. This >> will only happen when power level is set to "auto" in sysfs >> so the usb driver gets suspended when the interfaces are not in use. >> >> NOTE: The way this has been implemented will always try to put the >> Power Domain in state D1 if the Power Domain exists so there is not a >> way a user could disable this feature. It may be worth getting a control >> exposed to userland that enables/disables this feature (?). > > Can it be tied with runtime PM? > > Need to read through your patchset at first... > > > thanks, > > Takashi Hi, I just realized I accidentally only replied to alsa-devel.. Sorry about that. I think it should be possible to tie up the D1 state changes (low power but still interrupt capable) to runtime PM. Changes to D2 are already tied to PM in this patchset. Just need to find the way to cleanly access `dev->power.runtime_auto` before the driver attempts to set D1 state. We could also let the driver only do D2<->D0 changes for now. I got some kbuild errors due to missing include. Should I re-send this patchset or try to go around getting it tied up to runtime PM first? Regards, Jorge > > >> Power Domains affecting other units independently are required to be >> bypassed via a Selector Unit first before the host can change the >> power state. This sceneario is not covered in this patchset. >> >> based on next-20180719 >> >> Jorge Sanjuan (4): >> ALSA: usb-audio: Initial Power Domain support >> ALSA: usb-audio: AudioStreaming Power Domain parsing >> ALSA: usb-audio: Operate UAC3 Power Domains in PCM callbacks >> ALSA: usb-audio: Add UAC3 Power Domains to suspend/resume >> >> include/linux/usb/audio-v3.h | 4 ++ >> sound/usb/Makefile | 1 + >> sound/usb/card.c | 9 ++++ >> sound/usb/card.h | 2 + >> sound/usb/pcm.c | 64 +++++++++++++++++++++-- >> sound/usb/pcm.h | 2 + >> sound/usb/power.c | 117 +++++++++++++++++++++++++++++++++++++++++++ >> sound/usb/power.h | 19 +++++++ >> sound/usb/stream.c | 70 +++++++++++++++++++++++--- >> 9 files changed, 277 insertions(+), 11 deletions(-) >> create mode 100644 sound/usb/power.c >> >> -- >> 2.11.0 >> > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >