[00/27] ASoC: Map missing jack kcontrols

Message ID 20230802175737.263412-1-alpernebiyasak@gmail.com
Headers
Series ASoC: Map missing jack kcontrols |

Message

Alper Nebi Yasak Aug. 2, 2023, 5:57 p.m. UTC
  This patchset adds missing jack kcontrols for each independently
detectable audio peripheral and maps jack pins to those kcontrols
accordingly, with the primary intent to enable/improve jack detection
handling in PulseAudio and PipeWire through JackControl UCM values.

Usually it's just splitting a joint anything-is-connected "Headset Jack"
kcontrol (from [1]) into those like "Headphone Jack" and "Headset Mic"
(similar to a previous series for Intel Chromebooks [2]). This split is
important to avoid automatically switching to a nonexistent external
microphone when a headphone-only device is connected.

When the underlying hardware seems to support it, this also adds a "Line
Out" kcontrol. This is important in case the hardware can actually
support a line-level connection via a different configuration (bypassing
output amplifiers?), or simply for userspace to display "Line Out"
instead of "Headphones" to the user for connected line-out devices.

Beyond the mappings, I had to add PIN_SWITCH card kcontrols and DAPM
widgets to avoid "unknown pin" errors on my devices, so tried to do them
for all. For Intel devices I saw a pattern of routing things to
"Platform Clock" and added to that as well. Looking at patch 5/7 of a
Mediatek-related series [3], I can only guess that routes could be
further improved, but don't know exactly how for each device. And one
more concern is I don't know if the names conflict with any controls
from codecs, although I tried to keep to names of existing widgets.

As far as I can tell, the root cause for most of why these are missing
originates to things being developed for ChromeOS, whose userspace reads
the jack input device and doesn't care for these kcontrols. There's
non-ChromeOS cases as well, maybe things got copy-pasted around and
people didn't need or couldn't figure out how to get more specific than
a single jack kcontrol. The secondary intent in this patchset is to fix
this *everywhere*, so future copy-pastes result in the right behaviour.

For more context also see:

[1] ASoC: soc-card: Create jack kcontrol without pins
https://lore.kernel.org/alsa-devel/20220408041114.6024-1-akihiko.odaki@gmail.com/

[2] ASoC: Intel: Chromebooks: remap jack pins
https://lore.kernel.org/alsa-devel/20220616214055.134943-1-pierre-louis.bossart@linux.intel.com/

[3] ASoC: mediatek: Allow separate handling of headphone and headset mic jack
https://lore.kernel.org/alsa-devel/20220922235951.252532-1-nfraprado@collabora.com/

[4] ASoC: rk3399_gru_sound: Add DAPM pins, kcontrols for jack detection
https://lore.kernel.org/alsa-devel/20200721182709.6895-1-alpernebiyasak@gmail.com/

This applies onto next-20230802. Unfortunately most of it is untested
except for a few Chromebooks I have (Kevin, Lick, Hana, Cozmo), because
I'm intentionally generalizing to everything.


Alper Nebi Yasak (27):
  ASoC: amd: acp-da7219-max98357a: Map missing jack kcontrols
  ASoC: amd: acp-rt5645: Map missing jack kcontrols
  ASoC: amd: acp: Map missing jack kcontrols
  ASoC: amd: acp3x-rt5682-max9836: Map missing jack kcontrols
  ASoC: Intel: avs: da7219: Map missing jack kcontrols
  ASoC: Intel: bxt_da7219_max98357a: Map missing Line Out jack kcontrol
  ASoC: Intel: bytcr_wm5102: Map missing Line Out jack kcontrol
  ASoC: Intel: kbl_da7219_max98357a: Map missing Line Out jack kcontrol
  ASoC: Intel: kbl_da7219_max98927: Map missing Line Out jack kcontrol
  ASoC: Intel: sof_da7219_max98373: Map missing Line Out jack kcontrol
  ASoC: imx-es8328: Map missing jack kcontrols
  ASoC: mediatek: mt8173-max98090: Configure jack as a Headset jack
  ASoC: mediatek: mt8173-rt5650-rt5514: Map missing jack kcontrols
  ASoC: mediatek: mt8173-rt5650-rt5676: Map missing jack kcontrols
  ASoC: mediatek: mt8173-rt5650: Map missing jack kcontrols
  ASoC: mediatek: mt8183-da7219-max98357: Map missing jack kcontrols
  ASoC: mediatek: mt8183-mt6358-ts3a227-max98357: Map missing jack
    kcontrols
  ASoC: mediatek: mt8186-mt6366-da7219-max98357: Map missing jack
    kcontrols
  ASoC: qcom: apq8016_sbc: Map missing jack kcontrols
  ASoC: qcom: sc7180: Map missing jack kcontrols
  ASoC: qcom: sc7280: Map missing jack kcontrols
  ASoC: qcom: sdm845: Map missing jack kcontrols
  ASoC: rk3399-gru-sound: Map missing Line Out jack kcontrol
  ASoC: rockchip: rockchip_rt5645: Map missing jack kcontrols
  ASoC: samsung: littlemill: Map missing jack kcontrols
  ASoC: samsung: lowland: Split Line Out jack kcontrol from Headphone
  ASoC: samsung: midas_wm1811: Map missing jack kcontrols

 sound/soc/amd/acp-da7219-max98357a.c          |  41 +++-
 sound/soc/amd/acp-rt5645.c                    |  22 +-
 sound/soc/amd/acp/acp-mach-common.c           | 226 ++++++++++++++----
 sound/soc/amd/acp3x-rt5682-max9836.c          |  23 +-
 sound/soc/fsl/imx-es8328.c                    |  25 +-
 sound/soc/intel/avs/boards/da7219.c           |  34 ++-
 sound/soc/intel/boards/bxt_da7219_max98357a.c |   7 +
 sound/soc/intel/boards/bytcr_wm5102.c         |   7 +
 sound/soc/intel/boards/kbl_da7219_max98357a.c |   7 +
 sound/soc/intel/boards/kbl_da7219_max98927.c  |   7 +
 sound/soc/intel/boards/sof_da7219_max98373.c  |  10 +
 sound/soc/mediatek/mt8173/mt8173-max98090.c   |   2 +-
 .../mediatek/mt8173/mt8173-rt5650-rt5514.c    |  23 +-
 .../mediatek/mt8173/mt8173-rt5650-rt5676.c    |  23 +-
 sound/soc/mediatek/mt8173/mt8173-rt5650.c     |  23 +-
 .../mediatek/mt8183/mt8183-da7219-max98357.c  |  43 +++-
 .../mt8183/mt8183-mt6358-ts3a227-max98357.c   |  53 +++-
 .../mt8186/mt8186-mt6366-da7219-max98357.c    |   6 +
 sound/soc/qcom/apq8016_sbc.c                  |  37 ++-
 sound/soc/qcom/sc7180.c                       |  40 +++-
 sound/soc/qcom/sc7280.c                       |  34 ++-
 sound/soc/qcom/sdm845.c                       |  32 ++-
 sound/soc/rockchip/rk3399_gru_sound.c         |   7 +-
 sound/soc/rockchip/rockchip_rt5645.c          |  22 +-
 sound/soc/samsung/littlemill.c                |  27 ++-
 sound/soc/samsung/lowland.c                   |   8 +-
 sound/soc/samsung/midas_wm1811.c              |  25 +-
 27 files changed, 668 insertions(+), 146 deletions(-)


base-commit: 626c67169f9972fffcdf3bc3864de421f162ebf5
  

Comments

Mark Brown Aug. 7, 2023, 7:54 p.m. UTC | #1
On Wed, 02 Aug 2023 20:57:10 +0300, Alper Nebi Yasak wrote:
> This patchset adds missing jack kcontrols for each independently
> detectable audio peripheral and maps jack pins to those kcontrols
> accordingly, with the primary intent to enable/improve jack detection
> handling in PulseAudio and PipeWire through JackControl UCM values.
> 
> Usually it's just splitting a joint anything-is-connected "Headset Jack"
> kcontrol (from [1]) into those like "Headphone Jack" and "Headset Mic"
> (similar to a previous series for Intel Chromebooks [2]). This split is
> important to avoid automatically switching to a nonexistent external
> microphone when a headphone-only device is connected.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/27] ASoC: amd: acp-da7219-max98357a: Map missing jack kcontrols
        commit: 5532a1cfedda10ec0c5e9edbb8089e6165b532fe
[02/27] ASoC: amd: acp-rt5645: Map missing jack kcontrols
        commit: 596c92fb77a0402b3f2d3ebd36ef6c6aec45faf5
[03/27] ASoC: amd: acp: Map missing jack kcontrols
        commit: 7ac3404c2e21ff6b717fd9ac2f7b352e0149f7bd
[04/27] ASoC: amd: acp3x-rt5682-max9836: Map missing jack kcontrols
        commit: 00c7ee820895c9563b7780f84f1b9420cbfbe6c7
[05/27] ASoC: Intel: avs: da7219: Map missing jack kcontrols
        commit: c699fc46f45bab70a831a56e95d6f6c6e51ac7be
[06/27] ASoC: Intel: bxt_da7219_max98357a: Map missing Line Out jack kcontrol
        commit: 92d7071f751a863fe22aaf8cfdd94f96749e0aa5
[07/27] ASoC: Intel: bytcr_wm5102: Map missing Line Out jack kcontrol
        commit: 4e06382c0d275fa1e365ca2ee9b2286b7c49b07f
[08/27] ASoC: Intel: kbl_da7219_max98357a: Map missing Line Out jack kcontrol
        commit: da09176f1f04baae467c97a4dc8b6d9fa5cd11b8
[09/27] ASoC: Intel: kbl_da7219_max98927: Map missing Line Out jack kcontrol
        commit: 2830bfdbe90b0bf6170f88ca0803fa72e1b1e506
[10/27] ASoC: Intel: sof_da7219_max98373: Map missing Line Out jack kcontrol
        commit: 7265089ade245d062fe8f9938261656ff2a49633
[11/27] ASoC: imx-es8328: Map missing jack kcontrols
        commit: 105e84586bfcbe8e48e386936899c4eb8c00be71
[12/27] ASoC: mediatek: mt8173-max98090: Configure jack as a Headset jack
        commit: 73864428ba983bc35e1efabc2e3ec04c6d87c67c
[13/27] ASoC: mediatek: mt8173-rt5650-rt5514: Map missing jack kcontrols
        commit: 87eb19815fa53220602fa40b77f7e3504bf6b476
[14/27] ASoC: mediatek: mt8173-rt5650-rt5676: Map missing jack kcontrols
        commit: 8badca99caf0cc843341e3ffa87d24f9caa206c9
[15/27] ASoC: mediatek: mt8173-rt5650: Map missing jack kcontrols
        commit: 0ef5533f7b54419f5b108d6004f56c6de78f026d
[16/27] ASoC: mediatek: mt8183-da7219-max98357: Map missing jack kcontrols
        commit: 9c7388baa2053f333dc524814be4d95f0c2c8ae7
[17/27] ASoC: mediatek: mt8183-mt6358-ts3a227-max98357: Map missing jack kcontrols
        commit: 09a22368bb87a90a447d901e7f5bf2037f321769
[18/27] ASoC: mediatek: mt8186-mt6366-da7219-max98357: Map missing jack kcontrols
        commit: 26de9cc1b96eecfe9fb9c672272665e97c3cdc59
[19/27] ASoC: qcom: apq8016_sbc: Map missing jack kcontrols
        commit: 45bda58af84ffd5c951267f848c8dc10ea485c06
[20/27] ASoC: qcom: sc7180: Map missing jack kcontrols
        commit: 883bfefca437c9061686fa8d092d5a8fa04d06c8
[21/27] ASoC: qcom: sc7280: Map missing jack kcontrols
        commit: 4ab959e5a11624805983909d18ca7f653bab748c
[22/27] ASoC: qcom: sdm845: Map missing jack kcontrols
        commit: 242372d64e5ee39be518672abd7b797d5cd9521b
[23/27] ASoC: rk3399-gru-sound: Map missing Line Out jack kcontrol
        commit: d60e810a0fa83692116293b4b798ab0273668108
[24/27] ASoC: rockchip: rockchip_rt5645: Map missing jack kcontrols
        commit: 24127e5a07a8eac754be50f537df891ebdadf1b8
[25/27] ASoC: samsung: littlemill: Map missing jack kcontrols
        commit: 4d87362f017ea16b6035906613a1c29095a6134f
[26/27] ASoC: samsung: lowland: Split Line Out jack kcontrol from Headphone
        commit: c9d3401844fa6ec6fa924859dca95bac38b1e1ff
[27/27] ASoC: samsung: midas_wm1811: Map missing jack kcontrols
        commit: d27224a45e5457ad89195d92decdd57596253428

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark