void rbox_dio_attach(struct device *parent, struct device *self, void *aux) { struct rbox_softc *sc = (struct rbox_softc *)self; struct dio_attach_args *da = aux; struct diofbreg *fbr; sc->sc_scode = da->da_scode; if (sc->sc_scode == conscode) { fbr = (struct diofbreg *)conaddr; /* already mapped */ sc->sc_fb = &diofb_cn; } else { sc->sc_fb = &sc->sc_fb_store; fbr = (struct diofbreg *) iomap(dio_scodetopa(sc->sc_scode), da->da_size); if (fbr == NULL || rbox_reset(sc->sc_fb, sc->sc_scode, fbr) != 0) { printf(": can't map framebuffer\n"); return; } } diofb_end_attach(sc, &rbox_accessops, sc->sc_fb, sc->sc_scode == conscode, NULL); }
void gbox_dio_attach(device_t parent, device_t self, void *aux) { struct gbox_softc *sc = device_private(self); struct dio_attach_args *da = aux; bus_space_handle_t bsh; struct diofbreg * fbr; sc->sc_dev = self; sc->sc_scode = da->da_scode; if (sc->sc_scode == conscode) { fbr = (struct diofbreg *)conaddr; /* already mapped */ sc->sc_fb = &diofb_cn; } else { sc->sc_fb = &sc->sc_fb_store; if (bus_space_map(da->da_bst, da->da_addr, da->da_size, 0, &bsh)) { aprint_error(": can't map framebuffer\n"); return; } fbr = bus_space_vaddr(da->da_bst, bsh); if (gbox_reset(sc->sc_fb, sc->sc_scode, fbr) != 0) { aprint_error(": can't reset framebuffer\n"); return; } } diofb_end_attach(self, &gbox_accessops, sc->sc_fb, sc->sc_scode == conscode, NULL); }
void rbox_intio_attach(struct device *parent, struct device *self, void *aux) { struct rbox_softc *sc = (struct rbox_softc *)self; struct diofbreg *fbr; fbr = (struct diofbreg *)IIOV(GRFIADDR); sc->sc_scode = CONSCODE_INTERNAL; if (sc->sc_scode == conscode) { sc->sc_fb = &diofb_cn; } else { sc->sc_fb = &sc->sc_fb_store; rbox_reset(sc->sc_fb, sc->sc_scode, fbr); } diofb_end_attach(sc, &rbox_accessops, sc->sc_fb, sc->sc_scode == conscode, NULL); }
void gbox_intio_attach(device_t parent, device_t self, void *aux) { struct gbox_softc *sc = device_private(self); struct intio_attach_args *ia = aux; struct diofbreg *fbr; sc->sc_dev = self; fbr = (struct diofbreg *)ia->ia_addr; sc->sc_scode = CONSCODE_INTERNAL; if (sc->sc_scode == conscode) { sc->sc_fb = &diofb_cn; } else { sc->sc_fb = &sc->sc_fb_store; gbox_reset(sc->sc_fb, sc->sc_scode, fbr); } diofb_end_attach(self, &gbox_accessops, sc->sc_fb, sc->sc_scode == conscode, NULL); }
void topcat_end_attach(struct topcat_softc *sc, u_int8_t id) { const char *fbname = "unknown"; switch (id) { case GID_TOPCAT: switch (sc->sc_fb->planes) { case 1: fbname = "HP98544 topcat"; break; case 4: if (sc->sc_fb->dheight == 400) fbname = "HP98543 topcat"; else fbname = "HP98545 topcat"; break; case 6: fbname = "HP98547 topcat"; break; } break; case GID_HRCCATSEYE: fbname = "HP98550 catseye"; /* also A1416 kathmandu */ break; case GID_LRCATSEYE: fbname = "HP98549 catseye"; break; case GID_HRMCATSEYE: fbname = "HP98548 catseye"; break; } diofb_end_attach(sc, &topcat_accessops, sc->sc_fb, sc->sc_scode == conscode, fbname); }