Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp941433iob; Fri, 13 May 2022 17:12:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkTC8/1rmV9r0ultjuIPfQbV4y18yjMt6id330emQgPNrxmjCwd1QDl2mqAap+pyhHjysY X-Received: by 2002:a5d:590d:0:b0:20a:c3eb:2584 with SMTP id v13-20020a5d590d000000b0020ac3eb2584mr5649428wrd.18.1652487154797; Fri, 13 May 2022 17:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652487154; cv=none; d=google.com; s=arc-20160816; b=H0WjDtxHiXtMIjF7K6ZZDvA5T33PmJgNdKbHBpzza12GVUpf3Bkw3LMmaMk4Pee/yg oXqhA0Bs+4h9opFpivqMk+QbsBJ4/UaZ++24nIf/vjiIjIE1ylHdMFmiPKNTaraFSQry jz8jZNFBRbKGWswrZYkc0LT8dl8O+efUobuwelb5+vUZfs6tPXYVVMhV9Bxih4kQa8EA aqsPlE4MbiP/fS1PrS1jOxpX77hkPYCtJVyHSld+RgD2KH/U9xxkm/bkva//Mbq0zZre W+A81YxVlRQ5fiMUO5lYVRjwr6sSl2wf9sLGBmnV+phNptctm17uu4kSmCTevvkSUE/l aPGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KDglamaHwWNFsJjMH8n4M899cYov2fck92ehvXsUuIU=; b=DYqXSFS7IeE1sCffD3IuPU+dh6dgFFY4N7ivNBSzO0lF/c1LenXP3Nss2/eWP2A1Fi +J4iX9By/YFu+tU9EGXZKuetSp4qARp16sAB9j9qiC9ir/LnyxRN6OWO6FrakbXOya7r lkLYrYYt1+gk9fcyR6Zua0P8bVV1pn/9k8sNWuSBHuliL81rredsFZhM5wXZALiEyAgs XCFuhVraUOGP6pfzQaT/+fdFZHjrJQM1daFzkvaLpkOW/d14URji5+kcpCg7TH47ed1v o56kOfXfU5BwLqh9cNyBtA89A5EHynsLGiWgkSyLeVFsGmsdpucHgrphcSomKUwSwuIx ipTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bg30amuY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c5-20020a1c3505000000b00392aa799943si7208370wma.140.2022.05.13.17.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:12:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bg30amuY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 043B231C345; Fri, 13 May 2022 16:13:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381895AbiEMPV3 (ORCPT + 99 others); Fri, 13 May 2022 11:21:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381907AbiEMPVB (ORCPT ); Fri, 13 May 2022 11:21:01 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB5D767D34 for ; Fri, 13 May 2022 08:20:59 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id z19so10353315edx.9 for ; Fri, 13 May 2022 08:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KDglamaHwWNFsJjMH8n4M899cYov2fck92ehvXsUuIU=; b=bg30amuYU6wYV2P5qNbOJwBy+IHyuJBCdFy8NHgLEKqZRlbttCeGVB6vZTCxzmmzks TI65tZFse17Bg3FTztLPHu1C8djT/1uvA8rpdFOEs5aIVqnyD3DmRbMX/7rUU3ibecKW Ihf3tG7TXQU2aUXnBa5zDS+4psPozMmTmWNO8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KDglamaHwWNFsJjMH8n4M899cYov2fck92ehvXsUuIU=; b=mrsQjooWnax2IJSU40U1OitlW8JFT/JIVFL7flESo6erjSb+jQYRfx1FHrrCtiao2I 8MG/iUWa/jxwo8Medp+IW3+Uc02kK2mr5LdGmuO0OCiVb3I5rGdALk7LuA95bggfLVuz Rx0OTG7Q6/pcuaHi06hWJ/I6WxVyb4blGrt31F/q0XGf0qe5opN0SJBuxuOwvXVtsMER Wlki/AuYdI0pZrHiKemxPtzB0HkoMfHtDJiRG2n7rexwDFrUo5xRae7OAAsNrXKLgABq KtZphKpDc2OKOSmHgp2F3RZETYnwPwsksrc2LsDfyjI6TLmqSYfd/ksHlhslkn2p3w0v E/Jg== X-Gm-Message-State: AOAM530rrX08Rn6IaHJqarlAQLwISNqsP2f1kzBjzwUPZ7id895Tb/L1 w4TT2EuT879Yxp5X4FYqo0E1UQ== X-Received: by 2002:a05:6402:5190:b0:427:df4a:19d9 with SMTP id q16-20020a056402519000b00427df4a19d9mr41598107edd.384.1652455258470; Fri, 13 May 2022 08:20:58 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i (net-188-217-59-245.cust.vodafonedsl.it. [188.217.59.245]) by smtp.gmail.com with ESMTPSA id el10-20020a170907284a00b006f3ef214e2csm873386ejc.146.2022.05.13.08.20.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 08:20:58 -0700 (PDT) Date: Fri, 13 May 2022 17:20:55 +0200 From: Tommaso Merciai To: Mark Brown Cc: linux-amarula@amarulasolutions.com, linuxfancy@googlegroups.com, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: max98088: add support for reg_4a_cfg_bypass reg Message-ID: <20220513152055.GI649073@tom-ThinkPad-T14s-Gen-2i> References: <20220512074359.446999-1-tommaso.merciai@amarulasolutions.com> <20220512104642.GD649073@tom-ThinkPad-T14s-Gen-2i> <20220512110959.GF649073@tom-ThinkPad-T14s-Gen-2i> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2022 at 12:19:03PM +0100, Mark Brown wrote: > On Thu, May 12, 2022 at 01:09:59PM +0200, Tommaso Merciai wrote: > > On Thu, May 12, 2022 at 11:53:07AM +0100, Mark Brown wrote: > > > On Thu, May 12, 2022 at 12:46:42PM +0200, Tommaso Merciai wrote: > > > > On Thu, May 12, 2022 at 11:12:02AM +0100, Mark Brown wrote: > > > > > > These look like they should be DAPM controls since they're controlling > > > > > audio routing but they're being added as regular controls. > > > > > Sorry again. You suggest to create a new structure for these entries, > > > > for example: > > > > If that's how they fit into the routing for the device, yes - you'd need > > > to define the bypass mixer as well and set up appropraite routes. > > > I added this reg as regular controls because this reg is pretty generic > > as you can see this controll bypass of some output, not all. > > What do you think about? > > That sounds exactly like a DAPM control, please make them DAPM controls. Hi Mark, Sorry again, but I'm quite new on alsa subsystem. I need an help on figuring out on how to implements your solution. From what you suggest I got that I need to create a bypass mixer for every switch (4 -> SPK, REC, MIC2, INA): /* Out Mixer SPK */ static const struct snd_kcontrol_new max98088_output_bypass_spk_mixer_controls[] = { SOC_DAPM_SINGLE("SPK Bypass Switch", M98088_REG_4A_CFG_BYPASS, 0, 1, 0), }; /* Out Mixer REC */ static const struct snd_kcontrol_new max98088_output_bypass_rec_mixer_controls[] = { SOC_DAPM_SINGLE("REC Bypass Switch", M98088_REG_4A_CFG_BYPASS, 1, 1, 0), }; /* Out Mixer MIC */ static const struct snd_kcontrol_new max98088_output_bypass_mic_mixer_controls[] = { SOC_DAPM_SINGLE("MIC2 Bypass Switch", M98088_REG_4A_CFG_BYPASS, 4, 1, 0), }; /* Out Mixer INA */ static const struct snd_kcontrol_new max98088_output_bypass_ina_mixer_controls[] = { SOC_DAPM_SINGLE("INA Bypass Switch", M98088_REG_4A_CFG_BYPASS, 7, 1, 0), }; After that, I need to route the new control mixers on the switch: {"Out Mixer SPK", "SPK Bypass Switch", "RECN"}, {"Out Mixer REC", "REC Bypass Switch", "RECP"}, {"Out Mixer MIC", "MIC2 Bypass Switch", "MIC1"}, {"Out Mixer INA", "INA Bypass Switch", "INA"}, Then route the bypass switch to the new output: {"SPKL", NULL, "SPK Bypass Switch"}, {"RECN", NULL, "REC Bypass Switch"}, {"MIC2", NULL, "MIC2 Bypass Switch"}, {"MIC1", NULL, "INA Bypass Switch"}, I'm in the right way? What do you think about? Can you point me a similar bypass switch into the kernel to take as reference? Thanks in advance Regards, Tommmaso -- Tommaso Merciai Embedded Linux Engineer tommaso.merciai@amarulasolutions.com __________________________________ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 info@amarulasolutions.com www.amarulasolutions.com