Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
13a5b21
ALSA: hda/realtek: enable SND_PCI_QUIRK for hp pavilion 14-ec1xxx series
CierCier Dec 29, 2023
18a434f
ALSA: hda/realtek: fix mute/micmute LEDs for a HP ZBook
Jan 2, 2024
8c14dbf
ALSA: hda: cs35l41: fix building without CONFIG_SPI
arndb Jan 3, 2024
c344ef3
ASoC: SOF: Intel: hda-codec: Delay the codec device registration
ujfalusi Dec 7, 2023
3150b70
ASoC: meson: g12a-toacodec: Validate written enum values
broonie Jan 3, 2024
1e00120
ASoC: meson: g12a-tohdmitx: Validate written enum values
broonie Jan 3, 2024
172c882
ASoC: meson: g12a-toacodec: Fix event generation
broonie Jan 3, 2024
b036d8e
ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux
broonie Jan 3, 2024
2cd06bc
Merge tag 'asoc-fix-v6.7-rc8' of https://git.kernel.org/pub/scm/linux…
tiwai Jan 4, 2024
b6ce6e6
ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6
sidtronics Jan 4, 2024
3dbb4e3
ASoC: dt-bindings: move tas2563 from tas2562.yaml to tas2781.yaml
Shenghao-Ding Jan 4, 2024
645994d
ASoC: tas2562: move tas2563 from tas2562 driver to tas2781 driver
Shenghao-Ding Jan 4, 2024
e9aa447
ASoC: tas2781: Add tas2563 into header file for DSP mode
Shenghao-Ding Jan 4, 2024
9f1bcd1
ASoC: tas2781: Add tas2563 into driver
Shenghao-Ding Jan 4, 2024
3504041
ASoC: codecs: rtq9128: Fix PM_RUNTIME usage
Dec 29, 2023
415d10c
ASoC: codecs: rtq9128: Fix TDM enable and DAI format control flow
Dec 29, 2023
15de2a2
rtq9128: Fix pm runtime and TDM usage
broonie Jan 5, 2024
821e2ac
Merge branch 'for-next' into for-linus
tiwai Jan 8, 2024
0205f37
Merge tag 'asoc-v6.8' of https://git.kernel.org/pub/scm/linux/kernel/…
tiwai Jan 8, 2024
59b946e
ASoC: Intel: bxt_da7219_max98357a: Fix kernel ops due to COMP_DUMMY c…
ujfalusi Jan 8, 2024
3ec7129
ASoC: Intel: bxt_rt298: Fix kernel ops due to COMP_DUMMY change
ujfalusi Jan 8, 2024
7aeb259
ALSA: hda/conexant: Fix headset auto detect fail in cx8070 and SN6140
Jan 8, 2024
6b3d14b
ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP Envy X360 13-ay0xxx
realcatgirly Jan 8, 2024
4d4e1b6
ASoC: mediatek: mt8192: Check existence of dai_name before dereferencing
nfraprado Jan 8, 2024
dcaca1b
ALSA: hda/tas2781: annotate calibration data endianness
soyersoyer Jan 8, 2024
8c51c13
kselftest/alsa - mixer-test: fix the number of parameters to ksft_exi…
Jan 7, 2024
3f47c1e
kselftest/alsa - mixer-test: Fix the print format specifier warning
Jan 7, 2024
f77a255
kselftest/alsa - mixer-test: Fix the print format specifier warning
Jan 7, 2024
fd38dd6
kselftest/alsa - conf: Stringify the printed errno in sysfs_get()
Jan 7, 2024
e70b8dd
ASoC: mediatek: mt8195: Remove afe-dai component and rework codec link
Jan 10, 2024
e3b3ec9
ASoC: mediatek: sof-common: Add NULL check for normal_link string
Jan 11, 2024
cdac6e1
ALSA: aloop: Introduce a function to get if access is interleaved mode
Jan 11, 2024
a03cfad
ALSA: oxygen: Fix right channel of capture volume mixer
tiwai Jan 12, 2024
813c2f2
ASoC: SOF: icp3-dtrace: Revert "Fix wrong kfree() usage"
ujfalusi Jan 12, 2024
301bda1
ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm()
morimoto Jan 12, 2024
454abb8
ALSA: hda: Properly setup HDMI stream
Jan 12, 2024
b1ccc42
Merge remote-tracking branch 'asoc/for-6.7' into asoc-linus
broonie Jan 12, 2024
f4f827c
Merge remote-tracking branch 'regmap/for-next' into sound/upstream-20…
ujfalusi Jan 15, 2024
b168c10
Merge remote-tracking branch 'takashi/for-next' into sound/upstream-2…
ujfalusi Jan 15, 2024
0824520
Merge remote-tracking branch 'soundwire/next' into sound/upstream-202…
ujfalusi Jan 15, 2024
3db49c8
Merge branch 'sound/upstream-20240115' into merge/sound-upstream-2024…
ujfalusi Jan 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Documentation/devicetree/bindings/sound/tas2562.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ description: |

Specifications about the audio amplifier can be found at:
https://www.ti.com/lit/gpn/tas2562
https://www.ti.com/lit/gpn/tas2563
https://www.ti.com/lit/gpn/tas2564
https://www.ti.com/lit/gpn/tas2110

Expand All @@ -29,7 +28,6 @@ properties:
compatible:
enum:
- ti,tas2562
- ti,tas2563
- ti,tas2564
- ti,tas2110

Expand Down
78 changes: 63 additions & 15 deletions Documentation/devicetree/bindings/sound/ti,tas2781.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,46 @@
$id: http://devicetree.org/schemas/sound/ti,tas2781.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments TAS2781 SmartAMP
title: Texas Instruments TAS2563/TAS2781 SmartAMP

maintainers:
- Shenghao Ding <[email protected]>

description:
The TAS2781 is a mono, digital input Class-D audio amplifier
optimized for efficiently driving high peak power into small
loudspeakers. An integrated on-chip DSP supports Texas Instruments
Smart Amp speaker protection algorithm. The integrated speaker
voltage and current sense provides for real time
description: |
The TAS2563/TAS2781 is a mono, digital input Class-D audio
amplifier optimized for efficiently driving high peak power into
small loudspeakers. An integrated on-chip DSP supports Texas
Instruments Smart Amp speaker protection algorithm. The
integrated speaker voltage and current sense provides for real time
monitoring of loudspeaker behavior.

allOf:
- $ref: dai-common.yaml#
Specifications about the audio amplifier can be found at:
https://www.ti.com/lit/gpn/tas2563
https://www.ti.com/lit/gpn/tas2781

properties:
compatible:
enum:
- ti,tas2781
description: |
ti,tas2563: 6.1-W Boosted Class-D Audio Amplifier With Integrated
DSP and IV Sense, 16/20/24/32bit stereo I2S or multichannel TDM.

ti,tas2781: 24-V Class-D Amplifier with Real Time Integrated Speaker
Protection and Audio Processing, 16/20/24/32bit stereo I2S or
multichannel TDM.
oneOf:
- items:
- enum:
- ti,tas2563
- const: ti,tas2781
- enum:
- ti,tas2781

reg:
description:
I2C address, in multiple tas2781s case, all the i2c address
I2C address, in multiple-AMP case, all the i2c address
aggregate as one Audio Device to support multiple audio slots.
maxItems: 8
minItems: 1
items:
minimum: 0x38
maximum: 0x3f

reset-gpios:
maxItems: 1
Expand All @@ -49,6 +59,44 @@ required:
- compatible
- reg

allOf:
- $ref: dai-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- ti,tas2563
then:
properties:
reg:
description:
I2C address, in multiple-AMP case, all the i2c address
aggregate as one Audio Device to support multiple audio slots.
maxItems: 4
minItems: 1
items:
minimum: 0x4c
maximum: 0x4f

- if:
properties:
compatible:
contains:
enum:
- ti,tas2781
then:
properties:
reg:
description:
I2C address, in multiple-AMP case, all the i2c address
aggregate as one Audio Device to support multiple audio slots.
maxItems: 8
minItems: 1
items:
minimum: 0x38
maximum: 0x3f

additionalProperties: false

examples:
Expand Down
9 changes: 5 additions & 4 deletions include/sound/tas2781.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0 */
//
// ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier
// ALSA SoC Texas Instruments TAS2563/TAS2781 Audio Smart Amplifier
//
// Copyright (C) 2022 - 2023 Texas Instruments Incorporated
// https://www.ti.com
//
// The TAS2781 driver implements a flexible and configurable
// The TAS2563/TAS2781 driver implements a flexible and configurable
// algo coefficient setting for one, two, or even multiple
// TAS2781 chips.
// TAS2563/TAS2781 chips.
//
// Author: Shenghao Ding <[email protected]>
// Author: Kevin Lu <[email protected]>
Expand Down Expand Up @@ -60,7 +60,8 @@
#define TASDEVICE_CMD_FIELD_W 0x4

enum audio_device {
TAS2781 = 0,
TAS2563,
TAS2781,
};

enum device_catlog_id {
Expand Down
23 changes: 17 additions & 6 deletions sound/drivers/aloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,17 @@ static int loopback_snd_timer_close_cable(struct loopback_pcm *dpcm)
return 0;
}

static bool is_access_interleaved(snd_pcm_access_t access)
{
switch (access) {
case SNDRV_PCM_ACCESS_MMAP_INTERLEAVED:
case SNDRV_PCM_ACCESS_RW_INTERLEAVED:
return true;
default:
return false;
}
};

static int loopback_check_format(struct loopback_cable *cable, int stream)
{
struct snd_pcm_runtime *runtime, *cruntime;
Expand All @@ -341,7 +352,8 @@ static int loopback_check_format(struct loopback_cable *cable, int stream)
check = runtime->format != cruntime->format ||
runtime->rate != cruntime->rate ||
runtime->channels != cruntime->channels ||
runtime->access != cruntime->access;
is_access_interleaved(runtime->access) !=
is_access_interleaved(cruntime->access);
if (!check)
return 0;
if (stream == SNDRV_PCM_STREAM_CAPTURE) {
Expand Down Expand Up @@ -369,7 +381,8 @@ static int loopback_check_format(struct loopback_cable *cable, int stream)
&setup->channels_id);
setup->channels = runtime->channels;
}
if (setup->access != runtime->access) {
if (is_access_interleaved(setup->access) !=
is_access_interleaved(runtime->access)) {
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE,
&setup->access_id);
setup->access = runtime->access;
Expand Down Expand Up @@ -584,8 +597,7 @@ static void copy_play_buf(struct loopback_pcm *play,
size = play->pcm_buffer_size - src_off;
if (dst_off + size > capt->pcm_buffer_size)
size = capt->pcm_buffer_size - dst_off;
if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ||
runtime->access == SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED)
if (!is_access_interleaved(runtime->access))
copy_play_buf_part_n(play, capt, size, src_off, dst_off);
else
memcpy(dst + dst_off, src + src_off, size);
Expand Down Expand Up @@ -1544,8 +1556,7 @@ static int loopback_access_get(struct snd_kcontrol *kcontrol,
mutex_lock(&loopback->cable_lock);
access = loopback->setup[kcontrol->id.subdevice][kcontrol->id.device].access;

ucontrol->value.enumerated.item[0] = access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ||
access == SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED;
ucontrol->value.enumerated.item[0] = !is_access_interleaved(access);

mutex_unlock(&loopback->cable_lock);
return 0;
Expand Down
4 changes: 1 addition & 3 deletions sound/pci/hda/cs35l41_hda_property.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
if (cs35l41->control_bus == SPI) {
cs35l41->index = id;

#if IS_ENABLED(CONFIG_SPI)
/*
* Manually set the Chip Select for the second amp <cs_gpio_index> in the node.
* This is only supported for systems with 2 amps, since we cannot expand the
Expand All @@ -246,7 +245,7 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
* uses a native chip select), to ensure the second amp does not clash with the
* first.
*/
if (cfg->cs_gpio_index >= 0) {
if (IS_ENABLED(CONFIG_SPI) && cfg->cs_gpio_index >= 0) {
spi = to_spi_device(cs35l41->dev);

if (cfg->num_amps != 2) {
Expand Down Expand Up @@ -277,7 +276,6 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde
spi_setup(spi);
}
}
#endif
} else {
if (cfg->num_amps > 2)
/*
Expand Down
115 changes: 113 additions & 2 deletions sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include "hda_jack.h"
#include "hda_generic.h"

enum {
CX_HEADSET_NOPRESENT = 0,
CX_HEADSET_PARTPRESENT,
CX_HEADSET_ALLPRESENT,
};

struct conexant_spec {
struct hda_gen_spec gen;

Expand All @@ -42,7 +48,8 @@ struct conexant_spec {
unsigned int gpio_led;
unsigned int gpio_mute_led_mask;
unsigned int gpio_mic_led_mask;

unsigned int headset_present_flag;
bool is_cx8070_sn6140;
};


Expand Down Expand Up @@ -164,6 +171,27 @@ static void cxt_init_gpio_led(struct hda_codec *codec)
}
}

static void cx_fixup_headset_recog(struct hda_codec *codec)
{
unsigned int mic_persent;

/* fix some headset type recognize fail issue, such as EDIFIER headset */
/* set micbiasd output current comparator threshold from 66% to 55%. */
snd_hda_codec_write(codec, 0x1c, 0, 0x320, 0x010);
/* set OFF voltage for DFET from -1.2V to -0.8V, set headset micbias registor
* value adjustment trim from 2.2K ohms to 2.0K ohms.
*/
snd_hda_codec_write(codec, 0x1c, 0, 0x3b0, 0xe10);
/* fix reboot headset type recognize fail issue */
mic_persent = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_PIN_SENSE, 0x0);
if (mic_persent & AC_PINSENSE_PRESENCE)
/* enable headset mic VREF */
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
else
/* disable headset mic VREF */
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20);
}

static int cx_auto_init(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;
Expand All @@ -174,6 +202,9 @@ static int cx_auto_init(struct hda_codec *codec)
cxt_init_gpio_led(codec);
snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);

if (spec->is_cx8070_sn6140)
cx_fixup_headset_recog(codec);

return 0;
}

Expand All @@ -192,6 +223,77 @@ static void cx_auto_free(struct hda_codec *codec)
snd_hda_gen_free(codec);
}

static void cx_process_headset_plugin(struct hda_codec *codec)
{
unsigned int val;
unsigned int count = 0;

/* Wait headset detect done. */
do {
val = snd_hda_codec_read(codec, 0x1c, 0, 0xca0, 0x0);
if (val & 0x080) {
codec_dbg(codec, "headset type detect done!\n");
break;
}
msleep(20);
count++;
} while (count < 3);
val = snd_hda_codec_read(codec, 0x1c, 0, 0xcb0, 0x0);
if (val & 0x800) {
codec_dbg(codec, "headset plugin, type is CTIA\n");
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
} else if (val & 0x400) {
codec_dbg(codec, "headset plugin, type is OMTP\n");
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
} else {
codec_dbg(codec, "headphone plugin\n");
}
}

static void cx_update_headset_mic_vref(struct hda_codec *codec, unsigned int res)
{
unsigned int phone_present, mic_persent, phone_tag, mic_tag;
struct conexant_spec *spec = codec->spec;

/* In cx8070 and sn6140, the node 16 can only be config to headphone or disabled,
* the node 19 can only be config to microphone or disabled.
* Check hp&mic tag to process headset pulgin&plugout.
*/
phone_tag = snd_hda_codec_read(codec, 0x16, 0, AC_VERB_GET_UNSOLICITED_RESPONSE, 0x0);
mic_tag = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_UNSOLICITED_RESPONSE, 0x0);
if ((phone_tag & (res >> AC_UNSOL_RES_TAG_SHIFT)) ||
(mic_tag & (res >> AC_UNSOL_RES_TAG_SHIFT))) {
phone_present = snd_hda_codec_read(codec, 0x16, 0, AC_VERB_GET_PIN_SENSE, 0x0);
if (!(phone_present & AC_PINSENSE_PRESENCE)) {/* headphone plugout */
spec->headset_present_flag = CX_HEADSET_NOPRESENT;
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20);
return;
}
if (spec->headset_present_flag == CX_HEADSET_NOPRESENT) {
spec->headset_present_flag = CX_HEADSET_PARTPRESENT;
} else if (spec->headset_present_flag == CX_HEADSET_PARTPRESENT) {
mic_persent = snd_hda_codec_read(codec, 0x19, 0,
AC_VERB_GET_PIN_SENSE, 0x0);
/* headset is present */
if ((phone_present & AC_PINSENSE_PRESENCE) &&
(mic_persent & AC_PINSENSE_PRESENCE)) {
cx_process_headset_plugin(codec);
spec->headset_present_flag = CX_HEADSET_ALLPRESENT;
}
}
}
}

static void cx_jack_unsol_event(struct hda_codec *codec, unsigned int res)
{
struct conexant_spec *spec = codec->spec;

if (spec->is_cx8070_sn6140)
cx_update_headset_mic_vref(codec, res);

snd_hda_jack_unsol_event(codec, res);
}

#ifdef CONFIG_PM
static int cx_auto_suspend(struct hda_codec *codec)
{
Expand All @@ -205,7 +307,7 @@ static const struct hda_codec_ops cx_auto_patch_ops = {
.build_pcms = snd_hda_gen_build_pcms,
.init = cx_auto_init,
.free = cx_auto_free,
.unsol_event = snd_hda_jack_unsol_event,
.unsol_event = cx_jack_unsol_event,
#ifdef CONFIG_PM
.suspend = cx_auto_suspend,
.check_power_status = snd_hda_gen_check_power_status,
Expand Down Expand Up @@ -1042,6 +1144,15 @@ static int patch_conexant_auto(struct hda_codec *codec)
codec->spec = spec;
codec->patch_ops = cx_auto_patch_ops;

/* init cx8070/sn6140 flag and reset headset_present_flag */
switch (codec->core.vendor_id) {
case 0x14f11f86:
case 0x14f11f87:
spec->is_cx8070_sn6140 = true;
spec->headset_present_flag = CX_HEADSET_NOPRESENT;
break;
}

cx_auto_parse_eapd(codec);
spec->gen.own_eapd_ctl = 1;

Expand Down
Loading