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]
Date:   Fri, 9 Sep 2022 18:45:25 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Astrid Rost <astrid.rost@...s.com>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, kernel@...s.com,
        alsa-devel-mejlinglistan <alsa-devel@...a-project.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: ts3a227e: allow enabling the jack detect in driver

On Fri, Sep 09, 2022 at 11:30:01AM +0200, Astrid Rost wrote:

> ti,jack-detect enables the jack detection input device

New properties need to be documented, I'm happy for that to be in the
existing document though obviously a conversion to YAML would be very
much appreciated.  However...

> +	if (enable) {
> +		/* Enable Headset and 4 Buttons Jack detection */
> +		ts3a227e->jack = devm_kzalloc(component->dev,
> +				sizeof(struct snd_soc_jack), GFP_KERNEL);
> +
> +		ret = snd_soc_card_jack_new_pins(card, "Headset Jack",
> +					    SND_JACK_HEADSET |
> +					    SND_JACK_BTN_0 | SND_JACK_BTN_1 |
> +					    SND_JACK_BTN_2 | SND_JACK_BTN_3,
> +					    ts3a227e->jack,
> +					    ts3a227e_jack_pins,
> +					    ARRAY_SIZE(ts3a227e_jack_pins));
> +		if (ret)
> +			return ret;
> +
> +		ret = ts3a227e_enable_jack_detect(component, ts3a227e->jack);
> +	}

...this is something that should be done in the machine driver rather
than the CODEC, the way the device is wired up in an individual system
may be surprising or the system may have some more specific labelling
that can be usefully applied so this is all deferred to the card.

It would sense to convert ts3a277e_enable_jack_detect() to be a
component set_jack() operation, that'd enable it to be used more easily
with generic cards (though I see that it's not yet wired up for
audio-graph-card unfortunately).

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ