]>
Commit | Line | Data |
---|---|---|
b6d6454f BD |
1 | /* include/linux/sm501.h |
2 | * | |
3 | * Copyright (c) 2006 Simtec Electronics | |
4 | * Ben Dooks <ben@simtec.co.uk> | |
5 | * Vincent Sanders <vince@simtec.co.uk> | |
6 | * | |
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 | |
10 | * | |
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. | |
15 | * | |
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 | |
19 | */ | |
20 | ||
21 | extern int sm501_unit_power(struct device *dev, | |
22 | unsigned int unit, unsigned int to); | |
23 | ||
24 | extern unsigned long sm501_set_clock(struct device *dev, | |
25 | int clksrc, unsigned long freq); | |
26 | ||
27 | extern unsigned long sm501_find_clock(int clksrc, unsigned long req_freq); | |
28 | ||
29 | /* sm501_misc_control | |
30 | * | |
31 | * Modify the SM501's MISC_CONTROL register | |
32 | */ | |
33 | ||
34 | extern int sm501_misc_control(struct device *dev, | |
35 | unsigned long set, unsigned long clear); | |
36 | ||
37 | /* sm501_modify_reg | |
38 | * | |
39 | * Modify a register in the SM501 which may be shared with other | |
40 | * drivers. | |
41 | */ | |
42 | ||
43 | extern unsigned long sm501_modify_reg(struct device *dev, | |
44 | unsigned long reg, | |
45 | unsigned long set, | |
46 | unsigned long clear); | |
47 | ||
48 | /* sm501_gpio_set | |
49 | * | |
50 | * set the state of the given GPIO line | |
51 | */ | |
52 | ||
53 | extern void sm501_gpio_set(struct device *dev, | |
54 | unsigned long gpio, | |
55 | unsigned int to, | |
56 | unsigned int dir); | |
57 | ||
58 | /* sm501_gpio_get | |
59 | * | |
60 | * get the state of the given GPIO line | |
61 | */ | |
62 | ||
63 | extern unsigned long sm501_gpio_get(struct device *dev, | |
64 | unsigned long gpio); | |
65 | ||
66 | ||
67 | /* Platform data definitions */ | |
68 | ||
69 | #define SM501FB_FLAG_USE_INIT_MODE (1<<0) | |
70 | #define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) | |
71 | #define SM501FB_FLAG_USE_HWCURSOR (1<<2) | |
72 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) | |
73 | ||
74 | struct sm501_platdata_fbsub { | |
75 | struct fb_videomode *def_mode; | |
76 | unsigned int def_bpp; | |
77 | unsigned long max_mem; | |
78 | unsigned int flags; | |
79 | }; | |
80 | ||
81 | enum sm501_fb_routing { | |
82 | SM501_FB_OWN = 0, /* CRT=>CRT, Panel=>Panel */ | |
83 | SM501_FB_CRT_PANEL = 1, /* Panel=>CRT, Panel=>Panel */ | |
84 | }; | |
85 | ||
86 | /* sm501_platdata_fb flag field bit definitions */ | |
87 | ||
88 | #define SM501_FBPD_SWAP_FB_ENDIAN (1<<0) /* need to endian swap */ | |
89 | ||
90 | /* sm501_platdata_fb | |
91 | * | |
92 | * configuration data for the framebuffer driver | |
93 | */ | |
94 | ||
95 | struct sm501_platdata_fb { | |
96 | enum sm501_fb_routing fb_route; | |
97 | unsigned int flags; | |
98 | struct sm501_platdata_fbsub *fb_crt; | |
99 | struct sm501_platdata_fbsub *fb_pnl; | |
100 | }; | |
101 | ||
102 | /* gpio i2c */ | |
103 | ||
104 | struct sm501_platdata_gpio_i2c { | |
105 | unsigned int pin_sda; | |
106 | unsigned int pin_scl; | |
107 | }; | |
108 | ||
109 | /* sm501_initdata | |
110 | * | |
111 | * use for initialising values that may not have been setup | |
112 | * before the driver is loaded. | |
113 | */ | |
114 | ||
115 | struct sm501_reg_init { | |
116 | unsigned long set; | |
117 | unsigned long mask; | |
118 | }; | |
119 | ||
120 | #define SM501_USE_USB_HOST (1<<0) | |
121 | #define SM501_USE_USB_SLAVE (1<<1) | |
122 | #define SM501_USE_SSP0 (1<<2) | |
123 | #define SM501_USE_SSP1 (1<<3) | |
124 | #define SM501_USE_UART0 (1<<4) | |
125 | #define SM501_USE_UART1 (1<<5) | |
126 | #define SM501_USE_FBACCEL (1<<6) | |
127 | #define SM501_USE_AC97 (1<<7) | |
128 | #define SM501_USE_I2S (1<<8) | |
129 | ||
130 | #define SM501_USE_ALL (0xffffffff) | |
131 | ||
132 | struct sm501_initdata { | |
133 | struct sm501_reg_init gpio_low; | |
134 | struct sm501_reg_init gpio_high; | |
135 | struct sm501_reg_init misc_timing; | |
136 | struct sm501_reg_init misc_control; | |
137 | ||
138 | unsigned long devices; | |
139 | unsigned long mclk; /* non-zero to modify */ | |
140 | unsigned long m1xclk; /* non-zero to modify */ | |
141 | }; | |
142 | ||
143 | /* sm501_init_gpio | |
144 | * | |
145 | * default gpio settings | |
146 | */ | |
147 | ||
148 | struct sm501_init_gpio { | |
149 | struct sm501_reg_init gpio_data_low; | |
150 | struct sm501_reg_init gpio_data_high; | |
151 | struct sm501_reg_init gpio_ddr_low; | |
152 | struct sm501_reg_init gpio_ddr_high; | |
153 | }; | |
154 | ||
155 | /* sm501_platdata | |
156 | * | |
157 | * This is passed with the platform device to allow the board | |
158 | * to control the behaviour of the SM501 driver(s) which attach | |
159 | * to the device. | |
160 | * | |
161 | */ | |
162 | ||
163 | struct sm501_platdata { | |
164 | struct sm501_initdata *init; | |
165 | struct sm501_init_gpio *init_gpiop; | |
166 | struct sm501_platdata_fb *fb; | |
167 | ||
168 | struct sm501_platdata_gpio_i2c *gpio_i2c; | |
169 | unsigned int gpio_i2c_nr; | |
170 | }; |