1. 04 Jan, 2019 4 commits
    • Hans de Goede's avatar
      ASoC: Intel: bytcht_es8316: Minor refactoring · 86909c8f
      Hans de Goede authored
      Some minor refactoring:
      1) Group the code setting the card dev and prive pointers together with
         registering the card
      2) Properly put the comment about registering the card at the place where
         we actually register the card and add a new comment for getting the clk
      3) Add a struct device *dev helper variable (this will be used more in
         follow up commits)
      4) Reword error message to have the same "foo failed: %d" wording as others
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      86909c8f
    • Hans de Goede's avatar
      ASoC: Intel: bytcht_es8316: Sort includes alphabetically · 6ca382c4
      Hans de Goede authored
      For lack of a better (non-random) way of sorting includes more and more
      files in the kernel are moving over to sorting the includes alphabetically.
      
      Move the bytcht_es8316 driver over to this sorting before we add a
      bunch of more includes.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      6ca382c4
    • Hans de Goede's avatar
      ASoC: es8316: Add DAC mono mix switch mixer control · 24b53f17
      Hans de Goede authored
      Export the DAC functionality to mix left + right together and then output
      the same (mixed) signal on both outputs.
      
      Various (x86) tablets with an ES8316 codec use a single speaker
      connected between the headhpone LOUT and ROUT pins, expecting the output
      to be in a mono differential mode. Presumably this is done to use the
      power of both the left and right outputs to allow the speaker to be
      louder.
      
      The ES8316 codec does not have a differential output mode, but we can
      emulate this by making both channels output the same through the mono mix
      switch, combined with setting the Playback Polarity control to "R Invert",
      which applias a 180 degrees phase inversion to the right channel.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      24b53f17
    • Hans de Goede's avatar
      ASoC: es8316: Add jack-detect support · 82225766
      Hans de Goede authored
      Adding jack-detect support may seem weird for a codec with only
      a single output, but it is necessary. The ES8316 appnote showing
      the intended usage uses a jack-receptacle which physically disconnects
      the speakers from the output when a jack is plugged in.
      
      But all 3 devices using the es8316 which I have (2 Cherry Trail
      devices and one Bay Trail CR device), use an analog mux to disconnect
      the speakers, driven by a GPIO. In order to enable/disable the speakers
      at the right time, we need jack-detect.
      
      The same goes for the microphone where we must correctly set the mux
      for the single ADC to either the internal or the headset microphone.
      
      All devices I have support the es8316's builtin jack-detect functionality.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      82225766
  2. 03 Jan, 2019 36 commits