mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
Merge branch 'for-linus' into for-next
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
commit
160781cda1
|
|
@ -334,7 +334,7 @@ int snd_parse_eld(struct device *dev, struct snd_parsed_hdmi_eld *e,
|
|||
e->eld_ver = GRAB_BITS(buf, 0, 3, 5);
|
||||
if (e->eld_ver != ELD_VER_CEA_861D &&
|
||||
e->eld_ver != ELD_VER_PARTIAL) {
|
||||
dev_info(dev, "HDMI: Unknown ELD version %d\n", e->eld_ver);
|
||||
dev_info_ratelimited(dev, "HDMI: Unknown ELD version %d\n", e->eld_ver);
|
||||
goto out_fail;
|
||||
}
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ int snd_parse_eld(struct device *dev, struct snd_parsed_hdmi_eld *e,
|
|||
e->product_id = get_unaligned_le16(buf + 18);
|
||||
|
||||
if (mnl > ELD_MAX_MNL) {
|
||||
dev_info(dev, "HDMI: MNL is reserved value %d\n", mnl);
|
||||
dev_info_ratelimited(dev, "HDMI: MNL is reserved value %d\n", mnl);
|
||||
goto out_fail;
|
||||
} else if (ELD_FIXED_BYTES + mnl > size) {
|
||||
dev_info(dev, "HDMI: out of range MNL %d\n", mnl);
|
||||
|
|
|
|||
|
|
@ -2138,6 +2138,9 @@ static int interleaved_copy(struct snd_pcm_substream *substream,
|
|||
off = frames_to_bytes(runtime, off);
|
||||
frames = frames_to_bytes(runtime, frames);
|
||||
|
||||
if (!data)
|
||||
return fill_silence(substream, 0, hwoff, NULL, frames);
|
||||
|
||||
return do_transfer(substream, 0, hwoff, data + off, frames, transfer,
|
||||
in_kernel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,18 +144,21 @@ int snd_seq_create_port(struct snd_seq_client *client, int port,
|
|||
num = max(port, 0);
|
||||
guard(mutex)(&client->ports_mutex);
|
||||
guard(write_lock_irq)(&client->ports_lock);
|
||||
struct list_head *insert_before = &client->ports_list_head;
|
||||
list_for_each_entry(p, &client->ports_list_head, list) {
|
||||
if (p->addr.port == port) {
|
||||
kfree(new_port);
|
||||
return -EBUSY;
|
||||
}
|
||||
if (p->addr.port > num)
|
||||
if (p->addr.port > num) {
|
||||
insert_before = &p->list;
|
||||
break;
|
||||
}
|
||||
if (port < 0) /* auto-probe mode */
|
||||
num = p->addr.port + 1;
|
||||
}
|
||||
/* insert the new port */
|
||||
list_add_tail(&new_port->list, &p->list);
|
||||
list_add_tail(&new_port->list, insert_before);
|
||||
client->num_ports++;
|
||||
new_port->addr.port = num; /* store the port number in the port */
|
||||
sprintf(new_port->name, "port-%d", num);
|
||||
|
|
|
|||
|
|
@ -1007,6 +1007,7 @@ static int snd_timer_dev_register(struct snd_device *dev)
|
|||
{
|
||||
struct snd_timer *timer = dev->device_data;
|
||||
struct snd_timer *timer1;
|
||||
struct list_head *insert_before = &snd_timer_list;
|
||||
|
||||
if (snd_BUG_ON(!timer || !timer->hw.start || !timer->hw.stop))
|
||||
return -ENXIO;
|
||||
|
|
@ -1016,28 +1017,36 @@ static int snd_timer_dev_register(struct snd_device *dev)
|
|||
|
||||
guard(mutex)(®ister_mutex);
|
||||
list_for_each_entry(timer1, &snd_timer_list, device_list) {
|
||||
if (timer1->tmr_class > timer->tmr_class)
|
||||
if (timer1->tmr_class > timer->tmr_class) {
|
||||
insert_before = &timer1->device_list;
|
||||
break;
|
||||
}
|
||||
if (timer1->tmr_class < timer->tmr_class)
|
||||
continue;
|
||||
if (timer1->card && timer->card) {
|
||||
if (timer1->card->number > timer->card->number)
|
||||
if (timer1->card->number > timer->card->number) {
|
||||
insert_before = &timer1->device_list;
|
||||
break;
|
||||
}
|
||||
if (timer1->card->number < timer->card->number)
|
||||
continue;
|
||||
}
|
||||
if (timer1->tmr_device > timer->tmr_device)
|
||||
if (timer1->tmr_device > timer->tmr_device) {
|
||||
insert_before = &timer1->device_list;
|
||||
break;
|
||||
}
|
||||
if (timer1->tmr_device < timer->tmr_device)
|
||||
continue;
|
||||
if (timer1->tmr_subdevice > timer->tmr_subdevice)
|
||||
if (timer1->tmr_subdevice > timer->tmr_subdevice) {
|
||||
insert_before = &timer1->device_list;
|
||||
break;
|
||||
}
|
||||
if (timer1->tmr_subdevice < timer->tmr_subdevice)
|
||||
continue;
|
||||
/* conflicts.. */
|
||||
return -EBUSY;
|
||||
}
|
||||
list_add_tail(&timer->device_list, &timer1->device_list);
|
||||
list_add_tail(&timer->device_list, insert_before);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5518,6 +5518,30 @@ static int zxr_headphone_gain_set(struct hda_codec *codec, long val)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Manual output selection (HP/Speaker Playback Switch or alt Output Select)
|
||||
* is meaningful only when HP/Speaker auto-detect is disabled, since the
|
||||
* select_out path always prefers jack presence when auto-detect is on. When
|
||||
* the user explicitly chooses an output, turn auto-detect off so the manual
|
||||
* choice actually takes effect, and notify userspace so the auto-detect
|
||||
* control reflects the new state.
|
||||
*/
|
||||
static void ca0132_disable_hp_auto_detect(struct hda_codec *codec)
|
||||
{
|
||||
struct ca0132_spec *spec = codec->spec;
|
||||
struct snd_kcontrol *kctl;
|
||||
|
||||
if (!spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID])
|
||||
return;
|
||||
|
||||
spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID] = 0;
|
||||
kctl = snd_hda_find_mixer_ctl(codec,
|
||||
"HP/Speaker Auto Detect Playback Switch");
|
||||
if (kctl)
|
||||
snd_ctl_notify(codec->card, SNDRV_CTL_EVENT_MASK_VALUE,
|
||||
&kctl->id);
|
||||
}
|
||||
|
||||
static int ca0132_vnode_switch_set(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
|
|
@ -5530,14 +5554,11 @@ static int ca0132_vnode_switch_set(struct snd_kcontrol *kcontrol,
|
|||
int auto_jack;
|
||||
|
||||
if (nid == VNID_HP_SEL) {
|
||||
auto_jack =
|
||||
spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID];
|
||||
if (!auto_jack) {
|
||||
if (ca0132_use_alt_functions(spec))
|
||||
ca0132_alt_select_out(codec);
|
||||
else
|
||||
ca0132_select_out(codec);
|
||||
}
|
||||
ca0132_disable_hp_auto_detect(codec);
|
||||
if (ca0132_use_alt_functions(spec))
|
||||
ca0132_alt_select_out(codec);
|
||||
else
|
||||
ca0132_select_out(codec);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -5998,7 +6019,6 @@ static int ca0132_alt_output_select_put(struct snd_kcontrol *kcontrol,
|
|||
struct ca0132_spec *spec = codec->spec;
|
||||
int sel = ucontrol->value.enumerated.item[0];
|
||||
unsigned int items = NUM_OF_OUTPUTS;
|
||||
unsigned int auto_jack;
|
||||
|
||||
if (sel >= items)
|
||||
return 0;
|
||||
|
|
@ -6008,10 +6028,8 @@ static int ca0132_alt_output_select_put(struct snd_kcontrol *kcontrol,
|
|||
|
||||
spec->out_enum_val = sel;
|
||||
|
||||
auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID];
|
||||
|
||||
if (!auto_jack)
|
||||
ca0132_alt_select_out(codec);
|
||||
ca0132_disable_hp_auto_detect(codec);
|
||||
ca0132_alt_select_out(codec);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7103,6 +7103,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8a34, "HP Pavilion x360 2-in-1 Laptop 14-ek0xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
|
||||
SND_PCI_QUIRK(0x103c, 0x8a36, "HP Pavilion Plus 14-eh0xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
|
||||
SND_PCI_QUIRK(0x103c, 0x8a3d, "HP Victus 15-fb0xxx (MB 8A3D)", ALC245_FIXUP_HP_MUTE_LED_V2_COEFBIT),
|
||||
SND_PCI_QUIRK(0x103c, 0x8a4f, "HP Victus 15-fa0xxx (MB 8A4F)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
|
||||
SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4),
|
||||
|
|
@ -7122,6 +7123,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
|
||||
SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8b34, "HP 250 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
|
||||
|
|
@ -7248,7 +7250,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x103c, 0x8da0, "HP 16 Clipper OmniBook 7(X360)", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8da1, "HP 16 Clipper OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8da7, "HP 14 Enstrom OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8da8, "HP 16 Piston OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8da8, "HP 16 Piston OmniBook X", ALC245_FIXUP_HP_ENVY_X360_15_FH0XXX),
|
||||
SND_PCI_QUIRK(0x103c, 0x8dc9, "HP Laptop 15-fc0xxx", ALC236_FIXUP_HP_DMIC),
|
||||
SND_PCI_QUIRK(0x103c, 0x8dd4, "HP EliteStudio 8 AIO", ALC274_FIXUP_HP_AIO_BIND_DACS),
|
||||
SND_PCI_QUIRK(0x103c, 0x8dd7, "HP Laptop 15-fd0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
|
||||
|
|
@ -7260,6 +7262,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x103c, 0x8def, "HP EliteBook 660 G12", ALC236_FIXUP_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8df0, "HP EliteBook 630 G12", ALC236_FIXUP_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8df1, "HP EliteBook 630 G12", ALC236_FIXUP_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8df7, "HP Z66 G6", ALC236_FIXUP_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8dfb, "HP EliteBook 6 G1a 14", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
|
||||
SND_PCI_QUIRK(0x103c, 0x8dfc, "HP EliteBook 645 G12", ALC236_FIXUP_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8dfd, "HP EliteBook 6 G1a 16", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
|
||||
|
|
@ -7472,12 +7475,12 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x1043, 0x3e00, "ASUS G814FH/FM/FP", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x1043, 0x3e20, "ASUS G814PH/PM/PP", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x1043, 0x3e30, "ASUS TP3607SA", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3ee0, "ASUS Strix G815_JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3ef0, "ASUS Strix G635LR_LW_LX", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3f00, "ASUS Strix G815LH_LM_LP", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3f10, "ASUS Strix G835LR_LW_LX", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3f20, "ASUS Strix G615LR_LW", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3f30, "ASUS Strix G815LR_LW", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3ee0, "ASUS Strix G815_JHR_JMR_JPR", ALC287_FIXUP_TXNW2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3ef0, "ASUS Strix G635LR_LW_LX", ALC287_FIXUP_TXNW2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3f00, "ASUS Strix G815LH_LM_LP", ALC287_FIXUP_TXNW2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3f10, "ASUS Strix G835LR_LW_LX", ALC287_FIXUP_TXNW2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3f20, "ASUS Strix G615LR_LW", ALC287_FIXUP_TXNW2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3f30, "ASUS Strix G815LR_LW", ALC287_FIXUP_TXNW2781_I2C),
|
||||
SND_PCI_QUIRK(0x1043, 0x3fd0, "ASUS B3605CVA", ALC245_FIXUP_CS35L41_SPI_2),
|
||||
SND_PCI_QUIRK(0x1043, 0x3ff0, "ASUS B5405CVA", ALC245_FIXUP_CS35L41_SPI_2),
|
||||
SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
|
||||
|
|
|
|||
|
|
@ -1013,7 +1013,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
|
|||
const char *name = NULL;
|
||||
const char *type = NULL;
|
||||
unsigned int vendor, device;
|
||||
u16 pci_vendor, pci_device;
|
||||
u16 pci_vendor = 0, pci_device = 0;
|
||||
u16 codec_vendor, codec_device;
|
||||
|
||||
if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)
|
||||
|
|
@ -1066,7 +1066,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
|
|||
/* 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 (!pci_vendor || !pci_device || q->match_codec_ssid) {
|
||||
if (hda_quirk_match(codec_vendor, codec_device, q)) {
|
||||
type = "codec SSID";
|
||||
goto found_device;
|
||||
|
|
|
|||
|
|
@ -276,6 +276,12 @@ static short find_control(u16 control_index,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (control_index >= p_cache->control_count) {
|
||||
HPI_DEBUG_LOG(VERBOSE, "control_index out of bounce %d\n",
|
||||
control_index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*pI = p_cache->p_info[control_index];
|
||||
if (!*pI) {
|
||||
HPI_DEBUG_LOG(VERBOSE, "Uncached Control %d\n",
|
||||
|
|
|
|||
|
|
@ -894,8 +894,9 @@ find_format_descriptor(struct usb_interface *interface)
|
|||
struct uac_format_type_i_discrete_descriptor *desc;
|
||||
|
||||
desc = (struct uac_format_type_i_discrete_descriptor *)extra;
|
||||
if (desc->bLength > extralen) {
|
||||
dev_err(&interface->dev, "descriptor overflow\n");
|
||||
if (desc->bLength < sizeof(struct usb_descriptor_header) ||
|
||||
desc->bLength > extralen) {
|
||||
dev_err(&interface->dev, "invalid descriptor length\n");
|
||||
return NULL;
|
||||
}
|
||||
if (desc->bLength == UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(1) &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user