mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Now that the IRQs are always registered after all the ALSA controls are created it is possible to search for the control at the point the IRQ is requested. Move the control search out of the IRQ handler and do it at IRQ request time. This also fixes a potential issue when the card was torn down and reprobed without destroying the codec device, the kctl pointer stored by the IRQ handler would not be updated to the new control on the second probe. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20260721143636.361814-8-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
39 lines
1.1 KiB
C
39 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* The MIPI SDCA specification is available for public downloads at
|
|
* https://www.mipi.org/mipi-sdca-v1-0-download
|
|
*
|
|
* Copyright (C) 2025 Cirrus Logic, Inc. and
|
|
* Cirrus Logic International Semiconductor Ltd.
|
|
*/
|
|
|
|
#ifndef __SDCA_JACK_H__
|
|
#define __SDCA_JACK_H__
|
|
|
|
struct sdca_interrupt;
|
|
struct snd_kcontrol;
|
|
struct snd_soc_jack;
|
|
|
|
/**
|
|
* struct jack_state - Jack state structure to keep data between interrupts
|
|
* @kctl: Pointer to the ALSA control attached to this jack
|
|
* @jack: Pointer to the ASoC jack struct for this jack
|
|
* @mask: Possible reported jack status bits for this jack
|
|
*/
|
|
struct jack_state {
|
|
struct snd_kcontrol *kctl;
|
|
struct snd_soc_jack *jack;
|
|
|
|
unsigned int mask;
|
|
};
|
|
|
|
int sdca_jack_alloc_state(struct sdca_interrupt *interrupt);
|
|
int sdca_jack_init_state(struct sdca_interrupt *interrupt);
|
|
void sdca_jack_free_state(struct sdca_interrupt *interrupt);
|
|
|
|
int sdca_jack_process(struct sdca_interrupt *interrupt);
|
|
int sdca_jack_set_jack(struct sdca_interrupt_info *info, struct snd_soc_jack *jack);
|
|
int sdca_jack_report(struct sdca_interrupt *interrupt);
|
|
|
|
#endif // __SDCA_JACK_H__
|