void lcd_attach(device_t parent, device_t self, void *aux) { struct s3c24x0_lcd_softc *sc = device_private(self); bus_space_tag_t iot = s3c2xx0_softc->sc_iot; bus_space_handle_t gpio_ioh = s3c2xx0_softc->sc_gpio_ioh; #if NWSDISPLAY > 0 struct wsemuldisplaydev_attach_args aa; #else struct s3c24x0_lcd_screen *screen; #endif sc->sc_dev = self; aprint_normal( "\n" ); /* setup GPIO ports for LCD */ /* XXX: some LCD panels may not need all VD signals */ gpio_ioh = s3c2xx0_softc->sc_gpio_ioh; bus_space_write_4(iot, gpio_ioh, GPIO_PCUP, ~0); bus_space_write_4(iot, gpio_ioh, GPIO_PCCON, 0xaaaaaaaa); bus_space_write_4(iot, gpio_ioh, GPIO_PDUP, ~0); bus_space_write_4(iot, gpio_ioh, GPIO_PDCON, 0xaaaaaaaa); s3c24x0_lcd_attach_sub(sc, aux, &samsung_LTS350Q1); #if NWSDISPLAY > 0 aa.console = 0; aa.scrdata = &lcd_screen_list; aa.accessops = &lcd_accessops; aa.accesscookie = sc; (void) config_found(self, &aa, wsemuldisplaydevprint); #else screen = s3c24x0_lcd_new_screen(sc, 240, 320, 16); if( screen ){ sc->active = screen; s3c24x0_lcd_start_dma(sc, screen); s3c24x0_lcd_power(sc, 1); } #endif /* NWSDISPLAY */ }
int s3c24x0_lcd_show_screen(void *v, void *cookie, int waitok, void (*cb)(void *, int, int), void *cbarg) { struct s3c24x0_lcd_softc *sc = v; struct s3c24x0_lcd_screen *scr = cookie, *old; /* XXX: make sure the clock is provided for LCD controller */ old = sc->active; if (old == scr && sc->lcd_on) return 0; if (old) s3c24x0_lcd_stop_dma(sc); s3c24x0_lcd_start_dma(sc, scr); sc->active = scr; s3c24x0_lcd_power(sc, 1); /* XXX: callback */ return 0; }