Op 01-10-2024 om 11:17 schreef Jack Yu:
This is the initial codec driver for rt721-sdca. It's a three functions (jack,mic,amp) soundwire driver.
Signed-off-by: Jack Yu jack.yu@realtek.com
v2: Fix typo in mbq default registers. v3: Include soundwire common functions for Realtek.
sound/soc/codecs/Kconfig | 7 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/rt721-sdca-sdw.c | 551 ++++++++++ sound/soc/codecs/rt721-sdca-sdw.h | 150 +++ sound/soc/codecs/rt721-sdca.c | 1547 +++++++++++++++++++++++++++++ sound/soc/codecs/rt721-sdca.h | 268 +++++ 6 files changed, 2525 insertions(+) create mode 100644 sound/soc/codecs/rt721-sdca-sdw.c create mode 100644 sound/soc/codecs/rt721-sdca-sdw.h create mode 100644 sound/soc/codecs/rt721-sdca.c create mode 100644 sound/soc/codecs/rt721-sdca.h [...] +static void rt721_sdca_jack_detect_handler(struct work_struct *work) +{
- struct rt721_sdca_priv *rt721 =
container_of(work, struct rt721_sdca_priv, jack_detect_work.work);
- int btn_type = 0, ret;
- if (!rt721->hs_jack)
return;
- if (!rt721->component->card || !rt721->component->card->instantiated)
return;
- /* SDW_SCP_SDCA_INT_SDCA_6 is used for jack detection */
- if (rt721->scp_sdca_stat1 & SDW_SCP_SDCA_INT_SDCA_6) {
rt721->jack_type = rt_sdca_headset_detect(rt721->regmap,
RT721_SDCA_ENT_GE49);
Variable "ret" is not initialized, no assignment.
if (ret < 0)
return;
- }