Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch fix LCD drivers for Lubbock and Twintail.



details:   https://anonhg.NetBSD.org/src/rev/5dc2cf79081c
branches:  trunk
changeset: 752962:5dc2cf79081c
user:      bsh <bsh%NetBSD.org@localhost>
date:      Sat Mar 13 11:15:52 2010 +0000

description:
fix LCD drivers for Lubbock and Twintail.
  - pass correct attach args to pxa2x0_lcd_attach_sub()
  - make this driver compile without wsdisplay again.

diffstat:

 sys/arch/arm/xscale/pxa2x0_lcd.c      |  12 +++++++---
 sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c |  39 ++++++++++++++++++++++++++--------
 sys/arch/evbarm/lubbock/lubbock_lcd.c |  18 +++++++++------
 3 files changed, 48 insertions(+), 21 deletions(-)

diffs (242 lines):

diff -r 85c23ba63a0b -r 5dc2cf79081c sys/arch/arm/xscale/pxa2x0_lcd.c
--- a/sys/arch/arm/xscale/pxa2x0_lcd.c  Sat Mar 13 11:13:31 2010 +0000
+++ b/sys/arch/arm/xscale/pxa2x0_lcd.c  Sat Mar 13 11:15:52 2010 +0000
@@ -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
diff -r 85c23ba63a0b -r 5dc2cf79081c sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c
--- a/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c     Sat Mar 13 11:13:31 2010 +0000
+++ b/sys/arch/evbarm/g42xxeb/g42xxeb_lcd.c     Sat Mar 13 11:15:52 2010 +0000
@@ -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;
 }
 
diff -r 85c23ba63a0b -r 5dc2cf79081c sys/arch/evbarm/lubbock/lubbock_lcd.c
--- a/sys/arch/evbarm/lubbock/lubbock_lcd.c     Sat Mar 13 11:13:31 2010 +0000
+++ b/sys/arch/evbarm/lubbock/lubbock_lcd.c     Sat Mar 13 11:15:52 2010 +0000
@@ -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
 



Home | Main Index | Thread Index | Old Index