lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4a79cb14-4c71-8bd8-9c8c-ab2421e97e0b@perex.cz>
Date:   Sun, 14 Feb 2021 19:51:39 +0100
From:   Jaroslav Kysela <perex@...ex.cz>
To:     Perry Yuan <perry979106@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Perry Yuan <Perry.Yuan@...l.com>
Cc:     oder_chiou@...ltek.com, tiwai@...e.com, hdegoede@...hat.com,
        mgross@...ux.intel.com, lgirdwood@...il.com,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
        platform-driver-x86@...r.kernel.org, Mario.Limonciello@...l.com
Subject: Re: [PATCH v3 3/3] ASoC: rt715:add micmute led state control supports

Dne 14. 02. 21 v 7:43 Perry Yuan napsal(a):

>>> @@ -287,6 +291,18 @@ static int rt715_sdca_put_volsw(struct snd_kcontrol *kcontrol,
>>>   			return err;
>>>   	}
>>>   
>>> +#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
>>> +

My question is, how do we know that the rt715 codec has connected internal
microphone to this input? I believe that this should be covered in the machine
specific code (runtime check), not in the codec code. #if CONFIG is not
sufficient here.

> I have moved this part code to the local definition of 
> rt715_set_amp_gain_put and removed from rt715_priv.
> new code will be like this in V4.
> 
> @@ -88,6 +89,7 @@ static int rt715_set_amp_gain_put(struct snd_kcontrol 
> *kcontrol,
>                  RT715_SET_GAIN_MIX_ADC2_L};
>          unsigned int addr_h, addr_l, val_h, val_ll, val_lr;
>          unsigned int read_ll, read_rl, i, j, loop_cnt;
> +       bool micmute_led;
> 

The whole LED trigger mechanism for the sound is covered in my LED generic
code : https://lore.kernel.org/alsa-devel/20210211111400.1131020-1-perex@perex.cz/

						Jaroslav

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ