Skip to content

Commit 1d25684

Browse files
committed
ASoC: nau8824: Fix open coded prefix handling
As with the component layer code the nau8824 driver had been doing some open coded pin manipulation which will have been broken now the core is fixed to handle this properly, remove the open coding to avoid the issue. Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent bb6a40f commit 1d25684

File tree

1 file changed

+6
-36
lines changed

1 file changed

+6
-36
lines changed

sound/soc/codecs/nau8824.c

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -828,36 +828,6 @@ static void nau8824_int_status_clear_all(struct regmap *regmap)
828828
}
829829
}
830830

831-
static void nau8824_dapm_disable_pin(struct nau8824 *nau8824, const char *pin)
832-
{
833-
struct snd_soc_dapm_context *dapm = nau8824->dapm;
834-
const char *prefix = dapm->component->name_prefix;
835-
char prefixed_pin[80];
836-
837-
if (prefix) {
838-
snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
839-
prefix, pin);
840-
snd_soc_dapm_disable_pin(dapm, prefixed_pin);
841-
} else {
842-
snd_soc_dapm_disable_pin(dapm, pin);
843-
}
844-
}
845-
846-
static void nau8824_dapm_enable_pin(struct nau8824 *nau8824, const char *pin)
847-
{
848-
struct snd_soc_dapm_context *dapm = nau8824->dapm;
849-
const char *prefix = dapm->component->name_prefix;
850-
char prefixed_pin[80];
851-
852-
if (prefix) {
853-
snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
854-
prefix, pin);
855-
snd_soc_dapm_force_enable_pin(dapm, prefixed_pin);
856-
} else {
857-
snd_soc_dapm_force_enable_pin(dapm, pin);
858-
}
859-
}
860-
861831
static void nau8824_eject_jack(struct nau8824 *nau8824)
862832
{
863833
struct snd_soc_dapm_context *dapm = nau8824->dapm;
@@ -866,8 +836,8 @@ static void nau8824_eject_jack(struct nau8824 *nau8824)
866836
/* Clear all interruption status */
867837
nau8824_int_status_clear_all(regmap);
868838

869-
nau8824_dapm_disable_pin(nau8824, "SAR");
870-
nau8824_dapm_disable_pin(nau8824, "MICBIAS");
839+
snd_soc_dapm_disable_pin(dapm, "SAR");
840+
snd_soc_dapm_disable_pin(dapm, "MICBIAS");
871841
snd_soc_dapm_sync(dapm);
872842

873843
/* Enable the insertion interruption, disable the ejection
@@ -897,8 +867,8 @@ static void nau8824_jdet_work(struct work_struct *work)
897867
struct regmap *regmap = nau8824->regmap;
898868
int adc_value, event = 0, event_mask = 0;
899869

900-
nau8824_dapm_enable_pin(nau8824, "MICBIAS");
901-
nau8824_dapm_enable_pin(nau8824, "SAR");
870+
snd_soc_dapm_enable_pin(dapm, "MICBIAS");
871+
snd_soc_dapm_enable_pin(dapm, "SAR");
902872
snd_soc_dapm_sync(dapm);
903873

904874
msleep(100);
@@ -909,8 +879,8 @@ static void nau8824_jdet_work(struct work_struct *work)
909879
if (adc_value < HEADSET_SARADC_THD) {
910880
event |= SND_JACK_HEADPHONE;
911881

912-
nau8824_dapm_disable_pin(nau8824, "SAR");
913-
nau8824_dapm_disable_pin(nau8824, "MICBIAS");
882+
snd_soc_dapm_disable_pin(dapm, "SAR");
883+
snd_soc_dapm_disable_pin(dapm, "MICBIAS");
914884
snd_soc_dapm_sync(dapm);
915885
} else {
916886
event |= SND_JACK_HEADSET;

0 commit comments

Comments
 (0)