~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

Viewing changes to drivers/staging/gma500/mdfld_dsi_pkg_sender.h

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2010 Intel Corporation
 
3
 *
 
4
 * Permission is hereby granted, free of charge, to any person obtaining a
 
5
 * copy of this software and associated documentation files (the "Software"),
 
6
 * to deal in the Software without restriction, including without limitation
 
7
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
8
 * and/or sell copies of the Software, and to permit persons to whom the
 
9
 * Software is furnished to do so, subject to the following conditions:
 
10
 *
 
11
 * The above copyright notice and this permission notice (including the next
 
12
 * paragraph) shall be included in all copies or substantial portions of the
 
13
 * Software.
 
14
 *
 
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 
18
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
20
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
21
 * DEALINGS IN THE SOFTWARE.
 
22
 *
 
23
 * Authors:
 
24
 * Jackie Li<yaodong.li@intel.com>
 
25
 */
 
26
#ifndef __MDFLD_DSI_PKG_SENDER_H__
 
27
#define __MDFLD_DSI_PKG_SENDER_H__
 
28
 
 
29
#include <linux/kthread.h>
 
30
 
 
31
#define MDFLD_MAX_DCS_PARAM     8
 
32
#define MDFLD_MAX_PKG_NUM       2048
 
33
 
 
34
enum {
 
35
        MDFLD_DSI_PKG_DCS,
 
36
        MDFLD_DSI_PKG_GEN_SHORT_WRITE_0 = 0x03,
 
37
        MDFLD_DSI_PKG_GEN_SHORT_WRITE_1 = 0x13,
 
38
        MDFLD_DSI_PKG_GEN_SHORT_WRITE_2 = 0x23,
 
39
        MDFLD_DSI_PKG_GEN_READ_0 = 0x04,
 
40
        MDFLD_DSI_PKG_GEN_READ_1 = 0x14,
 
41
        MDFLD_DSI_PKG_GEN_READ_2 = 0x24,
 
42
        MDFLD_DSI_PKG_GEN_LONG_WRITE = 0x29,
 
43
        MDFLD_DSI_PKG_MCS_SHORT_WRITE_0 = 0x05,
 
44
        MDFLD_DSI_PKG_MCS_SHORT_WRITE_1 = 0x15,
 
45
        MDFLD_DSI_PKG_MCS_READ = 0x06,
 
46
        MDFLD_DSI_PKG_MCS_LONG_WRITE = 0x39,
 
47
};
 
48
 
 
49
enum {
 
50
        MDFLD_DSI_LP_TRANSMISSION,
 
51
        MDFLD_DSI_HS_TRANSMISSION,
 
52
        MDFLD_DSI_DCS,
 
53
};
 
54
 
 
55
enum {
 
56
        MDFLD_DSI_PANEL_MODE_SLEEP = 0x1,
 
57
};
 
58
 
 
59
enum {
 
60
        MDFLD_DSI_PKG_SENDER_FREE = 0x0,
 
61
        MDFLD_DSI_PKG_SENDER_BUSY = 0x1,
 
62
};
 
63
 
 
64
enum {
 
65
        MDFLD_DSI_SEND_PACKAGE,
 
66
        MDFLD_DSI_QUEUE_PACKAGE,
 
67
};
 
68
 
 
69
struct mdfld_dsi_gen_short_pkg {
 
70
        u8 cmd;
 
71
        u8 param;
 
72
};
 
73
 
 
74
struct mdfld_dsi_gen_long_pkg {
 
75
        u32 *data;
 
76
        u32 len;
 
77
};
 
78
 
 
79
struct mdfld_dsi_dcs_pkg {
 
80
        u8 cmd;
 
81
        u8 param[MDFLD_MAX_DCS_PARAM];
 
82
        u32 param_num;
 
83
        u8 data_src;
 
84
};
 
85
 
 
86
struct mdfld_dsi_pkg {
 
87
        u8 pkg_type;
 
88
        u8 transmission_type;
 
89
 
 
90
        union {
 
91
                struct mdfld_dsi_gen_short_pkg short_pkg;
 
92
                struct mdfld_dsi_gen_long_pkg long_pkg;
 
93
                struct mdfld_dsi_dcs_pkg dcs_pkg;
 
94
        } pkg;
 
95
 
 
96
        struct list_head entry;
 
97
};
 
98
 
 
99
struct mdfld_dsi_pkg_sender {
 
100
        struct drm_device *dev;
 
101
        struct mdfld_dsi_connector *dsi_connector;
 
102
        u32 status;
 
103
 
 
104
        u32 panel_mode;
 
105
 
 
106
        int pipe;
 
107
 
 
108
        spinlock_t lock;
 
109
        struct list_head pkg_list;
 
110
        struct list_head free_list;
 
111
 
 
112
        u32 pkg_num;
 
113
 
 
114
        int dbi_pkg_support;
 
115
 
 
116
        u32 dbi_cb_phy;
 
117
        void *dbi_cb_addr;
 
118
 
 
119
        /* Registers */
 
120
        u32 dpll_reg;
 
121
        u32 dspcntr_reg;
 
122
        u32 pipeconf_reg;
 
123
        u32 pipestat_reg;
 
124
        u32 dsplinoff_reg;
 
125
        u32 dspsurf_reg;
 
126
 
 
127
        u32 mipi_intr_stat_reg;
 
128
        u32 mipi_lp_gen_data_reg;
 
129
        u32 mipi_hs_gen_data_reg;
 
130
        u32 mipi_lp_gen_ctrl_reg;
 
131
        u32 mipi_hs_gen_ctrl_reg;
 
132
        u32 mipi_gen_fifo_stat_reg;
 
133
        u32 mipi_data_addr_reg;
 
134
        u32 mipi_data_len_reg;
 
135
        u32 mipi_cmd_addr_reg;
 
136
        u32 mipi_cmd_len_reg;
 
137
};
 
138
 
 
139
/* DCS definitions */
 
140
#define DCS_SOFT_RESET                  0x01
 
141
#define DCS_ENTER_SLEEP_MODE            0x10
 
142
#define DCS_EXIT_SLEEP_MODE             0x11
 
143
#define DCS_SET_DISPLAY_OFF             0x28
 
144
#define DCS_SET_DISPLAY_ON              0x29
 
145
#define DCS_SET_COLUMN_ADDRESS          0x2a
 
146
#define DCS_SET_PAGE_ADDRESS            0x2b
 
147
#define DCS_WRITE_MEM_START             0x2c
 
148
#define DCS_SET_TEAR_OFF                0x34
 
149
#define DCS_SET_TEAR_ON                 0x35
 
150
 
 
151
extern int mdfld_dsi_pkg_sender_init(struct mdfld_dsi_connector *dsi_connector,
 
152
                        int pipe);
 
153
extern void mdfld_dsi_pkg_sender_destroy(struct mdfld_dsi_pkg_sender *sender);
 
154
extern int mdfld_dsi_send_dcs(struct mdfld_dsi_pkg_sender *sender, u8 dcs,
 
155
                        u8 *param, u32 param_num, u8 data_src, int delay);
 
156
extern int mdfld_dsi_send_mcs_short_hs(struct mdfld_dsi_pkg_sender *sender,
 
157
                        u8 cmd, u8 param, u8 param_num, int delay);
 
158
extern int mdfld_dsi_send_mcs_short_lp(struct mdfld_dsi_pkg_sender *sender,
 
159
                        u8 cmd, u8 param, u8 param_num, int delay);
 
160
extern int mdfld_dsi_send_mcs_long_hs(struct mdfld_dsi_pkg_sender *sender,
 
161
                        u32 *data, u32 len, int delay);
 
162
extern int mdfld_dsi_send_mcs_long_lp(struct mdfld_dsi_pkg_sender *sender,
 
163
                        u32 *data, u32 len, int delay);
 
164
extern int mdfld_dsi_send_gen_short_hs(struct mdfld_dsi_pkg_sender *sender,
 
165
                        u8 param0, u8 param1, u8 param_num, int delay);
 
166
extern int mdfld_dsi_send_gen_short_lp(struct mdfld_dsi_pkg_sender *sender,
 
167
                        u8 param0, u8 param1, u8 param_num, int delay);
 
168
extern int mdfld_dsi_send_gen_long_hs(struct mdfld_dsi_pkg_sender *sender,
 
169
                        u32 *data, u32 len, int delay);
 
170
extern int mdfld_dsi_send_gen_long_lp(struct mdfld_dsi_pkg_sender *sender,
 
171
                        u32 *data, u32 len, int delay);
 
172
 
 
173
extern int mdfld_dsi_read_gen_hs(struct mdfld_dsi_pkg_sender *sender,
 
174
                        u8 param0, u8 param1, u8 param_num, u32 *data, u16 len);
 
175
extern int mdfld_dsi_read_gen_lp(struct mdfld_dsi_pkg_sender *sender,
 
176
                        u8 param0, u8 param1, u8 param_num, u32 *data, u16 len);
 
177
extern int mdfld_dsi_read_mcs_hs(struct mdfld_dsi_pkg_sender *sender,
 
178
                        u8 cmd, u32 *data, u16 len);
 
179
extern int mdfld_dsi_read_mcs_lp(struct mdfld_dsi_pkg_sender *sender,
 
180
                        u8 cmd, u32 *data, u16 len);
 
181
 
 
182
extern void mdfld_dsi_cmds_kick_out(struct mdfld_dsi_pkg_sender *sender);
 
183
 
 
184
#endif /* __MDFLD_DSI_PKG_SENDER_H__ */