1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
//-----------------------------------------------------------------------------
//
// linux/drivers/video/epson/s1d13521fb.h --
// Function header for Epson S1D13521 controller frame buffer drivers.
//
// Copyright(c) Seiko Epson Corporation 2000-2008.
// All rights reserved.
//
// This file is subject to the terms and conditions of the GNU General Public
// License. See the file COPYING in the main directory of this archive for
// more details.
//
//----------------------------------------------------------------------------
#ifndef __S1D13521FB_H__
#define __S1D13521FB_H__
#include <linux/kernel.h>
#include <linux/fb.h>
#include "DataType.h"
#include "s1d13521ioctl.h"
#include "s1d13521.h"
#include "s1d13521_debug.h"
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
//
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#define HRDY_TIMEOUT_MS 5000
//#define CONFIG_FB_EPSON_PROC
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
//
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// In Indirect Mode, a copy of the framebuffer is kept in system memory.
// A timer periodically writes this copy to the "real" framebuffer in
// hardware. This copy is called a virtual framebuffer.
//----------------------------------------------------------------------------
// Global structures used by s1d13521fb frame buffer code
//----------------------------------------------------------------------------
typedef struct
{
volatile unsigned char *RegAddr;
unsigned RegAddrMappedSize;
volatile unsigned char *DataPort;
unsigned DataPortSzie;
volatile unsigned char *CommandPort;
unsigned CommandPortSzie;
u32 VirtualFramebufferAddr;
int blank_mode;
u32 pseudo_palette[16];
}FB_INFO_S1D13521;
extern struct fb_fix_screeninfo s1d13521fb_fix;
extern struct fb_info s1d13521_fb;
extern FB_INFO_S1D13521 s1d13521fb_info;
extern char *s1d13521fb_version;
//-----------------------------------------------------------------------------
// Global Function Prototypes
//-----------------------------------------------------------------------------
#ifdef CONFIG_FB_EPSON_PROC
int __devinit s1d13521proc_init(void);
void __devexit s1d13521proc_terminate(void);
#endif
#ifdef CONFIG_FB_EPSON_PCI
int __devinit s1d13521pci_init(long *physicalAddress);
void __devexit s1d13521pci_terminate(void);
#endif
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
//
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
typedef struct TAG_ST_A_GPIO_INFO{
const UINT32 Info;
const char *Name;
} ST_A_GPIO_INFO, *PST_A_GPIO_INFO;
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
//
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
typedef enum {
_EPSON_ERROR_SUCCESS=0,
_EPSON_ERROR_NOT_READY,
_EPSON_ERROR_TIMEOUT,
_EPSON_ERROR_WRITE_FAIL,
} EN_EPSON_ERROR_CODE;
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
//
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
typedef struct TAG_ST_DESC_ACCESS_BUF {
UINT32 Len;
PUINT pData;
} ST_DESC_ACCESS_BUF, *PST_DESC_ACCESS_BUF;
#pragma pack(1)
typedef struct TAG_ST_COMMAND_PACKAGE {
ST_DESC_ACCESS_BUF Write;
ST_DESC_ACCESS_BUF Read;
UINT16 Command;
} ST_COMMAND_PACKAGE, *PST_COMMAND_PACKAGE;
#pragma pack()
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
//
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
typedef struct TAG_ST_PARTIAL_RECT {
UINT16 StartX;
UINT16 StartY;
UINT16 Width;
UINT16 Height;
} ST_PARTIAL_RECT, *PST_PARTIAL_RECT;
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
//
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
int __devinit s1d13521if_InterfaceInit(FB_INFO_S1D13521 *info);
void __devexit s1d13521if_InterfaceTerminate(FB_INFO_S1D13521 *info);
int BusIssueCmd(unsigned ioctlcmd,s1d13521_ioctl_cmd_params *params,int numparams);
void BusIssueWriteBuf(u16 *ptr16, unsigned copysize16);
void BusIssueReadBuf(u16 *ptr16, unsigned copysize16);
u16 BusIssueReadReg(u16 Index);
EN_EPSON_ERROR_CODE BusIssueWriteReg(u16 Index, u16 Value);
EN_EPSON_ERROR_CODE BusIssueWriteRegX(u16 Index, u16 Value);
EN_EPSON_ERROR_CODE BusIssueCmdX(UINT16 Cmd);
EN_EPSON_ERROR_CODE BusIssueWriteRegBuf(u16 Index, PUINT16 pData, UINT32 Length);
EN_EPSON_ERROR_CODE BusWaitForHRDY(void);
void BusIssueDoRefreshDisplay(unsigned cmd,unsigned mode);
void BusIssueInitDisplay(void);
void BusIssueInitRegisters(void);
int pvi_GoToSleep(void);
int pvi_GoToNormal(void);
// int s1d13521if_CmdPackage(PST_COMMAND_PACKAGE pCmdPkg);
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//
//
//
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
int pvi_Init(VOID);
VOID pvi_Deinit(VOID);
int pvi_ioctl_NewImage(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_StopNewImage(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_DisplayImage(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_PartialImage(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_DisplayPartial(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_Reset(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_SetDepth(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_EraseDisplay(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_Rotate(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_Positive(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_Negative(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_GoToNormal(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_GoToSleep(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_GoToStandBy(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_WriteToFlash(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_ReadFromFlash(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_Init(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_AutoRefreshOn(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_AutoRefreshOff(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_SetRefresh(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_ForcedRefresh(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_GetRefresh(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_RestoreImage(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_ControllerVersion(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_SoftwareVersion(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_DisplaySize(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_GetStatus(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_Temperature(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_WriteRegister(PTDisplayCommand puDisplayCommand);
int pvi_ioctl_ReadRegister(PTDisplayCommand puDisplayCommand);
int pvi_SwitchCommand(PTDisplayCommand pDisplayCommand);
//int Epson_displayCMD(PST_IMAGE_PGM PST);
//int Epson_displayCMD_MEM(PST_IMAGE_PGM_MEM PST); //KEG 20090914
//int Epson_LoadImageArea(PTloadImageArea area); // KEG 20090814
//BOOL BusIssueFlashOperation(PS1D13532_FLASH_PACKAGE pFlashControl);
BOOL BusIssueReset(void);
//int ImagePGM(PST_IMAGE_PGM pPGM);
VOID DeviceReset(VOID);
#endif //__S1D13521FB_H__
|