Module Name: src Committed By: bsh Date: Sat Mar 13 11:15:52 UTC 2010
Modified Files: src/sys/arch/arm/xscale: pxa2x0_lcd.c src/sys/arch/evbarm/g42xxeb: g42xxeb_lcd.c src/sys/arch/evbarm/lubbock: lubbock_lcd.c Log Message: fix LCD drivers for Lubbock and Twintail. - pass correct attach args to pxa2x0_lcd_attach_sub() - make this driver compile without wsdisplay again. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/xscale/pxa2x0_lcd.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/lubbock/lubbock_lcd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/xscale/pxa2x0_lcd.c diff -u src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.27 src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.28 --- src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.27 Thu Jan 29 12:28:15 2009 +++ src/sys/arch/arm/xscale/pxa2x0_lcd.c Sat Mar 13 11:15:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pxa2x0_lcd.c,v 1.27 2009/01/29 12:28:15 nonaka Exp $ */ +/* $NetBSD: pxa2x0_lcd.c,v 1.28 2010/03/13 11:15:52 bsh Exp $ */ /* * Copyright (c) 2002 Genetec Corporation. All rights reserved. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.27 2009/01/29 12:28:15 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.28 2010/03/13 11:15:52 bsh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -82,9 +82,11 @@ static void pxa2x0_lcd_initialize(struct pxa2x0_lcd_softc *, const struct lcd_panel_geometry *); +#if NWSDISPLAY > 0 static void pxa2x0_lcd_setup_rasops(struct pxa2x0_lcd_softc *, struct rasops_info *, struct pxa2x0_wsscreen_descr *, const struct lcd_panel_geometry *); +#endif void pxa2x0_lcd_geometry(struct pxa2x0_lcd_softc *sc, @@ -249,6 +251,7 @@ pxa2x0_lcd_initialize(sc, geom); +#if NWSDISPLAY > 0 if (pxa2x0_lcd_console.is_console) { struct pxa2x0_wsscreen_descr *descr = pxa2x0_lcd_console.descr; struct pxa2x0_lcd_screen *scr; @@ -278,6 +281,7 @@ aprint_normal_dev(sc->dev, "console\n"); } +#endif } int @@ -368,7 +372,6 @@ restore_interrupts(save); } -#if NWSDISPLAY > 0 /* * Disable screen refresh. */ @@ -391,7 +394,6 @@ ~LCCR0_DIS & bus_space_read_4(sc->iot, sc->ioh, LCDC_LCCR0)); } -#endif #define _rgb(r,g,b) (((r)<<11) | ((g)<<5) | b) #define rgb(r,g,b) _rgb((r)>>1,g,(b)>>1) @@ -604,6 +606,7 @@ return error; } +#if NWSDISPLAY > 0 /* * Initialize rasops for a screen, as well as struct wsscreen_descr if this * is the first screen creation. @@ -645,6 +648,7 @@ descr->c.capabilities = rinfo->ri_caps; descr->c.textops = &rinfo->ri_ops; } +#endif /* * Power management Index: src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c diff -u src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c:1.12 src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c:1.13 --- src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c:1.12 Thu Jan 29 12:28:15 2009 +++ src/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c Sat Mar 13 11:15:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: g42xxeb_lcd.c,v 1.12 2009/01/29 12:28:15 nonaka Exp $ */ +/* $NetBSD: g42xxeb_lcd.c,v 1.13 2010/03/13 11:15:52 bsh Exp $ */ /*- * Copyright (c) 2001, 2002, 2005 Genetec corp. @@ -127,7 +127,7 @@ dev_type_mmap(lcdmmap); const struct cdevsw lcd_cdevsw = { lcdopen, lcdclose, noread, nowrite, - lcdioctl, nostop, notty, nopoll, lcdmmap, D_TTY + lcdioctl, nostop, notty, nopoll, lcdmmap, nokqfilter, D_TTY }; #endif @@ -188,19 +188,27 @@ }; #endif /* G4250_LCD_TOSHIBA_LTM035 */ -void lcd_attach( device_t parent, device_t self, void *aux ) +void lcd_attach(device_t parent, device_t self, void *aux) { struct pxa2x0_lcd_softc *sc = device_private(self); + struct pxaip_attach_args paa; + struct obio_attach_args *oba = aux; sc->dev = self; + paa.pxa_name = "obio"; + paa.pxa_iot = oba->oba_iot; + paa.pxa_addr = oba->oba_addr; + paa.pxa_size = 0; /* XXX */ + paa.pxa_intr = oba->oba_intr; + #ifdef G4250_LCD_TOSHIBA_LTM035 # define PANEL toshiba_LTM035 #else # define PANEL nec_NL3224BC35 #endif - pxa2x0_lcd_attach_sub(sc, aux, &PANEL); + pxa2x0_lcd_attach_sub(sc, &paa, &PANEL); #if NWSDISPLAY > 0 @@ -218,8 +226,6 @@ aa.accessops = &lcd_accessops; aa.accesscookie = sc; - printf("\n"); - (void) config_found(self, &aa, wsemuldisplaydevprint); } #else @@ -232,8 +238,6 @@ sc->active = screen; pxa2x0_lcd_start_dma(sc, screen); } - - printf("\n"); } #endif @@ -246,8 +250,9 @@ int lcd_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l) { + struct pxa2x0_lcd_softc *sc = v; struct obio_softc *osc = - (struct obio_softc *) device_parent((struct device *)v); + device_private(device_parent(sc->dev)); uint16_t reg; switch (cmd) { @@ -273,8 +278,9 @@ lcd_show_screen(void *v, void *cookie, int waitok, void (*cb)(void *, int, int), void *cbarg) { + struct pxa2x0_lcd_softc *sc = v; struct obio_softc *osc = - (struct obio_softc *) device_parent((struct device *)v); + device_private(device_parent(sc->dev)); uint16_t reg; pxa2x0_lcd_show_screen(v,cookie,waitok,cb,cbarg); @@ -295,6 +301,19 @@ int lcdopen(dev_t dev, int oflags, int devtype, struct lwp *l) { + struct pxa2x0_lcd_softc *sc = + device_lookup_private(&lcd_cd, minor(dev)); + struct obio_softc *osc = + device_private(device_parent(sc->dev)); + uint16_t reg; + + /* Turn on LCD backlight. + XXX: with fixed blightness. want new ioctl to set blightness. */ + reg = bus_space_read_2(osc->sc_iot, osc->sc_obioreg_ioh, G42XXEB_LCDCTL); + bus_space_write_2(osc->sc_iot, osc->sc_obioreg_ioh, G42XXEB_LCDCTL, + (reg & ~LCDCTL_BL_PWN) | 0x4000 | LCDCTL_BL_ON); + + return 0; } Index: src/sys/arch/evbarm/lubbock/lubbock_lcd.c diff -u src/sys/arch/evbarm/lubbock/lubbock_lcd.c:1.10 src/sys/arch/evbarm/lubbock/lubbock_lcd.c:1.11 --- src/sys/arch/evbarm/lubbock/lubbock_lcd.c:1.10 Fri May 29 14:15:44 2009 +++ src/sys/arch/evbarm/lubbock/lubbock_lcd.c Sat Mar 13 11:15:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: lubbock_lcd.c,v 1.10 2009/05/29 14:15:44 rjs Exp $ */ +/* $NetBSD: lubbock_lcd.c,v 1.11 2010/03/13 11:15:52 bsh Exp $ */ /* * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. @@ -40,7 +40,7 @@ * LCD panel geometry */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lubbock_lcd.c,v 1.10 2009/05/29 14:15:44 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lubbock_lcd.c,v 1.11 2010/03/13 11:15:52 bsh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -174,10 +174,18 @@ void lcd_attach( device_t parent, device_t self, void *aux ) { struct pxa2x0_lcd_softc *sc = device_private(self); + struct obio_attach_args *oba = aux; + struct pxaip_attach_args paa; sc->dev = self; - pxa2x0_lcd_attach_sub(sc, aux, &sharp_LM8V31); + paa.pxa_name = "obio"; + paa.pxa_iot = oba->oba_iot; + paa.pxa_addr = oba->oba_addr; + paa.pxa_size = 0; /* XXX */ + paa.pxa_intr = oba->oba_intr; + + pxa2x0_lcd_attach_sub(sc, &paa, &sharp_LM8V31); #if NWSDISPLAY > 0 @@ -195,8 +203,6 @@ aa.accessops = &lcd_accessops; aa.accesscookie = sc; - printf( "\n" ); - (void) config_found(self, &aa, wsemuldisplaydevprint); } #else @@ -209,8 +215,6 @@ sc->active = screen; pxa2x0_lcd_start_dma( sc, screen ); } - - printf( "\n" ); } #endif