Commit a1fe5b6d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "A collection of small fixes:

   - Lots of ASoC SOF fixes and related reworks

   - ASoC TAS codec fixes including DT updates

   - A few HD-audio quirks and regression fixes

   - Minor fixes for aloop, oxygen and scarlett2 mixer"

* tag 'sound-fix-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits)
  ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5
  ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook
  ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx
  ASoC: SOF: ipc4-loader: remove the CPC check warnings
  ASoC: SOF: ipc4-pcm: remove log message for LLP
  ALSA: hda: generic: Remove obsolete call to ledtrig_audio_get
  ALSA: scarlett2: Fix yet more -Wformat-truncation warnings
  ALSA: hda: Properly setup HDMI stream
  ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm()
  ASoC: SOF: icp3-dtrace: Revert "Fix wrong kfree() usage"
  ALSA: oxygen: Fix right channel of capture volume mixer
  ALSA: aloop: Introduce a function to get if access is interleaved mode
  ASoC: mediatek: sof-common: Add NULL check for normal_link string
  ASoC: mediatek: mt8195: Remove afe-dai component and rework codec link
  ASoC: mediatek: mt8192: Check existence of dai_name before dereferencing
  ASoC: Intel: bxt_rt298: Fix kernel ops due to COMP_DUMMY change
  ASoC: Intel: bxt_da7219_max98357a: Fix kernel ops due to COMP_DUMMY change
  ASoC: codecs: rtq9128: Fix TDM enable and DAI format control flow
  ASoC: codecs: rtq9128: Fix PM_RUNTIME usage
  ASoC: tas2781: Add tas2563 into driver
  ...
parents e08b5758 fb3c007f
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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

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

+63 −15
Original line number Diff line number Diff line
@@ -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 <shenghao-ding@ti.com>

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:
    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
@@ -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:
+5 −4
Original line number Diff line number Diff line
/* 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 <shenghao-ding@ti.com>
// Author: Kevin Lu <kevin-lu@ti.com>
@@ -60,7 +60,8 @@
#define TASDEVICE_CMD_FIELD_W		0x4

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

enum device_catlog_id {
+17 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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) {
@@ -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;
@@ -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);
@@ -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;
+0 −1
Original line number Diff line number Diff line
@@ -3946,7 +3946,6 @@ static int create_mute_led_cdev(struct hda_codec *codec,
	cdev->max_brightness = 1;
	cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute";
	cdev->brightness_set_blocking = callback;
	cdev->brightness = ledtrig_audio_get(idx);
	cdev->flags = LED_CORE_SUSPENDRESUME;

	err = led_classdev_register(&codec->core.dev, cdev);
Loading