Skip to content

Commit 725570f

Browse files
Marek Vasutbroonie
authored andcommitted
ASoC: max98088: Remove duplicate DACs
This codec only has one set of left and right DACs, remove the duplicate DACs with duplicated bits controlling them as the userspace can set those controls to mismatched value. This most likely does break userspace ABI, but there seem to be no in-kernel users. Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e90dbd3 commit 725570f

File tree

1 file changed

+26
-54
lines changed

1 file changed

+26
-54
lines changed

sound/soc/codecs/max98088.c

Lines changed: 26 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,8 @@ static const struct snd_kcontrol_new max98088_snd_controls[] = {
515515

516516
/* Left speaker mixer switch */
517517
static const struct snd_kcontrol_new max98088_left_speaker_mixer_controls[] = {
518-
SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 0, 1, 0),
519-
SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 7, 1, 0),
520-
SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 0, 1, 0),
521-
SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 7, 1, 0),
518+
SOC_DAPM_SINGLE("Left DAC Switch", M98088_REG_2B_MIX_SPK_LEFT, 0, 1, 0),
519+
SOC_DAPM_SINGLE("Right DAC Switch", M98088_REG_2B_MIX_SPK_LEFT, 7, 1, 0),
522520
SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 5, 1, 0),
523521
SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_2B_MIX_SPK_LEFT, 6, 1, 0),
524522
SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_2B_MIX_SPK_LEFT, 1, 1, 0),
@@ -529,10 +527,8 @@ static const struct snd_kcontrol_new max98088_left_speaker_mixer_controls[] = {
529527

530528
/* Right speaker mixer switch */
531529
static const struct snd_kcontrol_new max98088_right_speaker_mixer_controls[] = {
532-
SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_2C_MIX_SPK_RIGHT, 7, 1, 0),
533-
SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_2C_MIX_SPK_RIGHT, 0, 1, 0),
534-
SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_2C_MIX_SPK_RIGHT, 7, 1, 0),
535-
SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_2C_MIX_SPK_RIGHT, 0, 1, 0),
530+
SOC_DAPM_SINGLE("Left DAC Switch", M98088_REG_2C_MIX_SPK_RIGHT, 7, 1, 0),
531+
SOC_DAPM_SINGLE("Right DAC Switch", M98088_REG_2C_MIX_SPK_RIGHT, 0, 1, 0),
536532
SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_2C_MIX_SPK_RIGHT, 5, 1, 0),
537533
SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_2C_MIX_SPK_RIGHT, 6, 1, 0),
538534
SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_2C_MIX_SPK_RIGHT, 1, 1, 0),
@@ -543,10 +539,8 @@ static const struct snd_kcontrol_new max98088_right_speaker_mixer_controls[] = {
543539

544540
/* Left headphone mixer switch */
545541
static const struct snd_kcontrol_new max98088_left_hp_mixer_controls[] = {
546-
SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_25_MIX_HP_LEFT, 0, 1, 0),
547-
SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_25_MIX_HP_LEFT, 7, 1, 0),
548-
SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_25_MIX_HP_LEFT, 0, 1, 0),
549-
SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_25_MIX_HP_LEFT, 7, 1, 0),
542+
SOC_DAPM_SINGLE("Left DAC Switch", M98088_REG_25_MIX_HP_LEFT, 0, 1, 0),
543+
SOC_DAPM_SINGLE("Right DAC Switch", M98088_REG_25_MIX_HP_LEFT, 7, 1, 0),
550544
SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_25_MIX_HP_LEFT, 5, 1, 0),
551545
SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_25_MIX_HP_LEFT, 6, 1, 0),
552546
SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_25_MIX_HP_LEFT, 1, 1, 0),
@@ -557,10 +551,8 @@ static const struct snd_kcontrol_new max98088_left_hp_mixer_controls[] = {
557551

558552
/* Right headphone mixer switch */
559553
static const struct snd_kcontrol_new max98088_right_hp_mixer_controls[] = {
560-
SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_26_MIX_HP_RIGHT, 7, 1, 0),
561-
SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_26_MIX_HP_RIGHT, 0, 1, 0),
562-
SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_26_MIX_HP_RIGHT, 7, 1, 0),
563-
SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_26_MIX_HP_RIGHT, 0, 1, 0),
554+
SOC_DAPM_SINGLE("Left DAC Switch", M98088_REG_26_MIX_HP_RIGHT, 7, 1, 0),
555+
SOC_DAPM_SINGLE("Right DAC Switch", M98088_REG_26_MIX_HP_RIGHT, 0, 1, 0),
564556
SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_26_MIX_HP_RIGHT, 5, 1, 0),
565557
SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_26_MIX_HP_RIGHT, 6, 1, 0),
566558
SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_26_MIX_HP_RIGHT, 1, 1, 0),
@@ -571,10 +563,8 @@ static const struct snd_kcontrol_new max98088_right_hp_mixer_controls[] = {
571563

572564
/* Left earpiece/receiver mixer switch */
573565
static const struct snd_kcontrol_new max98088_left_rec_mixer_controls[] = {
574-
SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_28_MIX_REC_LEFT, 0, 1, 0),
575-
SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_28_MIX_REC_LEFT, 7, 1, 0),
576-
SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_28_MIX_REC_LEFT, 0, 1, 0),
577-
SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_28_MIX_REC_LEFT, 7, 1, 0),
566+
SOC_DAPM_SINGLE("Left DAC Switch", M98088_REG_28_MIX_REC_LEFT, 0, 1, 0),
567+
SOC_DAPM_SINGLE("Right DAC Switch", M98088_REG_28_MIX_REC_LEFT, 7, 1, 0),
578568
SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_28_MIX_REC_LEFT, 5, 1, 0),
579569
SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_28_MIX_REC_LEFT, 6, 1, 0),
580570
SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_28_MIX_REC_LEFT, 1, 1, 0),
@@ -585,10 +575,8 @@ static const struct snd_kcontrol_new max98088_left_rec_mixer_controls[] = {
585575

586576
/* Right earpiece/receiver mixer switch */
587577
static const struct snd_kcontrol_new max98088_right_rec_mixer_controls[] = {
588-
SOC_DAPM_SINGLE("Left DAC1 Switch", M98088_REG_29_MIX_REC_RIGHT, 7, 1, 0),
589-
SOC_DAPM_SINGLE("Right DAC1 Switch", M98088_REG_29_MIX_REC_RIGHT, 0, 1, 0),
590-
SOC_DAPM_SINGLE("Left DAC2 Switch", M98088_REG_29_MIX_REC_RIGHT, 7, 1, 0),
591-
SOC_DAPM_SINGLE("Right DAC2 Switch", M98088_REG_29_MIX_REC_RIGHT, 0, 1, 0),
578+
SOC_DAPM_SINGLE("Left DAC Switch", M98088_REG_29_MIX_REC_RIGHT, 7, 1, 0),
579+
SOC_DAPM_SINGLE("Right DAC Switch", M98088_REG_29_MIX_REC_RIGHT, 0, 1, 0),
592580
SOC_DAPM_SINGLE("MIC1 Switch", M98088_REG_29_MIX_REC_RIGHT, 5, 1, 0),
593581
SOC_DAPM_SINGLE("MIC2 Switch", M98088_REG_29_MIX_REC_RIGHT, 6, 1, 0),
594582
SOC_DAPM_SINGLE("INA1 Switch", M98088_REG_29_MIX_REC_RIGHT, 1, 1, 0),
@@ -717,13 +705,9 @@ static const struct snd_soc_dapm_widget max98088_dapm_widgets[] = {
717705
SND_SOC_DAPM_ADC("ADCL", "HiFi Capture", M98088_REG_4C_PWR_EN_IN, 1, 0),
718706
SND_SOC_DAPM_ADC("ADCR", "HiFi Capture", M98088_REG_4C_PWR_EN_IN, 0, 0),
719707

720-
SND_SOC_DAPM_DAC("DACL1", "HiFi Playback",
708+
SND_SOC_DAPM_DAC("DACL", "HiFi Playback",
721709
M98088_REG_4D_PWR_EN_OUT, 1, 0),
722-
SND_SOC_DAPM_DAC("DACR1", "HiFi Playback",
723-
M98088_REG_4D_PWR_EN_OUT, 0, 0),
724-
SND_SOC_DAPM_DAC("DACL2", "Aux Playback",
725-
M98088_REG_4D_PWR_EN_OUT, 1, 0),
726-
SND_SOC_DAPM_DAC("DACR2", "Aux Playback",
710+
SND_SOC_DAPM_DAC("DACR", "HiFi Playback",
727711
M98088_REG_4D_PWR_EN_OUT, 0, 0),
728712

729713
SND_SOC_DAPM_PGA("HP Left Out", M98088_REG_4D_PWR_EN_OUT,
@@ -819,10 +803,8 @@ static const struct snd_soc_dapm_widget max98088_dapm_widgets[] = {
819803

820804
static const struct snd_soc_dapm_route max98088_audio_map[] = {
821805
/* Left headphone output mixer */
822-
{"Left HP Mixer", "Left DAC1 Switch", "DACL1"},
823-
{"Left HP Mixer", "Left DAC2 Switch", "DACL2"},
824-
{"Left HP Mixer", "Right DAC1 Switch", "DACR1"},
825-
{"Left HP Mixer", "Right DAC2 Switch", "DACR2"},
806+
{"Left HP Mixer", "Left DAC Switch", "DACL"},
807+
{"Left HP Mixer", "Right DAC Switch", "DACR"},
826808
{"Left HP Mixer", "MIC1 Switch", "MIC1 Input"},
827809
{"Left HP Mixer", "MIC2 Switch", "MIC2 Input"},
828810
{"Left HP Mixer", "INA1 Switch", "INA1 Input"},
@@ -831,10 +813,8 @@ static const struct snd_soc_dapm_route max98088_audio_map[] = {
831813
{"Left HP Mixer", "INB2 Switch", "INB2 Input"},
832814

833815
/* Right headphone output mixer */
834-
{"Right HP Mixer", "Left DAC1 Switch", "DACL1"},
835-
{"Right HP Mixer", "Left DAC2 Switch", "DACL2" },
836-
{"Right HP Mixer", "Right DAC1 Switch", "DACR1"},
837-
{"Right HP Mixer", "Right DAC2 Switch", "DACR2"},
816+
{"Right HP Mixer", "Left DAC Switch", "DACL"},
817+
{"Right HP Mixer", "Right DAC Switch", "DACR"},
838818
{"Right HP Mixer", "MIC1 Switch", "MIC1 Input"},
839819
{"Right HP Mixer", "MIC2 Switch", "MIC2 Input"},
840820
{"Right HP Mixer", "INA1 Switch", "INA1 Input"},
@@ -843,10 +823,8 @@ static const struct snd_soc_dapm_route max98088_audio_map[] = {
843823
{"Right HP Mixer", "INB2 Switch", "INB2 Input"},
844824

845825
/* Left speaker output mixer */
846-
{"Left SPK Mixer", "Left DAC1 Switch", "DACL1"},
847-
{"Left SPK Mixer", "Left DAC2 Switch", "DACL2"},
848-
{"Left SPK Mixer", "Right DAC1 Switch", "DACR1"},
849-
{"Left SPK Mixer", "Right DAC2 Switch", "DACR2"},
826+
{"Left SPK Mixer", "Left DAC Switch", "DACL"},
827+
{"Left SPK Mixer", "Right DAC Switch", "DACR"},
850828
{"Left SPK Mixer", "MIC1 Switch", "MIC1 Input"},
851829
{"Left SPK Mixer", "MIC2 Switch", "MIC2 Input"},
852830
{"Left SPK Mixer", "INA1 Switch", "INA1 Input"},
@@ -855,10 +833,8 @@ static const struct snd_soc_dapm_route max98088_audio_map[] = {
855833
{"Left SPK Mixer", "INB2 Switch", "INB2 Input"},
856834

857835
/* Right speaker output mixer */
858-
{"Right SPK Mixer", "Left DAC1 Switch", "DACL1"},
859-
{"Right SPK Mixer", "Left DAC2 Switch", "DACL2"},
860-
{"Right SPK Mixer", "Right DAC1 Switch", "DACR1"},
861-
{"Right SPK Mixer", "Right DAC2 Switch", "DACR2"},
836+
{"Right SPK Mixer", "Left DAC Switch", "DACL"},
837+
{"Right SPK Mixer", "Right DAC Switch", "DACR"},
862838
{"Right SPK Mixer", "MIC1 Switch", "MIC1 Input"},
863839
{"Right SPK Mixer", "MIC2 Switch", "MIC2 Input"},
864840
{"Right SPK Mixer", "INA1 Switch", "INA1 Input"},
@@ -867,10 +843,8 @@ static const struct snd_soc_dapm_route max98088_audio_map[] = {
867843
{"Right SPK Mixer", "INB2 Switch", "INB2 Input"},
868844

869845
/* Earpiece/Receiver output mixer */
870-
{"Left REC Mixer", "Left DAC1 Switch", "DACL1"},
871-
{"Left REC Mixer", "Left DAC2 Switch", "DACL2"},
872-
{"Left REC Mixer", "Right DAC1 Switch", "DACR1"},
873-
{"Left REC Mixer", "Right DAC2 Switch", "DACR2"},
846+
{"Left REC Mixer", "Left DAC Switch", "DACL"},
847+
{"Left REC Mixer", "Right DAC Switch", "DACR"},
874848
{"Left REC Mixer", "MIC1 Switch", "MIC1 Input"},
875849
{"Left REC Mixer", "MIC2 Switch", "MIC2 Input"},
876850
{"Left REC Mixer", "INA1 Switch", "INA1 Input"},
@@ -879,10 +853,8 @@ static const struct snd_soc_dapm_route max98088_audio_map[] = {
879853
{"Left REC Mixer", "INB2 Switch", "INB2 Input"},
880854

881855
/* Earpiece/Receiver output mixer */
882-
{"Right REC Mixer", "Left DAC1 Switch", "DACL1"},
883-
{"Right REC Mixer", "Left DAC2 Switch", "DACL2"},
884-
{"Right REC Mixer", "Right DAC1 Switch", "DACR1"},
885-
{"Right REC Mixer", "Right DAC2 Switch", "DACR2"},
856+
{"Right REC Mixer", "Left DAC Switch", "DACL"},
857+
{"Right REC Mixer", "Right DAC Switch", "DACR"},
886858
{"Right REC Mixer", "MIC1 Switch", "MIC1 Input"},
887859
{"Right REC Mixer", "MIC2 Switch", "MIC2 Input"},
888860
{"Right REC Mixer", "INA1 Switch", "INA1 Input"},

0 commit comments

Comments
 (0)