alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: Perry Yuan <Perry.Yuan@dell.com>,
	oder_chiou@realtek.com, tiwai@suse.com,  hdegoede@redhat.com,
	mgross@linux.intel.com
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
	lgirdwood@gmail.com, Mario.Limonciello@dell.com
Subject: Re: [PATCH v3 3/3] ASoC: rt715:add micmute led state control supports
Date: Fri, 15 Jan 2021 18:45:07 +0100	[thread overview]
Message-ID: <1765b000-ac56-7373-b544-b5d9daa1565b@perex.cz> (raw)
In-Reply-To: <20210112171814.5404-1-Perry_Yuan@Dell.com>

Dne 12. 01. 21 v 18:18 Perry Yuan napsal(a):

> +#if IS_ENABLED(CONFIG_DELL_PRIVACY)
> +	/* dell privacy LED trigger state changed by muted/unmute switch */
> +	if (mc->invert) {
> +		if (ucontrol->value.integer.value[0] || ucontrol->value.integer.value[1]) {
> +			rt715->micmute_led = LED_OFF;
> +		} else {
> +			rt715->micmute_led = LED_ON;
> +		}
> +		ledtrig_audio_set(LED_AUDIO_MICMUTE, rt715->micmute_led);
> +	}
> +#endif

[removing lkml and x86-platform lists]

Looking to this code, perhaps, it may be a good idea to move the LED trigger
handling from the low-level drivers and do it in the top-level control code
(sound/core/control.c). Adding a new flag SNDRV_CTL_ELEM_ACCESS_MIC_LED may be
an option and we can nicely handle the situation for multiple microphones (OR
operation). The motivation is to remove the duplicated code.

The same situation is for the playback LED.

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

      parent reply	other threads:[~2021-01-15 17:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 17:18 [PATCH v3 3/3] ASoC: rt715:add micmute led state control supports Perry Yuan
2021-01-12 17:50 ` Limonciello, Mario
2021-01-16 15:25   ` Perry Yuan
2021-01-19 16:33     ` Limonciello, Mario
2021-01-19 20:33       ` Hans de Goede
2021-01-19 20:52         ` Takashi Iwai
2021-01-20  3:26       ` Yuan, Perry
2021-01-12 17:54 ` Mark Brown
2021-01-16 15:50   ` Perry Yuan
2021-01-18 12:03     ` Mark Brown
2021-02-14  6:42   ` Perry Yuan
2021-02-14  6:43   ` Perry Yuan
2021-02-14 18:51     ` Jaroslav Kysela
2021-01-15 17:45 ` Jaroslav Kysela [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1765b000-ac56-7373-b544-b5d9daa1565b@perex.cz \
    --to=perex@perex.cz \
    --cc=Mario.Limonciello@dell.com \
    --cc=Perry.Yuan@dell.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=lgirdwood@gmail.com \
    --cc=mgross@linux.intel.com \
    --cc=oder_chiou@realtek.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).