~vicamo/+git/ubuntu-kernel:bug-1918378/fix-headset-mic-volume-ctrl-name/oem-5.10

Last commit made on 2021-03-10
Get this branch:
git clone -b bug-1918378/fix-headset-mic-volume-ctrl-name/oem-5.10 https://git.launchpad.net/~vicamo/+git/ubuntu-kernel
Only You-Sheng Yang can upload to this branch. If you are You-Sheng Yang please log in for upload directions.

Branch merges

Branch information

Name:
bug-1918378/fix-headset-mic-volume-ctrl-name/oem-5.10
Repository:
lp:~vicamo/+git/ubuntu-kernel

Recent commits

a30dbef... by You-Sheng Yang

Bug 1916554/1918378: ALSA: hda/cirrus - Add HDA support for CS8409/CS42L42 codecs

79712ce... by Stefan Binding <email address hidden>

ALSA: hda/cirrus: Fix Headset Mic volume control name

Signed-off-by: Stefan Binding <email address hidden>
Change-Id: I49c31897d124893d56aa23d9fd44ee77c2afdb72
(cherry picked from
https://github.com/CirrusLogic/product-support/blob/82915ae88a02781b173c83568426722789d74f37/dell/hda/5.10.7/0001-ALSA-hda-cirrus-Fix-Headset-Mic-volume-control-name.patch)
Signed-off-by: You-Sheng Yang <email address hidden>

f36886b... by Stefan Binding <email address hidden>

ALSA: hda/cirrus: Add Headphone and Headset MIC Volume Control

BugLink: https://bugs.launchpad.net/bugs/1916554

CS8409 does not support Volume Control for NIDs 0x24 (the Headphones),
or 0x34 (The Headset Mic).
However, CS42L42 codec does support gain control for both.
We can add support for Volume Controls, by writing the the CS42L42
regmap via i2c commands, using custom info, get and put volume
functions, saved in the control.

Tested on DELL Inspiron-3500, DELL Inspiron-3501, DELL Inspiron-3500

Signed-off-by: Stefan Binding <email address hidden>
Signed-off-by: Vitaly Rodionov <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=for-next&id=b9dd23bb03fe241ccb774c59b05d5cbac07895dc)
Signed-off-by: You-Sheng Yang <email address hidden>

1e8e2d0... by Vitaly Rodionov <email address hidden>

ALSA: hda/cirrus: Add jack detect interrupt support from CS42L42 companion codec.

BugLink: https://bugs.launchpad.net/bugs/1916554

In the case of CS8409 we do not have unsol events from NID's 0x24 and 0x34
where hs mic and hp are connected. Companion codec CS42L42 will generate
interrupt via gpio 4 to notify jack events. We have to overwrite standard
snd_hda_jack_unsol_event(), read CS42L42 jack detect status registers and
then notify status via generic snd_hda_jack_unsol_event() call.

Tested on DELL Inspiron-3500, DELL Inspiron-3501, DELL Inspiron-3505.

Signed-off-by: Vitaly Rodionov <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=for-next&id=b73df04187ebb52edf3f7e502bb245c5ccab2763)
Signed-off-by: You-Sheng Yang <email address hidden>

c04d7bb... by Vitaly Rodionov <email address hidden>

ALSA: hda/cirrus: Add support for CS8409 HDA bridge and CS42L42 companion codec.

BugLink: https://bugs.launchpad.net/bugs/1916554

Dell's laptops Inspiron 3500, Inspiron 3501, Inspiron 3505 are using Cirrus Logic
CS8409 HDA bridge with CS42L42 companion codec.

The CS8409 is a multichannel HD audio routing controller.
CS8409 includes support for four channels of digital
microphone data and two bidirectional ASPs for up to 32
channels of TDM data or 4 channels of I2S data. The CS8409 is
intended to be used with a remote companion codec that implements
high performance analog functions in close physical
proximity to the end-equipment audio port or speaker driver.

The CS42L42 is a low-power audio codec with integrated MIPI
SoundWire interface or I2C/I2S/TDM interfaces designed
for portable applications. It provides a high-dynamic range,
stereo DAC for audio playback and a mono high-dynamic-range
ADC for audio capture

CS42L42 is connected to CS8409 HDA bridge via I2C and I2S.

CS8409 CS42L42
------- --------
ASP1.A TX --> ASP_SDIN
ASP1.A RX <-- ASP_SDOUT
GPIO5 --> RST#
GPIO4 <-- INT#
GPIO3 <-- WAKE#
GPIO7 <-> I2C SDA
GPIO6 --> I2C CLK

Tested on DELL Inspiron-3500, DELL Inspiron-3501, DELL Inspiron-3505

This patch will register CS8409 with sound card and create
input/output paths and two input devices, initialise CS42L42
companion codec and configure it for ASP TX/RX TDM mode,
24bit, 48kHz.

cat /proc/asound/pcm
00-00: CS8409 Analog : CS8409 Analog : playback 1 : capture 1
00-03: HDMI 0 : HDMI 0 : playback 1

dmesg
snd_hda_codec_cirrus hdaudioC0D0: autoconfig for CS8409: line_outs=1 (0x2c/0x0/0x0/0x0/0x0) type:speaker
snd_hda_codec_cirrus hdaudioC0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
snd_hda_codec_cirrus hdaudioC0D0: hp_outs=1 (0x24/0x0/0x0/0x0/0x0)
snd_hda_codec_cirrus hdaudioC0D0: mono: mono_out=0x0
snd_hda_codec_cirrus hdaudioC0D0: inputs:
snd_hda_codec_cirrus hdaudioC0D0: Internal Mic=0x44
snd_hda_codec_cirrus hdaudioC0D0: Mic=0x34
input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1f.3/sound/card0/input8
input: HDA Intel PCH Headset Mic as /devices/pci0000:00/0000:00:1f.3/sound/card0/input9

Signed-off-by: Vitaly Rodionov <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=for-next&id=6cc7e93f46a5ce9f65ad3c6c6f645f1d831a8fa4)
Signed-off-by: You-Sheng Yang <email address hidden>

6368d80... by Vitaly Rodionov <email address hidden>

ALSA: hda/cirrus: Increase AUTO_CFG_MAX_INS from 8 to 18

BugLink: https://bugs.launchpad.net/bugs/1916554

In preparation to support Cirrus Logic CS8409 HDA bridge on new Dell platforms
it is nessasary to increase AUTO_CFG_MAX_INS and AUTO_CFG_NUM_INPUTS values.
Currently AUTO_CFG_MAX_INS is limited to 8, but Cirrus Logic HDA bridge CS8409
has 18 input pins, 16 ASP receivers and 2 DMIC inputs. We have to increase this
value to 18, so generic code can handle this correctly.

Tested on DELL Inspiron-3505, DELL Inspiron-3501, DELL Inspiron-3500

Signed-off-by: Vitaly Rodionov <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=for-next&id=b95a913cb368edcb606d844a6dc6240093d87020)
Signed-off-by: You-Sheng Yang <email address hidden>

95ddd8c... by Timo Aaltonen

UBUNTU: Ubuntu-oem-5.10-5.10.0-1017.18

Signed-off-by: Timo Aaltonen <email address hidden>

2528a2c... by Timo Aaltonen

UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1917468
Properties: no-test-build
Signed-off-by: Timo Aaltonen <email address hidden>

d0e6345... by Kai-Heng Feng

ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()

BugLink: https://bugs.launchpad.net/bugs/1917842

Rear audio on Lenovo ThinkStation P620 stops working after commit
1965c4364bdd ("ALSA: usb-audio: Disable autosuspend for Lenovo
ThinkStation P620"):
[ 6.013526] usbcore: registered new interface driver snd-usb-audio
[ 6.023064] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1
[ 6.023083] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4
[ 6.023090] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1
[ 6.023098] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4
[ 6.023103] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1
[ 6.023110] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4
[ 6.045846] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1
[ 6.045866] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4
[ 6.045877] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1
[ 6.045886] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4
[ 6.045894] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1
[ 6.045908] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4

I overlooked the issue because when I was working on the said commit,
only the front audio is tested. Apology for that.

Changing supports_autosuspend in driver is too late for disabling
autosuspend, because it was already used by USB probe routine, so it can
break the balance on the following code that depends on
supports_autosuspend.

Fix it by using usb_disable_autosuspend() helper, and balance the
suspend count in disconnect callback.

Fixes: 1965c4364bdd ("ALSA: usb-audio: Disable autosuspend for Lenovo ThinkStation P620")
Signed-off-by: Kai-Heng Feng <email address hidden>
Cc: <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit 9799110825dba087c2bdce886977cf84dada2005 linux-next)
Signed-off-by: Kai-Heng Feng <email address hidden>
Signed-off-by: Timo Aaltonen <email address hidden>

3c8fec3... by Hui Wang

ALSA: hda/hdmi: let new platforms assign the pcm slot dynamically

BugLink: https://bugs.launchpad.net/bugs/1917829

If the platform set the dyn_pcm_assign to true, it will call
hdmi_find_pcm_slot() to find a pcm slot when hdmi/dp monitor is
connected and need to create a pcm.

So far only intel_hsw_common_init() and patch_nvhdmi() set the
dyn_pcm_assign to true, here we let tgl platforms assign the pcm slot
dynamically first, if the driver runs for a period of time and there
is no regression reported, we could set no_fixed_assgin to true in
the intel_hsw_common_init(), and then set it to true in the
patch_nvhdmi().

This change comes from the discussion between Takashi and
Kai Vehmanen. Please refer to:
https://github.com/alsa-project/alsa-lib/pull/118

Suggested-and-reviewed-by: Takashi Iwai <email address hidden>
Suggested-and-reviewed-by: Kai Vehmanen <email address hidden>
Signed-off-by: Hui Wang <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Takashi Iwai <email address hidden>
(cherry picked from commit 13046370c4d143b629adc1a51659a8a6497fbbe6 linux-next)
Signed-off-by: Hui Wang <email address hidden>
Signed-off-by: Timo Aaltonen <email address hidden>