mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 10:31:33 -04:00
ASoC: SDCA: Add missing destroy for HID device
The SDCA code is currently missing a cleanup for HID devices when the drivers are unbound. Add the missing HID cleanup as part of the IRQ cleanup to mirror when the HID device is created. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20260805124205.4152543-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
01dba3e934
commit
df1fd5d8ab
@@ -17,6 +17,7 @@ struct sdca_interrupt;
|
||||
#if IS_ENABLED(CONFIG_SND_SOC_SDCA_HID)
|
||||
|
||||
int sdca_add_hid_device(struct sdca_interrupt *interrupt);
|
||||
void sdca_destroy_hid_device(struct sdca_interrupt *interrupt);
|
||||
int sdca_hid_process_report(struct sdca_interrupt *interrupt);
|
||||
|
||||
#else
|
||||
@@ -26,6 +27,10 @@ static inline int sdca_add_hid_device(struct sdca_interrupt *interrupt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void sdca_destroy_hid_device(struct sdca_interrupt *interrupt)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int sdca_hid_process_report(struct sdca_interrupt *interrupt)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -122,6 +122,18 @@ int sdca_add_hid_device(struct sdca_interrupt *interrupt)
|
||||
}
|
||||
EXPORT_SYMBOL_NS(sdca_add_hid_device, "SND_SOC_SDCA");
|
||||
|
||||
/**
|
||||
* sdca_destroy_hid_device - destroy the HID device
|
||||
* @interrupt: Pointer to the SDCA interrupt information structure.
|
||||
*/
|
||||
void sdca_destroy_hid_device(struct sdca_interrupt *interrupt)
|
||||
{
|
||||
struct hid_device *hid = interrupt->priv;
|
||||
|
||||
hid_destroy_device(hid);
|
||||
}
|
||||
EXPORT_SYMBOL_NS(sdca_destroy_hid_device, "SND_SOC_SDCA");
|
||||
|
||||
/**
|
||||
* sdca_hid_process_report - read a HID event from the device and report
|
||||
* @interrupt: Pointer to the SDCA interrupt information structure.
|
||||
|
||||
@@ -487,6 +487,8 @@ int sdca_irq_populate_early(struct device *dev, struct regmap *regmap,
|
||||
}
|
||||
break;
|
||||
case SDCA_CTL_TYPE_S(HIDE, HIDTX_CURRENTOWNER):
|
||||
interrupt->free_priv = sdca_destroy_hid_device;
|
||||
|
||||
ret = sdca_add_hid_device(interrupt);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user