1 /* $NetBSD: s3c24x0_lcd.h,v 1.3 2006/04/15 17:00:11 jmmv Exp $ */
4 * Copyright (c) 2004 Genetec Corporation. All rights reserved.
5 * Written by Hiroyuki Bessho for Genetec Corporation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
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. The name of Genetec Corporation may not be used to endorse or
16 * promote products derived from this software without specific prior
19 * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
33 #ifndef _ARM_S3C2XX0_S3C24X0_LCD_H
34 #define _ARM_S3C2XX0_S3C24X0_LCD_H
36 #include <dev/rasops/rasops.h>
37 #include <machine/bus.h>
41 struct s3c24x0_lcd_screen
{
42 LIST_ENTRY(s3c24x0_lcd_screen
) link
;
46 bus_dma_segment_t segs
[1];
55 struct rasops_info rinfo
;
58 struct s3c24x0_lcd_softc
{
61 /* control registers */
63 bus_space_handle_t ioh
;
64 bus_dma_tag_t dma_tag
;
66 const struct s3c24x0_lcd_panel_info
*panel_info
;
68 LIST_HEAD(, s3c24x0_lcd_screen
) screens
;
69 struct s3c24x0_lcd_screen
*active
;
70 void *ih
; /* interrupt handler */
73 int lcd_on
; /* LCD is turned on */
76 void s3c24x0_lcd_attach_sub(struct s3c24x0_lcd_softc
*,
77 struct s3c2xx0_attach_args
*, const struct s3c24x0_lcd_panel_info
*);
78 int s3c24x0_lcd_start_dma(struct s3c24x0_lcd_softc
*,
79 struct s3c24x0_lcd_screen
*);
81 struct s3c24x0_lcd_panel_info
{
84 int pixel_clock
; /* in Hz */
86 /* Initial values to go to LCD controll registers */
94 #define s3c24x0_lcd_panel_tft(info) \
95 (((info)->lcdcon1 & LCDCON1_PNRMODE_MASK) == LCDCON1_PNRMODE_TFT)
98 void s3c24x0_set_lcd_panel_info(struct s3c24x0_lcd_softc
*,
99 const struct s3c24x0_lcd_panel_info
*);
101 struct s3c24x0_lcd_screen
*s3c24x0_lcd_new_screen(struct s3c24x0_lcd_softc
*,
105 * we need bits-per-pixel value to configure wsdisplay screen
107 struct s3c24x0_wsscreen_descr
{
108 struct wsscreen_descr c
; /* standard descriptor */
109 int depth
; /* bits per pixel */
112 int s3c24x0_lcd_show_screen(void *, void *, int, void (*)(void *, int, int),
114 int s3c24x0_lcd_ioctl(void *v
, void *vs
, u_long cmd
, void *data
, int flag
,
116 paddr_t
s3c24x0_lcd_mmap(void *, void *, off_t
, int);
117 int s3c24x0_lcd_alloc_screen(void *, const struct wsscreen_descr
*, void **,
118 int *, int *, long *);
119 void s3c24x0_lcd_free_screen(void *, void *);
120 void s3c24x0_lcd_power(struct s3c24x0_lcd_softc
*, int);
122 extern const struct wsdisplay_emulops s3c24x0_lcd_emulops
;
124 #endif /* _ARM_S3C2XX0_S3C24X0_LCD_H */