Skip to content

Commit

Permalink
Merge tag 'sound-5.7-rc3' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This became a slightly big pull request, as the accumulated ASoC fixes
  are included here. Some highlights:

   - Revert of ASoC DAI startup changes that caused regression on some
     x86 platforms

   - Regression fix in HD-audio power management and driver blacklist

   - A collection of ASoC DAPM and topology fixes

   - Continued USB-audio fixes and quirks

   - Lots of small device-specific fixes

   - Rockchip S/PDIF DT stuff update for validation issues"

* tag 'sound-5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (51 commits)
  ALSA: hda: Always use jackpoll helper for jack update after resume
  ALSA: hda/realtek - Add new codec supported for ALC245
  ALSA: usb-audio: Fix usb audio refcnt leak when getting spdif
  ALSA: usb-audio: Add connector notifier delegation
  ALSA: usb-audio: Apply async workaround for Scarlett 2i4 2nd gen
  ASoC: wm8960: Fix wrong clock after suspend & resume
  ALSA: usx2y: Fix potential NULL dereference
  ALSA: usb-audio: Add quirk for Focusrite Scarlett 2i2
  ASoC: wm89xx: Add missing dependency
  ASoC: dapm: fixup dapm kcontrol widget
  ASoC: rsnd: Fix "status check failed" spam for multi-SSI
  ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent
  ASoC: meson: gx-card: fix codec-to-codec link setup
  ASoC: meson: axg-card: fix codec-to-codec link setup
  ALSA: usb-audio: Add static mapping table for ALC1220-VB-based mobos
  ALSA: hda: Remove ASUS ROG Zenith from the blacklist
  ALSA: hda/realtek - Fix unexpected init_amp override
  ALSA: usb-audio: Filter out unsupported sample rates on Focusrite devices
  ASoC: SOF: Intel: add min/max channels for SSP on Baytrail/Broadwell
  ASoC: stm32: sai: fix sai probe
  ...
  • Loading branch information
torvalds committed Apr 24, 2020
2 parents 88412a4 + 8d6762a commit b4ecf26
Show file tree
Hide file tree
Showing 44 changed files with 712 additions and 387 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/sound/rockchip-i2s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ properties:
- const: tx
- const: rx

power-domains:
maxItems: 1

rockchip,capture-channels:
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
Expand Down
45 changes: 0 additions & 45 deletions Documentation/devicetree/bindings/sound/rockchip-spdif.txt

This file was deleted.

101 changes: 101 additions & 0 deletions Documentation/devicetree/bindings/sound/rockchip-spdif.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/rockchip-spdif.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Rockchip SPDIF transceiver

description:
The S/PDIF audio block is a stereo transceiver that allows the
processor to receive and transmit digital audio via a coaxial or
fibre cable.

maintainers:
- Heiko Stuebner <heiko@sntech.de>

properties:
compatible:
oneOf:
- const: rockchip,rk3066-spdif
- const: rockchip,rk3228-spdif
- const: rockchip,rk3328-spdif
- const: rockchip,rk3366-spdif
- const: rockchip,rk3368-spdif
- const: rockchip,rk3399-spdif
- items:
- enum:
- rockchip,rk3188-spdif
- rockchip,rk3288-spdif
- const: rockchip,rk3066-spdif

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
items:
- description: clock for SPDIF bus
- description: clock for SPDIF controller

clock-names:
items:
- const: mclk
- const: hclk

dmas:
maxItems: 1

dma-names:
const: tx

power-domains:
maxItems: 1

rockchip,grf:
$ref: /schemas/types.yaml#/definitions/phandle
description:
The phandle of the syscon node for the GRF register.
Required property on RK3288.

"#sound-dai-cells":
const: 0

required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- dmas
- dma-names
- "#sound-dai-cells"

if:
properties:
compatible:
contains:
const: rockchip,rk3288-spdif

then:
required:
- rockchip,grf

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/rk3188-cru.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
spdif: spdif@1011e000 {
compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
reg = <0x1011e000 0x2000>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru SCLK_SPDIF>, <&cru HCLK_SPDIF>;
clock-names = "mclk", "hclk";
dmas = <&dmac1_s 8>;
dma-names = "tx";
#sound-dai-cells = <0>;
};
1 change: 0 additions & 1 deletion include/sound/soc-dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ struct snd_soc_dai {

/* bit field */
unsigned int probed:1;
unsigned int started[SNDRV_PCM_STREAM_LAST + 1];
};

static inline struct snd_soc_pcm_stream *
Expand Down
3 changes: 3 additions & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,9 @@ struct snd_soc_dai_link {
const struct snd_soc_pcm_stream *params;
unsigned int num_params;

struct snd_soc_dapm_widget *playback_widget;
struct snd_soc_dapm_widget *capture_widget;

unsigned int dai_fmt; /* format to set on init */

enum snd_soc_dpcm_trigger trigger[2]; /* trigger type for DPCM */
Expand Down
28 changes: 17 additions & 11 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,18 @@ static void hda_jackpoll_work(struct work_struct *work)
struct hda_codec *codec =
container_of(work, struct hda_codec, jackpoll_work.work);

snd_hda_jack_set_dirty_all(codec);
snd_hda_jack_poll_all(codec);
/* for non-polling trigger: we need nothing if already powered on */
if (!codec->jackpoll_interval && snd_hdac_is_power_on(&codec->core))
return;

/* the power-up/down sequence triggers the runtime resume */
snd_hda_power_up_pm(codec);
/* update jacks manually if polling is required, too */
if (codec->jackpoll_interval) {
snd_hda_jack_set_dirty_all(codec);
snd_hda_jack_poll_all(codec);
}
snd_hda_power_down_pm(codec);

if (!codec->jackpoll_interval)
return;
Expand Down Expand Up @@ -2951,18 +2961,14 @@ static int hda_codec_runtime_resume(struct device *dev)
static int hda_codec_force_resume(struct device *dev)
{
struct hda_codec *codec = dev_to_hda_codec(dev);
bool forced_resume = hda_codec_need_resume(codec);
int ret;

/* The get/put pair below enforces the runtime resume even if the
* device hasn't been used at suspend time. This trick is needed to
* update the jack state change during the sleep.
*/
if (forced_resume)
pm_runtime_get_noresume(dev);
ret = pm_runtime_force_resume(dev);
if (forced_resume)
pm_runtime_put(dev);
/* schedule jackpoll work for jack detection update */
if (codec->jackpoll_interval ||
(pm_runtime_suspended(dev) && hda_codec_need_resume(codec)))
schedule_delayed_work(&codec->jackpoll_work,
codec->jackpoll_interval);
return ret;
}

Expand Down
18 changes: 2 additions & 16 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,8 @@ static void __azx_runtime_resume(struct azx *chip, bool from_rt)

if (status && from_rt) {
list_for_each_codec(codec, &chip->bus)
if (status & (1 << codec->addr))
if (!codec->relaxed_resume &&
(status & (1 << codec->addr)))
schedule_delayed_work(&codec->jackpoll_work,
codec->jackpoll_interval);
}
Expand Down Expand Up @@ -1044,9 +1045,7 @@ static int azx_suspend(struct device *dev)
static int azx_resume(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
struct hda_codec *codec;
struct azx *chip;
bool forced_resume = false;

if (!azx_is_pm_ready(card))
return 0;
Expand All @@ -1058,19 +1057,7 @@ static int azx_resume(struct device *dev)
if (azx_acquire_irq(chip, 1) < 0)
return -EIO;

/* check for the forced resume */
list_for_each_codec(codec, &chip->bus) {
if (hda_codec_need_resume(codec)) {
forced_resume = true;
break;
}
}

if (forced_resume)
pm_runtime_get_noresume(dev);
pm_runtime_force_resume(dev);
if (forced_resume)
pm_runtime_put(dev);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);

trace_azx_resume(chip);
Expand Down Expand Up @@ -2092,7 +2079,6 @@ static void pcm_mmap_prepare(struct snd_pcm_substream *substream,
* should be ignored from the beginning.
*/
static const struct snd_pci_quirk driver_blacklist[] = {
SND_PCI_QUIRK(0x1043, 0x874f, "ASUS ROG Zenith II / Strix", 0),
SND_PCI_QUIRK(0x1462, 0xcb59, "MSI TRX40 Creator", 0),
SND_PCI_QUIRK(0x1462, 0xcb60, "MSI TRX40", 0),
{}
Expand Down
9 changes: 9 additions & 0 deletions sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ static bool static_hdmi_pcm;
module_param(static_hdmi_pcm, bool, 0644);
MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");

static bool enable_acomp = true;
module_param(enable_acomp, bool, 0444);
MODULE_PARM_DESC(enable_acomp, "Enable audio component binding (default=yes)");

struct hdmi_spec_per_cvt {
hda_nid_t cvt_nid;
int assigned;
Expand Down Expand Up @@ -2505,6 +2509,11 @@ static void generic_acomp_init(struct hda_codec *codec,
{
struct hdmi_spec *spec = codec->spec;

if (!enable_acomp) {
codec_info(codec, "audio component disabled by module option\n");
return;
}

spec->port2pin = port2pin;
setup_drm_audio_ops(codec, ops);
if (!snd_hdac_acomp_init(&codec->bus->core, &spec->drm_audio_ops,
Expand Down
11 changes: 8 additions & 3 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
case 0x10ec0233:
case 0x10ec0235:
case 0x10ec0236:
case 0x10ec0245:
case 0x10ec0255:
case 0x10ec0256:
case 0x10ec0257:
Expand Down Expand Up @@ -797,9 +798,11 @@ static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
{
if (!alc_subsystem_id(codec, ports)) {
struct alc_spec *spec = codec->spec;
codec_dbg(codec,
"realtek: Enable default setup for auto mode as fallback\n");
spec->init_amp = ALC_INIT_DEFAULT;
if (spec->init_amp == ALC_INIT_UNDEFINED) {
codec_dbg(codec,
"realtek: Enable default setup for auto mode as fallback\n");
spec->init_amp = ALC_INIT_DEFAULT;
}
}
}

Expand Down Expand Up @@ -8196,6 +8199,7 @@ static int patch_alc269(struct hda_codec *codec)
spec->gen.mixer_nid = 0;
break;
case 0x10ec0215:
case 0x10ec0245:
case 0x10ec0285:
case 0x10ec0289:
spec->codec_variant = ALC269_TYPE_ALC215;
Expand Down Expand Up @@ -9457,6 +9461,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/amd/acp3x-rt5682-max9836.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
}

snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);

ret = snd_soc_component_set_jack(component, &pco_jack, NULL);
if (ret) {
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,7 @@ config SND_SOC_WM8804_SPI

config SND_SOC_WM8900
tristate
depends on SND_SOC_I2C_AND_SPI

config SND_SOC_WM8903
tristate "Wolfson Microelectronics WM8903 CODEC"
Expand Down Expand Up @@ -1576,6 +1577,7 @@ config SND_SOC_WM8985

config SND_SOC_WM8988
tristate
depends on SND_SOC_I2C_AND_SPI

config SND_SOC_WM8990
tristate
Expand All @@ -1594,6 +1596,7 @@ config SND_SOC_WM8994

config SND_SOC_WM8995
tristate
depends on SND_SOC_I2C_AND_SPI

config SND_SOC_WM8996
tristate
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/codecs/hdac_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ static struct hdac_hdmi_pcm *
hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi,
struct hdac_hdmi_cvt *cvt)
{
struct hdac_hdmi_pcm *pcm = NULL;
struct hdac_hdmi_pcm *pcm;

list_for_each_entry(pcm, &hdmi->pcm_list, head) {
if (pcm->cvt == cvt)
break;
return pcm;
}

return pcm;
return NULL;
}

static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm,
Expand Down
Loading

0 comments on commit b4ecf26

Please sign in to comment.