Annotation of sys/arch/arm/xscale/pxa2x0_lcd.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: pxa2x0_lcd.h,v 1.11 2005/12/22 18:45:46 deraadt Exp $ */
2: /* $NetBSD: pxa2x0_lcd.h,v 1.2 2003/06/17 09:43:14 bsh Exp $ */
3: /*
4: * Copyright (c) 2002 Genetec Corporation. All rights reserved.
5: * Written by Hiroyuki Bessho for Genetec Corporation.
6: *
7: * Redistribution and use in source and binary forms, with or without
8: * modification, are permitted provided that the following conditions
9: * are met:
10: * 1. Redistributions of source code must retain the above copyright
11: * notice, this list of conditions and the following disclaimer.
12: * 2. Redistributions in binary form must reproduce the above copyright
13: * notice, this list of conditions and the following disclaimer in the
14: * documentation and/or other materials provided with the distribution.
15: * 3. All advertising materials mentioning features or use of this software
16: * must display the following acknowledgement:
17: * This product includes software developed for the NetBSD Project by
18: * Genetec Corporation.
19: * 4. The name of Genetec Corporation may not be used to endorse or
20: * promote products derived from this software without specific prior
21: * written permission.
22: *
23: * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
24: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
27: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33: * POSSIBILITY OF SUCH DAMAGE.
34: */
35:
36:
37: #ifndef _ARM_XSCALE_PXA2X0_LCD_H
38: #define _ARM_XSCALE_PXA2X0_LCD_H
39:
40: #include <dev/rasops/rasops.h>
41: #include <machine/bus.h>
42:
43: /* LCD Controller */
44:
45: struct lcd_dma_descriptor {
46: uint32_t fdadr; /* next frame descriptor */
47: uint32_t fsadr; /* frame start address */
48: uint32_t fidr; /* frame ID */
49: uint32_t ldcmd; /* DMA command */
50: #define LDCMD_PAL (1U<<26) /* Palette buffer */
51: #define LDCMD_SOFINT (1U<<22) /* Start of Frame interrupt */
52: #define LDCMD_EOFINT (1U<<21) /* End of Frame interrupt */
53: };
54:
55:
56: struct pxa2x0_lcd_screen {
57: LIST_ENTRY(pxa2x0_lcd_screen) link;
58:
59: /* Frame buffer */
60: bus_dmamap_t dma;
61: bus_dma_segment_t segs[1];
62: int nsegs;
63: size_t buf_size;
64: size_t map_size;
65: void *buf_va;
66: int depth;
67:
68: /* DMA frame descriptor */
69: struct lcd_dma_descriptor *dma_desc;
70: paddr_t dma_desc_pa;
71:
72: /* rasterop */
73: struct rasops_info rinfo;
74: };
75:
76: struct pxa2x0_lcd_softc {
77: struct device dev;
78: /* control register */
79: bus_space_tag_t iot;
80: bus_space_handle_t ioh;
81: bus_dma_tag_t dma_tag;
82:
83: const struct lcd_panel_geometry *geometry;
84:
85: int n_screens;
86: LIST_HEAD(, pxa2x0_lcd_screen) screens;
87: struct pxa2x0_lcd_screen *active;
88:
89: void *ih; /* interrupt handler */
90: };
91:
92: struct lcd_panel_geometry {
93: short panel_width;
94: short panel_height;
95: short extra_lines;
96:
97: short panel_info;
98: #define LCDPANEL_VSP (1<<0) /* L_FCLK pin is active low */
99: #define LCDPANEL_HSP (1<<1) /* L_LCLK pin is active low */
100: #define LCDPANEL_PCP (1<<2) /* use L_PCLK falling edge */
101: #define LCDPANEL_OEP (1<<3) /* L_BIAS pin is active low */
102: #define LCDPANEL_DPC (1<<4) /* double pixel clock mode */
103:
104: #define LCDPANEL_DUAL (1<<5) /* Dual or single */
105: #define LCDPANEL_SINGLE 0
106: #define LCDPANEL_ACTIVE (1<<6) /* Active or Passive */
107: #define LCDPANEL_PASSIVE 0
108: #define LCDPANEL_MONOCHROME (1<<7) /* depth=1 */
109:
110: short pixel_clock_div; /* pixel clock divider */
111: short ac_bias; /* AC bias pin frequency */
112:
113: short hsync_pulse_width; /* Horizontal sync pulse width */
114: short beg_line_wait; /* beginning of line wait (BLW) */
115: short end_line_wait; /* end of line pxel wait (ELW) */
116:
117: short vsync_pulse_width; /* vertical sync pulse width */
118: short beg_frame_wait; /* beginning of frame wait (BFW) */
119: short end_frame_wait; /* end of frame wait (EFW) */
120: };
121:
122: /*
123: * we need bits-per-pixel value to configure wsdisplay screen
124: */
125: struct pxa2x0_wsscreen_descr {
126: struct wsscreen_descr c; /* standard descriptor */
127: int depth; /* bits per pixel */
128: int flags; /* rasops flags */
129: };
130:
131: void pxa2x0_lcd_attach_sub(struct pxa2x0_lcd_softc *,
132: struct pxaip_attach_args *, struct pxa2x0_wsscreen_descr *,
133: const struct lcd_panel_geometry *, int);
134: int pxa2x0_lcd_cnattach(struct pxa2x0_wsscreen_descr *,
135: const struct lcd_panel_geometry *, void (*)(u_int, int));
136:
137: int pxa2x0_lcd_alloc_screen(void *, const struct wsscreen_descr *,
138: void **, int *, int *, long *);
139: void pxa2x0_lcd_free_screen(void *, void *);
140: int pxa2x0_lcd_ioctl(void *, u_long, caddr_t, int, struct proc *);
141: paddr_t pxa2x0_lcd_mmap(void *, off_t, int);
142: int pxa2x0_lcd_show_screen(void *, void *, int, void (*)(void *, int, int),
143: void *);
144: void pxa2x0_lcd_power(int, void *);
145: void pxa2x0_lcd_suspend(struct pxa2x0_lcd_softc *);
146: void pxa2x0_lcd_resume(struct pxa2x0_lcd_softc *);
147:
148: #endif /* _ARM_XSCALE_PXA2X0_LCD_H */
CVSweb