int bivideo_getcnfb(struct hpcfb_fbconf *fb) { console_flag = 1; return bivideo_init(fb); }
void bivideoattach(struct device *parent, struct device *self, void *aux) { struct bivideo_softc *sc = (struct bivideo_softc *)self; struct hpcfb_attach_args ha; if (attach_flag) { panic("%s(%d): bivideo attached twice", __FILE__, __LINE__); } attach_flag = 1; printf(": "); if (bivideo_init(&sc->sc_fbconf) != 0) { /* just return so that hpcfb will not be attached */ return; } printf("pseudo video controller"); if (console_flag) { printf(", console"); } printf("\n"); printf("%s: framebuffer address: 0x%08lx\n", sc->sc_dev.dv_xname, (u_long)bootinfo->fb_addr); /* Add a suspend hook to power saving */ sc->sc_powerstate = 0; sc->sc_powerhook = powerhook_establish(bivideo_power, sc); if (sc->sc_powerhook == NULL) printf("%s: WARNING: unable to establish power hook\n", sc->sc_dev.dv_xname); /* initialize backlight brightness and lcd contrast */ sc->sc_lcd_inited = 0; bivideo_init_brightness(sc, 1); bivideo_init_contrast(sc, 1); bivideo_init_backlight(sc, 1); ha.ha_console = console_flag; ha.ha_accessops = &bivideo_ha; ha.ha_accessctx = sc; ha.ha_curfbconf = 0; ha.ha_nfbconf = 1; ha.ha_fbconflist = &sc->sc_fbconf; ha.ha_curdspconf = 0; ha.ha_ndspconf = 1; ha.ha_dspconflist = &sc->sc_dspconf; config_found(self, &ha, hpcfbprint); }
void bivideoattach(device_t parent, device_t self, void *aux) { struct bivideo_softc *sc = device_private(self); struct hpcfb_attach_args ha; if (attach_flag) { panic("%s(%d): bivideo attached twice", __FILE__, __LINE__); } attach_flag = 1; printf(": "); if (bivideo_init(&sc->sc_fbconf) != 0) { /* just return so that hpcfb will not be attached */ return; } printf("pseudo video controller"); if (console_flag) { printf(", console"); } printf("\n"); printf("%s: framebuffer address: 0x%08lx\n", device_xname(self), (u_long)bootinfo->fb_addr); /* Add a suspend hook to power saving */ sc->sc_powerstate = 0; if (!pmf_device_register(self, bivideo_suspend, bivideo_resume)) aprint_error_dev(self, "unable to establish power handler\n"); /* initialize backlight brightness and lcd contrast */ sc->sc_lcd_inited = 0; bivideo_init_brightness(sc, 1); bivideo_init_contrast(sc, 1); bivideo_init_backlight(sc, 1); ha.ha_console = console_flag; ha.ha_accessops = &bivideo_ha; ha.ha_accessctx = sc; ha.ha_curfbconf = 0; ha.ha_nfbconf = 1; ha.ha_fbconflist = &sc->sc_fbconf; ha.ha_curdspconf = 0; ha.ha_ndspconf = 1; ha.ha_dspconflist = &sc->sc_dspconf; config_found(self, &ha, hpcfbprint); }