Merge branches 'fixes', 'cleanups' and 'boards'
[pandora-kernel.git] / arch / arm / plat-omap / include / mach / board.h
1 /*
2  *  arch/arm/plat-omap/include/mach/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/types.h>
14
15 #include <mach/gpio-switch.h>
16
17 /* Different peripheral ids */
18 #define OMAP_TAG_CLOCK          0x4f01
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_serial_console_config {
38         u8 console_uart;
39         u32 console_speed;
40 };
41
42 struct omap_sti_console_config {
43         unsigned enable:1;
44         u8 channel;
45 };
46
47 struct omap_camera_sensor_config {
48         u16 reset_gpio;
49         int (*power_on)(void * data);
50         int (*power_off)(void * data);
51 };
52
53 struct omap_usb_config {
54         /* Configure drivers according to the connectors on your board:
55          *  - "A" connector (rectagular)
56          *      ... for host/OHCI use, set "register_host".
57          *  - "B" connector (squarish) or "Mini-B"
58          *      ... for device/gadget use, set "register_dev".
59          *  - "Mini-AB" connector (very similar to Mini-B)
60          *      ... for OTG use as device OR host, initialize "otg"
61          */
62         unsigned        register_host:1;
63         unsigned        register_dev:1;
64         u8              otg;    /* port number, 1-based:  usb1 == 2 */
65
66         u8              hmc_mode;
67
68         /* implicitly true if otg:  host supports remote wakeup? */
69         u8              rwc;
70
71         /* signaling pins used to talk to transceiver on usbN:
72          *  0 == usbN unused
73          *  2 == usb0-only, using internal transceiver
74          *  3 == 3 wire bidirectional
75          *  4 == 4 wire bidirectional
76          *  6 == 6 wire unidirectional (or TLL)
77          */
78         u8              pins[3];
79 };
80
81 struct omap_lcd_config {
82         char panel_name[16];
83         char ctrl_name[16];
84         s16  nreset_gpio;
85         u8   data_lines;
86 };
87
88 struct device;
89 struct fb_info;
90 struct omap_backlight_config {
91         int default_intensity;
92         int (*set_power)(struct device *dev, int state);
93         int (*check_fb)(struct fb_info *fb);
94 };
95
96 struct omap_fbmem_config {
97         u32 start;
98         u32 size;
99 };
100
101 struct omap_pwm_led_platform_data {
102         const char *name;
103         int intensity_timer;
104         int blink_timer;
105         void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
106 };
107
108 /* See arch/arm/plat-omap/include/mach/gpio-switch.h for definitions */
109 struct omap_gpio_switch_config {
110         char name[12];
111         u16 gpio;
112         int flags:4;
113         int type:4;
114         int key_code:24; /* Linux key code */
115 };
116
117 struct omap_uart_config {
118         /* Bit field of UARTs present; bit 0 --> UART1 */
119         unsigned int enabled_uarts;
120 };
121
122
123 struct omap_flash_part_config {
124         char part_table[0];
125 };
126
127 struct omap_boot_reason_config {
128         char reason_str[12];
129 };
130
131 struct omap_version_config {
132         char component[12];
133         char version[12];
134 };
135
136
137 #include <mach/board-nokia.h>
138
139 struct omap_board_config_entry {
140         u16 tag;
141         u16 len;
142         u8  data[0];
143 };
144
145 struct omap_board_config_kernel {
146         u16 tag;
147         const void *data;
148 };
149
150 extern const void *__omap_get_config(u16 tag, size_t len, int nr);
151
152 #define omap_get_config(tag, type) \
153         ((const type *) __omap_get_config((tag), sizeof(type), 0))
154 #define omap_get_nr_config(tag, type, nr) \
155         ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
156
157 extern const void *omap_get_var_config(u16 tag, size_t *len);
158
159 extern struct omap_board_config_kernel *omap_board_config;
160 extern int omap_board_config_size;
161
162
163 /* for TI reference platforms sharing the same debug card */
164 extern int debug_card_init(u32 addr, unsigned gpio);
165
166 #endif