Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sound/pci/hda/hdaa.c
Show First 20 Lines • Show All 6,732 Lines • ▼ Show 20 Lines | if (pdevinfo->recas >= 0) { | ||||
} | } | ||||
} | } | ||||
retval += bus_print_child_footer(dev, child); | retval += bus_print_child_footer(dev, child); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
static int | static int | ||||
hdaa_child_location_str(device_t dev, device_t child, char *buf, | hdaa_child_location(device_t dev, device_t child, struct sbuf *sb) | ||||
size_t buflen) | |||||
{ | { | ||||
struct hdaa_devinfo *devinfo = device_get_softc(dev); | struct hdaa_devinfo *devinfo = device_get_softc(dev); | ||||
struct hdaa_pcm_devinfo *pdevinfo = | struct hdaa_pcm_devinfo *pdevinfo = | ||||
(struct hdaa_pcm_devinfo *)device_get_ivars(child); | (struct hdaa_pcm_devinfo *)device_get_ivars(child); | ||||
struct hdaa_audio_as *as; | struct hdaa_audio_as *as; | ||||
int first = 1, i, len = 0; | int first = 1, i; | ||||
len += snprintf(buf + len, buflen - len, "nid="); | sbuf_printf(sb, "nid="); | ||||
if (pdevinfo->playas >= 0) { | if (pdevinfo->playas >= 0) { | ||||
as = &devinfo->as[pdevinfo->playas]; | as = &devinfo->as[pdevinfo->playas]; | ||||
for (i = 0; i < 16; i++) { | for (i = 0; i < 16; i++) { | ||||
if (as->pins[i] <= 0) | if (as->pins[i] <= 0) | ||||
continue; | continue; | ||||
len += snprintf(buf + len, buflen - len, | sbuf_printf(sb, "%s%d", first ? "" : ",", as->pins[i]); | ||||
"%s%d", first ? "" : ",", as->pins[i]); | |||||
first = 0; | first = 0; | ||||
} | } | ||||
} | } | ||||
if (pdevinfo->recas >= 0) { | if (pdevinfo->recas >= 0) { | ||||
as = &devinfo->as[pdevinfo->recas]; | as = &devinfo->as[pdevinfo->recas]; | ||||
for (i = 0; i < 16; i++) { | for (i = 0; i < 16; i++) { | ||||
if (as->pins[i] <= 0) | if (as->pins[i] <= 0) | ||||
continue; | continue; | ||||
len += snprintf(buf + len, buflen - len, | sbuf_printf(sb, "%s%d", first ? "" : ",", as->pins[i]); | ||||
"%s%d", first ? "" : ",", as->pins[i]); | |||||
first = 0; | first = 0; | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
hdaa_stream_intr(device_t dev, int dir, int stream) | hdaa_stream_intr(device_t dev, int dir, int stream) | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | static device_method_t hdaa_methods[] = { | ||||
/* device interface */ | /* device interface */ | ||||
DEVMETHOD(device_probe, hdaa_probe), | DEVMETHOD(device_probe, hdaa_probe), | ||||
DEVMETHOD(device_attach, hdaa_attach), | DEVMETHOD(device_attach, hdaa_attach), | ||||
DEVMETHOD(device_detach, hdaa_detach), | DEVMETHOD(device_detach, hdaa_detach), | ||||
DEVMETHOD(device_suspend, hdaa_suspend), | DEVMETHOD(device_suspend, hdaa_suspend), | ||||
DEVMETHOD(device_resume, hdaa_resume), | DEVMETHOD(device_resume, hdaa_resume), | ||||
/* Bus interface */ | /* Bus interface */ | ||||
DEVMETHOD(bus_print_child, hdaa_print_child), | DEVMETHOD(bus_print_child, hdaa_print_child), | ||||
DEVMETHOD(bus_child_location_str, hdaa_child_location_str), | DEVMETHOD(bus_child_location, hdaa_child_location), | ||||
DEVMETHOD(hdac_stream_intr, hdaa_stream_intr), | DEVMETHOD(hdac_stream_intr, hdaa_stream_intr), | ||||
DEVMETHOD(hdac_unsol_intr, hdaa_unsol_intr), | DEVMETHOD(hdac_unsol_intr, hdaa_unsol_intr), | ||||
DEVMETHOD(hdac_pindump, hdaa_pindump), | DEVMETHOD(hdac_pindump, hdaa_pindump), | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
static driver_t hdaa_driver = { | static driver_t hdaa_driver = { | ||||
"hdaa", | "hdaa", | ||||
▲ Show 20 Lines • Show All 316 Lines • Show Last 20 Lines |