/*- * Copyright (c) 2023 Sergey Tyuryukanov * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include "opt_platform.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "generic_ohci.h" static const struct acpi_compat_data compat_data[] = { {"generic-ohci", 1}, { NULL, 0 } }; static int generic_ohci_acpi_probe(device_t self) { ACPI_HANDLE h; if ((h = acpi_get_handle(self)) == NULL || !acpi_MatchHid(h, "PRP0001")) return (ENXIO); if (acpi_dsd_search_compatible(self, compat_data)->acd_data == 0) return (ENXIO); device_set_desc(self, "Generic EHCI Controller"); return (BUS_PROBE_DEFAULT); } static device_method_t ohci_acpi_methods[] = { /* Device interface */ DEVMETHOD(device_probe, generic_ohci_acpi_probe), DEVMETHOD_END }; DEFINE_CLASS_1(ohci, ohci_acpi_driver, ohci_acpi_methods, sizeof(ohci_softc_t), generic_ohci_driver); static devclass_t ohci_acpi_devclass; DRIVER_MODULE(ohci, acpi, ohci_acpi_driver, ohci_acpi_devclass, 0, 0); MODULE_DEPEND(ohci, usb, 1, 1, 1);