Skip to content

Commit

Permalink
ASoC: sun4i-codec: correct dapm widgets and controls for h616
Browse files Browse the repository at this point in the history
The previous H616 support patch added a single LINEOUT DAPM pin switch
to the card controls. As the codec in this SoC only has a single route,
this seemed reasonable at the time, however is redundant given the
existing DAPM codec widget definitions controlling the digital and
analog sides of the codec.

It is also insufficient to describe the scenario where separate
components (muxes, jack detection etc) are used to modify the audio
route external to the SoC. For example the Anbernic RG(##)XX series of
devices uses a headphone jack detection switch, GPIO-controlled speaker
amplifier and a passive external mux chip to route audio.

Remove the redundant LINEOUT card control, and add a Speaker pin switch
control and Headphone DAPM widget to allow control of the above
hardware.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Ryan Walklin <ryan@testtoast.com>
Tested-by: Philippe Simons <simons.philippe@gmail.com>
Link: https://patch.msgid.link/20250214220247.10810-3-ryan@testtoast.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Ryan Walklin authored and Mark Brown committed Mar 13, 2025
1 parent 7bda89a commit ae5f76d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/sunxi/sun4i-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1916,10 +1916,11 @@ static const struct snd_soc_component_driver sun50i_h616_codec_codec = {
};

static const struct snd_kcontrol_new sun50i_h616_card_controls[] = {
SOC_DAPM_PIN_SWITCH("LINEOUT"),
SOC_DAPM_PIN_SWITCH("Speaker"),
};

static const struct snd_soc_dapm_widget sun50i_h616_codec_card_dapm_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_LINE("Line Out", NULL),
SND_SOC_DAPM_SPK("Speaker", sun4i_codec_spk_event),
};
Expand Down

0 comments on commit ae5f76d

Please sign in to comment.