ea446ae85ce4704149e318ce49e8932a80f7a40f
[openwrt-10.03/.git] / target / linux / xburst / files-2.6.32 / include / video / metronomefb.h
1 /*
2  * metronomefb.h - definitions for the metronome framebuffer driver
3  *
4  * Copyright (C) 2008 by Jaya Kumar
5  *
6  * This file is subject to the terms and conditions of the GNU General Public
7  * License. See the file COPYING in the main directory of this archive for
8  * more details.
9  *
10  */
11
12 #ifndef _LINUX_METRONOMEFB_H_
13 #define _LINUX_METRONOMEFB_H_
14
15 /* command structure used by metronome controller */
16 struct metromem_cmd {
17         u16 opcode;
18         u16 args[((64-2)/2)];
19         u16 csum;
20 } __attribute__((packed));
21
22 struct epd_frame;
23
24 /* struct used by metronome. board specific stuff comes from *board */
25 struct metronomefb_par {
26         struct metromem_cmd *metromem_cmd;
27         unsigned char *metromem_wfm;
28         unsigned char *metromem_img;
29         u16 *metromem_img_csum;
30         u16 *csum_table;
31         dma_addr_t metromem_dma;
32         const struct firmware *firmware;
33         struct fb_info *info;
34         struct metronome_board *board;
35         struct platform_device *pdev;
36         wait_queue_head_t waitq;
37         u8 frame_count;
38         int extra_size;
39         int current_wf_mode;
40         int current_wf_temp;
41         unsigned int manual_refresh_threshold;
42         unsigned int partial_autorefresh_interval;
43         const struct epd_frame *epd_frame;
44         u32 *fxbuckets;
45         u32 *fybuckets;
46
47         unsigned int partial_updates_count;
48         unsigned is_first_update:1;
49
50         struct mutex lock;
51 };
52
53 #define METRONOME_POWER_OFF     0
54 #define METRONOME_POWER_ON      1
55
56 /* board specific routines and data */
57 struct metronome_board {
58         struct module *owner; /* the platform device */
59         void (*power_ctl)(struct metronomefb_par *, int);
60         void (*set_rst)(struct metronomefb_par *, int);
61         void (*set_stdby)(struct metronomefb_par *, int);
62         int (*get_err)(struct metronomefb_par *);
63         int (*get_rdy)(struct metronomefb_par *);
64         void (*cleanup)(struct metronomefb_par *);
65         int (*met_wait_event)(struct metronomefb_par *);
66         int (*met_wait_event_intr)(struct metronomefb_par *);
67         int (*setup_irq)(struct fb_info *);
68         int (*setup_fb)(struct metronomefb_par *);
69         int (*setup_io)(struct metronomefb_par *);
70         int (*get_panel_type)(void);
71 };
72
73 #endif