[{"id":3680553,"web_url":"http://patchwork.ozlabs.org/comment/3680553/","msgid":"<aea9de3f-1128-49b1-a6e6-cc467d76673b@sirena.org.uk>","list_archive_url":null,"date":"2026-04-22T11:26:15","subject":"Re: [PATCH] ASoC: tegra: Add Mixer Fade controls","submitter":{"id":24878,"url":"http://patchwork.ozlabs.org/api/people/24878/","name":"Mark Brown","email":"broonie@kernel.org"},"content":"On Wed, Apr 22, 2026 at 10:29:57AM +0000, Sheetal wrote:\n> Add fade controls for the Tegra mixer to allow the user to configure\n> the gain and duration for each mixer stream. The mixer supports up to\n> 10 input streams (RX1 through RX10), each with independently\n\n>   amixer -c <card> cset name=\"MIXER1 Fade\" \\\n>     \"<id1>,<gain1>,<duration1>[,<id2>,<gain2>,<duration2>,...]\"\n>   id       - mixer input RX stream index (1 to 10)\n>   gain     - target gain level\n>   duration - fade duration in samples (N3 parameter)\n\nThis would be more idomatically represented as 10 pairs of controls, one\nwith the gain and one with the duration.  Possibly also with an\nadditional strobe control which actually makes the changes take effect\nif there's a need to do a block of them at once.\n\n> +static int tegra210_mixer_put_fade(struct snd_kcontrol *kcontrol,\n> +\t\t\t\t   struct snd_ctl_elem_value *ucontrol)\n> +{\n\n> +\tstruct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);\n> +\tstruct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);\n> +\tu32 rx_id, rx_gain, rx_duration;\n> +\tint id, base, err = 0;\n> +\n> +\t/* Process array of RX stream parameters (id, gain, duration) */\n> +\tfor (id = 0; id < TEGRA210_MIXER_RX_MAX; id++) {\n> +\t\tbase = 3 * id;\n> +\t\trx_id = ucontrol->value.integer.value[base];\n> +\t\trx_gain = ucontrol->value.integer.value[base + 1];\n> +\t\trx_duration = ucontrol->value.integer.value[base + 2];\n\nI'm not seeing much validation of these, for example it looks like you\ncan set a duration of 0 quite happily which seems to be a problem as we\ndivide by the duration when configuring.\n\n> +               /* Only update if values are different */\n> +               if (mixer->duration[rx_id] != rx_duration ||\n +                   mixer->gain_value[rx_id] != rx_gain) {\n> +                       err = tegra210_mixer_configure_gain(cmpnt, rx_id, false);\n\n...\n\n> +                       mixer->duration[rx_id] = rx_duration;\n> +                       mixer->gain_value[rx_id] = rx_gain;\n\nDoesn't this mean that the values that get configured are the ones that\nwere previously set, not the new ones?","headers":{"Return-Path":"\n <linux-tegra+bounces-13848-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=TwVhreVa;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13848-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"TwVhreVa\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0xpN1q3Pz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 21:29:48 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id B077C300B3C3\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 11:26:21 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7ACE43CFF51;\n\tWed, 22 Apr 2026 11:26:21 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 37F523CF69C;\n\tWed, 22 Apr 2026 11:26:21 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 9C6FFC2BCB6;\n\tWed, 22 Apr 2026 11:26:18 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776857181; cv=none;\n b=OEiUKGnLkcVcofbqfJloBpaEbDLd2rz5w4hUmlT+OHdKpY5svJh3xpQ8B9QjvFguWZL8y1IAgHqdEMbIvsAeNmdH2E+kfDYa6bQJR9ihcf6TDODa6KRbE9pgVjKXwFrAkE+1bcIKDvb5PVUv7BO+le2V/A+PSlCb7TCATzudYXc=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776857181; c=relaxed/simple;\n\tbh=PogCZHVp0QQqzo41o3AKHaILLQ5MixRXQwwxYi5qMnw=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=ZZTwdm9FlcHPaPzen4dblV0ZSGv9Jtgrnbv8ZZLPybEYMIIm5XpY7KMH/yQ25m3d4CfFlMWcC3mJuqfn7gWjz9cwQHUiN+BKlUpfx0oWPkjP2pXs/65+6a39pkuq8mpWfBVkJ2PAKvySd4DyB2Kf/EeqRffsxD42tTgkT5d8/Wc=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=TwVhreVa; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1776857180;\n\tbh=PogCZHVp0QQqzo41o3AKHaILLQ5MixRXQwwxYi5qMnw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TwVhreVaJWOzpcLPMLVbRR50lj5g7mvXxOO4tn1YXauPkjUrs6rX754YUn135FAS2\n\t IdHUt254SoUmOwUREEqQPEp/OYTb6XNygi53b4Ob2+1e0rU4GfvwJRTG3CGYMqJiOK\n\t gx63uvPsu8e0x3m7zBMYRNaa+HaB5892F/SaLwfQ436KoyGq1/+3XBvs0CwkWc/rZ5\n\t U87/UhKdMOxJV+6EBcLQK8iWTf2jtdFkC0mChnS65ooVWM8WCsEmKp2kLjCVj88DWa\n\t E4SM6HCaZuqg2rzhZNuE5Ee1fAc77N6RI2mPM1Pfo2x2TWHF4X+EzMjouXyacI00VL\n\t EJn4fVE4VfTfw==","Date":"Wed, 22 Apr 2026 12:26:15 +0100","From":"Mark Brown <broonie@kernel.org>","To":"Sheetal <sheetal@nvidia.com>","Cc":"Liam Girdwood <lgirdwood@gmail.com>, Jaroslav Kysela <perex@perex.cz>,\n\tTakashi Iwai <tiwai@suse.com>,\n\tThierry Reding <thierry.reding@kernel.org>,\n\tJonathan Hunter <jonathanh@nvidia.com>,\n\tSameer Pujar <spujar@nvidia.com>, Mohan Kumar <mkumard@nvidia.com>,\n\tKuninori Morimoto <kuninori.morimoto.gx@renesas.com>,\n\tlinux-sound@vger.kernel.org, linux-tegra@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org","Subject":"Re: [PATCH] ASoC: tegra: Add Mixer Fade controls","Message-ID":"<aea9de3f-1128-49b1-a6e6-cc467d76673b@sirena.org.uk>","References":"<20260422102957.2706861-1-sheetal@nvidia.com>","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n\tprotocol=\"application/pgp-signature\"; boundary=\"xsRwQoHyr+8dlzzD\"","Content-Disposition":"inline","In-Reply-To":"<20260422102957.2706861-1-sheetal@nvidia.com>","X-Cookie":"I'm definitely not in Omaha!"}}]