]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-arm/arch-omap/board.h
ARM: OMAP: Make GPIO switch framework sysfs usage more sensible
[linux-2.6-omap-h63xx.git] / include / asm-arm / arch-omap / board.h
1 /*
2  *  linux/include/asm-arm/arch-omap/board.h
3  *
4  *  Information structures for board-specific data
5  *
6  *  Copyright (C) 2004  Nokia Corporation
7  *  Written by Juha Yrjölä <juha.yrjola@nokia.com>
8  */
9
10 #ifndef _OMAP_BOARD_H
11 #define _OMAP_BOARD_H
12
13 #include <linux/config.h>
14 #include <linux/types.h>
15
16 /* Different peripheral ids */
17 #define OMAP_TAG_CLOCK          0x4f01
18 #define OMAP_TAG_MMC            0x4f02
19 #define OMAP_TAG_SERIAL_CONSOLE 0x4f03
20 #define OMAP_TAG_USB            0x4f04
21 #define OMAP_TAG_LCD            0x4f05
22 #define OMAP_TAG_GPIO_SWITCH    0x4f06
23 #define OMAP_TAG_UART           0x4f07
24 #define OMAP_TAG_FBMEM          0x4f08
25 #define OMAP_TAG_STI_CONSOLE    0x4f09
26 #define OMAP_TAG_CAMERA_SENSOR  0x4f0a
27
28 #define OMAP_TAG_BOOT_REASON    0x4f80
29 #define OMAP_TAG_FLASH_PART     0x4f81
30 #define OMAP_TAG_VERSION_STR    0x4f82
31
32 struct omap_clock_config {
33         /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
34         u8 system_clock_type;
35 };
36
37 struct omap_mmc_conf {
38         unsigned enabled:1;
39         /* nomux means "standard" muxing is wrong on this board, and that
40          * board-specific code handled it before common init logic.
41          */
42         unsigned nomux:1;
43         /* switch pin can be for card detect (default) or card cover */
44         unsigned cover:1;
45         /* 4 wire signaling is optional, and is only used for SD/SDIO */
46         unsigned wire4:1;
47         s16 power_pin;
48         s16 switch_pin;
49         s16 wp_pin;
50 };
51
52 struct omap_mmc_config {
53         struct omap_mmc_conf mmc[2];
54 };
55
56 struct omap_serial_console_config {
57         u8 console_uart;
58         u32 console_speed;
59 };
60
61 struct omap_sti_console_config {
62         unsigned enable:1;
63         u8 channel;
64 };
65
66 struct omap_camera_sensor_config {
67         u16 reset_gpio;
68         int (*power_on)(void * data);
69         int (*power_off)(void * data);
70 };
71
72 struct omap_usb_config {
73         /* Configure drivers according to the connectors on your board:
74          *  - "A" connector (rectagular)
75          *      ... for host/OHCI use, set "register_host".
76          *  - "B" connector (squarish) or "Mini-B"
77          *      ... for device/gadget use, set "register_dev".
78          *  - "Mini-AB" connector (very similar to Mini-B)
79          *      ... for OTG use as device OR host, initialize "otg"
80          */
81         unsigned        register_host:1;
82         unsigned        register_dev:1;
83         u8              otg;    /* port number, 1-based:  usb1 == 2 */
84
85         u8              hmc_mode;
86
87         /* implicitly true if otg:  host supports remote wakeup? */
88         u8              rwc;
89
90         /* signaling pins used to talk to transceiver on usbN:
91          *  0 == usbN unused
92          *  2 == usb0-only, using internal transceiver
93          *  3 == 3 wire bidirectional
94          *  4 == 4 wire bidirectional
95          *  6 == 6 wire unidirectional (or TLL)
96          */
97         u8              pins[3];
98 };
99
100 struct omap_lcd_config {
101         char panel_name[16];
102         char ctrl_name[16];
103         s16  nreset_gpio;
104         u8   data_lines;
105 };
106
107 struct omap_fbmem_config {
108         u32 start;
109         u32 size;
110 };
111
112 struct omap_pwm_led_platform_data {
113         const char *name;
114         int intensity_timer;
115         int blink_timer;
116         void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
117 };
118
119 /* Cover:
120  *      high -> closed
121  *      low  -> open
122  * Connection:
123  *      high -> connected
124  *      low  -> disconnected
125  * Activity:
126  *      high -> active
127  *      low  -> inactive
128  *
129  */
130 #define OMAP_GPIO_SWITCH_TYPE_COVER             0x0000
131 #define OMAP_GPIO_SWITCH_TYPE_CONNECTION        0x0001
132 #define OMAP_GPIO_SWITCH_TYPE_ACTIVITY          0x0002
133 #define OMAP_GPIO_SWITCH_FLAG_INVERTED          0x0001
134 #define OMAP_GPIO_SWITCH_FLAG_OUTPUT            0x0002
135 struct omap_gpio_switch_config {
136         char name[12];
137         u16 gpio;
138         int flags:4;
139         int type:4;
140         int key_code:24; /* Linux key code */
141 };
142
143 struct omap_uart_config {
144         /* Bit field of UARTs present; bit 0 --> UART1 */
145         unsigned int enabled_uarts;
146 };
147
148
149 struct omap_flash_part_config {
150         char part_table[0];
151 };
152
153 struct omap_boot_reason_config {
154         char reason_str[12];
155 };
156
157 struct omap_version_config {
158         char component[12];
159         char version[12];
160 };
161
162
163 #include <asm-arm/arch-omap/board-nokia.h>
164
165 struct omap_board_config_entry {
166         u16 tag;
167         u16 len;
168         u8  data[0];
169 };
170
171 struct omap_board_config_kernel {
172         u16 tag;
173         const void *data;
174 };
175
176 extern const void *__omap_get_config(u16 tag, size_t len, int nr);
177
178 #define omap_get_config(tag, type) \
179         ((const type *) __omap_get_config((tag), sizeof(type), 0))
180 #define omap_get_nr_config(tag, type, nr) \
181         ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
182
183 extern const void *omap_get_var_config(u16 tag, size_t *len);
184
185 extern struct omap_board_config_kernel *omap_board_config;
186 extern int omap_board_config_size;
187
188 #endif