Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/pci/es137x.c
Show All 12 Lines | |||||
(devid == CT5880_PCI_ID && revid == CT5880REV_CT5880_E)) { | (devid == CT5880_PCI_ID && revid == CT5880REV_CT5880_E)) { | ||||
/* XXX: an user should be able to set this with a control tool, | /* XXX: an user should be able to set this with a control tool, | ||||
if not done before 7.0-RELEASE, this needs to be converted | if not done before 7.0-RELEASE, this needs to be converted | ||||
to a device specific sysctl "dev.pcm.X.yyy" via | to a device specific sysctl "dev.pcm.X.yyy" via | ||||
device_get_sysctl_*() as discussed on multimedia@ in msg-id | device_get_sysctl_*() as discussed on multimedia@ in msg-id | ||||
<861wujij2q.fsf@xps.des.no> */ | <861wujij2q.fsf@xps.des.no> */ | ||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | ||||
"spdif_enabled", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), | "spdif_enabled", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
sysctl_es137x_spdif_enable, "I", | dev, sizeof(dev), sysctl_es137x_spdif_enable, "I", | ||||
kaktus: MPSAFE | |||||
"Enable S/PDIF output on primary playback channel"); | "Enable S/PDIF output on primary playback channel"); | ||||
} else if (devid == ES1370_PCI_ID) { | } else if (devid == ES1370_PCI_ID) { | ||||
/* | /* | ||||
* Enable fixed rate sysctl if both DAC2 / ADC enabled. | * Enable fixed rate sysctl if both DAC2 / ADC enabled. | ||||
*/ | */ | ||||
if (es->ch[ES_DAC2].channel != NULL && | if (es->ch[ES_DAC2].channel != NULL && | ||||
es->ch[ES_ADC].channel != NULL) { | es->ch[ES_ADC].channel != NULL) { | ||||
/* XXX: an user should be able to set this with a control tool, | /* XXX: an user should be able to set this with a control tool, | ||||
if not done before 7.0-RELEASE, this needs to be converted | if not done before 7.0-RELEASE, this needs to be converted | ||||
to a device specific sysctl "dev.pcm.X.yyy" via | to a device specific sysctl "dev.pcm.X.yyy" via | ||||
device_get_sysctl_*() as discussed on multimedia@ in msg-id | device_get_sysctl_*() as discussed on multimedia@ in msg-id | ||||
<861wujij2q.fsf@xps.des.no> */ | <861wujij2q.fsf@xps.des.no> */ | ||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), | SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), | ||||
OID_AUTO, "fixed_rate", CTLTYPE_INT | CTLFLAG_RW, | OID_AUTO, "fixed_rate", | ||||
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | |||||
kaktusAuthorUnsubmitted Done Inline ActionsMPSAFE kaktus: MPSAFE | |||||
dev, sizeof(dev), sysctl_es137x_fixed_rate, "I", | dev, sizeof(dev), sysctl_es137x_fixed_rate, "I", | ||||
"Enable fixed rate playback/recording"); | "Enable fixed rate playback/recording"); | ||||
} | } | ||||
/* | /* | ||||
* Enable single pcm mixer sysctl if both DAC1/2 enabled. | * Enable single pcm mixer sysctl if both DAC1/2 enabled. | ||||
*/ | */ | ||||
if (es->ch[ES_DAC1].channel != NULL && | if (es->ch[ES_DAC1].channel != NULL && | ||||
es->ch[ES_DAC2].channel != NULL) { | es->ch[ES_DAC2].channel != NULL) { | ||||
/* XXX: an user should be able to set this with a control tool, | /* XXX: an user should be able to set this with a control tool, | ||||
if not done before 7.0-RELEASE, this needs to be converted | if not done before 7.0-RELEASE, this needs to be converted | ||||
to a device specific sysctl "dev.pcm.X.yyy" via | to a device specific sysctl "dev.pcm.X.yyy" via | ||||
device_get_sysctl_*() as discussed on multimedia@ in msg-id | device_get_sysctl_*() as discussed on multimedia@ in msg-id | ||||
<861wujij2q.fsf@xps.des.no> */ | <861wujij2q.fsf@xps.des.no> */ | ||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), | SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), | ||||
OID_AUTO, "single_pcm_mixer", | OID_AUTO, "single_pcm_mixer", | ||||
CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, | ||||
sysctl_es137x_single_pcm_mixer, "I", | sizeof(dev), sysctl_es137x_single_pcm_mixer, "I", | ||||
kaktusAuthorUnsubmitted Done Inline ActionsMPSAFE kaktus: MPSAFE | |||||
"Single PCM mixer controller for both DAC1/DAC2"); | "Single PCM mixer controller for both DAC1/DAC2"); | ||||
} | } | ||||
} | } | ||||
if (resource_int_value(device_get_name(dev), device_get_unit(dev), | if (resource_int_value(device_get_name(dev), device_get_unit(dev), | ||||
"latency_timer", &r) == 0 && !(r < 0 || r > 255)) | "latency_timer", &r) == 0 && !(r < 0 || r > 255)) | ||||
pci_write_config(dev, PCIR_LATTIMER, r, 1); | pci_write_config(dev, PCIR_LATTIMER, r, 1); | ||||
/* XXX: this needs to be converted to a device specific sysctl | /* XXX: this needs to be converted to a device specific sysctl | ||||
"dev.pcm.X.yyy" via device_get_sysctl_*() as discussed on | "dev.pcm.X.yyy" via device_get_sysctl_*() as discussed on | ||||
multimedia@ in msg-id <861wujij2q.fsf@xps.des.no> */ | multimedia@ in msg-id <861wujij2q.fsf@xps.des.no> */ | ||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | ||||
"latency_timer", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), | "latency_timer", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
sysctl_es137x_latency_timer, "I", | dev, sizeof(dev), sysctl_es137x_latency_timer, "I", | ||||
kaktusAuthorUnsubmitted Done Inline ActionsMPSAFE kaktus: MPSAFE | |||||
"PCI Latency Timer configuration"); | "PCI Latency Timer configuration"); | ||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | ||||
"polling", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), | "polling", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, | ||||
sysctl_es_polling, "I", | sizeof(dev), sysctl_es_polling, "I", "Enable polling mode"); | ||||
kaktusAuthorUnsubmitted Done Inline ActionsMPSAFE kaktus: MPSAFE | |||||
"Enable polling mode"); | |||||
} | } | ||||
static int | static int | ||||
es_pci_attach(device_t dev) | es_pci_attach(device_t dev) | ||||
{ | { | ||||
struct es_info *es = NULL; | struct es_info *es = NULL; | ||||
int mapped, i, numplay, dac_cfg; | int mapped, i, numplay, dac_cfg; | ||||
char status[SND_STATUSLEN]; | char status[SND_STATUSLEN]; | ||||
Show All 12 Lines |
MPSAFE