Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5DCCC433E0 for ; Tue, 2 Feb 2021 09:40:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3F4A64EDE for ; Tue, 2 Feb 2021 09:40:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3F4A64EDE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3FB611769; Tue, 2 Feb 2021 10:39:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3FB611769 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1612258848; bh=V3n65vf0jj/3CH7l4N6aQiH+qZiv/SmqQ5PPYJsHsxs=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ia+nB4BAel3B5TfHz1S3ruGW83JgxtI38ueob8F1xquBo0QcJn1s7dM0hv6IMIQVq zxd2DpGFLCq2CiH6syaM4NoNVELgvfZ/3SkBZG2fwXqLZytQO+HOqBc9vg6jWMCUbs KbIt0Wrrbi6SIS1d30Pam84A8rJirrLG96P4q0Zs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B791BF8013C; Tue, 2 Feb 2021 10:39:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C2B25F80171; Tue, 2 Feb 2021 10:39:56 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3D6FEF8013C for ; Tue, 2 Feb 2021 10:39:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3D6FEF8013C X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C8368B07B; Tue, 2 Feb 2021 09:39:50 +0000 (UTC) Date: Tue, 02 Feb 2021 10:39:50 +0100 Message-ID: From: Takashi Iwai To: Hui Wang Subject: Re: [PATCH v9 1/1] alsa: jack: implement software jack injection via debugfs In-Reply-To: <20210127085639.74954-2-hui.wang@canonical.com> References: <20210127085639.74954-1-hui.wang@canonical.com> <20210127085639.74954-2-hui.wang@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Wed, 27 Jan 2021 09:56:39 +0100, Hui Wang wrote: > > This change adds audio jack injection feature through debugfs, with > this feature, we could validate alsa userspace changes by injecting > plugin or plugout events to the non-phantom audio jacks. > > With this change, the sound core will build the folders > $debugfs_mount_dir/sound/cardN if SND_DEBUG and DEBUG_FS are enabled. > And if users also enable the SND_JACK_INJECTION_DEBUG, the jack > injection nodes will be built in the folder cardN like below: > > $tree $debugfs_mount_dir/sound > $debugfs_mount_dir/sound > ├── card0 > │   ├── HDMI_DP_pcm_10_Jack > │   │   ├── jackin_inject > │   │   ├── kctl_id > │   │   ├── mask_bits > │   │   ├── status > │   │   ├── sw_inject_enable > │   │   └── type > ... > │   └── HDMI_DP_pcm_9_Jack > │   ├── jackin_inject > │   ├── kctl_id > │   ├── mask_bits > │   ├── status > │   ├── sw_inject_enable > │   └── type > └── card1 > ├── HDMI_DP_pcm_5_Jack > │   ├── jackin_inject > │   ├── kctl_id > │   ├── mask_bits > │   ├── status > │   ├── sw_inject_enable > │   └── type > ... > ├── Headphone_Jack > │   ├── jackin_inject > │   ├── kctl_id > │   ├── mask_bits > │   ├── status > │   ├── sw_inject_enable > │   └── type > └── Headset_Mic_Jack > ├── jackin_inject > ├── kctl_id > ├── mask_bits > ├── status > ├── sw_inject_enable > └── type > > The nodes kctl_id, mask_bits, status and type are read-only, users > could check jack or jack_kctl's information through them. > > The nodes sw_inject_enable and jackin_inject are directly used for > injection. The sw_inject_enable is read-write, users could check if > software injection is enabled or not on this jack, and users could > echo 1 or 0 to enable or disable software injection on this jack. Once > the injection is enabled, the jack will not change by hardware events > anymore, once the injection is disabled, the jack will restore the > last reported hardware events to the jack. The jackin_inject is > write-only, if the injection is enabled, users could echo 1 or 0 to > this node to inject plugin or plugout events to this jack. > > For the detailed usage information on these nodes, please refer to > Documentation/sound/designs/jack-injection.rst. > > Reviewed-by: Takashi Iwai > Reviewed-by: Jaroslav Kysela > Reviewed-by: Kai Vehmanen > Signed-off-by: Hui Wang Applied now. Thanks. Takashi