Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/pci/hda/hdaa.c
Show First 20 Lines • Show All 413 Lines • ▼ Show 20 Lines | if (ctl != NULL && ctl->mute) { | ||||
if (val != w->wclass.pin.ctrl) { | if (val != w->wclass.pin.ctrl) { | ||||
w->wclass.pin.ctrl = val; | w->wclass.pin.ctrl = val; | ||||
hda_command(devinfo->dev, | hda_command(devinfo->dev, | ||||
HDA_CMD_SET_PIN_WIDGET_CTRL(0, | HDA_CMD_SET_PIN_WIDGET_CTRL(0, | ||||
w->nid, w->wclass.pin.ctrl)); | w->nid, w->wclass.pin.ctrl)); | ||||
} | } | ||||
} | } | ||||
/* (Un)Mute other pins. */ | /* (Un)Mute other pins. */ | ||||
for (j = 0; j < 15; j++) { | for (j = 0; j < 14; j++) { | ||||
if (as->pins[j] <= 0) | if (as->pins[j] <= 0) | ||||
continue; | continue; | ||||
ctl = hdaa_audio_ctl_amp_get(devinfo, | ctl = hdaa_audio_ctl_amp_get(devinfo, | ||||
as->pins[j], HDAA_CTL_IN, -1, 1); | as->pins[j], HDAA_CTL_IN, -1, 1); | ||||
if (ctl != NULL && ctl->mute) { | if (ctl != NULL && ctl->mute) { | ||||
/* If pin has muter - use it. */ | /* If pin has muter - use it. */ | ||||
val = connected ? 1 : 0; | val = connected ? 1 : 0; | ||||
if (val == ctl->forcemute) | if (val == ctl->forcemute) | ||||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | HDA_BOOTVERBOSE( | ||||
if (connected || old != 2) { | if (connected || old != 2) { | ||||
device_printf(devinfo->dev, | device_printf(devinfo->dev, | ||||
"Pin sense: nid=%d sense=0x%08x (%sconnected)\n", | "Pin sense: nid=%d sense=0x%08x (%sconnected)\n", | ||||
w->nid, res, !connected ? "dis" : ""); | w->nid, res, !connected ? "dis" : ""); | ||||
} | } | ||||
); | ); | ||||
as = &devinfo->as[w->bindas]; | as = &devinfo->as[w->bindas]; | ||||
if (as->hpredir >= 0 && as->pins[15] == w->nid) | if (as->hpredir >= 0 && | ||||
(as->pins[15] == w->nid || as->pins[14] == w->nid)) | |||||
hdaa_hpredir_handler(w); | hdaa_hpredir_handler(w); | ||||
if (as->dir == HDAA_CTL_IN && old != 2) | if (as->dir == HDAA_CTL_IN && old != 2) | ||||
hdaa_autorecsrc_handler(as, w); | hdaa_autorecsrc_handler(as, w); | ||||
if (old != 2) | if (old != 2) | ||||
hdaa_channels_handler(as); | hdaa_channels_handler(as); | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) { | ||||
w->unsol = HDAC_UNSOL_ALLOC( | w->unsol = HDAC_UNSOL_ALLOC( | ||||
device_get_parent(devinfo->dev), | device_get_parent(devinfo->dev), | ||||
devinfo->dev, w->nid); | devinfo->dev, w->nid); | ||||
hda_command(devinfo->dev, | hda_command(devinfo->dev, | ||||
HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, | HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, | ||||
HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | w->unsol)); | HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | w->unsol)); | ||||
} | } | ||||
as = &devinfo->as[w->bindas]; | as = &devinfo->as[w->bindas]; | ||||
if (as->hpredir >= 0 && as->pins[15] == w->nid) { | if (as->hpredir >= 0 && | ||||
(as->pins[15] == w->nid || as->pins[14] == w->nid)) { | |||||
if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || | if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || | ||||
(HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) { | (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) { | ||||
device_printf(devinfo->dev, | device_printf(devinfo->dev, | ||||
"No presence detection support at nid %d\n", | "No presence detection support at nid %d\n", | ||||
w->nid); | w->nid); | ||||
} else { | } else { | ||||
if (w->unsol < 0) | if (w->unsol < 0) | ||||
poll = 1; | poll = 1; | ||||
▲ Show 20 Lines • Show All 2,489 Lines • ▼ Show 20 Lines | for (i = devinfo->startnode; i < devinfo->endnode; i++) { | ||||
} | } | ||||
if (as[cnt].location == -1) { | if (as[cnt].location == -1) { | ||||
as[cnt].location = | as[cnt].location = | ||||
HDA_CONFIG_DEFAULTCONF_LOCATION(w->wclass.pin.config); | HDA_CONFIG_DEFAULTCONF_LOCATION(w->wclass.pin.config); | ||||
} else if (as[cnt].location != | } else if (as[cnt].location != | ||||
HDA_CONFIG_DEFAULTCONF_LOCATION(w->wclass.pin.config)) { | HDA_CONFIG_DEFAULTCONF_LOCATION(w->wclass.pin.config)) { | ||||
as[cnt].location = -2; | as[cnt].location = -2; | ||||
} | } | ||||
/* Headphones with seq=15 may mean redirection. */ | /* | ||||
* Headphones with seq == 15 (or 14) may mean | |||||
* redirection. | |||||
*/ | |||||
if (type == HDA_CONFIG_DEFAULTCONF_DEVICE_HP_OUT && | if (type == HDA_CONFIG_DEFAULTCONF_DEVICE_HP_OUT && | ||||
seq == 15) | (seq == 15 || seq == 14)) | ||||
hpredir = 1; | hpredir = 1; | ||||
as[cnt].pins[seq] = w->nid; | as[cnt].pins[seq] = w->nid; | ||||
as[cnt].pincnt++; | as[cnt].pincnt++; | ||||
/* Association 15 is a multiple unassociated pins. */ | /* Association 15 is a multiple unassociated pins. */ | ||||
if (j == 15) | if (j == 15) | ||||
cnt++; | cnt++; | ||||
} | } | ||||
if (j != 15 && as[cnt].pincnt > 0) { | if (j != 15 && as[cnt].pincnt > 0) { | ||||
▲ Show 20 Lines • Show All 275 Lines • ▼ Show 20 Lines | hdaa_audio_trace_as_out(struct hdaa_devinfo *devinfo, int as, int seq) | ||||
/* Find next pin */ | /* Find next pin */ | ||||
for (i = seq; i < 16 && ases[as].pins[i] == 0; i++) | for (i = seq; i < 16 && ases[as].pins[i] == 0; i++) | ||||
; | ; | ||||
/* Check if there is no any left. If so - we succeeded. */ | /* Check if there is no any left. If so - we succeeded. */ | ||||
if (i == 16) | if (i == 16) | ||||
return (1); | return (1); | ||||
hpredir = (i == 15 && ases[as].fakeredir == 0)?ases[as].hpredir:-1; | hpredir = ((i == 15 || i == 14) && | ||||
ases[as].fakeredir == 0) ? ases[as].hpredir : -1; | |||||
min = 0; | min = 0; | ||||
do { | do { | ||||
HDA_BOOTHVERBOSE( | HDA_BOOTHVERBOSE( | ||||
device_printf(devinfo->dev, | device_printf(devinfo->dev, | ||||
" Tracing pin %d with min nid %d", | " Tracing pin %d with min nid %d", | ||||
ases[as].pins[i], min); | ases[as].pins[i], min); | ||||
if (hpredir >= 0) | if (hpredir >= 0) | ||||
printf(" and hpredir %d", hpredir); | printf(" and hpredir %d", hpredir); | ||||
▲ Show 20 Lines • Show All 1,743 Lines • ▼ Show 20 Lines | if (ret == 0) { | ||||
pcmcap = w->param.supp_pcm_size_rate; | pcmcap = w->param.supp_pcm_size_rate; | ||||
} else { | } else { | ||||
fmtcap &= cap; | fmtcap &= cap; | ||||
pcmcap &= w->param.supp_pcm_size_rate; | pcmcap &= w->param.supp_pcm_size_rate; | ||||
} | } | ||||
ch->io[ret++] = as[ch->as].dacs[ch->asindex][i]; | ch->io[ret++] = as[ch->as].dacs[ch->asindex][i]; | ||||
ch->stripecap &= w->wclass.conv.stripecap; | ch->stripecap &= w->wclass.conv.stripecap; | ||||
/* Do not count redirection pin/dac channels. */ | /* Do not count redirection pin/dac channels. */ | ||||
if (i == 15 && as[ch->as].hpredir >= 0) | if ((i == 15 || i == 14) && as[ch->as].hpredir >= 0) | ||||
continue; | continue; | ||||
channels += HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) + 1; | channels += HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) + 1; | ||||
if (HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) != 1) | if (HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) != 1) | ||||
onlystereo = 0; | onlystereo = 0; | ||||
pinset |= (1 << i); | pinset |= (1 << i); | ||||
} | } | ||||
ch->io[ret] = -1; | ch->io[ret] = -1; | ||||
ch->channels = channels; | ch->channels = channels; | ||||
▲ Show 20 Lines • Show All 1,817 Lines • Show Last 20 Lines |