Lines Matching refs:alpm
130 #define ALPM_LOCK(alpm) mtx_lock(&(alpm)->lock) argument
131 #define ALPM_UNLOCK(alpm) mtx_unlock(&(alpm)->lock) argument
132 #define ALPM_LOCK_ASSERT(alpm) mtx_assert(&(alpm)->lock, MA_OWNED) argument
134 #define ALPM_SMBINB(alpm,register) \ argument
135 (bus_space_read_1(alpm->smbst, alpm->smbsh, register))
136 #define ALPM_SMBOUTB(alpm,register,value) \ argument
137 (bus_space_write_1(alpm->smbst, alpm->smbsh, register, value))
159 struct alpm_softc *alpm; in alpm_attach() local
161 alpm = device_get_softc(dev); in alpm_attach()
209 alpm->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, in alpm_attach()
212 if (alpm->res == NULL) { in alpm_attach()
216 alpm->smbst = rman_get_bustag(alpm->res); in alpm_attach()
217 alpm->smbsh = rman_get_bushandle(alpm->res); in alpm_attach()
218 mtx_init(&alpm->lock, device_get_nameunit(dev), "alpm", MTX_DEF); in alpm_attach()
221 alpm->smbus = device_add_child(dev, "smbus", DEVICE_UNIT_ANY); in alpm_attach()
222 if (alpm->smbus == NULL) { in alpm_attach()
234 struct alpm_softc *alpm = device_get_softc(dev); in alpm_detach() local
241 mtx_destroy(&alpm->lock); in alpm_detach()
243 if (alpm->res) in alpm_detach()
244 bus_release_resource(dev, SYS_RES_IOPORT, SMBBA, alpm->res); in alpm_detach()
654 DRIVER_MODULE(alpm, pci, alpm_driver, 0, 0);
655 DRIVER_MODULE(smbus, alpm, smbus_driver, 0, 0);
656 MODULE_DEPEND(alpm, pci, 1, 1, 1);
657 MODULE_DEPEND(alpm, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
658 MODULE_VERSION(alpm, 1);