Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-omap1/board-sx1.c |
| 3 | * |
| 4 | * Modified from board-generic.c |
| 5 | * |
| 6 | * Support for the Siemens SX1 mobile phone. |
| 7 | * |
| 8 | * Original version : Vladimir Ananiev (Vovan888-at-gmail com) |
| 9 | * |
| 10 | * Maintainters : Vladimir Ananiev (aka Vovan888), Sergge |
| 11 | * oslik.ru |
| 12 | * |
| 13 | * This program is free software; you can redistribute it and/or modify |
| 14 | * it under the terms of the GNU General Public License version 2 as |
| 15 | * published by the Free Software Foundation. |
| 16 | */ |
Russell King | 2f8163b | 2011-07-26 10:53:52 +0100 | [diff] [blame] | 17 | #include <linux/gpio.h> |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 18 | #include <linux/kernel.h> |
| 19 | #include <linux/init.h> |
| 20 | #include <linux/input.h> |
| 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/notifier.h> |
| 23 | #include <linux/mtd/mtd.h> |
| 24 | #include <linux/mtd/partitions.h> |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 25 | #include <linux/mtd/physmap.h> |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 26 | #include <linux/types.h> |
| 27 | #include <linux/i2c.h> |
| 28 | #include <linux/errno.h> |
Paul Gortmaker | dc28094 | 2011-07-31 16:17:29 -0400 | [diff] [blame] | 29 | #include <linux/export.h> |
Tomi Valkeinen | ddba6c7 | 2011-09-20 15:23:13 +0300 | [diff] [blame] | 30 | #include <linux/omapfb.h> |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 31 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 32 | #include <asm/mach-types.h> |
| 33 | #include <asm/mach/arch.h> |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 34 | #include <asm/mach/map.h> |
| 35 | |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 36 | #include <plat/flash.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 37 | #include <plat/mux.h> |
| 38 | #include <plat/dma.h> |
| 39 | #include <plat/irda.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 40 | #include <plat/tc.h> |
| 41 | #include <plat/board.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 42 | #include <plat/keypad.h> |
| 43 | #include <plat/board-sx1.h> |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 44 | |
Tony Lindgren | 2e3ee9f | 2012-02-24 10:34:34 -0800 | [diff] [blame] | 45 | #include <mach/hardware.h> |
Tony Lindgren | b924b20 | 2012-06-04 00:56:15 -0700 | [diff] [blame] | 46 | #include <mach/usb.h> |
Tony Lindgren | 2e3ee9f | 2012-02-24 10:34:34 -0800 | [diff] [blame] | 47 | |
| 48 | #include "common.h" |
| 49 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 50 | /* Write to I2C device */ |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 51 | int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 52 | { |
| 53 | struct i2c_adapter *adap; |
| 54 | int err; |
| 55 | struct i2c_msg msg[1]; |
| 56 | unsigned char data[2]; |
| 57 | |
| 58 | adap = i2c_get_adapter(0); |
| 59 | if (!adap) |
| 60 | return -ENODEV; |
| 61 | msg->addr = devaddr; /* I2C address of chip */ |
| 62 | msg->flags = 0; |
| 63 | msg->len = 2; |
| 64 | msg->buf = data; |
| 65 | data[0] = regoffset; /* register num */ |
| 66 | data[1] = value; /* register data */ |
| 67 | err = i2c_transfer(adap, msg, 1); |
Jean Delvare | c9a2c46 | 2008-02-24 20:03:41 +0100 | [diff] [blame] | 68 | i2c_put_adapter(adap); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 69 | if (err >= 0) |
| 70 | return 0; |
| 71 | return err; |
| 72 | } |
| 73 | |
| 74 | /* Read from I2C device */ |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 75 | int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value) |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 76 | { |
| 77 | struct i2c_adapter *adap; |
| 78 | int err; |
| 79 | struct i2c_msg msg[1]; |
| 80 | unsigned char data[2]; |
| 81 | |
| 82 | adap = i2c_get_adapter(0); |
| 83 | if (!adap) |
| 84 | return -ENODEV; |
| 85 | |
| 86 | msg->addr = devaddr; /* I2C address of chip */ |
| 87 | msg->flags = 0; |
| 88 | msg->len = 1; |
| 89 | msg->buf = data; |
| 90 | data[0] = regoffset; /* register num */ |
| 91 | err = i2c_transfer(adap, msg, 1); |
| 92 | |
| 93 | msg->addr = devaddr; /* I2C address */ |
| 94 | msg->flags = I2C_M_RD; |
| 95 | msg->len = 1; |
| 96 | msg->buf = data; |
| 97 | err = i2c_transfer(adap, msg, 1); |
| 98 | *value = data[0]; |
Jean Delvare | c9a2c46 | 2008-02-24 20:03:41 +0100 | [diff] [blame] | 99 | i2c_put_adapter(adap); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 100 | |
| 101 | if (err >= 0) |
| 102 | return 0; |
| 103 | return err; |
| 104 | } |
| 105 | /* set keyboard backlight intensity */ |
| 106 | int sx1_setkeylight(u8 keylight) |
| 107 | { |
| 108 | if (keylight > SOFIA_MAX_LIGHT_VAL) |
| 109 | keylight = SOFIA_MAX_LIGHT_VAL; |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 110 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 111 | } |
| 112 | /* get current keylight intensity */ |
| 113 | int sx1_getkeylight(u8 * keylight) |
| 114 | { |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 115 | return sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 116 | } |
| 117 | /* set LCD backlight intensity */ |
| 118 | int sx1_setbacklight(u8 backlight) |
| 119 | { |
| 120 | if (backlight > SOFIA_MAX_LIGHT_VAL) |
| 121 | backlight = SOFIA_MAX_LIGHT_VAL; |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 122 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, |
| 123 | backlight); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 124 | } |
| 125 | /* get current LCD backlight intensity */ |
| 126 | int sx1_getbacklight (u8 * backlight) |
| 127 | { |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 128 | return sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, |
| 129 | backlight); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 130 | } |
| 131 | /* set LCD backlight power on/off */ |
| 132 | int sx1_setmmipower(u8 onoff) |
| 133 | { |
| 134 | int err; |
| 135 | u8 dat = 0; |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 136 | err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 137 | if (err < 0) |
| 138 | return err; |
| 139 | if (onoff) |
| 140 | dat |= SOFIA_MMILIGHT_POWER; |
| 141 | else |
| 142 | dat &= ~SOFIA_MMILIGHT_POWER; |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 143 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 144 | } |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 145 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 146 | /* set USB power on/off */ |
| 147 | int sx1_setusbpower(u8 onoff) |
| 148 | { |
| 149 | int err; |
| 150 | u8 dat = 0; |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 151 | err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 152 | if (err < 0) |
| 153 | return err; |
| 154 | if (onoff) |
| 155 | dat |= SOFIA_USB_POWER; |
| 156 | else |
| 157 | dat &= ~SOFIA_USB_POWER; |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 158 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | EXPORT_SYMBOL(sx1_setkeylight); |
| 162 | EXPORT_SYMBOL(sx1_getkeylight); |
| 163 | EXPORT_SYMBOL(sx1_setbacklight); |
| 164 | EXPORT_SYMBOL(sx1_getbacklight); |
| 165 | EXPORT_SYMBOL(sx1_setmmipower); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 166 | EXPORT_SYMBOL(sx1_setusbpower); |
| 167 | |
| 168 | /*----------- Keypad -------------------------*/ |
| 169 | |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 170 | static const unsigned int sx1_keymap[] = { |
| 171 | KEY(3, 5, GROUP_0 | 117), /* camera Qt::Key_F17 */ |
| 172 | KEY(4, 0, GROUP_0 | 114), /* voice memo Qt::Key_F14 */ |
| 173 | KEY(4, 1, GROUP_2 | 114), /* voice memo */ |
| 174 | KEY(4, 2, GROUP_3 | 114), /* voice memo */ |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 175 | KEY(0, 0, GROUP_1 | KEY_F12), /* red button Qt::Key_Hangup */ |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 176 | KEY(3, 4, GROUP_1 | KEY_LEFT), |
| 177 | KEY(3, 2, GROUP_1 | KEY_DOWN), |
| 178 | KEY(3, 1, GROUP_1 | KEY_RIGHT), |
| 179 | KEY(3, 0, GROUP_1 | KEY_UP), |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 180 | KEY(3, 3, GROUP_1 | KEY_POWER), /* joystick press or Qt::Key_Select */ |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 181 | KEY(0, 5, GROUP_1 | KEY_1), |
| 182 | KEY(0, 4, GROUP_1 | KEY_2), |
| 183 | KEY(0, 3, GROUP_1 | KEY_3), |
| 184 | KEY(4, 3, GROUP_1 | KEY_4), |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 185 | KEY(4, 4, GROUP_1 | KEY_5), |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 186 | KEY(4, 5, GROUP_1 | KEY_KPASTERISK),/* "*" */ |
| 187 | KEY(1, 4, GROUP_1 | KEY_6), |
| 188 | KEY(1, 5, GROUP_1 | KEY_7), |
| 189 | KEY(1, 3, GROUP_1 | KEY_8), |
| 190 | KEY(2, 3, GROUP_1 | KEY_9), |
| 191 | KEY(2, 5, GROUP_1 | KEY_0), |
| 192 | KEY(2, 4, GROUP_1 | 113), /* # F13 Toggle input method Qt::Key_F13 */ |
| 193 | KEY(1, 0, GROUP_1 | KEY_F11), /* green button Qt::Key_Call */ |
| 194 | KEY(2, 1, GROUP_1 | KEY_YEN), /* left soft Qt::Key_Context1 */ |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 195 | KEY(2, 2, GROUP_1 | KEY_F8), /* right soft Qt::Key_Back */ |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 196 | KEY(1, 2, GROUP_1 | KEY_LEFTSHIFT), /* shift */ |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 197 | KEY(1, 1, GROUP_1 | KEY_BACKSPACE), /* C (clear) */ |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 198 | KEY(2, 0, GROUP_1 | KEY_F7), /* menu Qt::Key_Menu */ |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 199 | }; |
| 200 | |
| 201 | static struct resource sx1_kp_resources[] = { |
| 202 | [0] = { |
| 203 | .start = INT_KEYBOARD, |
| 204 | .end = INT_KEYBOARD, |
| 205 | .flags = IORESOURCE_IRQ, |
| 206 | }, |
| 207 | }; |
| 208 | |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 209 | static const struct matrix_keymap_data sx1_keymap_data = { |
| 210 | .keymap = sx1_keymap, |
| 211 | .keymap_size = ARRAY_SIZE(sx1_keymap), |
| 212 | }; |
| 213 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 214 | static struct omap_kp_platform_data sx1_kp_data = { |
| 215 | .rows = 6, |
| 216 | .cols = 6, |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 217 | .keymap_data = &sx1_keymap_data, |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 218 | .delay = 80, |
| 219 | }; |
| 220 | |
| 221 | static struct platform_device sx1_kp_device = { |
| 222 | .name = "omap-keypad", |
| 223 | .id = -1, |
| 224 | .dev = { |
| 225 | .platform_data = &sx1_kp_data, |
| 226 | }, |
| 227 | .num_resources = ARRAY_SIZE(sx1_kp_resources), |
| 228 | .resource = sx1_kp_resources, |
| 229 | }; |
| 230 | |
| 231 | /*----------- IRDA -------------------------*/ |
| 232 | |
| 233 | static struct omap_irda_config sx1_irda_data = { |
| 234 | .transceiver_cap = IR_SIRMODE, |
| 235 | .rx_channel = OMAP_DMA_UART3_RX, |
| 236 | .tx_channel = OMAP_DMA_UART3_TX, |
| 237 | .dest_start = UART3_THR, |
| 238 | .src_start = UART3_RHR, |
| 239 | .tx_trigger = 0, |
| 240 | .rx_trigger = 0, |
| 241 | }; |
| 242 | |
| 243 | static struct resource sx1_irda_resources[] = { |
| 244 | [0] = { |
| 245 | .start = INT_UART3, |
| 246 | .end = INT_UART3, |
| 247 | .flags = IORESOURCE_IRQ, |
| 248 | }, |
| 249 | }; |
| 250 | |
| 251 | static u64 irda_dmamask = 0xffffffff; |
| 252 | |
| 253 | static struct platform_device sx1_irda_device = { |
| 254 | .name = "omapirda", |
| 255 | .id = 0, |
| 256 | .dev = { |
| 257 | .platform_data = &sx1_irda_data, |
| 258 | .dma_mask = &irda_dmamask, |
| 259 | }, |
| 260 | .num_resources = ARRAY_SIZE(sx1_irda_resources), |
| 261 | .resource = sx1_irda_resources, |
| 262 | }; |
| 263 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 264 | /*----------- MTD -------------------------*/ |
| 265 | |
| 266 | static struct mtd_partition sx1_partitions[] = { |
| 267 | /* bootloader (U-Boot, etc) in first sector */ |
| 268 | { |
| 269 | .name = "bootloader", |
| 270 | .offset = 0x01800000, |
| 271 | .size = SZ_128K, |
| 272 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 273 | }, |
| 274 | /* bootloader params in the next sector */ |
| 275 | { |
| 276 | .name = "params", |
| 277 | .offset = MTDPART_OFS_APPEND, |
| 278 | .size = SZ_128K, |
| 279 | .mask_flags = 0, |
| 280 | }, |
| 281 | /* kernel */ |
| 282 | { |
| 283 | .name = "kernel", |
| 284 | .offset = MTDPART_OFS_APPEND, |
| 285 | .size = SZ_2M - 2 * SZ_128K, |
| 286 | .mask_flags = 0 |
| 287 | }, |
| 288 | /* file system */ |
| 289 | { |
| 290 | .name = "filesystem", |
| 291 | .offset = MTDPART_OFS_APPEND, |
| 292 | .size = MTDPART_SIZ_FULL, |
| 293 | .mask_flags = 0 |
| 294 | } |
| 295 | }; |
| 296 | |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 297 | static struct physmap_flash_data sx1_flash_data = { |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 298 | .width = 2, |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 299 | .set_vpp = omap1_set_vpp, |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 300 | .parts = sx1_partitions, |
| 301 | .nr_parts = ARRAY_SIZE(sx1_partitions), |
| 302 | }; |
| 303 | |
| 304 | #ifdef CONFIG_SX1_OLD_FLASH |
| 305 | /* MTD Intel StrataFlash - old flashes */ |
| 306 | static struct resource sx1_old_flash_resource[] = { |
| 307 | [0] = { |
| 308 | .start = OMAP_CS0_PHYS, /* Physical */ |
| 309 | .end = OMAP_CS0_PHYS + SZ_16M - 1,, |
| 310 | .flags = IORESOURCE_MEM, |
| 311 | }, |
| 312 | [1] = { |
| 313 | .start = OMAP_CS1_PHYS, |
| 314 | .end = OMAP_CS1_PHYS + SZ_8M - 1, |
| 315 | .flags = IORESOURCE_MEM, |
| 316 | }, |
| 317 | }; |
| 318 | |
| 319 | static struct platform_device sx1_flash_device = { |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 320 | .name = "physmap-flash", |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 321 | .id = 0, |
| 322 | .dev = { |
| 323 | .platform_data = &sx1_flash_data, |
| 324 | }, |
| 325 | .num_resources = 2, |
| 326 | .resource = &sx1_old_flash_resource, |
| 327 | }; |
| 328 | #else |
| 329 | /* MTD Intel 4000 flash - new flashes */ |
| 330 | static struct resource sx1_new_flash_resource = { |
| 331 | .start = OMAP_CS0_PHYS, |
| 332 | .end = OMAP_CS0_PHYS + SZ_32M - 1, |
| 333 | .flags = IORESOURCE_MEM, |
| 334 | }; |
| 335 | |
| 336 | static struct platform_device sx1_flash_device = { |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 337 | .name = "physmap-flash", |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 338 | .id = 0, |
| 339 | .dev = { |
| 340 | .platform_data = &sx1_flash_data, |
| 341 | }, |
| 342 | .num_resources = 1, |
| 343 | .resource = &sx1_new_flash_resource, |
| 344 | }; |
| 345 | #endif |
| 346 | |
| 347 | /*----------- USB -------------------------*/ |
| 348 | |
| 349 | static struct omap_usb_config sx1_usb_config __initdata = { |
| 350 | .otg = 0, |
| 351 | .register_dev = 1, |
| 352 | .register_host = 0, |
| 353 | .hmc_mode = 0, |
| 354 | .pins[0] = 2, |
| 355 | .pins[1] = 0, |
| 356 | .pins[2] = 0, |
| 357 | }; |
| 358 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 359 | /*----------- LCD -------------------------*/ |
| 360 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 361 | static struct omap_lcd_config sx1_lcd_config __initdata = { |
| 362 | .ctrl_name = "internal", |
| 363 | }; |
| 364 | |
| 365 | /*-----------------------------------------*/ |
| 366 | static struct platform_device *sx1_devices[] __initdata = { |
| 367 | &sx1_flash_device, |
| 368 | &sx1_kp_device, |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 369 | &sx1_irda_device, |
| 370 | }; |
Tony Lindgren | e27a93a | 2007-12-18 20:58:32 -0800 | [diff] [blame] | 371 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 372 | /*-----------------------------------------*/ |
Tony Lindgren | e27a93a | 2007-12-18 20:58:32 -0800 | [diff] [blame] | 373 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 374 | static void __init omap_sx1_init(void) |
| 375 | { |
Janusz Krzysztofik | c33da3a | 2009-10-22 14:47:42 -0700 | [diff] [blame] | 376 | /* mux pins for uarts */ |
| 377 | omap_cfg_reg(UART1_TX); |
| 378 | omap_cfg_reg(UART1_RTS); |
| 379 | omap_cfg_reg(UART2_TX); |
| 380 | omap_cfg_reg(UART2_RTS); |
| 381 | omap_cfg_reg(UART3_TX); |
| 382 | omap_cfg_reg(UART3_RX); |
| 383 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 384 | platform_add_devices(sx1_devices, ARRAY_SIZE(sx1_devices)); |
| 385 | |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 386 | omap_serial_init(); |
Jarkko Nikula | 1ed16a8 | 2007-11-07 06:54:32 +0200 | [diff] [blame] | 387 | omap_register_i2c_bus(1, 100, NULL, 0); |
Tony Lindgren | dd0cdd8 | 2010-07-05 16:31:30 +0300 | [diff] [blame] | 388 | omap1_usb_init(&sx1_usb_config); |
Carlos Eduardo Aguiar | 087c503 | 2007-11-30 01:52:53 -0400 | [diff] [blame] | 389 | sx1_mmc_init(); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 390 | |
| 391 | /* turn on USB power */ |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 392 | /* sx1_setusbpower(1); can't do it here because i2c is not ready */ |
Jarkko Nikula | 73069e3 | 2009-01-15 13:09:52 +0200 | [diff] [blame] | 393 | gpio_request(1, "A_IRDA_OFF"); |
| 394 | gpio_request(11, "A_SWITCH"); |
| 395 | gpio_request(15, "A_USB_ON"); |
David Brownell | e918edf | 2008-12-10 17:35:26 -0800 | [diff] [blame] | 396 | gpio_direction_output(1, 1); /*A_IRDA_OFF = 1 */ |
| 397 | gpio_direction_output(11, 0); /*A_SWITCH = 0 */ |
| 398 | gpio_direction_output(15, 0); /*A_USB_ON = 0 */ |
Tomi Valkeinen | ddba6c7 | 2011-09-20 15:23:13 +0300 | [diff] [blame] | 399 | |
| 400 | omapfb_set_lcd_config(&sx1_lcd_config); |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 401 | } |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 402 | |
| 403 | MACHINE_START(SX1, "OMAP310 based Siemens SX1") |
Nicolas Pitre | 246e389 | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 404 | .atag_offset = 0x100, |
Tony Lindgren | 7b88e62 | 2011-10-05 15:14:02 -0700 | [diff] [blame] | 405 | .map_io = omap15xx_map_io, |
| 406 | .init_early = omap1_init_early, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 407 | .reserve = omap_reserve, |
Tony Lindgren | 7b88e62 | 2011-10-05 15:14:02 -0700 | [diff] [blame] | 408 | .init_irq = omap1_init_irq, |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 409 | .init_machine = omap_sx1_init, |
Shawn Guo | 82c3bd0 | 2012-04-26 13:49:29 +0800 | [diff] [blame] | 410 | .init_late = omap1_init_late, |
Tony Lindgren | e74984e | 2011-03-29 15:54:48 -0700 | [diff] [blame] | 411 | .timer = &omap1_timer, |
Russell King | baa9588 | 2011-11-05 17:06:28 +0000 | [diff] [blame] | 412 | .restart = omap1_restart, |
Vladimir Ananiev | c79ed19 | 2006-12-06 17:14:08 -0800 | [diff] [blame] | 413 | MACHINE_END |