sound fixes for 6.19-rc1
The rest for 6.19 merge window. The only slightly large change is
the enablement of CIX HD-audio controller, which took a bit time to
be cooked up, while most of other changes are device-specific small
trivial fixes.
- Default disablement of the kconfig for decades old pre-release
alsa-lib PCM API; it's only the default config value change, so
it can't lead to any regressions for the existing setups
- Support for CIX HD-audio controller
- A few ASoC ACP fixes
- Fixes for ASoC cirrus, bcm, wcd, qcom, ak platforms
- Trivial hardening for FireWire and USB-audio
- HD-audio Intel binding fix and quirks
-----BEGIN PGP SIGNATURE-----
iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmk6tSgOHHRpd2FpQHN1
c2UuZGUACgkQLtJE4w1nLE+RVBAAjPpGl5pG+oS2COkHkaieg+fHcHBOQxKDO+fU
4p8t/gAb6ELPrYX7YdH0EbSyUhQOYkRin5DSNj1qEa4PQwCayXp2Xv/HT7t6aqbl
0F3rboXTEnBMRf8haAde+hgNzF0aLwOE3BFZc5hWpDs04pFX8Y0hKu1/JlrVVyvJ
j54KuoZQxp7nu9N+t9xsdIet3nrrjbdvKGXqPbNbo6IWviuj+6+YSueaLdgNOpD1
nP8dDx2LcuRf0KRPNoIP4ZuJvOD3C9/rbbHAkSZ5Vf2dliy+aIHo/8SXWjBVW9N3
V+HFc9P9te3VtUpCOIZjK2Pgf3QTfMIkFIspOR4kSlbdkhoZoPlM2J65VXXugeur
5lxfnXwL439iW2KfKGFjSdu23EHh7VSBIIXWzRO0y0qtgyEakINCkOEVG//AW+9v
OL1IUoyatfa3HQA2K15E1xgVr4jTAwENXyMszJ+1zsaLTTD09sKFmFmfLUUCS9Ir
ekpRC1n0m8dWfDJtGcmcxyda87DL+9lOK0r6KW3Mo31EL92KWlm1wJiQSrsuNWgh
J4NE8F9+Smh96CKXB/v+B+kXIOsXh8+dVoYWRNzJ9wYfXf2ch8l2LIYPBFJa159/
7XyzFWC3636ZWrCn6sE/rkzEh/0OHEWI+npeN47OJ1Wh1CSS/b1tFZbGaurkGe5i
ni1Sa54=
=3ys0
-----END PGP SIGNATURE-----
Merge tag 'sound-fix-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"The only slightly large change is the enablement of CIX HD-audio
controller, which took a bit time to be cooked up, while most of other
changes are device-specific small trivial fixes:
- Default disablement of the kconfig for decades old pre-release
alsa-lib PCM API; it's only the default config value change, so it
can't lead to any regressions for the existing setups
- Support for CIX HD-audio controller
- A few ASoC ACP fixes
- Fixes for ASoC cirrus, bcm, wcd, qcom, ak platforms
- Trivial hardening for FireWire and USB-audio
- HD-audio Intel binding fix and quirks"
* tag 'sound-fix-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (30 commits)
ALSA: hda/tas2781: Add new quirk for HP new project
ALSA: hda: cix-ipbloq: Use modern PM ops
ALSA: hda: intel-dsp-config: Prefer legacy driver as fallback
ASoC: amd: acp: update tdm channels for specific DAI
ASoC: cs35l56: Fix incorrect select SND_SOC_CS35L56_CAL_SYSFS_COMMON
ALSA: firewire-motu: add bounds check in put_user loop for DSP events
ASoC: cs35l41: Always return 0 when a subsystem ID is found
ALSA: uapi: Fix typo in asound.h comment
ALSA: Do not build obsolete API
ALSA: hda: add CIX IPBLOQ HDA controller support
ALSA: hda/core: add addr_offset field for bus address translation
ALSA: hda: dt-bindings: add CIX IPBLOQ HDA controller support
ALSA: hda/realtek: Add support for ASUS UM3406GA
ALSA: hda/realtek: Add support for HP Turbine Laptops
ALSA: usb-audio: Initialize status1 to fix uninitialized symbol errors
ALSA: firewire-motu: fix buffer overflow in hwdep read for DSP events
ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_hda_read_acpi()
ASoC: cros_ec_codec: Remove unnecessary selection of CRYPTO
ASoc: qcom: q6afe: fix bad guard conversion
ASoC: rockchip: Fix Wvoid-pointer-to-enum-cast warning (again)
...
pull/1354/merge
commit
7f3c8f9191
|
|
@ -9,6 +9,9 @@ title: Cirrus Logic CS42448/CS42888 audio CODEC
|
||||||
maintainers:
|
maintainers:
|
||||||
- patches@opensource.cirrus.com
|
- patches@opensource.cirrus.com
|
||||||
|
|
||||||
|
allOf:
|
||||||
|
- $ref: dai-common.yaml#
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
compatible:
|
compatible:
|
||||||
enum:
|
enum:
|
||||||
|
|
@ -63,7 +66,7 @@ then:
|
||||||
- VLC-supply
|
- VLC-supply
|
||||||
- VLS-supply
|
- VLS-supply
|
||||||
|
|
||||||
additionalProperties: false
|
unevaluatedProperties: false
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
- |
|
- |
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
$id: http://devicetree.org/schemas/sound/cix,sky1-ipbloq-hda.yaml#
|
||||||
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||||
|
|
||||||
|
title: CIX IPBLOQ HDA controller
|
||||||
|
|
||||||
|
description:
|
||||||
|
CIX IPBLOQ High Definition Audio (HDA) Controller
|
||||||
|
|
||||||
|
maintainers:
|
||||||
|
- Joakim Zhang <joakim.zhang@cixtech.com>
|
||||||
|
|
||||||
|
allOf:
|
||||||
|
- $ref: sound-card-common.yaml#
|
||||||
|
|
||||||
|
properties:
|
||||||
|
compatible:
|
||||||
|
const: cix,sky1-ipbloq-hda
|
||||||
|
|
||||||
|
reg:
|
||||||
|
maxItems: 1
|
||||||
|
|
||||||
|
interrupts:
|
||||||
|
maxItems: 1
|
||||||
|
|
||||||
|
clocks:
|
||||||
|
maxItems: 2
|
||||||
|
|
||||||
|
clock-names:
|
||||||
|
items:
|
||||||
|
- const: ipg
|
||||||
|
- const: per
|
||||||
|
|
||||||
|
resets:
|
||||||
|
maxItems: 1
|
||||||
|
|
||||||
|
required:
|
||||||
|
- compatible
|
||||||
|
- reg
|
||||||
|
- interrupts
|
||||||
|
- clocks
|
||||||
|
- clock-names
|
||||||
|
- resets
|
||||||
|
|
||||||
|
unevaluatedProperties: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- |
|
||||||
|
#include<dt-bindings/interrupt-controller/arm-gic.h>
|
||||||
|
|
||||||
|
hda@70c0000 {
|
||||||
|
compatible = "cix,sky1-ipbloq-hda";
|
||||||
|
reg = <0x70c0000 0x10000>;
|
||||||
|
interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
clocks = <&audss_clk 7>,
|
||||||
|
<&audss_clk 8>;
|
||||||
|
clock-names = "ipg", "per";
|
||||||
|
resets = <&audss_rst 14>;
|
||||||
|
model = "CIX SKY1 EVB HDA";
|
||||||
|
};
|
||||||
|
|
@ -68,7 +68,6 @@ CONFIG_SOUND=m
|
||||||
CONFIG_SND=m
|
CONFIG_SND=m
|
||||||
CONFIG_SND_MIXER_OSS=m
|
CONFIG_SND_MIXER_OSS=m
|
||||||
CONFIG_SND_PCM_OSS=m
|
CONFIG_SND_PCM_OSS=m
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_VERBOSE_PROCFS is not set
|
# CONFIG_SND_VERBOSE_PROCFS is not set
|
||||||
CONFIG_SND_PXA2XX_AC97=m
|
CONFIG_SND_PXA2XX_AC97=m
|
||||||
CONFIG_USB_GADGET=y
|
CONFIG_USB_GADGET=y
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,6 @@ CONFIG_LOGO=y
|
||||||
# CONFIG_LOGO_LINUX_VGA16 is not set
|
# CONFIG_LOGO_LINUX_VGA16 is not set
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_VERBOSE_PROCFS is not set
|
# CONFIG_SND_VERBOSE_PROCFS is not set
|
||||||
CONFIG_SND_DEBUG=y
|
CONFIG_SND_DEBUG=y
|
||||||
CONFIG_SND_DEBUG_VERBOSE=y
|
CONFIG_SND_DEBUG_VERBOSE=y
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,6 @@ CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
CONFIG_SND_MIXER_OSS=y
|
CONFIG_SND_MIXER_OSS=y
|
||||||
CONFIG_SND_PCM_OSS=y
|
CONFIG_SND_PCM_OSS=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_VERBOSE_PROCFS is not set
|
# CONFIG_SND_VERBOSE_PROCFS is not set
|
||||||
CONFIG_SND_DUMMY=y
|
CONFIG_SND_DUMMY=y
|
||||||
CONFIG_SND_USB_AUDIO=y
|
CONFIG_SND_USB_AUDIO=y
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,6 @@ CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
|
||||||
CONFIG_LOGO=y
|
CONFIG_LOGO=y
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_DRIVERS is not set
|
# CONFIG_SND_DRIVERS is not set
|
||||||
CONFIG_SND_HDA_TEGRA=y
|
CONFIG_SND_HDA_TEGRA=y
|
||||||
CONFIG_SND_HDA_INPUT_BEEP=y
|
CONFIG_SND_HDA_INPUT_BEEP=y
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@ CONFIG_LOGO=y
|
||||||
# CONFIG_LOGO_LINUX_VGA16 is not set
|
# CONFIG_LOGO_LINUX_VGA16 is not set
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_PROC_FS is not set
|
# CONFIG_SND_PROC_FS is not set
|
||||||
# CONFIG_SND_DRIVERS is not set
|
# CONFIG_SND_DRIVERS is not set
|
||||||
# CONFIG_SND_SPI is not set
|
# CONFIG_SND_SPI is not set
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@ CONFIG_WATCHDOG_SYSFS=y
|
||||||
CONFIG_LOONGSON1_WDT=y
|
CONFIG_LOONGSON1_WDT=y
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_DRIVERS is not set
|
# CONFIG_SND_DRIVERS is not set
|
||||||
# CONFIG_SND_MIPS is not set
|
# CONFIG_SND_MIPS is not set
|
||||||
# CONFIG_SND_USB is not set
|
# CONFIG_SND_USB is not set
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ CONFIG_LOGO=y
|
||||||
# CONFIG_LOGO_LINUX_CLUT224 is not set
|
# CONFIG_LOGO_LINUX_CLUT224 is not set
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_VERBOSE_PROCFS is not set
|
# CONFIG_SND_VERBOSE_PROCFS is not set
|
||||||
# CONFIG_SND_DRIVERS is not set
|
# CONFIG_SND_DRIVERS is not set
|
||||||
# CONFIG_SND_SPI is not set
|
# CONFIG_SND_SPI is not set
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ CONFIG_TXX9_WDT=m
|
||||||
# CONFIG_VGA_ARB is not set
|
# CONFIG_VGA_ARB is not set
|
||||||
CONFIG_SOUND=m
|
CONFIG_SOUND=m
|
||||||
CONFIG_SND=m
|
CONFIG_SND=m
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_VERBOSE_PROCFS is not set
|
# CONFIG_SND_VERBOSE_PROCFS is not set
|
||||||
# CONFIG_SND_DRIVERS is not set
|
# CONFIG_SND_DRIVERS is not set
|
||||||
# CONFIG_SND_PCI is not set
|
# CONFIG_SND_PCI is not set
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,6 @@ CONFIG_LOGO=y
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
# CONFIG_SND_PCM_TIMER is not set
|
# CONFIG_SND_PCM_TIMER is not set
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_PROC_FS is not set
|
# CONFIG_SND_PROC_FS is not set
|
||||||
# CONFIG_SND_DRIVERS is not set
|
# CONFIG_SND_DRIVERS is not set
|
||||||
# CONFIG_SND_MIPS is not set
|
# CONFIG_SND_MIPS is not set
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,6 @@ CONFIG_SND_INTEL8X0=y
|
||||||
CONFIG_SND_POWERPC_SOC=y
|
CONFIG_SND_POWERPC_SOC=y
|
||||||
# CONFIG_SND_PPC is not set
|
# CONFIG_SND_PPC is not set
|
||||||
CONFIG_SND_SOC=y
|
CONFIG_SND_SOC=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_USB is not set
|
# CONFIG_SND_USB is not set
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@ CONFIG_SERIO_LIBPS2=y
|
||||||
CONFIG_SND_INTEL8X0=y
|
CONFIG_SND_INTEL8X0=y
|
||||||
CONFIG_SND_MIXER_OSS=y
|
CONFIG_SND_MIXER_OSS=y
|
||||||
CONFIG_SND_PCM_OSS=y
|
CONFIG_SND_PCM_OSS=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_ULI526X=y
|
CONFIG_ULI526X=y
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@ CONFIG_FB_SM501=m
|
||||||
CONFIG_LOGO=y
|
CONFIG_LOGO=y
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_DRIVERS is not set
|
# CONFIG_SND_DRIVERS is not set
|
||||||
# CONFIG_SND_PCI is not set
|
# CONFIG_SND_PCI is not set
|
||||||
# CONFIG_SND_PPC is not set
|
# CONFIG_SND_PPC is not set
|
||||||
|
|
|
||||||
|
|
@ -726,7 +726,6 @@ CONFIG_SND_OSSEMUL=y
|
||||||
CONFIG_SND_MIXER_OSS=m
|
CONFIG_SND_MIXER_OSS=m
|
||||||
CONFIG_SND_PCM_OSS=m
|
CONFIG_SND_PCM_OSS=m
|
||||||
CONFIG_SND_DYNAMIC_MINORS=y
|
CONFIG_SND_DYNAMIC_MINORS=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
CONFIG_SND_VERBOSE_PRINTK=y
|
CONFIG_SND_VERBOSE_PRINTK=y
|
||||||
CONFIG_SND_DEBUG=y
|
CONFIG_SND_DEBUG=y
|
||||||
CONFIG_SND_DEBUG_VERBOSE=y
|
CONFIG_SND_DEBUG_VERBOSE=y
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@ CONFIG_FB_TILEBLITTING=y
|
||||||
CONFIG_FB_SH_MOBILE_LCDC=m
|
CONFIG_FB_SH_MOBILE_LCDC=m
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=y
|
CONFIG_SND=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_VERBOSE_PROCFS is not set
|
# CONFIG_SND_VERBOSE_PROCFS is not set
|
||||||
CONFIG_SND_VERBOSE_PRINTK=y
|
CONFIG_SND_VERBOSE_PRINTK=y
|
||||||
CONFIG_SND_SOC=y
|
CONFIG_SND_SOC=y
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,6 @@ CONFIG_LOGO=y
|
||||||
# CONFIG_LOGO_SUPERH_VGA16 is not set
|
# CONFIG_LOGO_SUPERH_VGA16 is not set
|
||||||
CONFIG_SOUND=y
|
CONFIG_SOUND=y
|
||||||
CONFIG_SND=m
|
CONFIG_SND=m
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_DRIVERS is not set
|
# CONFIG_SND_DRIVERS is not set
|
||||||
# CONFIG_SND_SPI is not set
|
# CONFIG_SND_SPI is not set
|
||||||
# CONFIG_SND_SUPERH is not set
|
# CONFIG_SND_SUPERH is not set
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ CONFIG_SND_PCM_OSS=y
|
||||||
CONFIG_SND_SEQUENCER_OSS=y
|
CONFIG_SND_SEQUENCER_OSS=y
|
||||||
CONFIG_SND_HRTIMER=y
|
CONFIG_SND_HRTIMER=y
|
||||||
CONFIG_SND_DYNAMIC_MINORS=y
|
CONFIG_SND_DYNAMIC_MINORS=y
|
||||||
# CONFIG_SND_SUPPORT_OLD_API is not set
|
|
||||||
# CONFIG_SND_VERBOSE_PROCFS is not set
|
# CONFIG_SND_VERBOSE_PROCFS is not set
|
||||||
CONFIG_SND_VERBOSE_PRINTK=y
|
CONFIG_SND_VERBOSE_PRINTK=y
|
||||||
CONFIG_SND_DEBUG=y
|
CONFIG_SND_DEBUG=y
|
||||||
|
|
|
||||||
|
|
@ -380,6 +380,9 @@ struct hdac_bus {
|
||||||
|
|
||||||
/* factor used to derive STRIPE control value */
|
/* factor used to derive STRIPE control value */
|
||||||
unsigned int sdo_limit;
|
unsigned int sdo_limit;
|
||||||
|
|
||||||
|
/* address offset between host and hadc */
|
||||||
|
dma_addr_t addr_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
|
int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ struct snd_cea_861_aud_if {
|
||||||
unsigned char db2_sf_ss; /* sample frequency and size */
|
unsigned char db2_sf_ss; /* sample frequency and size */
|
||||||
unsigned char db3; /* not used, all zeros */
|
unsigned char db3; /* not used, all zeros */
|
||||||
unsigned char db4_ca; /* channel allocation code */
|
unsigned char db4_ca; /* channel allocation code */
|
||||||
unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
|
unsigned char db5_dminh_lsv; /* downmix inhibit & level-shift values */
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ config SND_MAX_CARDS
|
||||||
|
|
||||||
config SND_SUPPORT_OLD_API
|
config SND_SUPPORT_OLD_API
|
||||||
bool "Support old ALSA API"
|
bool "Support old ALSA API"
|
||||||
default y
|
default n
|
||||||
help
|
help
|
||||||
Say Y here to support the obsolete ALSA PCM API (ver.0.9.0 rc3
|
Say Y here to support the obsolete ALSA PCM API (ver.0.9.0 rc3
|
||||||
or older).
|
or older).
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
|
||||||
while (consumed < count &&
|
while (consumed < count &&
|
||||||
snd_motu_register_dsp_message_parser_copy_event(motu, &ev)) {
|
snd_motu_register_dsp_message_parser_copy_event(motu, &ev)) {
|
||||||
ptr = (u32 __user *)(buf + consumed);
|
ptr = (u32 __user *)(buf + consumed);
|
||||||
if (put_user(ev, ptr))
|
if (consumed + sizeof(ev) > count || put_user(ev, ptr))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
consumed += sizeof(ev);
|
consumed += sizeof(ev);
|
||||||
}
|
}
|
||||||
|
|
@ -83,10 +83,11 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
|
||||||
event.motu_register_dsp_change.type = SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE;
|
event.motu_register_dsp_change.type = SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE;
|
||||||
event.motu_register_dsp_change.count =
|
event.motu_register_dsp_change.count =
|
||||||
(consumed - sizeof(event.motu_register_dsp_change)) / 4;
|
(consumed - sizeof(event.motu_register_dsp_change)) / 4;
|
||||||
if (copy_to_user(buf, &event, sizeof(event.motu_register_dsp_change)))
|
if (copy_to_user(buf, &event,
|
||||||
|
min_t(long, count, sizeof(event.motu_register_dsp_change))))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
count = consumed;
|
count = min_t(long, count, consumed);
|
||||||
} else {
|
} else {
|
||||||
spin_unlock_irq(&motu->lock);
|
spin_unlock_irq(&motu->lock);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6770,6 +6770,9 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
||||||
SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
|
SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
|
||||||
SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
|
SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
|
||||||
SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
|
SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
|
||||||
|
SND_PCI_QUIRK(0x103c, 0x8e8a, "HP NexusX", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED),
|
||||||
|
SND_PCI_QUIRK(0x103c, 0x8e9d, "HP 17 Turbine OmniBook X UMA", ALC287_FIXUP_CS35L41_I2C_2),
|
||||||
|
SND_PCI_QUIRK(0x103c, 0x8e9e, "HP 17 Turbine OmniBook X UMA", ALC287_FIXUP_CS35L41_I2C_2),
|
||||||
SND_PCI_QUIRK(0x103c, 0x8eb6, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO),
|
SND_PCI_QUIRK(0x103c, 0x8eb6, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO),
|
||||||
SND_PCI_QUIRK(0x103c, 0x8eb7, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO),
|
SND_PCI_QUIRK(0x103c, 0x8eb7, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO),
|
||||||
SND_PCI_QUIRK(0x103c, 0x8eb8, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO),
|
SND_PCI_QUIRK(0x103c, 0x8eb8, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO),
|
||||||
|
|
@ -6842,6 +6845,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
||||||
SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
|
SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
|
SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
|
SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
|
||||||
|
SND_PCI_QUIRK(0x1043, 0x1584, "ASUS UM3406GA ", ALC287_FIXUP_CS35L41_I2C_2),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1652, "ASUS ROG Zephyrus Do 15 SE", ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK),
|
SND_PCI_QUIRK(0x1043, 0x1652, "ASUS ROG Zephyrus Do 15 SE", ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
|
SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
|
SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
|
||||||
|
|
|
||||||
|
|
@ -1901,6 +1901,8 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, i
|
||||||
|
|
||||||
cs35l41->dacpi = adev;
|
cs35l41->dacpi = adev;
|
||||||
physdev = get_device(acpi_get_first_physical_node(adev));
|
physdev = get_device(acpi_get_first_physical_node(adev));
|
||||||
|
if (!physdev)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
|
sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
|
||||||
if (IS_ERR(sub))
|
if (IS_ERR(sub))
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,20 @@ config SND_HDA_TEGRA
|
||||||
To compile this driver as a module, choose M here: the module
|
To compile this driver as a module, choose M here: the module
|
||||||
will be called snd-hda-tegra.
|
will be called snd-hda-tegra.
|
||||||
|
|
||||||
|
config SND_HDA_CIX_IPBLOQ
|
||||||
|
tristate "CIX IPBLOQ HD Audio"
|
||||||
|
depends on ARCH_CIX || COMPILE_TEST
|
||||||
|
select SND_HDA
|
||||||
|
select SND_HDA_ALIGNED_MMIO
|
||||||
|
help
|
||||||
|
Say Y here to support the HDA controller present in CIX SoCs
|
||||||
|
|
||||||
|
This options enables support for the HD Audio controller
|
||||||
|
present in some CIX SoCs.
|
||||||
|
|
||||||
|
To compile this driver as a module, choose M here: the module
|
||||||
|
will be called snd-hda-cix-ipbloq.
|
||||||
|
|
||||||
config SND_HDA_ACPI
|
config SND_HDA_ACPI
|
||||||
tristate "HD Audio ACPI"
|
tristate "HD Audio ACPI"
|
||||||
depends on ACPI
|
depends on ACPI
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
snd-hda-intel-y := intel.o
|
snd-hda-intel-y := intel.o
|
||||||
snd-hda-tegra-y := tegra.o
|
snd-hda-tegra-y := tegra.o
|
||||||
|
snd-hda-cix-ipbloq-y := cix-ipbloq.o
|
||||||
snd-hda-acpi-y := acpi.o
|
snd-hda-acpi-y := acpi.o
|
||||||
|
|
||||||
subdir-ccflags-y += -I$(src)/../common
|
subdir-ccflags-y += -I$(src)/../common
|
||||||
|
|
@ -10,4 +11,5 @@ CFLAGS_intel.o := -I$(src)
|
||||||
|
|
||||||
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o
|
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o
|
||||||
obj-$(CONFIG_SND_HDA_TEGRA) += snd-hda-tegra.o
|
obj-$(CONFIG_SND_HDA_TEGRA) += snd-hda-tegra.o
|
||||||
|
obj-$(CONFIG_SND_HDA_CIX_IPBLOQ) += snd-hda-cix-ipbloq.o
|
||||||
obj-$(CONFIG_SND_HDA_ACPI) += snd-hda-acpi.o
|
obj-$(CONFIG_SND_HDA_ACPI) += snd-hda-acpi.o
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,436 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
// Copyright 2025 Cix Technology Group Co., Ltd.
|
||||||
|
|
||||||
|
#include <linux/clk.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/mutex.h>
|
||||||
|
#include <linux/of.h>
|
||||||
|
#include <linux/of_reserved_mem.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/pm_runtime.h>
|
||||||
|
#include <linux/reset.h>
|
||||||
|
#include <linux/string.h>
|
||||||
|
|
||||||
|
#include <sound/hda_codec.h>
|
||||||
|
#include "hda_controller.h"
|
||||||
|
|
||||||
|
#define CIX_IPBLOQ_JACKPOLL_DEFAULT_TIME_MS 1000
|
||||||
|
#define CIX_IPBLOQ_POWER_SAVE_DEFAULT_TIME_MS 100
|
||||||
|
|
||||||
|
#define CIX_IPBLOQ_SKY1_ADDR_HOST_TO_HDAC_OFFSET (-0x90000000ULL)
|
||||||
|
|
||||||
|
struct cix_ipbloq_hda {
|
||||||
|
struct azx chip;
|
||||||
|
struct device *dev;
|
||||||
|
void __iomem *regs;
|
||||||
|
|
||||||
|
struct reset_control *reset;
|
||||||
|
struct clk_bulk_data clocks[2];
|
||||||
|
unsigned int nclocks;
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct hda_controller_ops cix_ipbloq_hda_ops;
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_dev_disconnect(struct snd_device *device)
|
||||||
|
{
|
||||||
|
struct azx *chip = device->device_data;
|
||||||
|
|
||||||
|
chip->bus.shutdown = 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_dev_free(struct snd_device *device)
|
||||||
|
{
|
||||||
|
struct azx *chip = device->device_data;
|
||||||
|
|
||||||
|
if (azx_bus(chip)->chip_init) {
|
||||||
|
azx_stop_all_streams(chip);
|
||||||
|
azx_stop_chip(chip);
|
||||||
|
}
|
||||||
|
|
||||||
|
azx_free_stream_pages(chip);
|
||||||
|
azx_free_streams(chip);
|
||||||
|
snd_hdac_bus_exit(azx_bus(chip));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_probe_codec(struct cix_ipbloq_hda *hda)
|
||||||
|
{
|
||||||
|
struct azx *chip = &hda->chip;
|
||||||
|
struct hdac_bus *bus = azx_bus(chip);
|
||||||
|
int err;
|
||||||
|
|
||||||
|
to_hda_bus(bus)->bus_probing = 1;
|
||||||
|
|
||||||
|
/* create codec instances */
|
||||||
|
err = azx_probe_codecs(chip, 8);
|
||||||
|
if (err < 0) {
|
||||||
|
dev_err(hda->dev, "probe codecs failed: %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = azx_codec_configure(chip);
|
||||||
|
if (err < 0) {
|
||||||
|
dev_err(hda->dev, "codec configure failed: %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = snd_card_register(chip->card);
|
||||||
|
if (err < 0) {
|
||||||
|
dev_err(hda->dev, "card register failed: %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
chip->running = 1;
|
||||||
|
|
||||||
|
to_hda_bus(bus)->bus_probing = 0;
|
||||||
|
|
||||||
|
snd_hda_set_power_save(&chip->bus, CIX_IPBLOQ_POWER_SAVE_DEFAULT_TIME_MS);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_init(struct cix_ipbloq_hda *hda,
|
||||||
|
struct azx *chip,
|
||||||
|
struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
const char *sname = NULL, *drv_name = "cix-ipbloq-hda";
|
||||||
|
struct hdac_bus *bus = azx_bus(chip);
|
||||||
|
struct snd_card *card = chip->card;
|
||||||
|
struct resource *res;
|
||||||
|
unsigned short gcap;
|
||||||
|
int irq_id, err;
|
||||||
|
|
||||||
|
hda->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
|
||||||
|
if (IS_ERR(hda->regs)) {
|
||||||
|
dev_err(hda->dev, "failed to get and ioremap resource\n");
|
||||||
|
return PTR_ERR(hda->regs);
|
||||||
|
}
|
||||||
|
bus->remap_addr = hda->regs;
|
||||||
|
bus->addr = res->start;
|
||||||
|
|
||||||
|
irq_id = platform_get_irq(pdev, 0);
|
||||||
|
if (irq_id < 0) {
|
||||||
|
dev_err(hda->dev, "failed to get the irq, err = %d\n", irq_id);
|
||||||
|
return irq_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = devm_request_irq(hda->dev, irq_id, azx_interrupt,
|
||||||
|
0, KBUILD_MODNAME, chip);
|
||||||
|
if (err < 0)
|
||||||
|
return dev_err_probe(hda->dev, err,
|
||||||
|
"unable to request IRQ %d : err = %d\n", irq_id, err);
|
||||||
|
bus->irq = irq_id;
|
||||||
|
card->sync_irq = bus->irq;
|
||||||
|
|
||||||
|
gcap = azx_readw(chip, GCAP);
|
||||||
|
chip->capture_streams = (gcap >> 8) & 0x0f;
|
||||||
|
chip->playback_streams = (gcap >> 12) & 0x0f;
|
||||||
|
chip->capture_index_offset = 0;
|
||||||
|
chip->playback_index_offset = chip->capture_streams;
|
||||||
|
chip->num_streams = chip->playback_streams + chip->capture_streams;
|
||||||
|
|
||||||
|
/* initialize streams */
|
||||||
|
err = azx_init_streams(chip);
|
||||||
|
if (err < 0) {
|
||||||
|
dev_err(hda->dev, "failed to initialize streams: %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = azx_alloc_stream_pages(chip);
|
||||||
|
if (err < 0) {
|
||||||
|
dev_err(hda->dev, "failed to allocate stream pages: %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* initialize chip */
|
||||||
|
azx_init_chip(chip, 1);
|
||||||
|
|
||||||
|
/* codec detection */
|
||||||
|
if (!bus->codec_mask) {
|
||||||
|
dev_err(hda->dev, "no codecs found\n");
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
dev_dbg(card->dev, "codec detection mask = 0x%lx\n", bus->codec_mask);
|
||||||
|
|
||||||
|
/* driver name */
|
||||||
|
strscpy(card->driver, drv_name, sizeof(card->driver));
|
||||||
|
|
||||||
|
/* shortname for card */
|
||||||
|
sname = of_get_property(pdev->dev.of_node, "model", NULL);
|
||||||
|
if (!sname)
|
||||||
|
sname = drv_name;
|
||||||
|
if (strlen(sname) > sizeof(card->shortname))
|
||||||
|
dev_dbg(card->dev, "truncating shortname for card\n");
|
||||||
|
strscpy(card->shortname, sname, sizeof(card->shortname));
|
||||||
|
|
||||||
|
/* longname for card */
|
||||||
|
snprintf(card->longname, sizeof(card->longname),
|
||||||
|
"%s at 0x%lx irq %i",
|
||||||
|
card->shortname, bus->addr, bus->irq);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_create(struct cix_ipbloq_hda *hda,
|
||||||
|
struct snd_card *card,
|
||||||
|
unsigned int driver_caps)
|
||||||
|
{
|
||||||
|
static const struct snd_device_ops ops = {
|
||||||
|
.dev_disconnect = cix_ipbloq_hda_dev_disconnect,
|
||||||
|
.dev_free = cix_ipbloq_hda_dev_free,
|
||||||
|
};
|
||||||
|
struct azx *chip;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
chip = &hda->chip;
|
||||||
|
chip->card = card;
|
||||||
|
chip->ops = &cix_ipbloq_hda_ops;
|
||||||
|
chip->driver_caps = driver_caps;
|
||||||
|
chip->driver_type = driver_caps & 0xff;
|
||||||
|
chip->dev_index = 0;
|
||||||
|
chip->single_cmd = 0;
|
||||||
|
chip->codec_probe_mask = -1;
|
||||||
|
chip->align_buffer_size = 1;
|
||||||
|
chip->jackpoll_interval = msecs_to_jiffies(CIX_IPBLOQ_JACKPOLL_DEFAULT_TIME_MS);
|
||||||
|
mutex_init(&chip->open_mutex);
|
||||||
|
INIT_LIST_HEAD(&chip->pcm_list);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HD-audio controllers appear pretty inaccurate about the update-IRQ timing.
|
||||||
|
* The IRQ is issued before actually the data is processed. So use stream
|
||||||
|
* link position by default instead of dma position buffer.
|
||||||
|
*/
|
||||||
|
chip->get_position[0] = chip->get_position[1] = azx_get_pos_lpib;
|
||||||
|
|
||||||
|
err = azx_bus_init(chip, NULL);
|
||||||
|
if (err < 0) {
|
||||||
|
dev_err(hda->dev, "failed to init bus, err = %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* RIRBSTS.RINTFL cannot be cleared, cause interrupt storm */
|
||||||
|
chip->bus.core.polling_mode = 1;
|
||||||
|
chip->bus.core.not_use_interrupts = 1;
|
||||||
|
|
||||||
|
chip->bus.core.aligned_mmio = 1;
|
||||||
|
chip->bus.core.dma_stop_delay = 100;
|
||||||
|
chip->bus.core.addr_offset = (dma_addr_t)CIX_IPBLOQ_SKY1_ADDR_HOST_TO_HDAC_OFFSET;
|
||||||
|
|
||||||
|
chip->bus.jackpoll_in_suspend = 1;
|
||||||
|
|
||||||
|
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
|
||||||
|
if (err < 0) {
|
||||||
|
dev_err(card->dev, "failed to create device, err = %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_probe(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
const unsigned int driver_flags = AZX_DCAPS_PM_RUNTIME;
|
||||||
|
struct cix_ipbloq_hda *hda;
|
||||||
|
struct snd_card *card;
|
||||||
|
struct azx *chip;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
hda = devm_kzalloc(&pdev->dev, sizeof(*hda), GFP_KERNEL);
|
||||||
|
if (!hda)
|
||||||
|
return -ENOMEM;
|
||||||
|
hda->dev = &pdev->dev;
|
||||||
|
|
||||||
|
hda->reset = devm_reset_control_get(hda->dev, NULL);
|
||||||
|
if (IS_ERR(hda->reset))
|
||||||
|
return dev_err_probe(hda->dev, PTR_ERR(hda->reset),
|
||||||
|
"failed to get reset, err = %ld\n", PTR_ERR(hda->reset));
|
||||||
|
|
||||||
|
hda->clocks[hda->nclocks++].id = "ipg";
|
||||||
|
hda->clocks[hda->nclocks++].id = "per";
|
||||||
|
err = devm_clk_bulk_get(hda->dev, hda->nclocks, hda->clocks);
|
||||||
|
if (err < 0)
|
||||||
|
return dev_err_probe(hda->dev, err, "failed to get clk, err = %d\n", err);
|
||||||
|
|
||||||
|
dma_set_mask_and_coherent(hda->dev, DMA_BIT_MASK(32));
|
||||||
|
|
||||||
|
err = of_reserved_mem_device_init(hda->dev);
|
||||||
|
if (err < 0 && err != -ENODEV) {
|
||||||
|
dev_err(hda->dev,
|
||||||
|
"failed to init reserved mem for DMA, err = %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = snd_card_new(hda->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
|
||||||
|
THIS_MODULE, 0, &card);
|
||||||
|
if (err < 0)
|
||||||
|
return dev_err_probe(hda->dev, err, "failed to crate card, err = %d\n", err);
|
||||||
|
|
||||||
|
err = cix_ipbloq_hda_create(hda, card, driver_flags);
|
||||||
|
if (err < 0)
|
||||||
|
goto out_free_card;
|
||||||
|
|
||||||
|
chip = &hda->chip;
|
||||||
|
card->private_data = chip;
|
||||||
|
dev_set_drvdata(hda->dev, card);
|
||||||
|
|
||||||
|
pm_runtime_enable(hda->dev);
|
||||||
|
if (!azx_has_pm_runtime(chip))
|
||||||
|
pm_runtime_forbid(hda->dev);
|
||||||
|
|
||||||
|
err = pm_runtime_resume_and_get(hda->dev);
|
||||||
|
if (err < 0) {
|
||||||
|
dev_err(hda->dev, "runtime resume and get failed, err = %d\n", err);
|
||||||
|
goto out_free_device;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = cix_ipbloq_hda_init(hda, chip, pdev);
|
||||||
|
if (err < 0)
|
||||||
|
goto out_free_device;
|
||||||
|
|
||||||
|
err = cix_ipbloq_hda_probe_codec(hda);
|
||||||
|
if (err < 0)
|
||||||
|
goto out_free_device;
|
||||||
|
|
||||||
|
pm_runtime_put(hda->dev);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
out_free_device:
|
||||||
|
snd_device_free(card, chip);
|
||||||
|
out_free_card:
|
||||||
|
snd_card_free(card);
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cix_ipbloq_hda_remove(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
struct snd_card *card = dev_get_drvdata(&pdev->dev);
|
||||||
|
struct azx *chip = card->private_data;
|
||||||
|
|
||||||
|
snd_device_free(card, chip);
|
||||||
|
snd_card_free(card);
|
||||||
|
|
||||||
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cix_ipbloq_hda_shutdown(struct platform_device *pdev)
|
||||||
|
{
|
||||||
|
struct snd_card *card = dev_get_drvdata(&pdev->dev);
|
||||||
|
struct azx *chip;
|
||||||
|
|
||||||
|
if (!card)
|
||||||
|
return;
|
||||||
|
|
||||||
|
chip = card->private_data;
|
||||||
|
if (chip && chip->running)
|
||||||
|
azx_stop_chip(chip);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_suspend(struct device *dev)
|
||||||
|
{
|
||||||
|
struct snd_card *card = dev_get_drvdata(dev);
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = pm_runtime_force_suspend(dev);
|
||||||
|
if (rc < 0)
|
||||||
|
return rc;
|
||||||
|
snd_power_change_state(card, SNDRV_CTL_POWER_D3cold);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
struct snd_card *card = dev_get_drvdata(dev);
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = pm_runtime_force_resume(dev);
|
||||||
|
if (rc < 0)
|
||||||
|
return rc;
|
||||||
|
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_runtime_suspend(struct device *dev)
|
||||||
|
{
|
||||||
|
struct snd_card *card = dev_get_drvdata(dev);
|
||||||
|
struct azx *chip = card->private_data;
|
||||||
|
struct cix_ipbloq_hda *hda = container_of(chip, struct cix_ipbloq_hda, chip);
|
||||||
|
|
||||||
|
if (chip && chip->running) {
|
||||||
|
azx_stop_chip(chip);
|
||||||
|
azx_enter_link_reset(chip);
|
||||||
|
}
|
||||||
|
|
||||||
|
clk_bulk_disable_unprepare(hda->nclocks, hda->clocks);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int cix_ipbloq_hda_runtime_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
struct snd_card *card = dev_get_drvdata(dev);
|
||||||
|
struct azx *chip = card->private_data;
|
||||||
|
struct cix_ipbloq_hda *hda = container_of(chip, struct cix_ipbloq_hda, chip);
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = clk_bulk_prepare_enable(hda->nclocks, hda->clocks);
|
||||||
|
if (rc) {
|
||||||
|
dev_err(dev, "failed to enable clk bulk, rc: %d\n", rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = reset_control_assert(hda->reset);
|
||||||
|
if (rc) {
|
||||||
|
dev_err(dev, "failed to assert reset, rc: %d\n", rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = reset_control_deassert(hda->reset);
|
||||||
|
if (rc) {
|
||||||
|
dev_err(dev, "failed to deassert reset, rc: %d\n", rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chip && chip->running)
|
||||||
|
azx_init_chip(chip, 1);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct dev_pm_ops cix_ipbloq_hda_pm = {
|
||||||
|
SYSTEM_SLEEP_PM_OPS(cix_ipbloq_hda_suspend,
|
||||||
|
cix_ipbloq_hda_resume)
|
||||||
|
RUNTIME_PM_OPS(cix_ipbloq_hda_runtime_suspend,
|
||||||
|
cix_ipbloq_hda_runtime_resume, NULL)
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct of_device_id cix_ipbloq_hda_match[] = {
|
||||||
|
{ .compatible = "cix,sky1-ipbloq-hda" },
|
||||||
|
{ /* sentinel */ },
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, cix_ipbloq_hda_match);
|
||||||
|
|
||||||
|
static struct platform_driver cix_ipbloq_hda_driver = {
|
||||||
|
.driver = {
|
||||||
|
.name = "cix-ipbloq-hda",
|
||||||
|
.pm = pm_ptr(&cix_ipbloq_hda_pm),
|
||||||
|
.of_match_table = cix_ipbloq_hda_match,
|
||||||
|
},
|
||||||
|
.probe = cix_ipbloq_hda_probe,
|
||||||
|
.remove = cix_ipbloq_hda_remove,
|
||||||
|
.shutdown = cix_ipbloq_hda_shutdown,
|
||||||
|
};
|
||||||
|
module_platform_driver(cix_ipbloq_hda_driver);
|
||||||
|
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
MODULE_DESCRIPTION("CIX IPBLOQ HDA bus driver");
|
||||||
|
MODULE_AUTHOR("Joakim Zhang <joakim.zhang@cixtech.com>");
|
||||||
|
|
@ -47,6 +47,7 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
|
||||||
INIT_LIST_HEAD(&bus->hlink_list);
|
INIT_LIST_HEAD(&bus->hlink_list);
|
||||||
init_waitqueue_head(&bus->rirb_wq);
|
init_waitqueue_head(&bus->rirb_wq);
|
||||||
bus->irq = -1;
|
bus->irq = -1;
|
||||||
|
bus->addr_offset = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default value of '8' is as per the HD audio specification (Rev 1.0a).
|
* Default value of '8' is as per the HD audio specification (Rev 1.0a).
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
|
||||||
/* CORB set up */
|
/* CORB set up */
|
||||||
bus->corb.addr = bus->rb.addr;
|
bus->corb.addr = bus->rb.addr;
|
||||||
bus->corb.buf = (__le32 *)bus->rb.area;
|
bus->corb.buf = (__le32 *)bus->rb.area;
|
||||||
snd_hdac_chip_writel(bus, CORBLBASE, (u32)bus->corb.addr);
|
snd_hdac_chip_writel(bus, CORBLBASE, (u32)(bus->corb.addr + bus->addr_offset));
|
||||||
snd_hdac_chip_writel(bus, CORBUBASE, upper_32_bits(bus->corb.addr));
|
snd_hdac_chip_writel(bus, CORBUBASE, upper_32_bits(bus->corb.addr + bus->addr_offset));
|
||||||
|
|
||||||
/* set the corb size to 256 entries (ULI requires explicitly) */
|
/* set the corb size to 256 entries (ULI requires explicitly) */
|
||||||
snd_hdac_chip_writeb(bus, CORBSIZE, 0x02);
|
snd_hdac_chip_writeb(bus, CORBSIZE, 0x02);
|
||||||
|
|
@ -70,8 +70,8 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
|
||||||
bus->rirb.buf = (__le32 *)(bus->rb.area + 2048);
|
bus->rirb.buf = (__le32 *)(bus->rb.area + 2048);
|
||||||
bus->rirb.wp = bus->rirb.rp = 0;
|
bus->rirb.wp = bus->rirb.rp = 0;
|
||||||
memset(bus->rirb.cmds, 0, sizeof(bus->rirb.cmds));
|
memset(bus->rirb.cmds, 0, sizeof(bus->rirb.cmds));
|
||||||
snd_hdac_chip_writel(bus, RIRBLBASE, (u32)bus->rirb.addr);
|
snd_hdac_chip_writel(bus, RIRBLBASE, (u32)(bus->rirb.addr + bus->addr_offset));
|
||||||
snd_hdac_chip_writel(bus, RIRBUBASE, upper_32_bits(bus->rirb.addr));
|
snd_hdac_chip_writel(bus, RIRBUBASE, upper_32_bits(bus->rirb.addr + bus->addr_offset));
|
||||||
|
|
||||||
/* set the rirb size to 256 entries (ULI requires explicitly) */
|
/* set the rirb size to 256 entries (ULI requires explicitly) */
|
||||||
snd_hdac_chip_writeb(bus, RIRBSIZE, 0x02);
|
snd_hdac_chip_writeb(bus, RIRBSIZE, 0x02);
|
||||||
|
|
@ -625,8 +625,8 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
|
||||||
|
|
||||||
/* program the position buffer */
|
/* program the position buffer */
|
||||||
if (bus->use_posbuf && bus->posbuf.addr) {
|
if (bus->use_posbuf && bus->posbuf.addr) {
|
||||||
snd_hdac_chip_writel(bus, DPLBASE, (u32)bus->posbuf.addr);
|
snd_hdac_chip_writel(bus, DPLBASE, (u32)(bus->posbuf.addr + bus->addr_offset));
|
||||||
snd_hdac_chip_writel(bus, DPUBASE, upper_32_bits(bus->posbuf.addr));
|
snd_hdac_chip_writel(bus, DPUBASE, upper_32_bits(bus->posbuf.addr + bus->addr_offset));
|
||||||
}
|
}
|
||||||
|
|
||||||
bus->chip_init = true;
|
bus->chip_init = true;
|
||||||
|
|
|
||||||
|
|
@ -718,7 +718,8 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci)
|
||||||
/* find the configuration for the specific device */
|
/* find the configuration for the specific device */
|
||||||
cfg = snd_intel_dsp_find_config(pci, config_table, ARRAY_SIZE(config_table));
|
cfg = snd_intel_dsp_find_config(pci, config_table, ARRAY_SIZE(config_table));
|
||||||
if (!cfg)
|
if (!cfg)
|
||||||
return SND_INTEL_DSP_DRIVER_ANY;
|
return IS_ENABLED(CONFIG_SND_HDA_INTEL) ?
|
||||||
|
SND_INTEL_DSP_DRIVER_LEGACY : SND_INTEL_DSP_DRIVER_ANY;
|
||||||
|
|
||||||
if (cfg->flags & FLAG_SOF) {
|
if (cfg->flags & FLAG_SOF) {
|
||||||
if (cfg->flags & FLAG_SOF_ONLY_IF_SOUNDWIRE &&
|
if (cfg->flags & FLAG_SOF_ONLY_IF_SOUNDWIRE &&
|
||||||
|
|
|
||||||
|
|
@ -288,16 +288,16 @@ int snd_hdac_stream_setup(struct hdac_stream *azx_dev, bool code_loading)
|
||||||
|
|
||||||
/* program the BDL address */
|
/* program the BDL address */
|
||||||
/* lower BDL address */
|
/* lower BDL address */
|
||||||
snd_hdac_stream_writel(azx_dev, SD_BDLPL, (u32)azx_dev->bdl.addr);
|
snd_hdac_stream_writel(azx_dev, SD_BDLPL, (u32)(azx_dev->bdl.addr + bus->addr_offset));
|
||||||
/* upper BDL address */
|
/* upper BDL address */
|
||||||
snd_hdac_stream_writel(azx_dev, SD_BDLPU,
|
snd_hdac_stream_writel(azx_dev, SD_BDLPU,
|
||||||
upper_32_bits(azx_dev->bdl.addr));
|
upper_32_bits(azx_dev->bdl.addr + bus->addr_offset));
|
||||||
|
|
||||||
/* enable the position buffer */
|
/* enable the position buffer */
|
||||||
if (bus->use_posbuf && bus->posbuf.addr) {
|
if (bus->use_posbuf && bus->posbuf.addr) {
|
||||||
if (!(snd_hdac_chip_readl(bus, DPLBASE) & AZX_DPLBASE_ENABLE))
|
if (!(snd_hdac_chip_readl(bus, DPLBASE) & AZX_DPLBASE_ENABLE))
|
||||||
snd_hdac_chip_writel(bus, DPLBASE,
|
snd_hdac_chip_writel(bus, DPLBASE,
|
||||||
(u32)bus->posbuf.addr | AZX_DPLBASE_ENABLE);
|
(u32)(bus->posbuf.addr + bus->addr_offset) | AZX_DPLBASE_ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the interrupt enable bits in the descriptor control register */
|
/* set the interrupt enable bits in the descriptor control register */
|
||||||
|
|
@ -464,8 +464,8 @@ static int setup_bdle(struct hdac_bus *bus,
|
||||||
|
|
||||||
addr = snd_sgbuf_get_addr(dmab, ofs);
|
addr = snd_sgbuf_get_addr(dmab, ofs);
|
||||||
/* program the address field of the BDL entry */
|
/* program the address field of the BDL entry */
|
||||||
bdl[0] = cpu_to_le32((u32)addr);
|
bdl[0] = cpu_to_le32((u32)(addr + bus->addr_offset));
|
||||||
bdl[1] = cpu_to_le32(upper_32_bits(addr));
|
bdl[1] = cpu_to_le32(upper_32_bits(addr + bus->addr_offset));
|
||||||
/* program the size field of the BDL entry */
|
/* program the size field of the BDL entry */
|
||||||
chunk = snd_sgbuf_get_chunk_size(dmab, ofs, size);
|
chunk = snd_sgbuf_get_chunk_size(dmab, ofs, size);
|
||||||
/* one BDLE cannot cross 4K boundary on CTHDA chips */
|
/* one BDLE cannot cross 4K boundary on CTHDA chips */
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,8 @@ static int acp_i2s_set_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, u32 rx_mas
|
||||||
|
|
||||||
spin_lock_irq(&chip->acp_lock);
|
spin_lock_irq(&chip->acp_lock);
|
||||||
list_for_each_entry(stream, &chip->stream_list, list) {
|
list_for_each_entry(stream, &chip->stream_list, list) {
|
||||||
|
if (dai->id != stream->dai_id)
|
||||||
|
continue;
|
||||||
switch (chip->acp_rev) {
|
switch (chip->acp_rev) {
|
||||||
case ACP_RN_PCI_ID:
|
case ACP_RN_PCI_ID:
|
||||||
case ACP_RMB_PCI_ID:
|
case ACP_RMB_PCI_ID:
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,10 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
|
||||||
SP_PB_FIFO_ADDR_OFFSET;
|
SP_PB_FIFO_ADDR_OFFSET;
|
||||||
reg_fifo_addr = ACP_I2S_TX_FIFOADDR(chip);
|
reg_fifo_addr = ACP_I2S_TX_FIFOADDR(chip);
|
||||||
reg_fifo_size = ACP_I2S_TX_FIFOSIZE(chip);
|
reg_fifo_size = ACP_I2S_TX_FIFOSIZE(chip);
|
||||||
phy_addr = I2S_SP_TX_MEM_WINDOW_START + stream->reg_offset;
|
if (chip->acp_rev >= ACP70_PCI_ID)
|
||||||
|
phy_addr = ACP7x_I2S_SP_TX_MEM_WINDOW_START;
|
||||||
|
else
|
||||||
|
phy_addr = I2S_SP_TX_MEM_WINDOW_START + stream->reg_offset;
|
||||||
writel(phy_addr, chip->base + ACP_I2S_TX_RINGBUFADDR(chip));
|
writel(phy_addr, chip->base + ACP_I2S_TX_RINGBUFADDR(chip));
|
||||||
} else {
|
} else {
|
||||||
reg_dma_size = ACP_I2S_RX_DMA_SIZE(chip);
|
reg_dma_size = ACP_I2S_RX_DMA_SIZE(chip);
|
||||||
|
|
@ -227,7 +230,10 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
|
||||||
SP_CAPT_FIFO_ADDR_OFFSET;
|
SP_CAPT_FIFO_ADDR_OFFSET;
|
||||||
reg_fifo_addr = ACP_I2S_RX_FIFOADDR(chip);
|
reg_fifo_addr = ACP_I2S_RX_FIFOADDR(chip);
|
||||||
reg_fifo_size = ACP_I2S_RX_FIFOSIZE(chip);
|
reg_fifo_size = ACP_I2S_RX_FIFOSIZE(chip);
|
||||||
phy_addr = I2S_SP_RX_MEM_WINDOW_START + stream->reg_offset;
|
if (chip->acp_rev >= ACP70_PCI_ID)
|
||||||
|
phy_addr = ACP7x_I2S_SP_RX_MEM_WINDOW_START;
|
||||||
|
else
|
||||||
|
phy_addr = I2S_SP_RX_MEM_WINDOW_START + stream->reg_offset;
|
||||||
writel(phy_addr, chip->base + ACP_I2S_RX_RINGBUFADDR(chip));
|
writel(phy_addr, chip->base + ACP_I2S_RX_RINGBUFADDR(chip));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -238,7 +244,10 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
|
||||||
BT_PB_FIFO_ADDR_OFFSET;
|
BT_PB_FIFO_ADDR_OFFSET;
|
||||||
reg_fifo_addr = ACP_BT_TX_FIFOADDR(chip);
|
reg_fifo_addr = ACP_BT_TX_FIFOADDR(chip);
|
||||||
reg_fifo_size = ACP_BT_TX_FIFOSIZE(chip);
|
reg_fifo_size = ACP_BT_TX_FIFOSIZE(chip);
|
||||||
phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset;
|
if (chip->acp_rev >= ACP70_PCI_ID)
|
||||||
|
phy_addr = ACP7x_I2S_BT_TX_MEM_WINDOW_START;
|
||||||
|
else
|
||||||
|
phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset;
|
||||||
writel(phy_addr, chip->base + ACP_BT_TX_RINGBUFADDR(chip));
|
writel(phy_addr, chip->base + ACP_BT_TX_RINGBUFADDR(chip));
|
||||||
} else {
|
} else {
|
||||||
reg_dma_size = ACP_BT_RX_DMA_SIZE(chip);
|
reg_dma_size = ACP_BT_RX_DMA_SIZE(chip);
|
||||||
|
|
@ -246,7 +255,10 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
|
||||||
BT_CAPT_FIFO_ADDR_OFFSET;
|
BT_CAPT_FIFO_ADDR_OFFSET;
|
||||||
reg_fifo_addr = ACP_BT_RX_FIFOADDR(chip);
|
reg_fifo_addr = ACP_BT_RX_FIFOADDR(chip);
|
||||||
reg_fifo_size = ACP_BT_RX_FIFOSIZE(chip);
|
reg_fifo_size = ACP_BT_RX_FIFOSIZE(chip);
|
||||||
phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset;
|
if (chip->acp_rev >= ACP70_PCI_ID)
|
||||||
|
phy_addr = ACP7x_I2S_BT_RX_MEM_WINDOW_START;
|
||||||
|
else
|
||||||
|
phy_addr = I2S_BT_RX_MEM_WINDOW_START + stream->reg_offset;
|
||||||
writel(phy_addr, chip->base + ACP_BT_RX_RINGBUFADDR(chip));
|
writel(phy_addr, chip->base + ACP_BT_RX_RINGBUFADDR(chip));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -257,7 +269,10 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
|
||||||
HS_PB_FIFO_ADDR_OFFSET;
|
HS_PB_FIFO_ADDR_OFFSET;
|
||||||
reg_fifo_addr = ACP_HS_TX_FIFOADDR;
|
reg_fifo_addr = ACP_HS_TX_FIFOADDR;
|
||||||
reg_fifo_size = ACP_HS_TX_FIFOSIZE;
|
reg_fifo_size = ACP_HS_TX_FIFOSIZE;
|
||||||
phy_addr = I2S_HS_TX_MEM_WINDOW_START + stream->reg_offset;
|
if (chip->acp_rev >= ACP70_PCI_ID)
|
||||||
|
phy_addr = ACP7x_I2S_HS_TX_MEM_WINDOW_START;
|
||||||
|
else
|
||||||
|
phy_addr = I2S_HS_TX_MEM_WINDOW_START + stream->reg_offset;
|
||||||
writel(phy_addr, chip->base + ACP_HS_TX_RINGBUFADDR);
|
writel(phy_addr, chip->base + ACP_HS_TX_RINGBUFADDR);
|
||||||
} else {
|
} else {
|
||||||
reg_dma_size = ACP_HS_RX_DMA_SIZE;
|
reg_dma_size = ACP_HS_RX_DMA_SIZE;
|
||||||
|
|
@ -265,7 +280,10 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
|
||||||
HS_CAPT_FIFO_ADDR_OFFSET;
|
HS_CAPT_FIFO_ADDR_OFFSET;
|
||||||
reg_fifo_addr = ACP_HS_RX_FIFOADDR;
|
reg_fifo_addr = ACP_HS_RX_FIFOADDR;
|
||||||
reg_fifo_size = ACP_HS_RX_FIFOSIZE;
|
reg_fifo_size = ACP_HS_RX_FIFOSIZE;
|
||||||
phy_addr = I2S_HS_RX_MEM_WINDOW_START + stream->reg_offset;
|
if (chip->acp_rev >= ACP70_PCI_ID)
|
||||||
|
phy_addr = ACP7x_I2S_HS_RX_MEM_WINDOW_START;
|
||||||
|
else
|
||||||
|
phy_addr = I2S_HS_RX_MEM_WINDOW_START + stream->reg_offset;
|
||||||
writel(phy_addr, chip->base + ACP_HS_RX_RINGBUFADDR);
|
writel(phy_addr, chip->base + ACP_HS_RX_RINGBUFADDR);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,9 @@ static int bcm63xx_soc_pcm_new(struct snd_soc_component *component,
|
||||||
|
|
||||||
i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev);
|
i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev);
|
||||||
|
|
||||||
of_dma_configure(pcm->card->dev, pcm->card->dev->of_node, 1);
|
ret = of_dma_configure(pcm->card->dev, pcm->card->dev->of_node, 1);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
ret = dma_coerce_mask_and_coherent(pcm->card->dev, DMA_BIT_MASK(32));
|
ret = dma_coerce_mask_and_coherent(pcm->card->dev, DMA_BIT_MASK(32));
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
||||||
|
|
@ -777,7 +777,6 @@ config SND_SOC_CQ0093VC
|
||||||
config SND_SOC_CROS_EC_CODEC
|
config SND_SOC_CROS_EC_CODEC
|
||||||
tristate "codec driver for ChromeOS EC"
|
tristate "codec driver for ChromeOS EC"
|
||||||
depends on CROS_EC
|
depends on CROS_EC
|
||||||
select CRYPTO
|
|
||||||
select CRYPTO_LIB_SHA256
|
select CRYPTO_LIB_SHA256
|
||||||
help
|
help
|
||||||
If you say yes here you will get support for the
|
If you say yes here you will get support for the
|
||||||
|
|
@ -918,7 +917,7 @@ config SND_SOC_CS35L56_CAL_DEBUGFS
|
||||||
config SND_SOC_CS35L56_CAL_SET_CTRL
|
config SND_SOC_CS35L56_CAL_SET_CTRL
|
||||||
bool "CS35L56 ALSA control to restore factory calibration"
|
bool "CS35L56 ALSA control to restore factory calibration"
|
||||||
default N
|
default N
|
||||||
select SND_SOC_CS35L56_CAL_SYSFS_COMMON
|
select SND_SOC_CS35L56_CAL_DEBUGFS_COMMON
|
||||||
help
|
help
|
||||||
Allow restoring factory calibration data through an ALSA
|
Allow restoring factory calibration data through an ALSA
|
||||||
control. This is only needed on platforms without UEFI or
|
control. This is only needed on platforms without UEFI or
|
||||||
|
|
|
||||||
|
|
@ -671,7 +671,15 @@ static int ak4458_runtime_resume(struct device *dev)
|
||||||
regcache_cache_only(ak4458->regmap, false);
|
regcache_cache_only(ak4458->regmap, false);
|
||||||
regcache_mark_dirty(ak4458->regmap);
|
regcache_mark_dirty(ak4458->regmap);
|
||||||
|
|
||||||
return regcache_sync(ak4458->regmap);
|
ret = regcache_sync(ak4458->regmap);
|
||||||
|
if (ret)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
err:
|
||||||
|
regcache_cache_only(ak4458->regmap, true);
|
||||||
|
regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), ak4458->supplies);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct snd_soc_component_driver soc_codec_dev_ak4458 = {
|
static const struct snd_soc_component_driver soc_codec_dev_ak4458 = {
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,15 @@ static int ak5558_runtime_resume(struct device *dev)
|
||||||
regcache_cache_only(ak5558->regmap, false);
|
regcache_cache_only(ak5558->regmap, false);
|
||||||
regcache_mark_dirty(ak5558->regmap);
|
regcache_mark_dirty(ak5558->regmap);
|
||||||
|
|
||||||
return regcache_sync(ak5558->regmap);
|
ret = regcache_sync(ak5558->regmap);
|
||||||
|
if (ret)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
err:
|
||||||
|
regcache_cache_only(ak5558->regmap, true);
|
||||||
|
regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), ak5558->supplies);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dev_pm_ops ak5558_pm = {
|
static const struct dev_pm_ops ak5558_pm = {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
#include <asm/byteorder.h>
|
#include <asm/byteorder.h>
|
||||||
#include <kunit/static_stub.h>
|
#include <kunit/static_stub.h>
|
||||||
#include <linux/cleanup.h>
|
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/dev_printk.h>
|
#include <linux/dev_printk.h>
|
||||||
#include <linux/efi.h>
|
#include <linux/efi.h>
|
||||||
|
|
@ -310,8 +309,9 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device *dev,
|
||||||
efi_guid_t **guid,
|
efi_guid_t **guid,
|
||||||
u32 *attr)
|
u32 *attr)
|
||||||
{
|
{
|
||||||
struct cirrus_amp_efi_data *efi_data __free(kfree) = NULL;
|
struct cirrus_amp_efi_data *efi_data;
|
||||||
unsigned long data_size = 0;
|
unsigned long data_size = 0;
|
||||||
|
u8 *data;
|
||||||
efi_status_t status;
|
efi_status_t status;
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
|
|
@ -339,18 +339,19 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get variable contents into buffer */
|
/* Get variable contents into buffer */
|
||||||
efi_data = kmalloc(data_size, GFP_KERNEL);
|
data = kmalloc(data_size, GFP_KERNEL);
|
||||||
if (!efi_data)
|
if (!data)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
status = cs_amp_get_efi_variable(cs_amp_lib_cal_efivars[i].name,
|
status = cs_amp_get_efi_variable(cs_amp_lib_cal_efivars[i].name,
|
||||||
cs_amp_lib_cal_efivars[i].guid,
|
cs_amp_lib_cal_efivars[i].guid,
|
||||||
attr, &data_size, efi_data);
|
attr, &data_size, data);
|
||||||
if (status != EFI_SUCCESS) {
|
if (status != EFI_SUCCESS) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
efi_data = (struct cirrus_amp_efi_data *)data;
|
||||||
dev_dbg(dev, "Calibration: Size=%d, Amp Count=%d\n", efi_data->size, efi_data->count);
|
dev_dbg(dev, "Calibration: Size=%d, Amp Count=%d\n", efi_data->size, efi_data->count);
|
||||||
|
|
||||||
if ((efi_data->count > 128) ||
|
if ((efi_data->count > 128) ||
|
||||||
|
|
@ -364,9 +365,10 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device *dev,
|
||||||
if (efi_data->size == 0)
|
if (efi_data->size == 0)
|
||||||
efi_data->size = data_size;
|
efi_data->size = data_size;
|
||||||
|
|
||||||
return_ptr(efi_data);
|
return efi_data;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
kfree(data);
|
||||||
dev_err(dev, "Failed to read calibration data from EFI: %d\n", ret);
|
dev_err(dev, "Failed to read calibration data from EFI: %d\n", ret);
|
||||||
|
|
||||||
return ERR_PTR(ret);
|
return ERR_PTR(ret);
|
||||||
|
|
@ -389,9 +391,9 @@ static int cs_amp_set_cal_efi_buffer(struct device *dev,
|
||||||
static int _cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, int amp_index,
|
static int _cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, int amp_index,
|
||||||
struct cirrus_amp_cal_data *out_data)
|
struct cirrus_amp_cal_data *out_data)
|
||||||
{
|
{
|
||||||
struct cirrus_amp_efi_data *efi_data __free(kfree) = NULL;
|
struct cirrus_amp_efi_data *efi_data;
|
||||||
struct cirrus_amp_cal_data *cal = NULL;
|
struct cirrus_amp_cal_data *cal = NULL;
|
||||||
int i;
|
int i, ret;
|
||||||
|
|
||||||
efi_data = cs_amp_get_cal_efi_buffer(dev, NULL, NULL, NULL);
|
efi_data = cs_amp_get_cal_efi_buffer(dev, NULL, NULL, NULL);
|
||||||
if (IS_ERR(efi_data))
|
if (IS_ERR(efi_data))
|
||||||
|
|
@ -432,14 +434,17 @@ static int _cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid,
|
||||||
dev_warn(dev, "Calibration entry %d does not match silicon ID", amp_index);
|
dev_warn(dev, "Calibration entry %d does not match silicon ID", amp_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cal) {
|
if (cal) {
|
||||||
|
memcpy(out_data, cal, sizeof(*out_data));
|
||||||
|
ret = 0;
|
||||||
|
} else {
|
||||||
dev_warn(dev, "No calibration for silicon ID %#llx\n", target_uid);
|
dev_warn(dev, "No calibration for silicon ID %#llx\n", target_uid);
|
||||||
return -ENOENT;
|
ret = -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(out_data, cal, sizeof(*out_data));
|
kfree(efi_data);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _cs_amp_set_efi_calibration_data(struct device *dev, int amp_index, int num_amps,
|
static int _cs_amp_set_efi_calibration_data(struct device *dev, int amp_index, int num_amps,
|
||||||
|
|
|
||||||
|
|
@ -1188,13 +1188,14 @@ static int cs35l41_get_system_name(struct cs35l41_private *cs35l41)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err:
|
|
||||||
if (sub) {
|
if (sub) {
|
||||||
cs35l41->dsp.system_name = sub;
|
cs35l41->dsp.system_name = sub;
|
||||||
dev_info(cs35l41->dev, "Subsystem ID: %s\n", cs35l41->dsp.system_name);
|
dev_info(cs35l41->dev, "Subsystem ID: %s\n", cs35l41->dsp.system_name);
|
||||||
} else
|
return 0;
|
||||||
dev_warn(cs35l41->dev, "Subsystem ID not found\n");
|
}
|
||||||
|
|
||||||
|
err:
|
||||||
|
dev_warn(cs35l41->dev, "Subsystem ID not found\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,8 @@ static int nau8325_clksrc_choose(struct nau8325 *nau8325,
|
||||||
const struct nau8325_srate_attr **srate_table,
|
const struct nau8325_srate_attr **srate_table,
|
||||||
int *n1_sel, int *mult_sel, int *n2_sel)
|
int *n1_sel, int *mult_sel, int *n2_sel)
|
||||||
{
|
{
|
||||||
int i, j, mclk, mclk_max, ratio, ratio_sel, n2_max;
|
int i, j, mclk, ratio;
|
||||||
|
int mclk_max = 0, ratio_sel = 0, n2_max = 0;
|
||||||
|
|
||||||
if (!nau8325->mclk || !nau8325->fs)
|
if (!nau8325->mclk || !nau8325->fs)
|
||||||
goto proc_err;
|
goto proc_err;
|
||||||
|
|
@ -408,7 +409,6 @@ static int nau8325_clksrc_choose(struct nau8325 *nau8325,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get MCLK_SRC through 1/N, Multiplier, and then 1/N2. */
|
/* Get MCLK_SRC through 1/N, Multiplier, and then 1/N2. */
|
||||||
mclk_max = 0;
|
|
||||||
for (i = 0; i < ARRAY_SIZE(mclk_n1_div); i++) {
|
for (i = 0; i < ARRAY_SIZE(mclk_n1_div); i++) {
|
||||||
for (j = 0; j < ARRAY_SIZE(mclk_n3_mult); j++) {
|
for (j = 0; j < ARRAY_SIZE(mclk_n3_mult); j++) {
|
||||||
mclk = nau8325->mclk << mclk_n3_mult[j].param;
|
mclk = nau8325->mclk << mclk_n3_mult[j].param;
|
||||||
|
|
|
||||||
|
|
@ -2866,7 +2866,7 @@ static int wcd937x_add_slave_components(struct wcd937x_priv *wcd937x,
|
||||||
dev_err(dev, "Couldn't parse phandle to qcom,rx-device!\n");
|
dev_err(dev, "Couldn't parse phandle to qcom,rx-device!\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
of_node_get(wcd937x->rxnode);
|
|
||||||
component_match_add_release(dev, matchptr, component_release_of,
|
component_match_add_release(dev, matchptr, component_release_of,
|
||||||
component_compare_of, wcd937x->rxnode);
|
component_compare_of, wcd937x->rxnode);
|
||||||
|
|
||||||
|
|
@ -2875,7 +2875,7 @@ static int wcd937x_add_slave_components(struct wcd937x_priv *wcd937x,
|
||||||
dev_err(dev, "Couldn't parse phandle to qcom,tx-device\n");
|
dev_err(dev, "Couldn't parse phandle to qcom,tx-device\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
of_node_get(wcd937x->txnode);
|
|
||||||
component_match_add_release(dev, matchptr, component_release_of,
|
component_match_add_release(dev, matchptr, component_release_of,
|
||||||
component_compare_of, wcd937x->txnode);
|
component_compare_of, wcd937x->txnode);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3464,7 +3464,6 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
of_node_get(wcd938x->rxnode);
|
|
||||||
component_match_add_release(dev, matchptr, component_release_of,
|
component_match_add_release(dev, matchptr, component_release_of,
|
||||||
component_compare_of, wcd938x->rxnode);
|
component_compare_of, wcd938x->rxnode);
|
||||||
|
|
||||||
|
|
@ -3473,7 +3472,7 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
|
||||||
dev_err(dev, "%s: Tx-device node not defined\n", __func__);
|
dev_err(dev, "%s: Tx-device node not defined\n", __func__);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
of_node_get(wcd938x->txnode);
|
|
||||||
component_match_add_release(dev, matchptr, component_release_of,
|
component_match_add_release(dev, matchptr, component_release_of,
|
||||||
component_compare_of, wcd938x->txnode);
|
component_compare_of, wcd938x->txnode);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -3526,7 +3526,6 @@ static int wcd939x_add_slave_components(struct wcd939x_priv *wcd939x,
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
of_node_get(wcd939x->rxnode);
|
|
||||||
component_match_add_release(dev, matchptr, component_release_of,
|
component_match_add_release(dev, matchptr, component_release_of,
|
||||||
component_compare_of, wcd939x->rxnode);
|
component_compare_of, wcd939x->rxnode);
|
||||||
|
|
||||||
|
|
@ -3535,7 +3534,7 @@ static int wcd939x_add_slave_components(struct wcd939x_priv *wcd939x,
|
||||||
dev_err(dev, "%s: Tx-device node not defined\n", __func__);
|
dev_err(dev, "%s: Tx-device node not defined\n", __func__);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
of_node_get(wcd939x->txnode);
|
|
||||||
component_match_add_release(dev, matchptr, component_release_of,
|
component_match_add_release(dev, matchptr, component_release_of,
|
||||||
component_compare_of, wcd939x->txnode);
|
component_compare_of, wcd939x->txnode);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -947,7 +947,7 @@ static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token)
|
||||||
struct q6afe_port *p;
|
struct q6afe_port *p;
|
||||||
struct q6afe_port *ret = NULL;
|
struct q6afe_port *ret = NULL;
|
||||||
|
|
||||||
guard(spinlock)(&afe->port_list_lock);
|
guard(spinlock_irqsave)(&afe->port_list_lock);
|
||||||
list_for_each_entry(p, &afe->port_list, node)
|
list_for_each_entry(p, &afe->port_list, node)
|
||||||
if (p->token == token) {
|
if (p->token == token) {
|
||||||
ret = p;
|
ret = p;
|
||||||
|
|
@ -1807,7 +1807,7 @@ struct q6afe_port *q6afe_port_get_from_id(struct device *dev, int id)
|
||||||
port->cfg_type = cfg_type;
|
port->cfg_type = cfg_type;
|
||||||
kref_init(&port->refcount);
|
kref_init(&port->refcount);
|
||||||
|
|
||||||
guard(spinlock)(&afe->port_list_lock);
|
guard(spinlock_irqsave)(&afe->port_list_lock);
|
||||||
list_add_tail(&port->node, &afe->port_list);
|
list_add_tail(&port->node, &afe->port_list);
|
||||||
|
|
||||||
return port;
|
return port;
|
||||||
|
|
|
||||||
|
|
@ -580,7 +580,7 @@ static int rockchip_pdm_probe(struct platform_device *pdev)
|
||||||
if (!pdm)
|
if (!pdm)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pdm->version = (enum rk_pdm_version)device_get_match_data(&pdev->dev);
|
pdm->version = (unsigned long)device_get_match_data(&pdev->dev);
|
||||||
if (pdm->version == RK_PDM_RK3308) {
|
if (pdm->version == RK_PDM_RK3308) {
|
||||||
pdm->reset = devm_reset_control_get(&pdev->dev, "pdm-m");
|
pdm->reset = devm_reset_control_get(&pdev->dev, "pdm-m");
|
||||||
if (IS_ERR(pdm->reset))
|
if (IS_ERR(pdm->reset))
|
||||||
|
|
|
||||||
|
|
@ -2545,6 +2545,7 @@ static int snd_rme_get_status1(struct snd_kcontrol *kcontrol,
|
||||||
struct usb_mixer_elem_list *list = snd_kcontrol_chip(kcontrol);
|
struct usb_mixer_elem_list *list = snd_kcontrol_chip(kcontrol);
|
||||||
struct snd_usb_audio *chip = list->mixer->chip;
|
struct snd_usb_audio *chip = list->mixer->chip;
|
||||||
|
|
||||||
|
*status1 = 0;
|
||||||
CLASS(snd_usb_lock, pm)(chip);
|
CLASS(snd_usb_lock, pm)(chip);
|
||||||
if (pm.err < 0)
|
if (pm.err < 0)
|
||||||
return pm.err;
|
return pm.err;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue