* [PATCH v2] ASoC: tegra: Add per-stream Mixer Fade controls
@ 2026-04-29 7:06 Sheetal
2026-04-30 5:59 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Sheetal @ 2026-04-29 7:06 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Jaroslav Kysela, Takashi Iwai, Thierry Reding, Jonathan Hunter,
Sameer Pujar, Mohan Kumar, Kuninori Morimoto, linux-sound,
linux-tegra, linux-kernel, Sheetal
Add per-stream fade controls for the Tegra mixer to allow
independently configuring target gain and fade duration for each of
the 10 input streams (RX1 through RX10).
The following controls are added per stream:
"RXn Fade Duration" - fade duration in samples (N3 parameter)
"RXn Fade Gain" - target gain level for fade
A strobe control commits all pending fade configurations:
"Fade Enable" - applies staged gain/duration for all pending
streams and starts the fade
A read-only status control reports per-stream fade state:
"Fade Status" - per-stream state for all 10 RX inputs
-1 = inactive, 0 = active, 1 = complete
Usage example (fade 2 streams simultaneously):
amixer -c <card> cset name="RX1 Fade Duration" 1024
amixer -c <card> cset name="RX1 Fade Gain" 12000
amixer -c <card> cset name="RX2 Fade Duration" 2048
amixer -c <card> cset name="RX2 Fade Gain" 15000
amixer -c <card> cset name="Fade Enable" 1
Signed-off-by: Sheetal <sheetal@nvidia.com>
---
Changes in v2:
- Replaced packed triplet control with per-stream "RXn Fade Duration"
and "RXn Fade Gain" controls, plus a "Fade Enable" strobe to commit
all pending fades atomically (Mark)
- Added duration == 0 validation to prevent divide-by-zero (Mark)
- Fixed configure_gain using stale values by separating staging (put)
from apply (strobe), so values are stored before hardware write (Mark)
- Fixed BIT(31) * BIT(6) integer overflow on 32-bit systems by using
BIT_ULL
- Added pm_runtime_resume_and_get() error checking in put_fade_enable
and get_fade_status
- Split fade_enable into two passes: configure gain first, then enable
sample count for all streams to start fading near-simultaneously
- Added TEGRA210_MIXER_GAIN_MAX and TEGRA210_MIXER_FADE_DURATION_MAX
macros to replace magic numbers in control definitions
sound/soc/tegra/tegra210_mixer.c | 236 ++++++++++++++++++++++++++++++-
sound/soc/tegra/tegra210_mixer.h | 20 ++-
2 files changed, 249 insertions(+), 7 deletions(-)
diff --git a/sound/soc/tegra/tegra210_mixer.c b/sound/soc/tegra/tegra210_mixer.c
index ce44117a0b9c..f461303fba25 100644
--- a/sound/soc/tegra/tegra210_mixer.c
+++ b/sound/soc/tegra/tegra210_mixer.c
@@ -151,10 +151,17 @@ static int tegra210_mixer_configure_gain(struct snd_soc_component *cmpnt,
for (i = 0; i < NUM_DURATION_PARMS; i++) {
int val;
- if (instant_gain)
+ if (instant_gain) {
val = 1;
- else
- val = gain_params.duration[i];
+ } else {
+ if (i == DURATION_N3_ID)
+ val = mixer->duration[id];
+ else if (i == DURATION_INV_N3_ID)
+ val = (u32)(BIT_ULL(31 + TEGRA210_MIXER_PRESCALAR) /
+ mixer->duration[id]);
+ else
+ val = gain_params.duration[i];
+ }
err = tegra210_mixer_write_ram(mixer,
REG_DURATION_PARAM(reg, i),
@@ -173,6 +180,175 @@ static int tegra210_mixer_configure_gain(struct snd_soc_component *cmpnt,
return err;
}
+static int tegra210_mixer_get_fade_duration(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct soc_mixer_control *mc =
+ (struct soc_mixer_control *)kcontrol->private_value;
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
+ struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
+
+ ucontrol->value.integer.value[0] = mixer->duration[mc->reg];
+
+ return 0;
+}
+
+static int tegra210_mixer_put_fade_duration(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct soc_mixer_control *mc =
+ (struct soc_mixer_control *)kcontrol->private_value;
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
+ struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
+ unsigned int id = mc->reg;
+ u32 duration = ucontrol->value.integer.value[0];
+
+ if (duration == 0)
+ return -EINVAL;
+
+ if (mixer->duration[id] == duration)
+ return 0;
+
+ mixer->duration[id] = duration;
+ mixer->fade_pending[id] = true;
+
+ return 1;
+}
+
+static int tegra210_mixer_get_fade_gain(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct soc_mixer_control *mc =
+ (struct soc_mixer_control *)kcontrol->private_value;
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
+ struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
+
+ ucontrol->value.integer.value[0] = mixer->gain_value[mc->reg];
+
+ return 0;
+}
+
+static int tegra210_mixer_put_fade_gain(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct soc_mixer_control *mc =
+ (struct soc_mixer_control *)kcontrol->private_value;
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
+ struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
+ unsigned int id = mc->reg;
+
+ if (mixer->gain_value[id] == ucontrol->value.integer.value[0])
+ return 0;
+
+ mixer->gain_value[id] = ucontrol->value.integer.value[0];
+ mixer->fade_pending[id] = true;
+
+ return 1;
+}
+
+static int tegra210_mixer_get_fade_enable(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = 0;
+
+ return 0;
+}
+
+static int tegra210_mixer_put_fade_enable(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
+ struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
+ int id, err, changed = 0;
+
+ /* Configure gain for all pending streams */
+ for (id = 0; id < TEGRA210_MIXER_RX_MAX; id++) {
+ if (!mixer->fade_pending[id])
+ continue;
+
+ err = tegra210_mixer_configure_gain(cmpnt, id, false);
+ if (err) {
+ dev_err(cmpnt->dev,
+ "Failed to configure fade for RX%d\n", id + 1);
+ return err;
+ }
+
+ changed = 1;
+ }
+
+ if (!changed)
+ return 0;
+
+ /* Enable sample count for all pending streams */
+ err = pm_runtime_resume_and_get(cmpnt->dev);
+ if (err < 0)
+ return err;
+
+ for (id = 0; id < TEGRA210_MIXER_RX_MAX; id++) {
+ if (!mixer->fade_pending[id])
+ continue;
+
+ if (!mixer->in_fade[id]) {
+ err = regmap_update_bits(mixer->regmap,
+ MIXER_REG(TEGRA210_MIXER_RX1_CTRL, id),
+ TEGRA210_MIXER_SAMPLE_COUNT_ENABLE,
+ TEGRA210_MIXER_SAMPLE_COUNT_ENABLE);
+ if (err) {
+ dev_err(cmpnt->dev,
+ "Failed to enable sample count for RX%d\n",
+ id + 1);
+ pm_runtime_put(cmpnt->dev);
+ return err;
+ }
+ mixer->in_fade[id] = true;
+ }
+
+ mixer->fade_pending[id] = false;
+ }
+
+ pm_runtime_put(cmpnt->dev);
+
+ return 1;
+}
+
+static int tegra210_mixer_get_fade_status(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
+ struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
+ u32 count;
+ int id, err;
+
+ err = pm_runtime_resume_and_get(cmpnt->dev);
+ if (err < 0)
+ return err;
+
+ for (id = 0; id < TEGRA210_MIXER_RX_MAX; id++) {
+ if (!mixer->in_fade[id]) {
+ ucontrol->value.integer.value[id] = TEGRA210_MIXER_FADE_IDLE;
+ continue;
+ }
+
+ regmap_read(mixer->regmap,
+ MIXER_REG(TEGRA210_MIXER_RX1_SAMPLE_COUNT, id),
+ &count);
+
+ if (count >= mixer->duration[id]) {
+ ucontrol->value.integer.value[id] = TEGRA210_MIXER_FADE_COMPLETE;
+ regmap_update_bits(mixer->regmap,
+ MIXER_REG(TEGRA210_MIXER_RX1_CTRL, id),
+ TEGRA210_MIXER_SAMPLE_COUNT_ENABLE, 0);
+ mixer->in_fade[id] = false;
+ } else {
+ ucontrol->value.integer.value[id] = TEGRA210_MIXER_FADE_ACTIVE;
+ }
+ }
+
+ pm_runtime_put(cmpnt->dev);
+
+ return 0;
+}
+
static int tegra210_mixer_get_gain(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -396,14 +572,37 @@ ADDER_CTRL_DECL(adder3, TEGRA210_MIXER_TX3_ADDER_CONFIG);
ADDER_CTRL_DECL(adder4, TEGRA210_MIXER_TX4_ADDER_CONFIG);
ADDER_CTRL_DECL(adder5, TEGRA210_MIXER_TX5_ADDER_CONFIG);
+static int tegra210_mixer_fade_status_info(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_info *uinfo)
+{
+ uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+ uinfo->count = TEGRA210_MIXER_RX_MAX;
+ uinfo->value.integer.min = TEGRA210_MIXER_FADE_IDLE;
+ uinfo->value.integer.max = TEGRA210_MIXER_FADE_COMPLETE;
+
+ return 0;
+}
+
+#define FADE_CTRL(id) \
+ SOC_SINGLE_EXT("RX" #id " Fade Duration", (id) - 1, 0, \
+ TEGRA210_MIXER_FADE_DURATION_MAX, 0, \
+ tegra210_mixer_get_fade_duration, \
+ tegra210_mixer_put_fade_duration), \
+ SOC_SINGLE_EXT("RX" #id " Fade Gain", (id) - 1, 0, \
+ TEGRA210_MIXER_GAIN_MAX, 0, \
+ tegra210_mixer_get_fade_gain, \
+ tegra210_mixer_put_fade_gain),
+
#define GAIN_CTRL(id) \
SOC_SINGLE_EXT("RX" #id " Gain Volume", \
MIXER_GAIN_CFG_RAM_ADDR((id) - 1), 0, \
- 0x20000, 0, tegra210_mixer_get_gain, \
+ TEGRA210_MIXER_GAIN_MAX, 0, \
+ tegra210_mixer_get_gain, \
tegra210_mixer_put_gain), \
SOC_SINGLE_EXT("RX" #id " Instant Gain Volume", \
MIXER_GAIN_CFG_RAM_ADDR((id) - 1), 0, \
- 0x20000, 0, tegra210_mixer_get_gain, \
+ TEGRA210_MIXER_GAIN_MAX, 0, \
+ tegra210_mixer_get_gain, \
tegra210_mixer_put_instant_gain),
/* Volume controls for all MIXER inputs */
@@ -418,6 +617,28 @@ static const struct snd_kcontrol_new tegra210_mixer_gain_ctls[] = {
GAIN_CTRL(8)
GAIN_CTRL(9)
GAIN_CTRL(10)
+
+ FADE_CTRL(1)
+ FADE_CTRL(2)
+ FADE_CTRL(3)
+ FADE_CTRL(4)
+ FADE_CTRL(5)
+ FADE_CTRL(6)
+ FADE_CTRL(7)
+ FADE_CTRL(8)
+ FADE_CTRL(9)
+ FADE_CTRL(10)
+ SOC_SINGLE_EXT("Fade Enable", SND_SOC_NOPM, 0, 1, 0,
+ tegra210_mixer_get_fade_enable,
+ tegra210_mixer_put_fade_enable),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Fade Status",
+ .info = tegra210_mixer_fade_status_info,
+ .access = SNDRV_CTL_ELEM_ACCESS_READ |
+ SNDRV_CTL_ELEM_ACCESS_VOLATILE,
+ .get = tegra210_mixer_get_fade_status,
+ },
};
static const struct snd_soc_dapm_widget tegra210_mixer_widgets[] = {
@@ -579,6 +800,7 @@ static bool tegra210_mixer_volatile_reg(struct device *dev,
case TEGRA210_MIXER_GAIN_CFG_RAM_DATA:
case TEGRA210_MIXER_PEAKM_RAM_CTRL:
case TEGRA210_MIXER_PEAKM_RAM_DATA:
+ case TEGRA210_MIXER_RX1_SAMPLE_COUNT:
return true;
default:
return false;
@@ -632,8 +854,10 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev)
dev_set_drvdata(dev, mixer);
/* Use default gain value for all MIXER inputs */
- for (i = 0; i < TEGRA210_MIXER_RX_MAX; i++)
+ for (i = 0; i < TEGRA210_MIXER_RX_MAX; i++) {
mixer->gain_value[i] = gain_params.gain_value;
+ mixer->duration[i] = gain_params.duration[DURATION_N3_ID];
+ }
regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(regs))
diff --git a/sound/soc/tegra/tegra210_mixer.h b/sound/soc/tegra/tegra210_mixer.h
index a330530fbc61..b7c896dec2e8 100644
--- a/sound/soc/tegra/tegra210_mixer.h
+++ b/sound/soc/tegra/tegra210_mixer.h
@@ -9,6 +9,7 @@
#ifndef __TEGRA210_MIXER_H__
#define __TEGRA210_MIXER_H__
+
/* XBAR_RX related MIXER offsets */
#define TEGRA210_MIXER_RX1_SOFT_RESET 0x04
#define TEGRA210_MIXER_RX1_STATUS 0x10
@@ -79,12 +80,26 @@
#define TEGRA210_MIXER_RX_LIMIT (TEGRA210_MIXER_RX_MAX * TEGRA210_MIXER_REG_STRIDE)
#define TEGRA210_MIXER_TX_MAX 5
#define TEGRA210_MIXER_TX_LIMIT (TEGRA210_MIXER_RX_LIMIT + (TEGRA210_MIXER_TX_MAX * TEGRA210_MIXER_REG_STRIDE))
+#define TEGRA210_MIXER_SAMPLE_COUNT_SHIFT 24
+#define TEGRA210_MIXER_SAMPLE_COUNT_ENABLE BIT(TEGRA210_MIXER_SAMPLE_COUNT_SHIFT)
#define REG_CFG_DONE_TRIGGER 0xf
#define VAL_CFG_DONE_TRIGGER 0x1
#define NUM_GAIN_POLY_COEFFS 9
-#define NUM_DURATION_PARMS 4
+#define TEGRA210_MIXER_GAIN_MAX 0x20000
+#define TEGRA210_MIXER_FADE_DURATION_MAX 0x7fffffff
+
+#define TEGRA210_MIXER_PRESCALAR 6
+#define TEGRA210_MIXER_FADE_IDLE (-1)
+#define TEGRA210_MIXER_FADE_ACTIVE 0
+#define TEGRA210_MIXER_FADE_COMPLETE 1
+
+enum {
+ DURATION_N3_ID = 2,
+ DURATION_INV_N3_ID,
+ NUM_DURATION_PARMS,
+};
struct tegra210_mixer_gain_params {
int poly_coeff[NUM_GAIN_POLY_COEFFS];
@@ -94,6 +109,9 @@ struct tegra210_mixer_gain_params {
struct tegra210_mixer {
int gain_value[TEGRA210_MIXER_RX_MAX];
+ u32 duration[TEGRA210_MIXER_RX_MAX];
+ bool in_fade[TEGRA210_MIXER_RX_MAX];
+ bool fade_pending[TEGRA210_MIXER_RX_MAX];
struct regmap *regmap;
};
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] ASoC: tegra: Add per-stream Mixer Fade controls
2026-04-29 7:06 [PATCH v2] ASoC: tegra: Add per-stream Mixer Fade controls Sheetal
@ 2026-04-30 5:59 ` Mark Brown
2026-04-30 9:42 ` Sheetal .
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2026-04-30 5:59 UTC (permalink / raw)
To: Sheetal
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Thierry Reding,
Jonathan Hunter, Sameer Pujar, Mohan Kumar, Kuninori Morimoto,
linux-sound, linux-tegra, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1895 bytes --]
On Wed, Apr 29, 2026 at 07:06:03AM +0000, Sheetal wrote:
> Add per-stream fade controls for the Tegra mixer to allow
> independently configuring target gain and fade duration for each of
> the 10 input streams (RX1 through RX10).
> +static int tegra210_mixer_get_fade_status(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + if (count >= mixer->duration[id]) {
> + ucontrol->value.integer.value[id] = TEGRA210_MIXER_FADE_COMPLETE;
> + regmap_update_bits(mixer->regmap,
> + MIXER_REG(TEGRA210_MIXER_RX1_CTRL, id),
> + TEGRA210_MIXER_SAMPLE_COUNT_ENABLE, 0);
> + mixer->in_fade[id] = false;
> + } else {
> + ucontrol->value.integer.value[id] = TEGRA210_MIXER_FADE_ACTIVE;
> + }
Is the _FADE_COMPLETE state a good idea here? Only the first read after
a fade will show it, and functionally it's the same as _IDLE - there's
no current fade running.
Also is there any overhead to having the sample counting enabled? This
is the only thing that turns it off AFAICT so if userspace doesn't look
at the control we'll just leave it running indefinitely. Perhaps a
timer to disable might be useful? It's generally a bit odd that we have
a write to the hardware in a get().
> + SOC_SINGLE_EXT("Fade Enable", SND_SOC_NOPM, 0, 1, 0,
> + tegra210_mixer_get_fade_enable,
> + tegra210_mixer_put_fade_enable),
Fade Switch.
> struct tegra210_mixer {
> int gain_value[TEGRA210_MIXER_RX_MAX];
> + u32 duration[TEGRA210_MIXER_RX_MAX];
> + bool in_fade[TEGRA210_MIXER_RX_MAX];
> + bool fade_pending[TEGRA210_MIXER_RX_MAX];
> struct regmap *regmap;
> };
gain_value is used by the existing RX n Gain Volume controls, don't we
need separate data for the fade controls here, or should we just have
the new Fade Gain controls? Having the separate controls is more
complicated.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] ASoC: tegra: Add per-stream Mixer Fade controls
2026-04-30 5:59 ` Mark Brown
@ 2026-04-30 9:42 ` Sheetal .
2026-04-30 10:41 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Sheetal . @ 2026-04-30 9:42 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Thierry Reding,
Jonathan Hunter, Sameer Pujar, Mohan Kumar, Kuninori Morimoto,
linux-sound, linux-tegra, linux-kernel
On 30-04-2026 11:29, Mark Brown wrote:
> On Wed, Apr 29, 2026 at 07:06:03AM +0000, Sheetal wrote:
>> Add per-stream fade controls for the Tegra mixer to allow
>> independently configuring target gain and fade duration for each of
>> the 10 input streams (RX1 through RX10).
>
>> +static int tegra210_mixer_get_fade_status(struct snd_kcontrol *kcontrol,
>> + struct snd_ctl_elem_value *ucontrol)
>> +{
>
>> + if (count >= mixer->duration[id]) {
>> + ucontrol->value.integer.value[id] = TEGRA210_MIXER_FADE_COMPLETE;
>> + regmap_update_bits(mixer->regmap,
>> + MIXER_REG(TEGRA210_MIXER_RX1_CTRL, id),
>> + TEGRA210_MIXER_SAMPLE_COUNT_ENABLE, 0);
>> + mixer->in_fade[id] = false;
>> + } else {
>> + ucontrol->value.integer.value[id] = TEGRA210_MIXER_FADE_ACTIVE;
>> + }
>
> Is the _FADE_COMPLETE state a good idea here? Only the first read after
> a fade will show it, and functionally it's the same as _IDLE - there's
> no current fade running.
>
Yes makes sense, will keep IDLE(0) and ACTIVE(1)
> Also is there any overhead to having the sample counting enabled? This
> is the only thing that turns it off AFAICT so if userspace doesn't look
> at the control we'll just leave it running indefinitely. Perhaps a
> timer to disable might be useful? It's generally a bit odd that we have
> a write to the hardware in a get().
>
Rather than a timer (which would require sample rate tracking to convert
the sample-based duration to wall-clock time), sample count will be
disabled before re-enabling it in the put callback, ensuring the counter
restarts from zero for each new fade. Does that sound reasonable, or
would you prefer a different approach?
>> + SOC_SINGLE_EXT("Fade Enable", SND_SOC_NOPM, 0, 1, 0,
>> + tegra210_mixer_get_fade_enable,
>> + tegra210_mixer_put_fade_enable),
>
> Fade Switch.
>
Ack
>> struct tegra210_mixer {
>> int gain_value[TEGRA210_MIXER_RX_MAX];
>> + u32 duration[TEGRA210_MIXER_RX_MAX];
>> + bool in_fade[TEGRA210_MIXER_RX_MAX];
>> + bool fade_pending[TEGRA210_MIXER_RX_MAX];
>> struct regmap *regmap;
>> };
>
> gain_value is used by the existing RX n Gain Volume controls, don't we
> need separate data for the fade controls here, or should we just have
> the new Fade Gain controls? Having the separate controls is more
> complicated.
The existing "RXn Gain Volume" applies gain immediately on each put
call, while Fade Gain needs to be staged until the Fade Switch strobe is
triggered. Sharing gain_value would break this staged semantics, so a
separate fade_gain[] field keeps the two independent.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] ASoC: tegra: Add per-stream Mixer Fade controls
2026-04-30 9:42 ` Sheetal .
@ 2026-04-30 10:41 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-04-30 10:41 UTC (permalink / raw)
To: Sheetal .
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Thierry Reding,
Jonathan Hunter, Sameer Pujar, Mohan Kumar, Kuninori Morimoto,
linux-sound, linux-tegra, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]
On Thu, Apr 30, 2026 at 03:12:08PM +0530, Sheetal . wrote:
> On 30-04-2026 11:29, Mark Brown wrote:
> > On Wed, Apr 29, 2026 at 07:06:03AM +0000, Sheetal wrote:
> > Also is there any overhead to having the sample counting enabled? This
> > is the only thing that turns it off AFAICT so if userspace doesn't look
> > at the control we'll just leave it running indefinitely. Perhaps a
> > timer to disable might be useful? It's generally a bit odd that we have
> > a write to the hardware in a get().
> Rather than a timer (which would require sample rate tracking to convert the
> sample-based duration to wall-clock time), sample count will be disabled
> before re-enabling it in the put callback, ensuring the counter restarts
> from zero for each new fade. Does that sound reasonable, or would you prefer
> a different approach?
It depends on how important it is to do the disable - if there's no
real need to do it until the next fade that's fine, if there's some cost
to having it run then you might need something more active.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-30 10:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29 7:06 [PATCH v2] ASoC: tegra: Add per-stream Mixer Fade controls Sheetal
2026-04-30 5:59 ` Mark Brown
2026-04-30 9:42 ` Sheetal .
2026-04-30 10:41 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox