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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c4a4537-f47f-8916-6138-10665ffd3d6a@opensource.cirrus.com>
Date:   Tue, 25 May 2021 10:14:32 +0100
From:   Richard Fitzgerald <rf@...nsource.cirrus.com>
To:     Lucas Tanure <tanureal@...nsource.cirrus.com>,
        James Schulman <james.schulman@...rus.com>,
        David Rhodes <david.rhodes@...rus.com>,
        "Liam Girdwood" <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        "Jaroslav Kysela" <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
CC:     <alsa-devel@...a-project.org>, <patches@...nsource.cirrus.com>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/4] ASoC: cs42l42: Check jack status before reporting
 button events

On 25/05/2021 10:08, Lucas Tanure wrote:
> Jack must be connected before reporting button events and
> if the jack is disconnected button release must be reported
> 
> Signed-off-by: Lucas Tanure <tanureal@...nsource.cirrus.com>
> ---
>   sound/soc/codecs/cs42l42.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
> index 8260de81b56c..eff013f295be 100644
> --- a/sound/soc/codecs/cs42l42.c
> +++ b/sound/soc/codecs/cs42l42.c
> @@ -1478,6 +1478,10 @@ static irqreturn_t cs42l42_irq_thread(int irq, void *data)
>   				default:
>   					break;
>   				}
> +				snd_soc_jack_report(cs42l42->jack, 0,
> +						    SND_JACK_BTN_0 | SND_JACK_BTN_1 |
> +						    SND_JACK_BTN_2 | SND_JACK_BTN_3);
> +
>   				dev_dbg(component->dev, "Unplug event\n");
>   			}
>   			break;
> @@ -1489,7 +1493,7 @@ static irqreturn_t cs42l42_irq_thread(int irq, void *data)
>   	}
>   
>   	/* Check button detect status */
> -	if ((~masks[7]) & irq_params_table[7].mask) {
> +	if (cs42l42->plug_state == CS42L42_TS_PLUG && ((~masks[7]) & irq_params_table[7].mask)) {
>   		if (!(current_button_status &
>   			CS42L42_M_HSBIAS_HIZ_MASK)) {
>   
> 

Reviewed-by: Richard Fitzgerald <rf@...nsource.cirrus.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ