Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/pci/hda/hdaa.c
Show First 20 Lines • Show All 6,457 Lines • ▼ Show 20 Lines | hdaa_sysctl_reconfig(SYSCTL_HANDLER_ARGS) | ||||
val = 0; | val = 0; | ||||
error = sysctl_handle_int(oidp, &val, 0, req); | error = sysctl_handle_int(oidp, &val, 0, req); | ||||
if (error != 0 || req->newptr == NULL || val == 0) | if (error != 0 || req->newptr == NULL || val == 0) | ||||
return (error); | return (error); | ||||
HDA_BOOTHVERBOSE( | HDA_BOOTHVERBOSE( | ||||
device_printf(dev, "Reconfiguration...\n"); | device_printf(dev, "Reconfiguration...\n"); | ||||
); | ); | ||||
if ((error = device_delete_children(dev)) != 0) | |||||
bus_topo_lock(); | |||||
if ((error = device_delete_children(dev)) != 0) { | |||||
bus_topo_unlock(); | |||||
return (error); | return (error); | ||||
} | |||||
hdaa_lock(devinfo); | hdaa_lock(devinfo); | ||||
hdaa_unconfigure(dev); | hdaa_unconfigure(dev); | ||||
hdaa_configure(dev); | hdaa_configure(dev); | ||||
hdaa_unlock(devinfo); | hdaa_unlock(devinfo); | ||||
bus_generic_attach(dev); | bus_generic_attach(dev); | ||||
bus_topo_unlock(); | |||||
HDA_BOOTHVERBOSE( | HDA_BOOTHVERBOSE( | ||||
device_printf(dev, "Reconfiguration done\n"); | device_printf(dev, "Reconfiguration done\n"); | ||||
); | ); | ||||
bus_topo_unlock(); | |||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
hdaa_suspend(device_t dev) | hdaa_suspend(device_t dev) | ||||
{ | { | ||||
struct hdaa_devinfo *devinfo = device_get_softc(dev); | struct hdaa_devinfo *devinfo = device_get_softc(dev); | ||||
int i; | int i; | ||||
▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), | ||||
"gpo_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, | "gpo_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, | ||||
devinfo, 0, hdaa_sysctl_gpo_state, "A", "GPO state"); | devinfo, 0, hdaa_sysctl_gpo_state, "A", "GPO state"); | ||||
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, | ||||
"gpo_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, | "gpo_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, | ||||
devinfo, 0, hdaa_sysctl_gpo_config, "A", "GPO configuration"); | devinfo, 0, hdaa_sysctl_gpo_config, "A", "GPO 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, | ||||
"reconfig", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | "reconfig", CTLTYPE_INT | CTLFLAG_RW, | ||||
dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); | dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); | ||||
SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), | SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | ||||
"init_clear", CTLFLAG_RW, | "init_clear", CTLFLAG_RW, | ||||
&devinfo->init_clear, 1,"Clear initial pin widget configuration"); | &devinfo->init_clear, 1,"Clear initial pin widget configuration"); | ||||
bus_generic_attach(dev); | bus_generic_attach(dev); | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 474 Lines • Show Last 20 Lines |