Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp467371iog; Wed, 29 Jun 2022 04:05:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uIc2tXiWWV71PkoGZSXci68LGDT+txIpeH4H/wIhldCilPxveRHzlC4bPEWupcraL4Vcqx X-Received: by 2002:a17:90b:3a90:b0:1ed:27b7:5458 with SMTP id om16-20020a17090b3a9000b001ed27b75458mr5003449pjb.208.1656500721674; Wed, 29 Jun 2022 04:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656500721; cv=none; d=google.com; s=arc-20160816; b=eVNCUShnEtHae2kkAN1SnYyWXx/xrdt8a4+iW8PbL+0h46Gp01QfEzYK1+ugK2uo4M uSc1LN3UozhZT9eeSVW/HVOjrojt0DTVCgQMTnqHOwLV6P1Y69o0t3T98wVjBXwX/T+K 2EouPAdi0mU3RBMa6+1qYh1EkFMh4xiK8uhwLy6o5drQIRW/qMSrQHAi7UC+jtpq/RrI 7bdUH2WIfx8VbSVuM7eqkSU6x5O/FOkgUPrF7scY7PuBbzRxV+3O/2yIA9D4H/I3PBlX 6Vqd35FM3k22Ni2PvtPmN5FUZZm1gCZaTqdMVrPWgF6aEaJYt22ndlVqsmwUYQUlt2rZ GW9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xGLyHh+8Mbf3/i/p0tGrUiVabNI3mp8YOPBN1Q5tKu8=; b=hDOQzh8EPR0BYVOpLBhGfnWmY2L6RwTZcANhktDD/a1Qc/jmW7DnYAB8YTHfdgy3w3 V14MvRhzPHLDW8bdAl5aiiTbW6mQqgTFveBE8mlhlb/2dmSOsnefYJDU+JRPkNQEY3aX W0cV3LtUd1QhiqsQe4+fr5F8bsNya7W6wuvYXh72eaV5INhOV9uaZw4tid6verRq1RVx vd+mLCIKD/TDg82P0yu7GLtbnYAos6m74IyS3k8AMMxuFg4cS3JYsvohZ8DvrxW2ba3l U4WeQUdXVCq7NUCYLj4IC0FBWl5P2gtgX40KLuaRz/MC/bN1dPlJ2RORer8l7VU5tigd 2toQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GdzGE2XF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j8-20020a056a00130800b00522d070c48bsi24886488pfu.317.2022.06.29.04.05.08; Wed, 29 Jun 2022 04:05:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GdzGE2XF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231942AbiF2LA3 (ORCPT + 99 others); Wed, 29 Jun 2022 07:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229836AbiF2LA1 (ORCPT ); Wed, 29 Jun 2022 07:00:27 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E66CC3C734 for ; Wed, 29 Jun 2022 04:00:26 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id n1so21835987wrg.12 for ; Wed, 29 Jun 2022 04:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=xGLyHh+8Mbf3/i/p0tGrUiVabNI3mp8YOPBN1Q5tKu8=; b=GdzGE2XFNE7YJK5ZCHvfLcGKwcL706RxrQqunB/BY7BN0UqlMiLNKOe2zxEi3M0zQG Sxjo6mIJ2Gp3YS0mACIuQkm2gxcnHjh3bZAF3VxAB8RArqfJri99f0L4pBJxsX8eYBNj OaPc7xN+zRrzRPkjHGgTqe0Xjeoe1xchJgqyVjPC/YbH4gq29Jy3ljwMXij1mFZleYpY xG5WwiIqC73Q35tU5tJJ1vSZGYJ8CEGFgYrT8MI7jtXOqBdWm5CEKjpnzIwVTPA+4NYG 6Spky0UTeSDkkzS9kEOYIIro0h3f3Y6WYBdCGcYvklkZV47KzTLH5ulbvyeVfGg+CWVX GzNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=xGLyHh+8Mbf3/i/p0tGrUiVabNI3mp8YOPBN1Q5tKu8=; b=LdkGcTcW8lKG4wJD0MjdSj3UfVNVnS8cwfNYFrq9yJiGRzuT0axXF8MB3Mn5/dj2H8 fn5nnupnVLNy2n8ZJASYmK+zEzkHDRwnm9ehPTA33OX51IbDdeqNB4z6rSLbYw2FFLdy edXfAquC3tpQ0fZ035LrTlanVtxSE7oWs4IWgHTy7jeHvICfmcMNmQz2Q2bF1ahEBjpM H3g8mgovsRBb8V3YND0+vWk4bZFRGtYBQweP8nWfZfiqIdM6RvEjohCjlEN6EzChJixj +rAhmeySqEFvrfu7Kfcr5e+BDXy++QCtKWi8wOEqHFD1ye5mqNdEJ82DG6uYn7nUpVc7 Ngmg== X-Gm-Message-State: AJIora/pdiuIMcx3OrX2WvtlLHeZSiWwRQ0kqoGY3BVnwck5YRHaZHzF irT+PW6tn7HFVDDA32kSUHM3Cw== X-Received: by 2002:adf:e30f:0:b0:21b:a39c:cb40 with SMTP id b15-20020adfe30f000000b0021ba39ccb40mr2439283wrj.180.1656500425448; Wed, 29 Jun 2022 04:00:25 -0700 (PDT) Received: from [192.168.86.238] (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.googlemail.com with ESMTPSA id m2-20020adffa02000000b0021d163daeb0sm8581792wrr.108.2022.06.29.04.00.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jun 2022 04:00:24 -0700 (PDT) Message-ID: <2fdd0847-5102-ea9f-cfbb-f3dd378d3a8a@linaro.org> Date: Wed, 29 Jun 2022 12:00:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 3/4] ASoC: codecs: wsa883x: add control, dapm widgets and map Content-Language: en-US To: Mark Brown Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, linux-kernel@vger.kernel.org References: <20220629090644.67982-1-srinivas.kandagatla@linaro.org> <20220629090644.67982-4-srinivas.kandagatla@linaro.org> From: Srinivas Kandagatla In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thanks Mark, On 29/06/2022 11:58, Mark Brown wrote: > On Wed, Jun 29, 2022 at 10:06:43AM +0100, Srinivas Kandagatla wrote: > >> +static int wsa_dev_mode_put(struct snd_kcontrol *kcontrol, >> + struct snd_ctl_elem_value *ucontrol) >> +{ >> + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); >> + struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); >> + >> + if (wsa883x->dev_mode == ucontrol->value.enumerated.item[0]) >> + return 0; >> + >> + wsa883x->dev_mode = ucontrol->value.enumerated.item[0]; >> + >> + return 0; >> +} > > This isn't returning 1 when the value changes so will miss generating > events, please test the driver with mixer-test. Yes my bad.. > >> + switch (event) { >> + case SND_SOC_DAPM_POST_PMU: >> + if (wsa883x->dev_mode == RECEIVER) { >> + snd_soc_component_write_field(component, WSA883X_CDC_PATH_MODE, >> + WSA883X_RXD_MODE_MASK, >> + WSA883X_RXD_MODE_HIFI); >> + snd_soc_component_write_field(component, WSA883X_SPKR_PWM_CLK_CTL, >> + WSA883X_SPKR_PWM_FREQ_SEL_MASK, >> + WSA883X_SPKR_PWM_FREQ_F600KHZ); >> + snd_soc_component_write_field(component, WSA883X_DRE_CTL_0, >> + WSA883X_DRE_PROG_DELAY_MASK, 0x0); >> + } else if (wsa883x->dev_mode == SPEAKER) { > > This looks like it'd be better written as a switch statement. Sounds good, > >> +static const struct snd_kcontrol_new wsa883x_snd_controls[] = { >> + SOC_SINGLE_RANGE_TLV("PA Gain", WSA883X_DRE_CTL_1, 1, >> + 0x0, 0x1f, 1, pa_gain), > > Volume controls should end in Volume, mixer-test should also have caught > this. Okay, will fix all these in next spin.