• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/viapm/

Lines Matching refs:viapm

77 	((u_char)bus_read_1(viapm->iores, port))
79 (bus_write_1(viapm->iores, port, (u_char)(val)))
190 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
198 bzero(viapm, sizeof(struct viapm_softc));
203 viapm->type = VIAPM_TYP_586B_3040E;
204 viapm->iorid = VIAPM_586B_3040E_BASE;
214 viapm->type = VIAPM_TYP_586B_3040F;
215 viapm->iorid = VIAPM_586B_3040F_BASE;
223 viapm->base = pci_read_config(dev, viapm->iorid, 4) &
230 if (bus_set_resource(dev, SYS_RES_IOPORT, viapm->iorid,
231 viapm->base, 256)) {
248 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
258 viapm->type = VIAPM_TYP_596B;
264 viapm->type = VIAPM_TYP_596B;
270 viapm->type = VIAPM_TYP_686A;
277 viapm->type = VIAPM_TYP_UNKNOWN;
283 viapm->type = VIAPM_TYP_UNKNOWN;
289 viapm->type = VIAPM_TYP_UNKNOWN;
295 viapm->type = VIAPM_TYP_UNKNOWN;
313 viapm->base = pci_read_config(dev, base_cfgreg, 4) & VIAPM_PRO_BA_MASK;
319 viapm->iorid = base_cfgreg;
320 if (bus_set_resource(dev, SYS_RES_IOPORT, viapm->iorid,
321 viapm->base, 16)) {
323 viapm->base);
328 device_printf(dev, "SMBus I/O base at 0x%x\n", viapm->base);
344 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
347 mtx_init(&viapm->lock, device_get_nameunit(dev), "viapm", MTX_DEF);
348 if (!(viapm->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
349 &viapm->iorid, RF_ACTIVE))) {
359 viapm->irqrid = 0;
360 if (!(viapm->irqres = bus_alloc_resource(dev, SYS_RES_IRQ,
361 &viapm->irqrid, 9, 9, 1,
367 if (bus_setup_intr(dev, viapm->irqres, INTR_TYPE_MISC | INTR_MPSAFE,
368 (driver_intr_t *) viasmb_intr, viapm, &viapm->irqih)) {
379 viapm->smbus = device_add_child(dev, "smbus", -1);
405 if (viapm->iores)
406 bus_release_resource(dev, SYS_RES_IOPORT, viapm->iorid, viapm->iores);
408 if (viapm->irqres)
409 bus_release_resource(dev, SYS_RES_IRQ, viapm->irqrid, viapm->irqres);
411 mtx_destroy(&viapm->lock);
419 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
421 mtx_init(&viapm->lock, device_get_nameunit(dev), "viapm", MTX_DEF);
422 if (!(viapm->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
423 &viapm->iorid, RF_ACTIVE | RF_SHAREABLE))) {
431 if (!(viapm->iicbb = device_add_child(dev, "iicbb", -1)))
439 if (viapm->iores)
441 viapm->iorid, viapm->iores);
442 mtx_destroy(&viapm->lock);
449 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
452 if (viapm->iicbb) {
453 device_delete_child(dev, viapm->iicbb);
456 if (viapm->iores)
457 bus_release_resource(dev, SYS_RES_IOPORT, viapm->iorid,
458 viapm->iores);
459 mtx_destroy(&viapm->lock);
467 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
470 if (viapm->smbus) {
471 device_delete_child(dev, viapm->smbus);
474 bus_release_resource(dev, SYS_RES_IOPORT, viapm->iorid, viapm->iores);
477 bus_release_resource(dev, SYS_RES_IRQ, viapm->irqrid, viapm->irqres);
479 mtx_destroy(&viapm->lock);
493 struct viapm_softc *viapm = device_get_softc(dev);
496 VIAPM_LOCK(viapm);
505 VIAPM_UNLOCK(viapm);
513 struct viapm_softc *viapm = device_get_softc(dev);
516 VIAPM_LOCK(viapm);
525 VIAPM_UNLOCK(viapm);
543 struct viapm_softc *viapm = device_get_softc(dev);
546 VIAPM_LOCK(viapm);
548 VIAPM_UNLOCK(viapm);
555 struct viapm_softc *viapm = device_get_softc(dev);
558 VIAPM_LOCK(viapm);
560 VIAPM_UNLOCK(viapm);
565 viapm_abort(struct viapm_softc *viapm)
574 viapm_clear(struct viapm_softc *viapm)
584 viapm_busy(struct viapm_softc *viapm)
590 VIAPM_DEBUG(printf("viapm: idle? STS=0x%x\n", sts));
599 viapm_wait(struct viapm_softc *viapm)
605 VIAPM_LOCK_ASSERT(viapm);
617 VIAPM_DEBUG(printf("viapm: SMBHST=0x%x\n", sts));
634 viapm_abort(viapm);
636 viapm_clear(viapm);
661 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
664 VIAPM_LOCK(viapm);
665 viapm_clear(viapm);
666 if (viapm_busy(viapm)) {
667 VIAPM_UNLOCK(viapm);
673 VIAPM_DEBUG(printf("viapm: QWRITE to 0x%x", slave));
677 VIAPM_DEBUG(printf("viapm: QREAD to 0x%x", slave));
686 error = viapm_wait(viapm);
687 VIAPM_UNLOCK(viapm);
695 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
698 VIAPM_LOCK(viapm);
699 viapm_clear(viapm);
700 if (viapm_busy(viapm)) {
701 VIAPM_UNLOCK(viapm);
710 error = viapm_wait(viapm);
712 VIAPM_DEBUG(printf("viapm: SENDB to 0x%x, byte=0x%x, error=0x%x\n", slave, byte, error));
713 VIAPM_UNLOCK(viapm);
721 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
724 VIAPM_LOCK(viapm);
725 viapm_clear(viapm);
726 if (viapm_busy(viapm)) {
727 VIAPM_UNLOCK(viapm);
735 if ((error = viapm_wait(viapm)) == SMB_ENOERR)
738 VIAPM_DEBUG(printf("viapm: RECVB from 0x%x, byte=0x%x, error=0x%x\n", slave, *byte, error));
739 VIAPM_UNLOCK(viapm);
747 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
750 VIAPM_LOCK(viapm);
751 viapm_clear(viapm);
752 if (viapm_busy(viapm)) {
753 VIAPM_UNLOCK(viapm);
763 error = viapm_wait(viapm);
765 VIAPM_DEBUG(printf("viapm: WRITEB to 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, byte, error));
766 VIAPM_UNLOCK(viapm);
774 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
777 VIAPM_LOCK(viapm);
778 viapm_clear(viapm);
779 if (viapm_busy(viapm)) {
780 VIAPM_UNLOCK(viapm);
789 if ((error = viapm_wait(viapm)) == SMB_ENOERR)
792 VIAPM_DEBUG(printf("viapm: READB from 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, *byte, error));
793 VIAPM_UNLOCK(viapm);
801 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
804 VIAPM_LOCK(viapm);
805 viapm_clear(viapm);
806 if (viapm_busy(viapm)) {
807 VIAPM_UNLOCK(viapm);
818 error = viapm_wait(viapm);
820 VIAPM_DEBUG(printf("viapm: WRITEW to 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, word, error));
821 VIAPM_UNLOCK(viapm);
829 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
833 VIAPM_LOCK(viapm);
834 viapm_clear(viapm);
835 if (viapm_busy(viapm)) {
836 VIAPM_UNLOCK(viapm);
845 if ((error = viapm_wait(viapm)) == SMB_ENOERR) {
852 VIAPM_DEBUG(printf("viapm: READW from 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, *word, error));
853 VIAPM_UNLOCK(viapm);
861 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
868 VIAPM_LOCK(viapm);
869 viapm_clear(viapm);
870 if (viapm_busy(viapm)) {
871 VIAPM_UNLOCK(viapm);
888 error = viapm_wait(viapm);
890 VIAPM_DEBUG(printf("viapm: WRITEBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error));
891 VIAPM_UNLOCK(viapm);
900 struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
907 VIAPM_LOCK(viapm);
908 viapm_clear(viapm);
909 if (viapm_busy(viapm)) {
910 VIAPM_UNLOCK(viapm);
918 if ((error = viapm_wait(viapm)) != SMB_ENOERR)
934 VIAPM_DEBUG(printf("viapm: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, *count, cmd, error));
935 VIAPM_UNLOCK(viapm);
966 "viapm",
1006 DRIVER_MODULE(viapm, pci, viapm_driver, viapm_devclass, 0, 0);
1008 DRIVER_MODULE(iicbb, viapm, iicbb_driver, iicbb_devclass, 0, 0);
1011 MODULE_DEPEND(viapm, pci, 1, 1, 1);
1013 MODULE_DEPEND(viapm, iicbb, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER);
1015 MODULE_VERSION(viapm, 1);
1018 DRIVER_MODULE(isa, viapm, isa_driver, isa_devclass, 0, 0);
1020 MODULE_DEPEND(viapm, isa, 1, 1, 1);