1 /* include/linux/sm501.h
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * Vincent Sanders <vince@simtec.co.uk>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 extern int sm501_unit_power(struct device
*dev
,
22 unsigned int unit
, unsigned int to
);
24 extern unsigned long sm501_set_clock(struct device
*dev
,
25 int clksrc
, unsigned long freq
);
27 <<<<<<< HEAD
:include
/linux
/sm501
.h
28 extern unsigned long sm501_find_clock(int clksrc
, unsigned long req_freq
);
30 extern unsigned long sm501_find_clock(struct device
*dev
,
31 int clksrc
, unsigned long req_freq
);
32 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/sm501
.h
36 * Modify the SM501's MISC_CONTROL register
39 extern int sm501_misc_control(struct device
*dev
,
40 unsigned long set
, unsigned long clear
);
44 * Modify a register in the SM501 which may be shared with other
48 extern unsigned long sm501_modify_reg(struct device
*dev
,
55 * set the state of the given GPIO line
58 extern void sm501_gpio_set(struct device
*dev
,
65 * get the state of the given GPIO line
68 extern unsigned long sm501_gpio_get(struct device
*dev
,
72 /* Platform data definitions */
74 #define SM501FB_FLAG_USE_INIT_MODE (1<<0)
75 #define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1)
76 #define SM501FB_FLAG_USE_HWCURSOR (1<<2)
77 #define SM501FB_FLAG_USE_HWACCEL (1<<3)
78 #define SM501FB_FLAG_PANEL_USE_FPEN (1<<4)
79 #define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5)
81 struct sm501_platdata_fbsub
{
82 struct fb_videomode
*def_mode
;
84 unsigned long max_mem
;
88 enum sm501_fb_routing
{
89 SM501_FB_OWN
= 0, /* CRT=>CRT, Panel=>Panel */
90 SM501_FB_CRT_PANEL
= 1, /* Panel=>CRT, Panel=>Panel */
93 /* sm501_platdata_fb flag field bit definitions */
95 #define SM501_FBPD_SWAP_FB_ENDIAN (1<<0) /* need to endian swap */
99 * configuration data for the framebuffer driver
102 struct sm501_platdata_fb
{
103 enum sm501_fb_routing fb_route
;
105 struct sm501_platdata_fbsub
*fb_crt
;
106 struct sm501_platdata_fbsub
*fb_pnl
;
111 struct sm501_platdata_gpio_i2c
{
112 unsigned int pin_sda
;
113 unsigned int pin_scl
;
118 * use for initialising values that may not have been setup
119 * before the driver is loaded.
122 struct sm501_reg_init
{
127 #define SM501_USE_USB_HOST (1<<0)
128 #define SM501_USE_USB_SLAVE (1<<1)
129 #define SM501_USE_SSP0 (1<<2)
130 #define SM501_USE_SSP1 (1<<3)
131 #define SM501_USE_UART0 (1<<4)
132 #define SM501_USE_UART1 (1<<5)
133 #define SM501_USE_FBACCEL (1<<6)
134 #define SM501_USE_AC97 (1<<7)
135 #define SM501_USE_I2S (1<<8)
137 #define SM501_USE_ALL (0xffffffff)
139 struct sm501_initdata
{
140 struct sm501_reg_init gpio_low
;
141 struct sm501_reg_init gpio_high
;
142 struct sm501_reg_init misc_timing
;
143 struct sm501_reg_init misc_control
;
145 unsigned long devices
;
146 unsigned long mclk
; /* non-zero to modify */
147 unsigned long m1xclk
; /* non-zero to modify */
152 * default gpio settings
155 struct sm501_init_gpio
{
156 struct sm501_reg_init gpio_data_low
;
157 struct sm501_reg_init gpio_data_high
;
158 struct sm501_reg_init gpio_ddr_low
;
159 struct sm501_reg_init gpio_ddr_high
;
164 * This is passed with the platform device to allow the board
165 * to control the behaviour of the SM501 driver(s) which attach
170 struct sm501_platdata
{
171 struct sm501_initdata
*init
;
172 struct sm501_init_gpio
*init_gpiop
;
173 struct sm501_platdata_fb
*fb
;
175 struct sm501_platdata_gpio_i2c
*gpio_i2c
;
176 unsigned int gpio_i2c_nr
;