blob: 609efe8c686e63c9cc591bc4682b9a535b0b9a97 [file] [log] [blame]
Heiko Stübner2c8304d2012-04-28 12:20:00 +02001/*
2 * Definitions for AUO-K190X framebuffer drivers
3 *
4 * Copyright (C) 2012 Heiko Stuebner <heiko@sntech.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef _LINUX_VIDEO_AUO_K190XFB_H_
12#define _LINUX_VIDEO_AUO_K190XFB_H_
13
14/* Controller standby command needs a param */
15#define AUOK190X_QUIRK_STANDBYPARAM (1 << 0)
16
17/* Controller standby is completely broken */
18#define AUOK190X_QUIRK_STANDBYBROKEN (1 << 1)
19
20/*
21 * Resolutions for the displays
22 */
23#define AUOK190X_RESOLUTION_800_600 0
24#define AUOK190X_RESOLUTION_1024_768 1
25
26/*
27 * struct used by auok190x. board specific stuff comes from *board
28 */
29struct auok190xfb_par {
30 struct fb_info *info;
31 struct auok190x_board *board;
32
33 struct regulator *regulator;
34
35 struct mutex io_lock;
36 struct delayed_work work;
37 wait_queue_head_t waitq;
38 int resolution;
39 int rotation;
40 int consecutive_threshold;
41 int update_cnt;
42
43 /* panel and controller informations */
44 int epd_type;
45 int panel_size_int;
46 int panel_size_float;
47 int panel_model;
48 int tcon_version;
49 int lut_version;
50
51 /* individual controller callbacks */
52 void (*update_partial)(struct auok190xfb_par *par, u16 y1, u16 y2);
53 void (*update_all)(struct auok190xfb_par *par);
54 bool (*need_refresh)(struct auok190xfb_par *par);
55 void (*init)(struct auok190xfb_par *par);
56 void (*recover)(struct auok190xfb_par *par);
57
58 int update_mode; /* mode to use for updates */
59 int last_mode; /* update mode last used */
60 int flash;
61
62 /* power management */
63 int autosuspend_delay;
64 bool standby;
65 bool manual_standby;
66};
67
68/**
69 * Board specific platform-data
70 * @init: initialize the controller interface
71 * @cleanup: cleanup the controller interface
72 * @wait_for_rdy: wait until the controller is not busy anymore
73 * @set_ctl: change an interface control
74 * @set_hdb: write a value to the data register
75 * @get_hdb: read a value from the data register
76 * @setup_irq: method to setup the irq handling on the busy gpio
77 * @gpio_nsleep: sleep gpio
78 * @gpio_nrst: reset gpio
79 * @gpio_nbusy: busy gpio
80 * @resolution: one of the AUOK190X_RESOLUTION constants
81 * @rotation: rotation of the framebuffer
82 * @quirks: controller quirks to honor
83 * @fps: frames per second for defio
84 */
85struct auok190x_board {
86 int (*init)(struct auok190xfb_par *);
87 void (*cleanup)(struct auok190xfb_par *);
88 int (*wait_for_rdy)(struct auok190xfb_par *);
89
90 void (*set_ctl)(struct auok190xfb_par *, unsigned char, u8);
91 void (*set_hdb)(struct auok190xfb_par *, u16);
92 u16 (*get_hdb)(struct auok190xfb_par *);
93
94 int (*setup_irq)(struct fb_info *);
95
96 int gpio_nsleep;
97 int gpio_nrst;
98 int gpio_nbusy;
99
100 int resolution;
101 int rotation;
102 int quirks;
103 int fps;
104};
105
106#endif