Skip to content

Commit 4ea56c9

Browse files
committed
Merge remote-tracking branch 'takashi/for-next' into sound/upstream-20241024
2 parents e25169f + 52345d3 commit 4ea56c9

18 files changed

Lines changed: 298 additions & 273 deletions

include/sound/hda_register.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
180180
#define SD_STS_FIFO_READY 0x20 /* FIFO ready */
181181

182182
/* INTCTL and INTSTS */
183-
#define AZX_INT_ALL_STREAM 0xff /* all stream interrupts */
183+
#define AZX_INT_ALL_STREAM 0x3fffffff /* all stream interrupts */
184184
#define AZX_INT_CTRL_EN 0x40000000 /* controller interrupt enable bit */
185185
#define AZX_INT_GLOBAL_EN 0x80000000 /* global interrupt enable bit */
186186

sound/firewire/cmp.c

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -333,53 +333,6 @@ int cmp_connection_establish(struct cmp_connection *c)
333333
}
334334
EXPORT_SYMBOL(cmp_connection_establish);
335335

336-
/**
337-
* cmp_connection_update - update the connection after a bus reset
338-
* @c: the connection manager
339-
*
340-
* This function must be called from the driver's .update handler to
341-
* reestablish any connection that might have been active.
342-
*
343-
* Returns zero on success, or a negative error code. On an error, the
344-
* connection is broken and the caller must stop transmitting iso packets.
345-
*/
346-
int cmp_connection_update(struct cmp_connection *c)
347-
{
348-
int err;
349-
350-
mutex_lock(&c->mutex);
351-
352-
if (!c->connected) {
353-
mutex_unlock(&c->mutex);
354-
return 0;
355-
}
356-
357-
err = fw_iso_resources_update(&c->resources);
358-
if (err < 0)
359-
goto err_unconnect;
360-
361-
if (c->direction == CMP_OUTPUT)
362-
err = pcr_modify(c, opcr_set_modify, pcr_set_check,
363-
SUCCEED_ON_BUS_RESET);
364-
else
365-
err = pcr_modify(c, ipcr_set_modify, pcr_set_check,
366-
SUCCEED_ON_BUS_RESET);
367-
368-
if (err < 0)
369-
goto err_unconnect;
370-
371-
mutex_unlock(&c->mutex);
372-
373-
return 0;
374-
375-
err_unconnect:
376-
c->connected = false;
377-
mutex_unlock(&c->mutex);
378-
379-
return err;
380-
}
381-
EXPORT_SYMBOL(cmp_connection_update);
382-
383336
static __be32 pcr_break_modify(struct cmp_connection *c, __be32 pcr)
384337
{
385338
return pcr & ~cpu_to_be32(PCR_BCAST_CONN | PCR_P2P_CONN_MASK);

sound/firewire/cmp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ int cmp_connection_reserve(struct cmp_connection *connection,
4747
void cmp_connection_release(struct cmp_connection *connection);
4848

4949
int cmp_connection_establish(struct cmp_connection *connection);
50-
int cmp_connection_update(struct cmp_connection *connection);
5150
void cmp_connection_break(struct cmp_connection *connection);
5251

5352
#endif

sound/pci/hda/hda_auto_parser.c

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,28 @@ void snd_hda_pick_pin_fixup(struct hda_codec *codec,
956956
}
957957
EXPORT_SYMBOL_GPL(snd_hda_pick_pin_fixup);
958958

959+
/* check whether the given quirk entry matches with vendor/device pair */
960+
static bool hda_quirk_match(u16 vendor, u16 device, const struct hda_quirk *q)
961+
{
962+
if (q->subvendor != vendor)
963+
return false;
964+
return !q->subdevice ||
965+
(device & q->subdevice_mask) == q->subdevice;
966+
}
967+
968+
/* look through the quirk list and return the matching entry */
969+
static const struct hda_quirk *
970+
hda_quirk_lookup_id(u16 vendor, u16 device, const struct hda_quirk *list)
971+
{
972+
const struct hda_quirk *q;
973+
974+
for (q = list; q->subvendor || q->subdevice; q++) {
975+
if (hda_quirk_match(vendor, device, q))
976+
return q;
977+
}
978+
return NULL;
979+
}
980+
959981
/**
960982
* snd_hda_pick_fixup - Pick up a fixup matching with PCI/codec SSID or model string
961983
* @codec: the HDA codec
@@ -975,14 +997,16 @@ EXPORT_SYMBOL_GPL(snd_hda_pick_pin_fixup);
975997
*/
976998
void snd_hda_pick_fixup(struct hda_codec *codec,
977999
const struct hda_model_fixup *models,
978-
const struct snd_pci_quirk *quirk,
1000+
const struct hda_quirk *quirk,
9791001
const struct hda_fixup *fixlist)
9801002
{
981-
const struct snd_pci_quirk *q;
1003+
const struct hda_quirk *q;
9821004
int id = HDA_FIXUP_ID_NOT_SET;
9831005
const char *name = NULL;
9841006
const char *type = NULL;
9851007
unsigned int vendor, device;
1008+
u16 pci_vendor, pci_device;
1009+
u16 codec_vendor, codec_device;
9861010

9871011
if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)
9881012
return;
@@ -1013,27 +1037,42 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
10131037
if (!quirk)
10141038
return;
10151039

1040+
if (codec->bus->pci) {
1041+
pci_vendor = codec->bus->pci->subsystem_vendor;
1042+
pci_device = codec->bus->pci->subsystem_device;
1043+
}
1044+
1045+
codec_vendor = codec->core.subsystem_id >> 16;
1046+
codec_device = codec->core.subsystem_id & 0xffff;
1047+
10161048
/* match with the SSID alias given by the model string "XXXX:YYYY" */
10171049
if (codec->modelname &&
10181050
sscanf(codec->modelname, "%04x:%04x", &vendor, &device) == 2) {
1019-
q = snd_pci_quirk_lookup_id(vendor, device, quirk);
1051+
q = hda_quirk_lookup_id(vendor, device, quirk);
10201052
if (q) {
10211053
type = "alias SSID";
10221054
goto found_device;
10231055
}
10241056
}
10251057

1026-
/* match with the PCI SSID */
1027-
q = snd_pci_quirk_lookup(codec->bus->pci, quirk);
1028-
if (q) {
1029-
type = "PCI SSID";
1030-
goto found_device;
1058+
/* match primarily with the PCI SSID */
1059+
for (q = quirk; q->subvendor || q->subdevice; q++) {
1060+
/* if the entry is specific to codec SSID, check with it */
1061+
if (!codec->bus->pci || q->match_codec_ssid) {
1062+
if (hda_quirk_match(codec_vendor, codec_device, q)) {
1063+
type = "codec SSID";
1064+
goto found_device;
1065+
}
1066+
} else {
1067+
if (hda_quirk_match(pci_vendor, pci_device, q)) {
1068+
type = "PCI SSID";
1069+
goto found_device;
1070+
}
1071+
}
10311072
}
10321073

10331074
/* match with the codec SSID */
1034-
q = snd_pci_quirk_lookup_id(codec->core.subsystem_id >> 16,
1035-
codec->core.subsystem_id & 0xffff,
1036-
quirk);
1075+
q = hda_quirk_lookup_id(codec_vendor, codec_device, quirk);
10371076
if (q) {
10381077
type = "codec SSID";
10391078
goto found_device;

sound/pci/hda/hda_local.h

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,32 @@ struct hda_fixup {
292292
} v;
293293
};
294294

295+
/*
296+
* extended form of snd_pci_quirk:
297+
* for PCI SSID matching, use SND_PCI_QUIRK() like before;
298+
* for codec SSID matching, use the new HDA_CODEC_QUIRK() instead
299+
*/
300+
struct hda_quirk {
301+
unsigned short subvendor; /* PCI subvendor ID */
302+
unsigned short subdevice; /* PCI subdevice ID */
303+
unsigned short subdevice_mask; /* bitmask to match */
304+
bool match_codec_ssid; /* match only with codec SSID */
305+
int value; /* value */
306+
#ifdef CONFIG_SND_DEBUG_VERBOSE
307+
const char *name; /* name of the device (optional) */
308+
#endif
309+
};
310+
311+
#ifdef CONFIG_SND_DEBUG_VERBOSE
312+
#define HDA_CODEC_QUIRK(vend, dev, xname, val) \
313+
{ _SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname),\
314+
.match_codec_ssid = true }
315+
#else
316+
#define HDA_CODEC_QUIRK(vend, dev, xname, val) \
317+
{ _SND_PCI_QUIRK_ID(vend, dev), .value = (val), \
318+
.match_codec_ssid = true }
319+
#endif
320+
295321
struct snd_hda_pin_quirk {
296322
unsigned int codec; /* Codec vendor/device ID */
297323
unsigned short subvendor; /* PCI subvendor ID */
@@ -351,7 +377,7 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action);
351377
void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth);
352378
void snd_hda_pick_fixup(struct hda_codec *codec,
353379
const struct hda_model_fixup *models,
354-
const struct snd_pci_quirk *quirk,
380+
const struct hda_quirk *quirk,
355381
const struct hda_fixup *fixlist);
356382
void snd_hda_pick_pin_fixup(struct hda_codec *codec,
357383
const struct snd_hda_pin_quirk *pin_quirk,

sound/pci/hda/patch_analog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static const struct hda_fixup ad1986a_fixups[] = {
345345
},
346346
};
347347

348-
static const struct snd_pci_quirk ad1986a_fixup_tbl[] = {
348+
static const struct hda_quirk ad1986a_fixup_tbl[] = {
349349
SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_FIXUP_LAPTOP_IMIC),
350350
SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9V", AD1986A_FIXUP_LAPTOP_IMIC),
351351
SND_PCI_QUIRK(0x1043, 0x1443, "ASUS Z99He", AD1986A_FIXUP_EAPD),
@@ -588,7 +588,7 @@ static const struct hda_fixup ad1981_fixups[] = {
588588
},
589589
};
590590

591-
static const struct snd_pci_quirk ad1981_fixup_tbl[] = {
591+
static const struct hda_quirk ad1981_fixup_tbl[] = {
592592
SND_PCI_QUIRK_VENDOR(0x1014, "Lenovo", AD1981_FIXUP_AMP_OVERRIDE),
593593
SND_PCI_QUIRK_VENDOR(0x103c, "HP", AD1981_FIXUP_HP_EAPD),
594594
SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", AD1981_FIXUP_AMP_OVERRIDE),
@@ -1061,7 +1061,7 @@ static const struct hda_fixup ad1884_fixups[] = {
10611061
},
10621062
};
10631063

1064-
static const struct snd_pci_quirk ad1884_fixup_tbl[] = {
1064+
static const struct hda_quirk ad1884_fixup_tbl[] = {
10651065
SND_PCI_QUIRK(0x103c, 0x2a82, "HP Touchsmart", AD1884_FIXUP_HP_TOUCHSMART),
10661066
SND_PCI_QUIRK_VENDOR(0x103c, "HP", AD1884_FIXUP_HP_EAPD),
10671067
SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1884_FIXUP_THINKPAD),

sound/pci/hda/patch_cirrus.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static const struct hda_model_fixup cs420x_models[] = {
385385
{}
386386
};
387387

388-
static const struct snd_pci_quirk cs420x_fixup_tbl[] = {
388+
static const struct hda_quirk cs420x_fixup_tbl[] = {
389389
SND_PCI_QUIRK(0x10de, 0x0ac0, "MacBookPro 5,3", CS420X_MBP53),
390390
SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),
391391
SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
@@ -634,13 +634,13 @@ static const struct hda_model_fixup cs4208_models[] = {
634634
{}
635635
};
636636

637-
static const struct snd_pci_quirk cs4208_fixup_tbl[] = {
637+
static const struct hda_quirk cs4208_fixup_tbl[] = {
638638
SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS4208_MAC_AUTO),
639639
{} /* terminator */
640640
};
641641

642642
/* codec SSID matching */
643-
static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {
643+
static const struct hda_quirk cs4208_mac_fixup_tbl[] = {
644644
SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11),
645645
SND_PCI_QUIRK(0x106b, 0x6c00, "MacMini 7,1", CS4208_MACMINI),
646646
SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6),
@@ -818,7 +818,7 @@ static const struct hda_model_fixup cs421x_models[] = {
818818
{}
819819
};
820820

821-
static const struct snd_pci_quirk cs421x_fixup_tbl[] = {
821+
static const struct hda_quirk cs421x_fixup_tbl[] = {
822822
/* Test Intel board + CDB2410 */
823823
SND_PCI_QUIRK(0x8086, 0x5001, "DP45SG/CDB4210", CS421X_CDB4210),
824824
{} /* terminator */

sound/pci/hda/patch_conexant.c

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -816,23 +816,6 @@ static const struct hda_pintbl cxt_pincfg_sws_js201d[] = {
816816
{}
817817
};
818818

819-
/* pincfg quirk for Tuxedo Sirius;
820-
* unfortunately the (PCI) SSID conflicts with System76 Pangolin pang14,
821-
* which has incompatible pin setup, so we check the codec SSID (luckily
822-
* different one!) and conditionally apply the quirk here
823-
*/
824-
static void cxt_fixup_sirius_top_speaker(struct hda_codec *codec,
825-
const struct hda_fixup *fix,
826-
int action)
827-
{
828-
/* ignore for incorrectly picked-up pang14 */
829-
if (codec->core.subsystem_id == 0x278212b3)
830-
return;
831-
/* set up the top speaker pin */
832-
if (action == HDA_FIXUP_ACT_PRE_PROBE)
833-
snd_hda_codec_set_pincfg(codec, 0x1d, 0x82170111);
834-
}
835-
836819
static const struct hda_fixup cxt_fixups[] = {
837820
[CXT_PINCFG_LENOVO_X200] = {
838821
.type = HDA_FIXUP_PINS,
@@ -993,12 +976,15 @@ static const struct hda_fixup cxt_fixups[] = {
993976
.v.pins = cxt_pincfg_sws_js201d,
994977
},
995978
[CXT_PINCFG_TOP_SPEAKER] = {
996-
.type = HDA_FIXUP_FUNC,
997-
.v.func = cxt_fixup_sirius_top_speaker,
979+
.type = HDA_FIXUP_PINS,
980+
.v.pins = (const struct hda_pintbl[]) {
981+
{ 0x1d, 0x82170111 },
982+
{ }
983+
},
998984
},
999985
};
1000986

1001-
static const struct snd_pci_quirk cxt5045_fixups[] = {
987+
static const struct hda_quirk cxt5045_fixups[] = {
1002988
SND_PCI_QUIRK(0x103c, 0x30d5, "HP 530", CXT_FIXUP_HP_530),
1003989
SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P105", CXT_FIXUP_TOSHIBA_P105),
1004990
/* HP, Packard Bell, Fujitsu-Siemens & Lenovo laptops have
@@ -1018,7 +1004,7 @@ static const struct hda_model_fixup cxt5045_fixup_models[] = {
10181004
{}
10191005
};
10201006

1021-
static const struct snd_pci_quirk cxt5047_fixups[] = {
1007+
static const struct hda_quirk cxt5047_fixups[] = {
10221008
/* HP laptops have really bad sound over 0 dB on NID 0x10.
10231009
*/
10241010
SND_PCI_QUIRK_VENDOR(0x103c, "HP", CXT_FIXUP_CAP_MIX_AMP_5047),
@@ -1030,7 +1016,7 @@ static const struct hda_model_fixup cxt5047_fixup_models[] = {
10301016
{}
10311017
};
10321018

1033-
static const struct snd_pci_quirk cxt5051_fixups[] = {
1019+
static const struct hda_quirk cxt5051_fixups[] = {
10341020
SND_PCI_QUIRK(0x103c, 0x360b, "Compaq CQ60", CXT_PINCFG_COMPAQ_CQ60),
10351021
SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT_PINCFG_LENOVO_X200),
10361022
{}
@@ -1041,7 +1027,7 @@ static const struct hda_model_fixup cxt5051_fixup_models[] = {
10411027
{}
10421028
};
10431029

1044-
static const struct snd_pci_quirk cxt5066_fixups[] = {
1030+
static const struct hda_quirk cxt5066_fixups[] = {
10451031
SND_PCI_QUIRK(0x1025, 0x0543, "Acer Aspire One 522", CXT_FIXUP_STEREO_DMIC),
10461032
SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT_FIXUP_ASPIRE_DMIC),
10471033
SND_PCI_QUIRK(0x1025, 0x054f, "Acer Aspire 4830T", CXT_FIXUP_ASPIRE_DMIC),
@@ -1092,8 +1078,8 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
10921078
SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI),
10931079
SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004),
10941080
SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205),
1095-
SND_PCI_QUIRK(0x2782, 0x12c3, "Sirius Gen1", CXT_PINCFG_TOP_SPEAKER),
1096-
SND_PCI_QUIRK(0x2782, 0x12c5, "Sirius Gen2", CXT_PINCFG_TOP_SPEAKER),
1081+
HDA_CODEC_QUIRK(0x2782, 0x12c3, "Sirius Gen1", CXT_PINCFG_TOP_SPEAKER),
1082+
HDA_CODEC_QUIRK(0x2782, 0x12c5, "Sirius Gen2", CXT_PINCFG_TOP_SPEAKER),
10971083
{}
10981084
};
10991085

sound/pci/hda/patch_cs8409-tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ struct sub_codec dolphin_cs42l42_1 = {
473473
* Arrays Used for all projects using CS8409
474474
******************************************************************************/
475475

476-
const struct snd_pci_quirk cs8409_fixup_tbl[] = {
476+
const struct hda_quirk cs8409_fixup_tbl[] = {
477477
SND_PCI_QUIRK(0x1028, 0x0A11, "Bullseye", CS8409_BULLSEYE),
478478
SND_PCI_QUIRK(0x1028, 0x0A12, "Bullseye", CS8409_BULLSEYE),
479479
SND_PCI_QUIRK(0x1028, 0x0A23, "Bullseye", CS8409_BULLSEYE),

sound/pci/hda/patch_cs8409.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ int cs42l42_volume_put(struct snd_kcontrol *kctrl, struct snd_ctl_elem_value *uc
355355

356356
extern const struct hda_pcm_stream cs42l42_48k_pcm_analog_playback;
357357
extern const struct hda_pcm_stream cs42l42_48k_pcm_analog_capture;
358-
extern const struct snd_pci_quirk cs8409_fixup_tbl[];
358+
extern const struct hda_quirk cs8409_fixup_tbl[];
359359
extern const struct hda_model_fixup cs8409_models[];
360360
extern const struct hda_fixup cs8409_fixups[];
361361
extern const struct hda_verb cs8409_cs42l42_init_verbs[];

0 commit comments

Comments
 (0)