Skip to content

Commit

Permalink
Merge pull request #5206 from bardliao/merge/sound-upstream-20241016
Browse files Browse the repository at this point in the history
Merge/sound upstream 20241016
  • Loading branch information
bardliao authored Oct 18, 2024
2 parents a8cc01c + e788959 commit de5635f
Show file tree
Hide file tree
Showing 55 changed files with 1,869 additions and 1,065 deletions.
1 change: 1 addition & 0 deletions Documentation/admin-guide/kernel-parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ is applicable::
SCSI Appropriate SCSI support is enabled.
A lot of drivers have their options described inside
the Documentation/scsi/ sub-directory.
SDW SoundWire support is enabled.
SECURITY Different security models are enabled.
SELINUX SELinux support is enabled.
SERIAL Serial support is enabled.
Expand Down
4 changes: 4 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6060,6 +6060,10 @@
non-zero "wait" parameter. See weight_single
and weight_many.

sdw_mclk_divider=[SDW]
Specify the MCLK divider for Intel SoundWire buses in
case the BIOS does not provide the clock rate properly.

skew_tick= [KNL,EARLY] Offset the periodic timer tick per cpu to mitigate
xtime_lock contention on larger systems, and/or RCU lock
contention on all systems with CONFIG_MAXSMP set.
Expand Down
4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/sound/everest,es8316.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
$id: http://devicetree.org/schemas/sound/everest,es8316.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Everest ES8311 and ES8316 audio CODECs
title: Everest ES8311, ES8316 and ES8323 audio CODECs

maintainers:
- Daniel Drake <[email protected]>
- Katsuhiro Suzuki <[email protected]>
- Matteo Martelli <[email protected]>
- Binbin Zhou <[email protected]>

allOf:
- $ref: dai-common.yaml#
Expand All @@ -19,6 +20,7 @@ properties:
enum:
- everest,es8311
- everest,es8316
- everest,es8323

reg:
maxItems: 1
Expand Down
68 changes: 68 additions & 0 deletions Documentation/devicetree/bindings/sound/loongson,ls2k1000-i2s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/loongson,ls2k1000-i2s.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Loongson-2K1000 I2S controller

maintainers:
- Binbin Zhou <[email protected]>

allOf:
- $ref: dai-common.yaml#

properties:
compatible:
const: loongson,ls2k1000-i2s

reg:
items:
- description: Loongson I2S controller Registers.
- description: APB DMA config register for Loongson I2S controller.

interrupts:
maxItems: 1

clocks:
maxItems: 1

dmas:
maxItems: 2

dma-names:
items:
- const: tx
- const: rx

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

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

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/clock/loongson,ls2k-clk.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2s@1fe2d000 {
compatible = "loongson,ls2k1000-i2s";
reg = <0x1fe2d000 0x14>,
<0x1fe00438 0x8>;
interrupt-parent = <&liointc0>;
interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk LOONGSON2_APB_CLK>;
dmas = <&apbdma2 0>, <&apbdma3 0>;
dma-names = "tx", "rx";
#sound-dai-cells = <0>;
};
...
42 changes: 42 additions & 0 deletions Documentation/devicetree/bindings/sound/nxp,uda1342.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/nxp,uda1342.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP uda1342 audio CODECs

maintainers:
- Binbin Zhou <[email protected]>

allOf:
- $ref: dai-common.yaml#

properties:
compatible:
const: nxp,uda1342

reg:
maxItems: 1

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

required:
- compatible
- reg
- '#sound-dai-cells'

unevaluatedProperties: false

examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
codec@1a {
compatible = "nxp,uda1342";
reg = <0x1a>;
#sound-dai-cells = <0>;
};
};
3 changes: 3 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -15089,6 +15089,7 @@ F: drivers/spi/spi-at91-usart.c

MICROCHIP AUDIO ASOC DRIVERS
M: Claudiu Beznea <[email protected]>
M: Andrei Simion <[email protected]>
L: [email protected]
S: Supported
F: Documentation/devicetree/bindings/sound/atmel*
Expand Down Expand Up @@ -15197,6 +15198,7 @@ F: include/video/atmel_lcdc.h

MICROCHIP MCP16502 PMIC DRIVER
M: Claudiu Beznea <[email protected]>
M: Andrei Simion <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Supported
F: Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml
Expand Down Expand Up @@ -15328,6 +15330,7 @@ F: drivers/spi/spi-atmel.*

MICROCHIP SSC DRIVER
M: Claudiu Beznea <[email protected]>
M: Andrei Simion <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Supported
F: Documentation/devicetree/bindings/misc/atmel-ssc.txt
Expand Down
2 changes: 1 addition & 1 deletion include/sound/hda_register.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
#define SD_STS_FIFO_READY 0x20 /* FIFO ready */

/* INTCTL and INTSTS */
#define AZX_INT_ALL_STREAM 0xff /* all stream interrupts */
#define AZX_INT_ALL_STREAM 0x3fffffff /* all stream interrupts */
#define AZX_INT_CTRL_EN 0x40000000 /* controller interrupt enable bit */
#define AZX_INT_GLOBAL_EN 0x80000000 /* global interrupt enable bit */

Expand Down
2 changes: 1 addition & 1 deletion include/uapi/sound/asoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

/* ABI version */
#define SND_SOC_TPLG_ABI_VERSION 0x5 /* current version */
#define SND_SOC_TPLG_ABI_VERSION_MIN 0x4 /* oldest version supported */
#define SND_SOC_TPLG_ABI_VERSION_MIN 0x5 /* oldest version supported */

/* Max size of TLV data */
#define SND_SOC_TPLG_TLV_SIZE 32
Expand Down
47 changes: 0 additions & 47 deletions sound/firewire/cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,53 +333,6 @@ int cmp_connection_establish(struct cmp_connection *c)
}
EXPORT_SYMBOL(cmp_connection_establish);

/**
* cmp_connection_update - update the connection after a bus reset
* @c: the connection manager
*
* This function must be called from the driver's .update handler to
* reestablish any connection that might have been active.
*
* Returns zero on success, or a negative error code. On an error, the
* connection is broken and the caller must stop transmitting iso packets.
*/
int cmp_connection_update(struct cmp_connection *c)
{
int err;

mutex_lock(&c->mutex);

if (!c->connected) {
mutex_unlock(&c->mutex);
return 0;
}

err = fw_iso_resources_update(&c->resources);
if (err < 0)
goto err_unconnect;

if (c->direction == CMP_OUTPUT)
err = pcr_modify(c, opcr_set_modify, pcr_set_check,
SUCCEED_ON_BUS_RESET);
else
err = pcr_modify(c, ipcr_set_modify, pcr_set_check,
SUCCEED_ON_BUS_RESET);

if (err < 0)
goto err_unconnect;

mutex_unlock(&c->mutex);

return 0;

err_unconnect:
c->connected = false;
mutex_unlock(&c->mutex);

return err;
}
EXPORT_SYMBOL(cmp_connection_update);

static __be32 pcr_break_modify(struct cmp_connection *c, __be32 pcr)
{
return pcr & ~cpu_to_be32(PCR_BCAST_CONN | PCR_P2P_CONN_MASK);
Expand Down
1 change: 0 additions & 1 deletion sound/firewire/cmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ int cmp_connection_reserve(struct cmp_connection *connection,
void cmp_connection_release(struct cmp_connection *connection);

int cmp_connection_establish(struct cmp_connection *connection);
int cmp_connection_update(struct cmp_connection *connection);
void cmp_connection_break(struct cmp_connection *connection);

#endif
61 changes: 50 additions & 11 deletions sound/pci/hda/hda_auto_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,28 @@ void snd_hda_pick_pin_fixup(struct hda_codec *codec,
}
EXPORT_SYMBOL_GPL(snd_hda_pick_pin_fixup);

/* check whether the given quirk entry matches with vendor/device pair */
static bool hda_quirk_match(u16 vendor, u16 device, const struct hda_quirk *q)
{
if (q->subvendor != vendor)
return false;
return !q->subdevice ||
(device & q->subdevice_mask) == q->subdevice;
}

/* look through the quirk list and return the matching entry */
static const struct hda_quirk *
hda_quirk_lookup_id(u16 vendor, u16 device, const struct hda_quirk *list)
{
const struct hda_quirk *q;

for (q = list; q->subvendor || q->subdevice; q++) {
if (hda_quirk_match(vendor, device, q))
return q;
}
return NULL;
}

/**
* snd_hda_pick_fixup - Pick up a fixup matching with PCI/codec SSID or model string
* @codec: the HDA codec
Expand All @@ -975,14 +997,16 @@ EXPORT_SYMBOL_GPL(snd_hda_pick_pin_fixup);
*/
void snd_hda_pick_fixup(struct hda_codec *codec,
const struct hda_model_fixup *models,
const struct snd_pci_quirk *quirk,
const struct hda_quirk *quirk,
const struct hda_fixup *fixlist)
{
const struct snd_pci_quirk *q;
const struct hda_quirk *q;
int id = HDA_FIXUP_ID_NOT_SET;
const char *name = NULL;
const char *type = NULL;
unsigned int vendor, device;
u16 pci_vendor, pci_device;
u16 codec_vendor, codec_device;

if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)
return;
Expand Down Expand Up @@ -1013,27 +1037,42 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
if (!quirk)
return;

if (codec->bus->pci) {
pci_vendor = codec->bus->pci->subsystem_vendor;
pci_device = codec->bus->pci->subsystem_device;
}

codec_vendor = codec->core.subsystem_id >> 16;
codec_device = codec->core.subsystem_id & 0xffff;

/* match with the SSID alias given by the model string "XXXX:YYYY" */
if (codec->modelname &&
sscanf(codec->modelname, "%04x:%04x", &vendor, &device) == 2) {
q = snd_pci_quirk_lookup_id(vendor, device, quirk);
q = hda_quirk_lookup_id(vendor, device, quirk);
if (q) {
type = "alias SSID";
goto found_device;
}
}

/* match with the PCI SSID */
q = snd_pci_quirk_lookup(codec->bus->pci, quirk);
if (q) {
type = "PCI SSID";
goto found_device;
/* match primarily with the PCI SSID */
for (q = quirk; q->subvendor || q->subdevice; q++) {
/* if the entry is specific to codec SSID, check with it */
if (!codec->bus->pci || q->match_codec_ssid) {
if (hda_quirk_match(codec_vendor, codec_device, q)) {
type = "codec SSID";
goto found_device;
}
} else {
if (hda_quirk_match(pci_vendor, pci_device, q)) {
type = "PCI SSID";
goto found_device;
}
}
}

/* match with the codec SSID */
q = snd_pci_quirk_lookup_id(codec->core.subsystem_id >> 16,
codec->core.subsystem_id & 0xffff,
quirk);
q = hda_quirk_lookup_id(codec_vendor, codec_device, quirk);
if (q) {
type = "codec SSID";
goto found_device;
Expand Down
28 changes: 27 additions & 1 deletion sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,32 @@ struct hda_fixup {
} v;
};

/*
* extended form of snd_pci_quirk:
* for PCI SSID matching, use SND_PCI_QUIRK() like before;
* for codec SSID matching, use the new HDA_CODEC_QUIRK() instead
*/
struct hda_quirk {
unsigned short subvendor; /* PCI subvendor ID */
unsigned short subdevice; /* PCI subdevice ID */
unsigned short subdevice_mask; /* bitmask to match */
bool match_codec_ssid; /* match only with codec SSID */
int value; /* value */
#ifdef CONFIG_SND_DEBUG_VERBOSE
const char *name; /* name of the device (optional) */
#endif
};

#ifdef CONFIG_SND_DEBUG_VERBOSE
#define HDA_CODEC_QUIRK(vend, dev, xname, val) \
{ _SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname),\
.match_codec_ssid = true }
#else
#define HDA_CODEC_QUIRK(vend, dev, xname, val) \
{ _SND_PCI_QUIRK_ID(vend, dev), .value = (val), \
.match_codec_ssid = true }
#endif

struct snd_hda_pin_quirk {
unsigned int codec; /* Codec vendor/device ID */
unsigned short subvendor; /* PCI subvendor ID */
Expand Down Expand Up @@ -351,7 +377,7 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action);
void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth);
void snd_hda_pick_fixup(struct hda_codec *codec,
const struct hda_model_fixup *models,
const struct snd_pci_quirk *quirk,
const struct hda_quirk *quirk,
const struct hda_fixup *fixlist);
void snd_hda_pick_pin_fixup(struct hda_codec *codec,
const struct snd_hda_pin_quirk *pin_quirk,
Expand Down
Loading

0 comments on commit de5635f

Please sign in to comment.