Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 1 | /* |
Linus Walleij | a3a6c6a | 2012-10-01 09:37:39 +0200 | [diff] [blame] | 2 | * Copyright (C) 2008-2012 ST-Ericsson |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 3 | * |
| 4 | * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2, as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | */ |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/interrupt.h> |
| 14 | #include <linux/platform_device.h> |
| 15 | #include <linux/io.h> |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 16 | #include <linux/i2c.h> |
Alessandro Rubini | af97bac | 2012-06-11 22:56:26 +0200 | [diff] [blame] | 17 | #include <linux/platform_data/i2c-nomadik.h> |
hongbo.zhang | dc1956b | 2012-11-15 18:56:43 +0800 | [diff] [blame] | 18 | #include <linux/platform_data/db8500_thermal.h> |
Rabin Vincent | ea05a57 | 2010-06-03 07:58:42 +0100 | [diff] [blame] | 19 | #include <linux/gpio.h> |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 20 | #include <linux/amba/bus.h> |
| 21 | #include <linux/amba/pl022.h> |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 22 | #include <linux/amba/serial.h> |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 23 | #include <linux/spi/spi.h> |
Linus Walleij | ee66e65 | 2011-12-02 14:16:33 +0100 | [diff] [blame] | 24 | #include <linux/mfd/abx500/ab8500.h> |
Bengt Jonsson | 79568b94 | 2011-03-11 11:54:46 +0100 | [diff] [blame] | 25 | #include <linux/regulator/ab8500.h> |
Lee Jones | 0b5ea1e | 2012-09-03 14:33:39 +0100 | [diff] [blame] | 26 | #include <linux/regulator/fixed.h> |
Lee Jones | cd2fa6d | 2013-01-31 11:31:16 +0000 | [diff] [blame^] | 27 | #include <linux/regulator/driver.h> |
| 28 | #include <linux/regulator/gpio-regulator.h> |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 29 | #include <linux/mfd/tc3589x.h> |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 30 | #include <linux/mfd/tps6105x.h> |
Linus Walleij | ee66e65 | 2011-12-02 14:16:33 +0100 | [diff] [blame] | 31 | #include <linux/mfd/abx500/ab8500-gpio.h> |
Ola Lilja | f242e50 | 2012-06-07 14:00:46 +0200 | [diff] [blame] | 32 | #include <linux/mfd/abx500/ab8500-codec.h> |
Milo(Woogyom) Kim | df4094d | 2013-02-05 19:26:59 +0900 | [diff] [blame] | 33 | #include <linux/platform_data/leds-lp55xx.h> |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 34 | #include <linux/input.h> |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 35 | #include <linux/smsc911x.h> |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 36 | #include <linux/gpio_keys.h> |
Shreshtha Kumar Sahu | 1a7d436 | 2011-06-13 10:11:44 +0200 | [diff] [blame] | 37 | #include <linux/delay.h> |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 38 | #include <linux/leds.h> |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 39 | #include <linux/pinctrl/consumer.h> |
Linus Walleij | bb16bd9 | 2012-10-10 14:27:58 +0200 | [diff] [blame] | 40 | #include <linux/platform_data/pinctrl-nomadik.h> |
Linus Walleij | 865fab6 | 2012-10-18 14:20:16 +0200 | [diff] [blame] | 41 | #include <linux/platform_data/dma-ste-dma40.h> |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 42 | |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 43 | #include <asm/mach-types.h> |
| 44 | #include <asm/mach/arch.h> |
| 45 | |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 46 | #include <mach/hardware.h> |
| 47 | #include <mach/setup.h> |
Rabin Vincent | 9e4e7fe | 2010-05-03 08:03:52 +0100 | [diff] [blame] | 48 | #include <mach/devices.h> |
Linus Walleij | 29aeb3c | 2010-09-06 22:15:08 +0100 | [diff] [blame] | 49 | #include <mach/irqs.h> |
Arnd Bergmann | db298da | 2012-08-24 15:19:33 +0200 | [diff] [blame] | 50 | #include <linux/platform_data/crypto-ux500.h> |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 51 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 52 | #include "ste-dma40-db8500.h" |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 53 | #include "devices-db8500.h" |
Hanumath Prasad | 008f8a2 | 2010-08-19 12:06:32 +0100 | [diff] [blame] | 54 | #include "board-mop500.h" |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 55 | #include "board-mop500-regulators.h" |
Rabin Vincent | ea05a57 | 2010-06-03 07:58:42 +0100 | [diff] [blame] | 56 | |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 57 | static struct gpio_led snowball_led_array[] = { |
| 58 | { |
| 59 | .name = "user_led", |
Lee Jones | c525f07 | 2012-05-02 09:20:37 +0100 | [diff] [blame] | 60 | .default_trigger = "heartbeat", |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 61 | .gpio = 142, |
| 62 | }, |
| 63 | }; |
| 64 | |
| 65 | static struct gpio_led_platform_data snowball_led_data = { |
| 66 | .leds = snowball_led_array, |
| 67 | .num_leds = ARRAY_SIZE(snowball_led_array), |
| 68 | }; |
| 69 | |
| 70 | static struct platform_device snowball_led_dev = { |
| 71 | .name = "leds-gpio", |
| 72 | .dev = { |
| 73 | .platform_data = &snowball_led_data, |
| 74 | }, |
| 75 | }; |
| 76 | |
Lee Jones | 0b5ea1e | 2012-09-03 14:33:39 +0100 | [diff] [blame] | 77 | static struct fixed_voltage_config snowball_gpio_en_3v3_data = { |
| 78 | .supply_name = "EN-3V3", |
| 79 | .gpio = SNOWBALL_EN_3V3_ETH_GPIO, |
| 80 | .microvolts = 3300000, |
| 81 | .enable_high = 1, |
| 82 | .init_data = &gpio_en_3v3_regulator, |
| 83 | .startup_delay = 5000, /* 1200us */ |
| 84 | }; |
| 85 | |
| 86 | static struct platform_device snowball_gpio_en_3v3_regulator_dev = { |
| 87 | .name = "reg-fixed-voltage", |
| 88 | .id = 1, |
| 89 | .dev = { |
| 90 | .platform_data = &snowball_gpio_en_3v3_data, |
| 91 | }, |
| 92 | }; |
| 93 | |
Lee Jones | cd2fa6d | 2013-01-31 11:31:16 +0000 | [diff] [blame^] | 94 | /* Dynamically populated. */ |
| 95 | static struct gpio sdi0_reg_gpios[] = { |
| 96 | { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" }, |
| 97 | }; |
| 98 | |
| 99 | static struct gpio_regulator_state sdi0_reg_states[] = { |
| 100 | { .value = 2900000, .gpios = (0 << 0) }, |
| 101 | { .value = 1800000, .gpios = (1 << 0) }, |
| 102 | }; |
| 103 | |
| 104 | static struct gpio_regulator_config sdi0_reg_info = { |
| 105 | .supply_name = "ext-mmc-level-shifter", |
| 106 | .gpios = sdi0_reg_gpios, |
| 107 | .nr_gpios = ARRAY_SIZE(sdi0_reg_gpios), |
| 108 | .states = sdi0_reg_states, |
| 109 | .nr_states = ARRAY_SIZE(sdi0_reg_states), |
| 110 | .type = REGULATOR_VOLTAGE, |
| 111 | .enable_high = 1, |
| 112 | .enabled_at_boot = 0, |
| 113 | .init_data = &sdi0_reg_init_data, |
| 114 | .startup_delay = 100, |
| 115 | }; |
| 116 | |
| 117 | static struct platform_device sdi0_regulator = { |
| 118 | .name = "gpio-regulator", |
| 119 | .id = -1, |
| 120 | .dev = { |
| 121 | .platform_data = &sdi0_reg_info, |
| 122 | }, |
| 123 | }; |
| 124 | |
Patrice Chotard | 0493e64 | 2013-01-08 10:41:02 +0100 | [diff] [blame] | 125 | static struct abx500_gpio_platform_data ab8500_gpio_pdata = { |
Philippe Langlais | a1524ee | 2012-02-13 10:52:25 +0100 | [diff] [blame] | 126 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), |
Bibek Basu | 3ef374a | 2011-02-15 12:56:16 +0530 | [diff] [blame] | 127 | }; |
| 128 | |
Ola Lilja | f242e50 | 2012-06-07 14:00:46 +0200 | [diff] [blame] | 129 | /* ab8500-codec */ |
| 130 | static struct ab8500_codec_platform_data ab8500_codec_pdata = { |
| 131 | .amics = { |
| 132 | .mic1_type = AMIC_TYPE_DIFFERENTIAL, |
| 133 | .mic2_type = AMIC_TYPE_DIFFERENTIAL, |
| 134 | .mic1a_micbias = AMIC_MICBIAS_VAMIC1, |
| 135 | .mic1b_micbias = AMIC_MICBIAS_VAMIC1, |
| 136 | .mic2_micbias = AMIC_MICBIAS_VAMIC2 |
| 137 | }, |
| 138 | .ear_cmv = EAR_CMV_0_95V |
| 139 | }; |
| 140 | |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 141 | static struct gpio_keys_button snowball_key_array[] = { |
| 142 | { |
| 143 | .gpio = 32, |
| 144 | .type = EV_KEY, |
| 145 | .code = KEY_1, |
| 146 | .desc = "userpb", |
| 147 | .active_low = 1, |
| 148 | .debounce_interval = 50, |
| 149 | .wakeup = 1, |
| 150 | }, |
| 151 | { |
| 152 | .gpio = 151, |
| 153 | .type = EV_KEY, |
| 154 | .code = KEY_2, |
| 155 | .desc = "extkb1", |
| 156 | .active_low = 1, |
| 157 | .debounce_interval = 50, |
| 158 | .wakeup = 1, |
| 159 | }, |
| 160 | { |
| 161 | .gpio = 152, |
| 162 | .type = EV_KEY, |
| 163 | .code = KEY_3, |
| 164 | .desc = "extkb2", |
| 165 | .active_low = 1, |
| 166 | .debounce_interval = 50, |
| 167 | .wakeup = 1, |
| 168 | }, |
| 169 | { |
| 170 | .gpio = 161, |
| 171 | .type = EV_KEY, |
| 172 | .code = KEY_4, |
| 173 | .desc = "extkb3", |
| 174 | .active_low = 1, |
| 175 | .debounce_interval = 50, |
| 176 | .wakeup = 1, |
| 177 | }, |
| 178 | { |
| 179 | .gpio = 162, |
| 180 | .type = EV_KEY, |
| 181 | .code = KEY_5, |
| 182 | .desc = "extkb4", |
| 183 | .active_low = 1, |
| 184 | .debounce_interval = 50, |
| 185 | .wakeup = 1, |
| 186 | }, |
| 187 | }; |
| 188 | |
| 189 | static struct gpio_keys_platform_data snowball_key_data = { |
| 190 | .buttons = snowball_key_array, |
| 191 | .nbuttons = ARRAY_SIZE(snowball_key_array), |
| 192 | }; |
| 193 | |
| 194 | static struct platform_device snowball_key_dev = { |
| 195 | .name = "gpio-keys", |
| 196 | .id = -1, |
| 197 | .dev = { |
| 198 | .platform_data = &snowball_key_data, |
| 199 | } |
| 200 | }; |
| 201 | |
| 202 | static struct smsc911x_platform_config snowball_sbnet_cfg = { |
| 203 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, |
| 204 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 205 | .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY, |
| 206 | .shift = 1, |
| 207 | }; |
| 208 | |
| 209 | static struct resource sbnet_res[] = { |
| 210 | { |
| 211 | .name = "smsc911x-memory", |
| 212 | .start = (0x5000 << 16), |
| 213 | .end = (0x5000 << 16) + 0xffff, |
| 214 | .flags = IORESOURCE_MEM, |
| 215 | }, |
| 216 | { |
| 217 | .start = NOMADIK_GPIO_TO_IRQ(140), |
| 218 | .end = NOMADIK_GPIO_TO_IRQ(140), |
| 219 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
| 220 | }, |
| 221 | }; |
| 222 | |
| 223 | static struct platform_device snowball_sbnet_dev = { |
| 224 | .name = "smsc911x", |
| 225 | .num_resources = ARRAY_SIZE(sbnet_res), |
| 226 | .resource = sbnet_res, |
| 227 | .dev = { |
| 228 | .platform_data = &snowball_sbnet_cfg, |
| 229 | }, |
| 230 | }; |
| 231 | |
Linus Walleij | 05ec260 | 2013-02-07 10:17:31 +0100 | [diff] [blame] | 232 | struct ab8500_platform_data ab8500_platdata = { |
Rabin Vincent | 39ae702 | 2010-07-26 11:12:15 +0100 | [diff] [blame] | 233 | .irq_base = MOP500_AB8500_IRQ_BASE, |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 234 | .regulator_reg_init = ab8500_regulator_reg_init, |
| 235 | .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init), |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 236 | .regulator = ab8500_regulators, |
| 237 | .num_regulator = ARRAY_SIZE(ab8500_regulators), |
Bibek Basu | 3ef374a | 2011-02-15 12:56:16 +0530 | [diff] [blame] | 238 | .gpio = &ab8500_gpio_pdata, |
Ola Lilja | f242e50 | 2012-06-07 14:00:46 +0200 | [diff] [blame] | 239 | .codec = &ab8500_codec_pdata, |
Rabin Vincent | 39ae702 | 2010-07-26 11:12:15 +0100 | [diff] [blame] | 240 | }; |
| 241 | |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 242 | /* |
hongbo.zhang | dc1956b | 2012-11-15 18:56:43 +0800 | [diff] [blame] | 243 | * Thermal Sensor |
| 244 | */ |
| 245 | |
| 246 | static struct resource db8500_thsens_resources[] = { |
| 247 | { |
| 248 | .name = "IRQ_HOTMON_LOW", |
| 249 | .start = IRQ_PRCMU_HOTMON_LOW, |
| 250 | .end = IRQ_PRCMU_HOTMON_LOW, |
| 251 | .flags = IORESOURCE_IRQ, |
| 252 | }, |
| 253 | { |
| 254 | .name = "IRQ_HOTMON_HIGH", |
| 255 | .start = IRQ_PRCMU_HOTMON_HIGH, |
| 256 | .end = IRQ_PRCMU_HOTMON_HIGH, |
| 257 | .flags = IORESOURCE_IRQ, |
| 258 | }, |
| 259 | }; |
| 260 | |
| 261 | static struct db8500_thsens_platform_data db8500_thsens_data = { |
| 262 | .trip_points[0] = { |
| 263 | .temp = 70000, |
| 264 | .type = THERMAL_TRIP_ACTIVE, |
| 265 | .cdev_name = { |
| 266 | [0] = "thermal-cpufreq-0", |
| 267 | }, |
| 268 | }, |
| 269 | .trip_points[1] = { |
| 270 | .temp = 75000, |
| 271 | .type = THERMAL_TRIP_ACTIVE, |
| 272 | .cdev_name = { |
| 273 | [0] = "thermal-cpufreq-0", |
| 274 | }, |
| 275 | }, |
| 276 | .trip_points[2] = { |
| 277 | .temp = 80000, |
| 278 | .type = THERMAL_TRIP_ACTIVE, |
| 279 | .cdev_name = { |
| 280 | [0] = "thermal-cpufreq-0", |
| 281 | }, |
| 282 | }, |
| 283 | .trip_points[3] = { |
| 284 | .temp = 85000, |
| 285 | .type = THERMAL_TRIP_CRITICAL, |
| 286 | }, |
| 287 | .num_trips = 4, |
| 288 | }; |
| 289 | |
| 290 | static struct platform_device u8500_thsens_device = { |
| 291 | .name = "db8500-thermal", |
| 292 | .resource = db8500_thsens_resources, |
| 293 | .num_resources = ARRAY_SIZE(db8500_thsens_resources), |
| 294 | .dev = { |
| 295 | .platform_data = &db8500_thsens_data, |
| 296 | }, |
| 297 | }; |
| 298 | |
| 299 | static struct platform_device u8500_cpufreq_cooling_device = { |
| 300 | .name = "db8500-cpufreq-cooling", |
| 301 | }; |
| 302 | |
| 303 | /* |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 304 | * TPS61052 |
| 305 | */ |
| 306 | |
| 307 | static struct tps6105x_platform_data mop500_tps61052_data = { |
| 308 | .mode = TPS6105X_MODE_VOLTAGE, |
| 309 | .regulator_data = &tps61052_regulator, |
| 310 | }; |
| 311 | |
| 312 | /* |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 313 | * TC35892 |
| 314 | */ |
| 315 | |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 316 | static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base) |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 317 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 318 | struct device *parent = NULL; |
| 319 | #if 0 |
| 320 | /* FIXME: Is the sdi actually part of tc3589x? */ |
| 321 | parent = tc3589x->dev; |
| 322 | #endif |
| 323 | mop500_sdi_tc35892_init(parent); |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 324 | } |
| 325 | |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 326 | static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = { |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 327 | .gpio_base = MOP500_EGPIO(0), |
| 328 | .setup = mop500_tc35892_init, |
| 329 | }; |
| 330 | |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 331 | static struct tc3589x_platform_data mop500_tc35892_data = { |
Sundar Iyer | 611b759 | 2010-12-13 09:33:15 +0530 | [diff] [blame] | 332 | .block = TC3589x_BLOCK_GPIO, |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 333 | .gpio = &mop500_tc35892_gpio_data, |
| 334 | .irq_base = MOP500_EGPIO_IRQ_BASE, |
| 335 | }; |
| 336 | |
Milo(Woogyom) Kim | df4094d | 2013-02-05 19:26:59 +0900 | [diff] [blame] | 337 | static struct lp55xx_led_config lp5521_pri_led[] = { |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 338 | [0] = { |
| 339 | .chan_nr = 0, |
| 340 | .led_current = 0x2f, |
| 341 | .max_current = 0x5f, |
| 342 | }, |
| 343 | [1] = { |
| 344 | .chan_nr = 1, |
| 345 | .led_current = 0x2f, |
| 346 | .max_current = 0x5f, |
| 347 | }, |
| 348 | [2] = { |
| 349 | .chan_nr = 2, |
| 350 | .led_current = 0x2f, |
| 351 | .max_current = 0x5f, |
| 352 | }, |
| 353 | }; |
| 354 | |
Milo(Woogyom) Kim | df4094d | 2013-02-05 19:26:59 +0900 | [diff] [blame] | 355 | static struct lp55xx_platform_data __initdata lp5521_pri_data = { |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 356 | .label = "lp5521_pri", |
| 357 | .led_config = &lp5521_pri_led[0], |
| 358 | .num_channels = 3, |
Milo(Woogyom) Kim | df4094d | 2013-02-05 19:26:59 +0900 | [diff] [blame] | 359 | .clock_mode = LP55XX_CLOCK_EXT, |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 360 | }; |
| 361 | |
Milo(Woogyom) Kim | df4094d | 2013-02-05 19:26:59 +0900 | [diff] [blame] | 362 | static struct lp55xx_led_config lp5521_sec_led[] = { |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 363 | [0] = { |
| 364 | .chan_nr = 0, |
| 365 | .led_current = 0x2f, |
| 366 | .max_current = 0x5f, |
| 367 | }, |
| 368 | [1] = { |
| 369 | .chan_nr = 1, |
| 370 | .led_current = 0x2f, |
| 371 | .max_current = 0x5f, |
| 372 | }, |
| 373 | [2] = { |
| 374 | .chan_nr = 2, |
| 375 | .led_current = 0x2f, |
| 376 | .max_current = 0x5f, |
| 377 | }, |
| 378 | }; |
| 379 | |
Milo(Woogyom) Kim | df4094d | 2013-02-05 19:26:59 +0900 | [diff] [blame] | 380 | static struct lp55xx_platform_data __initdata lp5521_sec_data = { |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 381 | .label = "lp5521_sec", |
| 382 | .led_config = &lp5521_sec_led[0], |
| 383 | .num_channels = 3, |
Milo(Woogyom) Kim | df4094d | 2013-02-05 19:26:59 +0900 | [diff] [blame] | 384 | .clock_mode = LP55XX_CLOCK_EXT, |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 385 | }; |
| 386 | |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 387 | static struct i2c_board_info __initdata mop500_i2c0_devices[] = { |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 388 | { |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 389 | I2C_BOARD_INFO("tc3589x", 0x42), |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 390 | .irq = NOMADIK_GPIO_TO_IRQ(217), |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 391 | .platform_data = &mop500_tc35892_data, |
| 392 | }, |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 393 | /* I2C0 devices only available prior to HREFv60 */ |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 394 | { |
| 395 | I2C_BOARD_INFO("tps61052", 0x33), |
| 396 | .platform_data = &mop500_tps61052_data, |
| 397 | }, |
| 398 | }; |
| 399 | |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 400 | #define NUM_PRE_V60_I2C0_DEVICES 1 |
| 401 | |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 402 | static struct i2c_board_info __initdata mop500_i2c2_devices[] = { |
| 403 | { |
| 404 | /* lp5521 LED driver, 1st device */ |
| 405 | I2C_BOARD_INFO("lp5521", 0x33), |
| 406 | .platform_data = &lp5521_pri_data, |
| 407 | }, |
| 408 | { |
| 409 | /* lp5521 LED driver, 2st device */ |
| 410 | I2C_BOARD_INFO("lp5521", 0x34), |
| 411 | .platform_data = &lp5521_sec_data, |
| 412 | }, |
Lee Jones | bb3b218 | 2011-01-13 14:41:22 +0000 | [diff] [blame] | 413 | { |
| 414 | /* Light sensor Rohm BH1780GLI */ |
| 415 | I2C_BOARD_INFO("bh1780", 0x29), |
| 416 | }, |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 417 | }; |
| 418 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 419 | static void __init mop500_i2c_init(struct device *parent) |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 420 | { |
Lee Jones | 98582d9 | 2012-04-17 15:52:26 +0100 | [diff] [blame] | 421 | db8500_add_i2c0(parent, NULL); |
| 422 | db8500_add_i2c1(parent, NULL); |
| 423 | db8500_add_i2c2(parent, NULL); |
| 424 | db8500_add_i2c3(parent, NULL); |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 425 | } |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 426 | |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 427 | static struct gpio_keys_button mop500_gpio_keys[] = { |
| 428 | { |
| 429 | .desc = "SFH7741 Proximity Sensor", |
| 430 | .type = EV_SW, |
| 431 | .code = SW_FRONT_PROXIMITY, |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 432 | .active_low = 0, |
| 433 | .can_disable = 1, |
| 434 | } |
| 435 | }; |
| 436 | |
| 437 | static struct regulator *prox_regulator; |
| 438 | static int mop500_prox_activate(struct device *dev); |
| 439 | static void mop500_prox_deactivate(struct device *dev); |
| 440 | |
| 441 | static struct gpio_keys_platform_data mop500_gpio_keys_data = { |
| 442 | .buttons = mop500_gpio_keys, |
| 443 | .nbuttons = ARRAY_SIZE(mop500_gpio_keys), |
| 444 | .enable = mop500_prox_activate, |
| 445 | .disable = mop500_prox_deactivate, |
| 446 | }; |
| 447 | |
| 448 | static struct platform_device mop500_gpio_keys_device = { |
| 449 | .name = "gpio-keys", |
| 450 | .id = 0, |
| 451 | .dev = { |
| 452 | .platform_data = &mop500_gpio_keys_data, |
| 453 | }, |
| 454 | }; |
| 455 | |
| 456 | static int mop500_prox_activate(struct device *dev) |
| 457 | { |
| 458 | prox_regulator = regulator_get(&mop500_gpio_keys_device.dev, |
| 459 | "vcc"); |
| 460 | if (IS_ERR(prox_regulator)) { |
| 461 | dev_err(&mop500_gpio_keys_device.dev, |
| 462 | "no regulator\n"); |
| 463 | return PTR_ERR(prox_regulator); |
| 464 | } |
| 465 | regulator_enable(prox_regulator); |
| 466 | return 0; |
| 467 | } |
| 468 | |
| 469 | static void mop500_prox_deactivate(struct device *dev) |
| 470 | { |
| 471 | regulator_disable(prox_regulator); |
| 472 | regulator_put(prox_regulator); |
| 473 | } |
| 474 | |
Andreas Westin | 585d188 | 2012-05-10 10:14:06 +0200 | [diff] [blame] | 475 | static struct cryp_platform_data u8500_cryp1_platform_data = { |
| 476 | .mem_to_engine = { |
| 477 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 478 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 479 | .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX, |
| 480 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
| 481 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
| 482 | .mode = STEDMA40_MODE_LOGICAL, |
| 483 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
| 484 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
| 485 | }, |
| 486 | .engine_to_mem = { |
| 487 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 488 | .src_dev_type = DB8500_DMA_DEV48_CAC1_RX, |
| 489 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 490 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
| 491 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
| 492 | .mode = STEDMA40_MODE_LOGICAL, |
| 493 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
| 494 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
| 495 | } |
| 496 | }; |
| 497 | |
| 498 | static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = { |
| 499 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 500 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 501 | .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX, |
| 502 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
| 503 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
| 504 | .mode = STEDMA40_MODE_LOGICAL, |
| 505 | .src_info.psize = STEDMA40_PSIZE_LOG_16, |
| 506 | .dst_info.psize = STEDMA40_PSIZE_LOG_16, |
| 507 | }; |
| 508 | |
| 509 | static struct hash_platform_data u8500_hash1_platform_data = { |
| 510 | .mem_to_engine = &u8500_hash_dma_cfg_tx, |
| 511 | .dma_filter = stedma40_filter, |
| 512 | }; |
| 513 | |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 514 | /* add any platform devices here - TODO */ |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 515 | static struct platform_device *mop500_platform_devs[] __initdata = { |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 516 | &mop500_gpio_keys_device, |
Lee Jones | cd2fa6d | 2013-01-31 11:31:16 +0000 | [diff] [blame^] | 517 | &sdi0_regulator, |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 518 | }; |
| 519 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 520 | #ifdef CONFIG_STE_DMA40 |
| 521 | static struct stedma40_chan_cfg ssp0_dma_cfg_rx = { |
| 522 | .mode = STEDMA40_MODE_LOGICAL, |
| 523 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 524 | .src_dev_type = DB8500_DMA_DEV8_SSP0_RX, |
| 525 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 526 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 527 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 528 | }; |
| 529 | |
| 530 | static struct stedma40_chan_cfg ssp0_dma_cfg_tx = { |
| 531 | .mode = STEDMA40_MODE_LOGICAL, |
| 532 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 533 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 534 | .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX, |
| 535 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 536 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 537 | }; |
| 538 | #endif |
| 539 | |
Lee Jones | fa86a76 | 2012-09-27 10:17:36 +0100 | [diff] [blame] | 540 | struct pl022_ssp_controller ssp0_plat = { |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 541 | .bus_id = 0, |
| 542 | #ifdef CONFIG_STE_DMA40 |
| 543 | .enable_dma = 1, |
| 544 | .dma_filter = stedma40_filter, |
| 545 | .dma_rx_param = &ssp0_dma_cfg_rx, |
| 546 | .dma_tx_param = &ssp0_dma_cfg_tx, |
| 547 | #else |
| 548 | .enable_dma = 0, |
| 549 | #endif |
| 550 | /* on this platform, gpio 31,142,144,214 & |
| 551 | * 224 are connected as chip selects |
| 552 | */ |
| 553 | .num_chipselect = 5, |
| 554 | }; |
| 555 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 556 | static void __init mop500_spi_init(struct device *parent) |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 557 | { |
Lee Jones | 15daf69 | 2012-03-15 16:47:11 +0000 | [diff] [blame] | 558 | db8500_add_ssp0(parent, &ssp0_plat); |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 559 | } |
| 560 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 561 | #ifdef CONFIG_STE_DMA40 |
| 562 | static struct stedma40_chan_cfg uart0_dma_cfg_rx = { |
| 563 | .mode = STEDMA40_MODE_LOGICAL, |
| 564 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 565 | .src_dev_type = DB8500_DMA_DEV13_UART0_RX, |
| 566 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 567 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 568 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 569 | }; |
| 570 | |
| 571 | static struct stedma40_chan_cfg uart0_dma_cfg_tx = { |
| 572 | .mode = STEDMA40_MODE_LOGICAL, |
| 573 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 574 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 575 | .dst_dev_type = DB8500_DMA_DEV13_UART0_TX, |
| 576 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 577 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 578 | }; |
| 579 | |
| 580 | static struct stedma40_chan_cfg uart1_dma_cfg_rx = { |
| 581 | .mode = STEDMA40_MODE_LOGICAL, |
| 582 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 583 | .src_dev_type = DB8500_DMA_DEV12_UART1_RX, |
| 584 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 585 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 586 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 587 | }; |
| 588 | |
| 589 | static struct stedma40_chan_cfg uart1_dma_cfg_tx = { |
| 590 | .mode = STEDMA40_MODE_LOGICAL, |
| 591 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 592 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 593 | .dst_dev_type = DB8500_DMA_DEV12_UART1_TX, |
| 594 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 595 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 596 | }; |
| 597 | |
| 598 | static struct stedma40_chan_cfg uart2_dma_cfg_rx = { |
| 599 | .mode = STEDMA40_MODE_LOGICAL, |
| 600 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 601 | .src_dev_type = DB8500_DMA_DEV11_UART2_RX, |
| 602 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 603 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 604 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 605 | }; |
| 606 | |
| 607 | static struct stedma40_chan_cfg uart2_dma_cfg_tx = { |
| 608 | .mode = STEDMA40_MODE_LOGICAL, |
| 609 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 610 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 611 | .dst_dev_type = DB8500_DMA_DEV11_UART2_TX, |
| 612 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 613 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 614 | }; |
| 615 | #endif |
| 616 | |
Lee Jones | fa86a76 | 2012-09-27 10:17:36 +0100 | [diff] [blame] | 617 | struct amba_pl011_data uart0_plat = { |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 618 | #ifdef CONFIG_STE_DMA40 |
| 619 | .dma_filter = stedma40_filter, |
| 620 | .dma_rx_param = &uart0_dma_cfg_rx, |
| 621 | .dma_tx_param = &uart0_dma_cfg_tx, |
| 622 | #endif |
| 623 | }; |
| 624 | |
Lee Jones | fa86a76 | 2012-09-27 10:17:36 +0100 | [diff] [blame] | 625 | struct amba_pl011_data uart1_plat = { |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 626 | #ifdef CONFIG_STE_DMA40 |
| 627 | .dma_filter = stedma40_filter, |
| 628 | .dma_rx_param = &uart1_dma_cfg_rx, |
| 629 | .dma_tx_param = &uart1_dma_cfg_tx, |
| 630 | #endif |
| 631 | }; |
| 632 | |
Lee Jones | fa86a76 | 2012-09-27 10:17:36 +0100 | [diff] [blame] | 633 | struct amba_pl011_data uart2_plat = { |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 634 | #ifdef CONFIG_STE_DMA40 |
| 635 | .dma_filter = stedma40_filter, |
| 636 | .dma_rx_param = &uart2_dma_cfg_rx, |
| 637 | .dma_tx_param = &uart2_dma_cfg_tx, |
| 638 | #endif |
| 639 | }; |
| 640 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 641 | static void __init mop500_uart_init(struct device *parent) |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 642 | { |
Linus Walleij | 78d80c5 | 2012-05-23 21:18:46 +0200 | [diff] [blame] | 643 | db8500_add_uart0(parent, &uart0_plat); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 644 | db8500_add_uart1(parent, &uart1_plat); |
| 645 | db8500_add_uart2(parent, &uart2_plat); |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 646 | } |
| 647 | |
Andreas Westin | 585d188 | 2012-05-10 10:14:06 +0200 | [diff] [blame] | 648 | static void __init u8500_cryp1_hash1_init(struct device *parent) |
| 649 | { |
| 650 | db8500_add_cryp1(parent, &u8500_cryp1_platform_data); |
| 651 | db8500_add_hash1(parent, &u8500_hash1_platform_data); |
| 652 | } |
| 653 | |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 654 | static struct platform_device *snowball_platform_devs[] __initdata = { |
| 655 | &snowball_led_dev, |
| 656 | &snowball_key_dev, |
Lee Jones | e6fada5 | 2012-05-17 13:18:36 +0100 | [diff] [blame] | 657 | &snowball_sbnet_dev, |
Lee Jones | 0b5ea1e | 2012-09-03 14:33:39 +0100 | [diff] [blame] | 658 | &snowball_gpio_en_3v3_regulator_dev, |
hongbo.zhang | dc1956b | 2012-11-15 18:56:43 +0800 | [diff] [blame] | 659 | &u8500_thsens_device, |
| 660 | &u8500_cpufreq_cooling_device, |
Lee Jones | cd2fa6d | 2013-01-31 11:31:16 +0000 | [diff] [blame^] | 661 | &sdi0_regulator, |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 662 | }; |
| 663 | |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 664 | static void __init mop500_init_machine(void) |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 665 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 666 | struct device *parent = NULL; |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 667 | int i2c0_devs; |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 668 | int i; |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 669 | |
Linus Walleij | 05ec260 | 2013-02-07 10:17:31 +0100 | [diff] [blame] | 670 | platform_device_register(&db8500_prcmu_device); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 671 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 672 | |
Lee Jones | cd2fa6d | 2013-01-31 11:31:16 +0000 | [diff] [blame^] | 673 | sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN; |
| 674 | sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL; |
| 675 | |
Linus Walleij | ed781d39 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 676 | mop500_pinmaps_init(); |
Lee Jones | 3a8e39c | 2012-07-06 12:46:23 +0200 | [diff] [blame] | 677 | parent = u8500_init_devices(&ab8500_platdata); |
Rabin Vincent | ea05a57 | 2010-06-03 07:58:42 +0100 | [diff] [blame] | 678 | |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 679 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) |
| 680 | mop500_platform_devs[i]->dev.parent = parent; |
| 681 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 682 | platform_add_devices(mop500_platform_devs, |
| 683 | ARRAY_SIZE(mop500_platform_devs)); |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 684 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 685 | mop500_i2c_init(parent); |
| 686 | mop500_sdi_init(parent); |
| 687 | mop500_spi_init(parent); |
Lee Jones | 39b740b | 2012-09-14 15:46:29 +0100 | [diff] [blame] | 688 | mop500_audio_init(parent); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 689 | mop500_uart_init(parent); |
Hanumath Prasad | 008f8a2 | 2010-08-19 12:06:32 +0100 | [diff] [blame] | 690 | |
Andreas Westin | 585d188 | 2012-05-10 10:14:06 +0200 | [diff] [blame] | 691 | u8500_cryp1_hash1_init(parent); |
| 692 | |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 693 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 694 | |
| 695 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); |
| 696 | i2c_register_board_info(2, mop500_i2c2_devices, |
| 697 | ARRAY_SIZE(mop500_i2c2_devices)); |
| 698 | |
| 699 | /* This board has full regulator constraints */ |
| 700 | regulator_has_full_constraints(); |
| 701 | } |
| 702 | |
| 703 | static void __init snowball_init_machine(void) |
| 704 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 705 | struct device *parent = NULL; |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 706 | int i; |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 707 | |
Linus Walleij | 05ec260 | 2013-02-07 10:17:31 +0100 | [diff] [blame] | 708 | platform_device_register(&db8500_prcmu_device); |
Lee Jones | cd2fa6d | 2013-01-31 11:31:16 +0000 | [diff] [blame^] | 709 | |
| 710 | sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO; |
| 711 | sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO; |
| 712 | |
Linus Walleij | ed781d39 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 713 | snowball_pinmaps_init(); |
Lee Jones | 3a8e39c | 2012-07-06 12:46:23 +0200 | [diff] [blame] | 714 | parent = u8500_init_devices(&ab8500_platdata); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 715 | |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 716 | for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++) |
| 717 | snowball_platform_devs[i]->dev.parent = parent; |
| 718 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 719 | platform_add_devices(snowball_platform_devs, |
| 720 | ARRAY_SIZE(snowball_platform_devs)); |
| 721 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 722 | mop500_i2c_init(parent); |
| 723 | snowball_sdi_init(parent); |
| 724 | mop500_spi_init(parent); |
Lee Jones | 39b740b | 2012-09-14 15:46:29 +0100 | [diff] [blame] | 725 | mop500_audio_init(parent); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 726 | mop500_uart_init(parent); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 727 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 728 | /* This board has full regulator constraints */ |
| 729 | regulator_has_full_constraints(); |
| 730 | } |
| 731 | |
| 732 | static void __init hrefv60_init_machine(void) |
| 733 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 734 | struct device *parent = NULL; |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 735 | int i2c0_devs; |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 736 | int i; |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 737 | |
Linus Walleij | 05ec260 | 2013-02-07 10:17:31 +0100 | [diff] [blame] | 738 | platform_device_register(&db8500_prcmu_device); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 739 | /* |
| 740 | * The HREFv60 board removed a GPIO expander and routed |
| 741 | * all these GPIO pins to the internal GPIO controller |
| 742 | * instead. |
| 743 | */ |
| 744 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; |
| 745 | |
Lee Jones | cd2fa6d | 2013-01-31 11:31:16 +0000 | [diff] [blame^] | 746 | sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO; |
| 747 | sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO; |
| 748 | |
Linus Walleij | ed781d39 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 749 | hrefv60_pinmaps_init(); |
Lee Jones | 3a8e39c | 2012-07-06 12:46:23 +0200 | [diff] [blame] | 750 | parent = u8500_init_devices(&ab8500_platdata); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 751 | |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 752 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) |
| 753 | mop500_platform_devs[i]->dev.parent = parent; |
| 754 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 755 | platform_add_devices(mop500_platform_devs, |
| 756 | ARRAY_SIZE(mop500_platform_devs)); |
| 757 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 758 | mop500_i2c_init(parent); |
| 759 | hrefv60_sdi_init(parent); |
| 760 | mop500_spi_init(parent); |
Lee Jones | 39b740b | 2012-09-14 15:46:29 +0100 | [diff] [blame] | 761 | mop500_audio_init(parent); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 762 | mop500_uart_init(parent); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 763 | |
| 764 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
| 765 | |
| 766 | i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 767 | |
| 768 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 769 | i2c_register_board_info(2, mop500_i2c2_devices, |
| 770 | ARRAY_SIZE(mop500_i2c2_devices)); |
Linus Walleij | db24520 | 2011-04-04 10:44:51 +0200 | [diff] [blame] | 771 | |
| 772 | /* This board has full regulator constraints */ |
| 773 | regulator_has_full_constraints(); |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 774 | } |
| 775 | |
| 776 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") |
| 777 | /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */ |
Nicolas Pitre | bc77b1a | 2011-07-05 22:38:18 -0400 | [diff] [blame] | 778 | .atag_offset = 0x100, |
Marc Zyngier | 5ac21a9 | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 779 | .smp = smp_ops(ux500_smp_ops), |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 780 | .map_io = u8500_map_io, |
Rabin Vincent | 178980f | 2010-05-03 07:39:02 +0100 | [diff] [blame] | 781 | .init_irq = ux500_init_irq, |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 782 | /* we re-use nomadik timer here */ |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 783 | .init_time = ux500_timer_init, |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 784 | .init_machine = mop500_init_machine, |
Shawn Guo | a010bc2 | 2012-05-02 17:10:07 +0800 | [diff] [blame] | 785 | .init_late = ux500_init_late, |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 786 | MACHINE_END |
| 787 | |
Linus Walleij | a3a6c6a | 2012-10-01 09:37:39 +0200 | [diff] [blame] | 788 | MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520") |
| 789 | .atag_offset = 0x100, |
| 790 | .map_io = u8500_map_io, |
| 791 | .init_irq = ux500_init_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 792 | .init_time = ux500_timer_init, |
Linus Walleij | a3a6c6a | 2012-10-01 09:37:39 +0200 | [diff] [blame] | 793 | .init_machine = mop500_init_machine, |
| 794 | .init_late = ux500_init_late, |
| 795 | MACHINE_END |
| 796 | |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 797 | MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") |
Nicolas Pitre | bc77b1a | 2011-07-05 22:38:18 -0400 | [diff] [blame] | 798 | .atag_offset = 0x100, |
Marc Zyngier | 5ac21a9 | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 799 | .smp = smp_ops(ux500_smp_ops), |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 800 | .map_io = u8500_map_io, |
| 801 | .init_irq = ux500_init_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 802 | .init_time = ux500_timer_init, |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 803 | .init_machine = hrefv60_init_machine, |
Shawn Guo | a010bc2 | 2012-05-02 17:10:07 +0800 | [diff] [blame] | 804 | .init_late = ux500_init_late, |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 805 | MACHINE_END |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 806 | |
| 807 | MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") |
Nicolas Pitre | bc77b1a | 2011-07-05 22:38:18 -0400 | [diff] [blame] | 808 | .atag_offset = 0x100, |
Marc Zyngier | 5ac21a9 | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 809 | .smp = smp_ops(ux500_smp_ops), |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 810 | .map_io = u8500_map_io, |
| 811 | .init_irq = ux500_init_irq, |
| 812 | /* we re-use nomadik timer here */ |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 813 | .init_time = ux500_timer_init, |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 814 | .init_machine = snowball_init_machine, |
Lee Jones | 0ddf855 | 2012-09-25 16:03:45 +0100 | [diff] [blame] | 815 | .init_late = NULL, |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 816 | MACHINE_END |