1/* $XFree86$ */
2/*
3 * $Workfile: cen9211.h $
4 * $Revision: 1.1.1.1 $
5 *
6 * File Contents: This header file defines the Durango routines and
7 *                variables used to access the memory mapped regions.
8 *
9 * SubModule:     Geode FlatPanel library
10 *
11 */
12
13/*
14 * NSC_LIC_ALTERNATIVE_PREAMBLE
15 *
16 * Revision 1.0
17 *
18 * National Semiconductor Alternative GPL-BSD License
19 *
20 * National Semiconductor Corporation licenses this software
21 * ("Software"):
22 *
23 * Panel Library
24 *
25 * under one of the two following licenses, depending on how the
26 * Software is received by the Licensee.
27 *
28 * If this Software is received as part of the Linux Framebuffer or
29 * other GPL licensed software, then the GPL license designated
30 * NSC_LIC_GPL applies to this Software; in all other circumstances
31 * then the BSD-style license designated NSC_LIC_BSD shall apply.
32 *
33 * END_NSC_LIC_ALTERNATIVE_PREAMBLE */
34
35/* NSC_LIC_BSD
36 *
37 * National Semiconductor Corporation Open Source License for
38 *
39 * Panel Library
40 *
41 * (BSD License with Export Notice)
42 *
43 * Copyright (c) 1999-2001
44 * National Semiconductor Corporation.
45 * All rights reserved.
46 *
47 * Redistribution and use in source and binary forms, with or without
48 * modification, are permitted provided that the following conditions
49 * are met:
50 *
51 *   * Redistributions of source code must retain the above copyright
52 *     notice, this list of conditions and the following disclaimer.
53 *
54 *   * Redistributions in binary form must reproduce the above
55 *     copyright notice, this list of conditions and the following
56 *     disclaimer in the documentation and/or other materials provided
57 *     with the distribution.
58 *
59 *   * Neither the name of the National Semiconductor Corporation nor
60 *     the names of its contributors may be used to endorse or promote
61 *     products derived from this software without specific prior
62 *     written permission.
63 *
64 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
65 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
66 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
67 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
68 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
69 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
70 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
71 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
72 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
73 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
74 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
75 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
76 * OF SUCH DAMAGE.
77 *
78 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
79 * YOUR JURISDICTION. It is licensee's responsibility to comply with
80 * any export regulations applicable in licensee's jurisdiction. Under
81 * CURRENT (2001) U.S. export regulations this software
82 * is eligible for export from the U.S. and can be downloaded by or
83 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
84 * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
85 * Syria, Sudan, Afghanistan and any other country to which the U.S.
86 * has embargoed goods and services.
87 *
88 * END_NSC_LIC_BSD */
89
90/* NSC_LIC_GPL
91 *
92 * National Semiconductor Corporation Gnu General Public License for
93 *
94 * Panel Library
95 *
96 * (GPL License with Export Notice)
97 *
98 * Copyright (c) 1999-2001
99 * National Semiconductor Corporation.
100 * All rights reserved.
101 *
102 * Redistribution and use in source and binary forms, with or without
103 * modification, are permitted under the terms of the GNU General
104 * Public License as published by the Free Software Foundation; either
105 * version 2 of the License, or (at your option) any later version
106 *
107 * In addition to the terms of the GNU General Public License, neither
108 * the name of the National Semiconductor Corporation nor the names of
109 * its contributors may be used to endorse or promote products derived
110 * from this software without specific prior written permission.
111 *
112 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
113 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
114 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
115 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
116 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
117 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
118 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
119 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
120 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
121 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
122 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
123 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
124 * OF SUCH DAMAGE. See the GNU General Public License for more details.
125 *
126 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
127 * YOUR JURISDICTION. It is licensee's responsibility to comply with
128 * any export regulations applicable in licensee's jurisdiction. Under
129 * CURRENT (2001) U.S. export regulations this software
130 * is eligible for export from the U.S. and can be downloaded by or
131 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
132 * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
133 * Syria, Sudan, Afghanistan and any other country to which the U.S.
134 * has embargoed goods and services.
135 *
136 * You should have received a copy of the GNU General Public License
137 * along with this file; if not, write to the Free Software Foundation,
138 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
139 *
140 * END_NSC_LIC_GPL */
141
142#include "92xx.h"
143#include "panel.h"
144
145#ifndef _CEN9211_h
146#define _CEN9211_h
147
148/* Centaurus/97317 GPIO PORT defines  */
149
150#define CENT_97317_CLOCK_PORT		0xE0
151#define CENT_97317_DATA_OUTPORT		0xE0
152#define CENT_97317_CHIP_SELECT		0xE4
153#define CENT_97317_DATA_INPORT		0xE4
154#define CENT_PORT1_DIRECTION		0xE1
155#define CENT_PORT2_DIRECTION		0xE5
156#define CENT_PORT1_OUTPUT_TYPE		0xE2
157#define CENT_PORT2_OUTPUT_TYPE		0xE6
158
159/*
160 * Centaurus/97317 GPIO bit masks.
161 * In and out are with respect to the 97317.
162 */
163
164#define CENT_97317_CLOCK_MASK		0x10
165#define CENT_97317_CHIP_SEL_MASK	0x01
166#define CENT_97317_DATA_IN_MASK		0x02
167#define CENT_97317_DATA_OUT_MASK	0x80
168
169#define CENT_PASS    1
170#define CENT_FAIL    0
171#define CENT_READ    0x0000
172#define CENT_WRITE   0x0001
173#define CENT_NO_DATA 0
174
175#define CENT_CONFIG_INDEX  0x2E
176#define CENT_SIOC2         0x22
177#define CENT_CONFIG_DATA   0x2F
178#define CENT_GPIO_BANK_SELECT	0x80
179
180#define CENT_NUM_READ_CLOCK_TOGGLES	1
181#define CENT_NUM_WRITE_CLOCK_TOGGLES	4
182
183/* local functions */
184void set_Centaurus_92xx_mode_params(int mode);
185void enable_Centaurus_9211_chip_select(void);
186void disable_Centaurus_9211_chip_select(void);
187void toggle_Centaurus_9211_clock(void);
188void write_Centaurus_CX9211_GPIO(unsigned char databit);
189void write_Centaurus_CX9211_DWdata(unsigned long data);
190void Centaurus_write_gpio(int width, unsigned long address,
191			  unsigned long data);
192void Centaurus_Power_Up(void);
193void Centaurus_Power_Down(void);
194unsigned long Centaurus_read_gpio(int width, unsigned long address);
195unsigned char read_Centaurus_CX9211_GPIO(void);
196unsigned long read_Centaurus_CX9211_DWdata(void);
197unsigned char restore_Centaurus_97317_SIOC2(void);
198unsigned char init_Centaurus_GPIO(void);
199unsigned char init_Centaurus_9211(void);
200unsigned char set_Centaurus_92xx_mode(Pnl_PanelStat * pstat);
201void CentaurusProgramFRMload(void);
202void Centaurus_Get_9211_Details(unsigned long flags, PPnl_PanelParams pParam);
203void Centaurus_Save_Panel_State(void);
204void Centaurus_Restore_Panel_State(void);
205void Centaurus_9211init(Pnl_PanelStat * pstat);
206
207#endif /* !_CEN9211_h */
208
209/* END OF FILE */
210