1. 25 Feb, 2021 1 commit
  2. 24 Feb, 2021 7 commits
    • Mark Brown's avatar
      Merge series "ASoC: rt5670: Various kcontrol fixes" from Hans de Goede <hdegoede@redhat.com>: · fa27f540
      Mark Brown authored
      Hi All,
      
      While working on adding hardware-volume control support to the UCM
      profile for the rt5672 and on adding LED trigger support to the
      rt5670 codec driver. I hit / noticed a couple of issues this series
      fixes these issues.
      
      Regards,
      
      Hans
      
      Hans de Goede (4):
        ASoC: rt5670: Remove 'OUT Channel Switch' control
        ASoC: rt5670: Remove 'HP Playback Switch' control
        ASoC: rt5670: Remove ADC vol-ctrl mute bits poking from Sto1 ADC mixer
          settings
        ASoC: rt5670: Add emulated 'DAC1 Playback Switch' control
      
       sound/soc/codecs/rt5670.c | 110 +++++++++++++++++++++++++++++++++-----
       sound/soc/codecs/rt5670.h |   9 ++--
       2 files changed, 101 insertions(+), 18 deletions(-)
      
      --
      2.30.1
      fa27f540
    • Shengjiu Wang's avatar
      ASoC: ak5558: Add MODULE_DEVICE_TABLE · 741c8397
      Shengjiu Wang authored
      Add missed MODULE_DEVICE_TABLE for the driver can be loaded
      automatically at boot.
      
      Fixes: 92088477 ("ASoC: ak5558: Add support for AK5558 ADC driver")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Link: https://lore.kernel.org/r/1614149872-25510-2-git-send-email-shengjiu.wang@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      741c8397
    • Shengjiu Wang's avatar
      ASoC: ak4458: Add MODULE_DEVICE_TABLE · f84b4524
      Shengjiu Wang authored
      Add missed MODULE_DEVICE_TABLE for the driver can be loaded
      automatically at boot.
      
      Fixes: 08660086 ("ASoC: ak4458: Add support for AK4458 DAC driver")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Link: https://lore.kernel.org/r/1614149872-25510-1-git-send-email-shengjiu.wang@nxp.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      f84b4524
    • Hans de Goede's avatar
      ASoC: rt5670: Add emulated 'DAC1 Playback Switch' control · 98204293
      Hans de Goede authored
      For reliable output-mute LED control we need a "DAC1 Playback Switch"
      control. The "DAC Playback volume" control is the only control in the
      path from the DAC1 data input to the speaker output, so the UCM profile
      for the speaker output will have its PlaybackMixerElem set to "DAC1".
      
      But userspace (pulseaudio) will set the "DAC1 Playback Volume" control to
      its softest setting (which is not fully muted) while still showing the
      speaker as being enabled at a low volume in the UI.
      
      If we were to set the SNDRV_CTL_ELEM_ACCESS_SPK_LED on the "DAC1 Playback
      Volume" control, this would mean then what pressing KEY_VOLUMEDOWN the
      speaker-mute LED (embedded in the volume-mute toggle key) would light
      while the UI is still showing the speaker as being enabled at a low
      volume, meaning that the UI and the LED are out of sync.
      
      Only after an _extra_ KEY_VOLUMEDOWN press would the UI show the
      speaker as being muted.
      
      The path from DAC1 data input to the speaker output does have
      a digital mixer with DAC1's data as one of its inputs direclty after
      the "DAC1 Playback Volume" control.
      
      This commit adds an emulated "DAC1 Playback Switch" control by:
      
      1. Declaring the enable flag for that mixers DAC1 input as well as the
      "DAC1 Playback Switch" control both as SND_SOC_NOPM controls.
      
      2. Storing the settings of both controls as driver-private data
      
      3. Only clearing the mute flag for the DAC1 input of that mixer if the
      stored values indicate both controls are enabled.
      
      This is a preparation patch for adding "audio-mute" LED trigger support.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210215142118.308516-5-hdegoede@redhat.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      98204293
    • Hans de Goede's avatar
      ASoC: rt5670: Remove ADC vol-ctrl mute bits poking from Sto1 ADC mixer settings · 674e4ff4
      Hans de Goede authored
      The SND_SOC_DAPM_MIXER declaration for "Sto1 ADC MIXL" and "Sto1 ADC MIXR"
      was using the mute bits from the RT5670_STO1_ADC_DIG_VOL control as mixer
      master mute bits.
      
      But these bits are already exposed to userspace as controls as part of the
      "ADC Capture Volume" / "ADC Capture Switch" control pair:
      
              SOC_DOUBLE("ADC Capture Switch", RT5670_STO1_ADC_DIG_VOL,
                      RT5670_L_MUTE_SFT, RT5670_R_MUTE_SFT, 1, 1),
              SOC_DOUBLE_TLV("ADC Capture Volume", RT5670_STO1_ADC_DIG_VOL,
                              RT5670_L_VOL_SFT, RT5670_R_VOL_SFT,
                              127, 0, adc_vol_tlv),
      
      Both the fact that the mute bits belong to the same reg as the vol-ctrl
      and the "Digital Mixer Path" diagram in the datasheet clearly shows that
      these mute bits are not part of the mixer and having 2 separate controls
      poking at the same bits is a bad idea.
      
      Remove the master-mute bits settings from the  "Sto1 ADC MIXL" and
      "Sto1 ADC MIXR" DAPM widget declarations, avoiding these bits getting
      poked from 2 different places.
      
      This should not cause any issues for userspace. AFAICT the rt567x codecs
      are only used on x86/ACPI devices and the UCM profiles used there already
      set the "ADC Capture Switch" as needed.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210215142118.308516-4-hdegoede@redhat.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      674e4ff4
    • Hans de Goede's avatar
      ASoC: rt5670: Remove 'HP Playback Switch' control · 8022f098
      Hans de Goede authored
      The RT5670_L_MUTE_SFT and RT5670_R_MUTE_SFT bits (bits 15 and 7) of the
      RT5670_HP_VOL register are set / unset by the headphones deplop code
      run by rt5670_hp_event() on SND_SOC_DAPM_POST_PMU / SND_SOC_DAPM_PRE_PMD.
      
      So we should not also export a control to userspace which toggles these
      same bits.
      
      This should not cause any issues for userspace. AFAICT the rt567x codecs
      are only used on x86/ACPI devices and the UCM profiles used there do not
      use the "HP Playback Switch" control.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210215142118.308516-3-hdegoede@redhat.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      8022f098
    • Hans de Goede's avatar
      ASoC: rt5670: Remove 'OUT Channel Switch' control · 30be2641
      Hans de Goede authored
      The "OUT Channel Switch" control is a left over from code copied from
      thr rt5640 codec driver.
      
      With the rt5640 codec driver the output volume controls have 2 pairs of
      mute bits:
      bit 7, 15: Mute Control for Spk/Headphone/Line Output Port
      bit 6, 14: Mute Control for Spk/Headphone/Line Volume Channel
      
      Bits 7 and 15 are normal mute bits on the rt5670/5672 which are
      controlled by 2 dapm widgets:
      	SND_SOC_DAPM_SWITCH("LOUT L Playback", SND_SOC_NOPM, 0, 0,
      			    &lout_l_enable_control),
      	SND_SOC_DAPM_SWITCH("LOUT R Playback", SND_SOC_NOPM, 0, 0,
      			    &lout_r_enable_control),
      
      But on the 5670/5672 bit 6 is always reserved, where as bit 14 is
      "LOUT Differential Mode" on the 5670 and also reserved on the 5672.
      
      So the "OUT Channel Switch" control which is controlling bits 6+14
      of the "LINE Output Control" register is bogus -> remove it.
      
      This should not cause any issues for userspace. AFAICT the rt567x codecs
      are only used on x86/ACPI devices and the UCM profiles used there do not
      use the "OUT Channel Switch" control.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210215142118.308516-2-hdegoede@redhat.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      30be2641
  3. 23 Feb, 2021 2 commits
  4. 22 Feb, 2021 2 commits
  5. 17 Feb, 2021 6 commits
  6. 15 Feb, 2021 1 commit
  7. 12 Feb, 2021 3 commits
  8. 11 Feb, 2021 12 commits
  9. 10 Feb, 2021 6 commits