[ig4] Give common name to PCI and ACPI device drivers
They share common device driver code with different bus attachments This commit starts a bunch of changes which have following properties: Reviewed by: imp (previous version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22016
This commit is contained in:
parent
e55890a9b8
commit
984ed3e493
@ -69,7 +69,7 @@ chromebook_i2c_identify(driver_t *driver, device_t bus)
|
||||
* See http://lxr.free-electrons.com/source/drivers/platform/chrome/chromeos_laptop.c
|
||||
*/
|
||||
controller = device_get_parent(bus);
|
||||
if (strcmp(device_get_name(controller), "ig4iic_pci") != 0)
|
||||
if (strcmp(device_get_name(controller), "ig4iic") != 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < nitems(slaves); i++) {
|
||||
|
@ -163,15 +163,10 @@ static device_method_t ig4iic_acpi_methods[] = {
|
||||
};
|
||||
|
||||
static driver_t ig4iic_acpi_driver = {
|
||||
"ig4iic_acpi",
|
||||
"ig4iic",
|
||||
ig4iic_acpi_methods,
|
||||
sizeof(struct ig4iic_softc),
|
||||
};
|
||||
|
||||
static devclass_t ig4iic_acpi_devclass;
|
||||
DRIVER_MODULE(ig4iic_acpi, acpi, ig4iic_acpi_driver, ig4iic_acpi_devclass, 0, 0);
|
||||
|
||||
MODULE_DEPEND(ig4iic_acpi, acpi, 1, 1, 1);
|
||||
MODULE_DEPEND(ig4iic_acpi, pci, 1, 1, 1);
|
||||
MODULE_DEPEND(ig4iic_acpi, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
|
||||
MODULE_VERSION(ig4iic_acpi, 1);
|
||||
DRIVER_MODULE(ig4iic, acpi, ig4iic_acpi_driver, ig4iic_devclass, 0, 0);
|
||||
MODULE_DEPEND(ig4iic, acpi, 1, 1, 1);
|
||||
|
@ -797,5 +797,8 @@ ig4iic_dump(ig4iic_softc_t *sc)
|
||||
}
|
||||
#undef REGDUMP
|
||||
|
||||
DRIVER_MODULE(iicbus, ig4iic_acpi, iicbus_driver, iicbus_devclass, NULL, NULL);
|
||||
DRIVER_MODULE(iicbus, ig4iic_pci, iicbus_driver, iicbus_devclass, NULL, NULL);
|
||||
devclass_t ig4iic_devclass;
|
||||
|
||||
DRIVER_MODULE(iicbus, ig4iic, iicbus_driver, iicbus_devclass, NULL, NULL);
|
||||
MODULE_DEPEND(ig4iic, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
|
||||
MODULE_VERSION(ig4iic, 1);
|
||||
|
@ -220,17 +220,13 @@ static device_method_t ig4iic_pci_methods[] = {
|
||||
};
|
||||
|
||||
static driver_t ig4iic_pci_driver = {
|
||||
"ig4iic_pci",
|
||||
"ig4iic",
|
||||
ig4iic_pci_methods,
|
||||
sizeof(struct ig4iic_softc)
|
||||
};
|
||||
|
||||
static devclass_t ig4iic_pci_devclass;
|
||||
|
||||
DRIVER_MODULE_ORDERED(ig4iic_pci, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0,
|
||||
DRIVER_MODULE_ORDERED(ig4iic, pci, ig4iic_pci_driver, ig4iic_devclass, 0, 0,
|
||||
SI_ORDER_ANY);
|
||||
MODULE_DEPEND(ig4iic_pci, pci, 1, 1, 1);
|
||||
MODULE_DEPEND(ig4iic_pci, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);
|
||||
MODULE_VERSION(ig4iic_pci, 1);
|
||||
MODULE_PNP_INFO("W32:vendor/device", pci, ig4iic_pci, ig4iic_pci_devices,
|
||||
MODULE_DEPEND(ig4iic, pci, 1, 1, 1);
|
||||
MODULE_PNP_INFO("W32:vendor/device", pci, ig4iic, ig4iic_pci_devices,
|
||||
nitems(ig4iic_pci_devices));
|
||||
|
@ -101,6 +101,8 @@ struct ig4iic_softc {
|
||||
|
||||
typedef struct ig4iic_softc ig4iic_softc_t;
|
||||
|
||||
extern devclass_t ig4iic_devclass;
|
||||
|
||||
/* Attach/Detach called from ig4iic_pci_*() */
|
||||
int ig4iic_attach(ig4iic_softc_t *sc);
|
||||
int ig4iic_detach(ig4iic_softc_t *sc);
|
||||
|
Loading…
Reference in New Issue
Block a user