diff options
Diffstat (limited to 'arch/arm/mach-s5pv210/mach-goni.c')
-rw-r--r-- | arch/arm/mach-s5pv210/mach-goni.c | 917 |
1 files changed, 0 insertions, 917 deletions
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c deleted file mode 100644 index 096a8173a1d9..000000000000 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ /dev/null | |||
@@ -1,917 +0,0 @@ | |||
1 | /* linux/arch/arm/mach-s5pv210/mach-goni.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.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/types.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/serial_core.h> | ||
15 | #include <linux/serial_s3c.h> | ||
16 | #include <linux/fb.h> | ||
17 | #include <linux/i2c.h> | ||
18 | #include <linux/i2c-gpio.h> | ||
19 | #include <linux/i2c/atmel_mxt_ts.h> | ||
20 | #include <linux/mfd/max8998.h> | ||
21 | #include <linux/mfd/wm8994/pdata.h> | ||
22 | #include <linux/regulator/fixed.h> | ||
23 | #include <linux/spi/spi.h> | ||
24 | #include <linux/spi/spi_gpio.h> | ||
25 | #include <linux/lcd.h> | ||
26 | #include <linux/gpio_keys.h> | ||
27 | #include <linux/input.h> | ||
28 | #include <linux/gpio.h> | ||
29 | #include <linux/mmc/host.h> | ||
30 | #include <linux/interrupt.h> | ||
31 | #include <linux/platform_data/s3c-hsotg.h> | ||
32 | |||
33 | #include <asm/mach/arch.h> | ||
34 | #include <asm/mach/map.h> | ||
35 | #include <asm/setup.h> | ||
36 | #include <asm/mach-types.h> | ||
37 | |||
38 | #include <video/samsung_fimd.h> | ||
39 | #include <mach/map.h> | ||
40 | #include <mach/regs-clock.h> | ||
41 | #include <mach/gpio-samsung.h> | ||
42 | |||
43 | #include <plat/gpio-cfg.h> | ||
44 | #include <plat/devs.h> | ||
45 | #include <plat/cpu.h> | ||
46 | #include <plat/fb.h> | ||
47 | #include <linux/platform_data/i2c-s3c2410.h> | ||
48 | #include <plat/keypad.h> | ||
49 | #include <plat/sdhci.h> | ||
50 | #include <plat/clock.h> | ||
51 | #include <plat/samsung-time.h> | ||
52 | #include <plat/mfc.h> | ||
53 | |||
54 | #include "common.h" | ||
55 | |||
56 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | ||
57 | #define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | ||
58 | S3C2410_UCON_RXILEVEL | \ | ||
59 | S3C2410_UCON_TXIRQMODE | \ | ||
60 | S3C2410_UCON_RXIRQMODE | \ | ||
61 | S3C2410_UCON_RXFIFO_TOI | \ | ||
62 | S3C2443_UCON_RXERR_IRQEN) | ||
63 | |||
64 | #define GONI_ULCON_DEFAULT S3C2410_LCON_CS8 | ||
65 | |||
66 | #define GONI_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE | ||
67 | |||
68 | static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = { | ||
69 | [0] = { | ||
70 | .hwport = 0, | ||
71 | .flags = 0, | ||
72 | .ucon = GONI_UCON_DEFAULT, | ||
73 | .ulcon = GONI_ULCON_DEFAULT, | ||
74 | .ufcon = GONI_UFCON_DEFAULT | | ||
75 | S5PV210_UFCON_TXTRIG256 | S5PV210_UFCON_RXTRIG256, | ||
76 | }, | ||
77 | [1] = { | ||
78 | .hwport = 1, | ||
79 | .flags = 0, | ||
80 | .ucon = GONI_UCON_DEFAULT, | ||
81 | .ulcon = GONI_ULCON_DEFAULT, | ||
82 | .ufcon = GONI_UFCON_DEFAULT | | ||
83 | S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64, | ||
84 | }, | ||
85 | [2] = { | ||
86 | .hwport = 2, | ||
87 | .flags = 0, | ||
88 | .ucon = GONI_UCON_DEFAULT, | ||
89 | .ulcon = GONI_ULCON_DEFAULT, | ||
90 | .ufcon = GONI_UFCON_DEFAULT | | ||
91 | S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16, | ||
92 | }, | ||
93 | [3] = { | ||
94 | .hwport = 3, | ||
95 | .flags = 0, | ||
96 | .ucon = GONI_UCON_DEFAULT, | ||
97 | .ulcon = GONI_ULCON_DEFAULT, | ||
98 | .ufcon = GONI_UFCON_DEFAULT | | ||
99 | S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16, | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | /* Frame Buffer */ | ||
104 | static struct s3c_fb_pd_win goni_fb_win0 = { | ||
105 | .max_bpp = 32, | ||
106 | .default_bpp = 16, | ||
107 | .xres = 480, | ||
108 | .yres = 800, | ||
109 | .virtual_x = 480, | ||
110 | .virtual_y = 2 * 800, | ||
111 | }; | ||
112 | |||
113 | static struct fb_videomode goni_lcd_timing = { | ||
114 | .left_margin = 16, | ||
115 | .right_margin = 16, | ||
116 | .upper_margin = 2, | ||
117 | .lower_margin = 28, | ||
118 | .hsync_len = 2, | ||
119 | .vsync_len = 1, | ||
120 | .xres = 480, | ||
121 | .yres = 800, | ||
122 | .refresh = 55, | ||
123 | }; | ||
124 | |||
125 | static struct s3c_fb_platdata goni_lcd_pdata __initdata = { | ||
126 | .win[0] = &goni_fb_win0, | ||
127 | .vtiming = &goni_lcd_timing, | ||
128 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB | | ||
129 | VIDCON0_CLKSEL_LCD, | ||
130 | .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN | ||
131 | | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, | ||
132 | .setup_gpio = s5pv210_fb_gpio_setup_24bpp, | ||
133 | }; | ||
134 | |||
135 | static int lcd_power_on(struct lcd_device *ld, int enable) | ||
136 | { | ||
137 | return 1; | ||
138 | } | ||
139 | |||
140 | static int reset_lcd(struct lcd_device *ld) | ||
141 | { | ||
142 | static unsigned int first = 1; | ||
143 | int reset_gpio = -1; | ||
144 | |||
145 | reset_gpio = S5PV210_MP05(5); | ||
146 | |||
147 | if (first) { | ||
148 | gpio_request(reset_gpio, "MLCD_RST"); | ||
149 | first = 0; | ||
150 | } | ||
151 | |||
152 | gpio_direction_output(reset_gpio, 1); | ||
153 | return 1; | ||
154 | } | ||
155 | |||
156 | static struct lcd_platform_data goni_lcd_platform_data = { | ||
157 | .reset = reset_lcd, | ||
158 | .power_on = lcd_power_on, | ||
159 | .lcd_enabled = 0, | ||
160 | .reset_delay = 120, /* 120ms */ | ||
161 | .power_on_delay = 25, /* 25ms */ | ||
162 | .power_off_delay = 200, /* 200ms */ | ||
163 | }; | ||
164 | |||
165 | #define LCD_BUS_NUM 3 | ||
166 | static struct spi_board_info spi_board_info[] __initdata = { | ||
167 | { | ||
168 | .modalias = "s6e63m0", | ||
169 | .platform_data = &goni_lcd_platform_data, | ||
170 | .max_speed_hz = 1200000, | ||
171 | .bus_num = LCD_BUS_NUM, | ||
172 | .chip_select = 0, | ||
173 | .mode = SPI_MODE_3, | ||
174 | .controller_data = (void *)S5PV210_MP01(1), /* DISPLAY_CS */ | ||
175 | }, | ||
176 | }; | ||
177 | |||
178 | static struct spi_gpio_platform_data lcd_spi_gpio_data = { | ||
179 | .sck = S5PV210_MP04(1), /* DISPLAY_CLK */ | ||
180 | .mosi = S5PV210_MP04(3), /* DISPLAY_SI */ | ||
181 | .miso = SPI_GPIO_NO_MISO, | ||
182 | .num_chipselect = 1, | ||
183 | }; | ||
184 | |||
185 | static struct platform_device goni_spi_gpio = { | ||
186 | .name = "spi_gpio", | ||
187 | .id = LCD_BUS_NUM, | ||
188 | .dev = { | ||
189 | .parent = &s3c_device_fb.dev, | ||
190 | .platform_data = &lcd_spi_gpio_data, | ||
191 | }, | ||
192 | }; | ||
193 | |||
194 | /* KEYPAD */ | ||
195 | static uint32_t keymap[] __initdata = { | ||
196 | /* KEY(row, col, keycode) */ | ||
197 | KEY(0, 1, KEY_MENU), /* Send */ | ||
198 | KEY(0, 2, KEY_BACK), /* End */ | ||
199 | KEY(1, 1, KEY_CONFIG), /* Half shot */ | ||
200 | KEY(1, 2, KEY_VOLUMEUP), | ||
201 | KEY(2, 1, KEY_CAMERA), /* Full shot */ | ||
202 | KEY(2, 2, KEY_VOLUMEDOWN), | ||
203 | }; | ||
204 | |||
205 | static struct matrix_keymap_data keymap_data __initdata = { | ||
206 | .keymap = keymap, | ||
207 | .keymap_size = ARRAY_SIZE(keymap), | ||
208 | }; | ||
209 | |||
210 | static struct samsung_keypad_platdata keypad_data __initdata = { | ||
211 | .keymap_data = &keymap_data, | ||
212 | .rows = 3, | ||
213 | .cols = 3, | ||
214 | }; | ||
215 | |||
216 | /* Radio */ | ||
217 | static struct i2c_board_info i2c1_devs[] __initdata = { | ||
218 | { | ||
219 | I2C_BOARD_INFO("si470x", 0x10), | ||
220 | }, | ||
221 | }; | ||
222 | |||
223 | static void __init goni_radio_init(void) | ||
224 | { | ||
225 | int gpio; | ||
226 | |||
227 | gpio = S5PV210_GPJ2(4); /* XMSMDATA_4 */ | ||
228 | gpio_request(gpio, "FM_INT"); | ||
229 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
230 | i2c1_devs[0].irq = gpio_to_irq(gpio); | ||
231 | |||
232 | gpio = S5PV210_GPJ2(5); /* XMSMDATA_5 */ | ||
233 | gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "FM_RST"); | ||
234 | } | ||
235 | |||
236 | /* TSP */ | ||
237 | static struct mxt_platform_data qt602240_platform_data = { | ||
238 | .irqflags = IRQF_TRIGGER_FALLING, | ||
239 | }; | ||
240 | |||
241 | static struct s3c2410_platform_i2c i2c2_data __initdata = { | ||
242 | .flags = 0, | ||
243 | .bus_num = 2, | ||
244 | .slave_addr = 0x10, | ||
245 | .frequency = 400 * 1000, | ||
246 | .sda_delay = 100, | ||
247 | }; | ||
248 | |||
249 | static struct i2c_board_info i2c2_devs[] __initdata = { | ||
250 | { | ||
251 | I2C_BOARD_INFO("qt602240_ts", 0x4a), | ||
252 | .platform_data = &qt602240_platform_data, | ||
253 | }, | ||
254 | }; | ||
255 | |||
256 | static void __init goni_tsp_init(void) | ||
257 | { | ||
258 | int gpio; | ||
259 | |||
260 | gpio = S5PV210_GPJ1(3); /* XMSMADDR_11 */ | ||
261 | gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "TSP_LDO_ON"); | ||
262 | gpio_export(gpio, 0); | ||
263 | |||
264 | gpio = S5PV210_GPJ0(5); /* XMSMADDR_5 */ | ||
265 | gpio_request(gpio, "TSP_INT"); | ||
266 | |||
267 | s5p_register_gpio_interrupt(gpio); | ||
268 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
269 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); | ||
270 | i2c2_devs[0].irq = gpio_to_irq(gpio); | ||
271 | } | ||
272 | |||
273 | /* USB OTG */ | ||
274 | static struct s3c_hsotg_plat goni_hsotg_pdata; | ||
275 | |||
276 | /* MAX8998 regulators */ | ||
277 | #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE) | ||
278 | |||
279 | static struct regulator_consumer_supply goni_ldo3_consumers[] = { | ||
280 | REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"), | ||
281 | }; | ||
282 | |||
283 | static struct regulator_consumer_supply goni_ldo5_consumers[] = { | ||
284 | REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"), | ||
285 | }; | ||
286 | |||
287 | static struct regulator_consumer_supply goni_ldo8_consumers[] = { | ||
288 | REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"), | ||
289 | REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"), | ||
290 | }; | ||
291 | |||
292 | static struct regulator_consumer_supply goni_ldo11_consumers[] = { | ||
293 | REGULATOR_SUPPLY("vddio", "0-0030"), /* "CAM_IO_2.8V" */ | ||
294 | }; | ||
295 | |||
296 | static struct regulator_consumer_supply goni_ldo13_consumers[] = { | ||
297 | REGULATOR_SUPPLY("vdda", "0-0030"), /* "CAM_A_2.8V" */ | ||
298 | }; | ||
299 | |||
300 | static struct regulator_consumer_supply goni_ldo14_consumers[] = { | ||
301 | REGULATOR_SUPPLY("vdd_core", "0-0030"), /* "CAM_CIF_1.8V" */ | ||
302 | }; | ||
303 | |||
304 | static struct regulator_init_data goni_ldo2_data = { | ||
305 | .constraints = { | ||
306 | .name = "VALIVE_1.1V", | ||
307 | .min_uV = 1100000, | ||
308 | .max_uV = 1100000, | ||
309 | .apply_uV = 1, | ||
310 | .always_on = 1, | ||
311 | .state_mem = { | ||
312 | .enabled = 1, | ||
313 | }, | ||
314 | }, | ||
315 | }; | ||
316 | |||
317 | static struct regulator_init_data goni_ldo3_data = { | ||
318 | .constraints = { | ||
319 | .name = "VUSB+MIPI_1.1V", | ||
320 | .min_uV = 1100000, | ||
321 | .max_uV = 1100000, | ||
322 | .apply_uV = 1, | ||
323 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
324 | }, | ||
325 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo3_consumers), | ||
326 | .consumer_supplies = goni_ldo3_consumers, | ||
327 | }; | ||
328 | |||
329 | static struct regulator_init_data goni_ldo4_data = { | ||
330 | .constraints = { | ||
331 | .name = "VDAC_3.3V", | ||
332 | .min_uV = 3300000, | ||
333 | .max_uV = 3300000, | ||
334 | .apply_uV = 1, | ||
335 | }, | ||
336 | }; | ||
337 | |||
338 | static struct regulator_init_data goni_ldo5_data = { | ||
339 | .constraints = { | ||
340 | .name = "VTF_2.8V", | ||
341 | .min_uV = 2800000, | ||
342 | .max_uV = 2800000, | ||
343 | .apply_uV = 1, | ||
344 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
345 | }, | ||
346 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers), | ||
347 | .consumer_supplies = goni_ldo5_consumers, | ||
348 | }; | ||
349 | |||
350 | static struct regulator_init_data goni_ldo6_data = { | ||
351 | .constraints = { | ||
352 | .name = "VCC_3.3V", | ||
353 | .min_uV = 3300000, | ||
354 | .max_uV = 3300000, | ||
355 | .apply_uV = 1, | ||
356 | }, | ||
357 | }; | ||
358 | |||
359 | static struct regulator_init_data goni_ldo7_data = { | ||
360 | .constraints = { | ||
361 | .name = "VLCD_1.8V", | ||
362 | .min_uV = 1800000, | ||
363 | .max_uV = 1800000, | ||
364 | .apply_uV = 1, | ||
365 | .always_on = 1, | ||
366 | }, | ||
367 | }; | ||
368 | |||
369 | static struct regulator_init_data goni_ldo8_data = { | ||
370 | .constraints = { | ||
371 | .name = "VUSB+VADC_3.3V", | ||
372 | .min_uV = 3300000, | ||
373 | .max_uV = 3300000, | ||
374 | .apply_uV = 1, | ||
375 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
376 | }, | ||
377 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo8_consumers), | ||
378 | .consumer_supplies = goni_ldo8_consumers, | ||
379 | }; | ||
380 | |||
381 | static struct regulator_init_data goni_ldo9_data = { | ||
382 | .constraints = { | ||
383 | .name = "VCC+VCAM_2.8V", | ||
384 | .min_uV = 2800000, | ||
385 | .max_uV = 2800000, | ||
386 | .apply_uV = 1, | ||
387 | }, | ||
388 | }; | ||
389 | |||
390 | static struct regulator_init_data goni_ldo10_data = { | ||
391 | .constraints = { | ||
392 | .name = "VPLL_1.1V", | ||
393 | .min_uV = 1100000, | ||
394 | .max_uV = 1100000, | ||
395 | .apply_uV = 1, | ||
396 | .boot_on = 1, | ||
397 | }, | ||
398 | }; | ||
399 | |||
400 | static struct regulator_init_data goni_ldo11_data = { | ||
401 | .constraints = { | ||
402 | .name = "CAM_IO_2.8V", | ||
403 | .min_uV = 2800000, | ||
404 | .max_uV = 2800000, | ||
405 | .apply_uV = 1, | ||
406 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
407 | }, | ||
408 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo11_consumers), | ||
409 | .consumer_supplies = goni_ldo11_consumers, | ||
410 | }; | ||
411 | |||
412 | static struct regulator_init_data goni_ldo12_data = { | ||
413 | .constraints = { | ||
414 | .name = "CAM_ISP_1.2V", | ||
415 | .min_uV = 1200000, | ||
416 | .max_uV = 1200000, | ||
417 | .apply_uV = 1, | ||
418 | }, | ||
419 | }; | ||
420 | |||
421 | static struct regulator_init_data goni_ldo13_data = { | ||
422 | .constraints = { | ||
423 | .name = "CAM_A_2.8V", | ||
424 | .min_uV = 2800000, | ||
425 | .max_uV = 2800000, | ||
426 | .apply_uV = 1, | ||
427 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
428 | }, | ||
429 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo13_consumers), | ||
430 | .consumer_supplies = goni_ldo13_consumers, | ||
431 | }; | ||
432 | |||
433 | static struct regulator_init_data goni_ldo14_data = { | ||
434 | .constraints = { | ||
435 | .name = "CAM_CIF_1.8V", | ||
436 | .min_uV = 1800000, | ||
437 | .max_uV = 1800000, | ||
438 | .apply_uV = 1, | ||
439 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
440 | }, | ||
441 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo14_consumers), | ||
442 | .consumer_supplies = goni_ldo14_consumers, | ||
443 | }; | ||
444 | |||
445 | static struct regulator_init_data goni_ldo15_data = { | ||
446 | .constraints = { | ||
447 | .name = "CAM_AF_3.3V", | ||
448 | .min_uV = 3300000, | ||
449 | .max_uV = 3300000, | ||
450 | .apply_uV = 1, | ||
451 | }, | ||
452 | }; | ||
453 | |||
454 | static struct regulator_init_data goni_ldo16_data = { | ||
455 | .constraints = { | ||
456 | .name = "VMIPI_1.8V", | ||
457 | .min_uV = 1800000, | ||
458 | .max_uV = 1800000, | ||
459 | .apply_uV = 1, | ||
460 | }, | ||
461 | }; | ||
462 | |||
463 | static struct regulator_init_data goni_ldo17_data = { | ||
464 | .constraints = { | ||
465 | .name = "VCC_3.0V_LCD", | ||
466 | .min_uV = 3000000, | ||
467 | .max_uV = 3000000, | ||
468 | .apply_uV = 1, | ||
469 | .always_on = 1, | ||
470 | }, | ||
471 | }; | ||
472 | |||
473 | /* BUCK */ | ||
474 | static struct regulator_consumer_supply buck1_consumer = | ||
475 | REGULATOR_SUPPLY("vddarm", NULL); | ||
476 | |||
477 | static struct regulator_consumer_supply buck2_consumer = | ||
478 | REGULATOR_SUPPLY("vddint", NULL); | ||
479 | |||
480 | static struct regulator_consumer_supply buck3_consumer = | ||
481 | REGULATOR_SUPPLY("vdet", "s5p-sdo"); | ||
482 | |||
483 | |||
484 | static struct regulator_init_data goni_buck1_data = { | ||
485 | .constraints = { | ||
486 | .name = "VARM_1.2V", | ||
487 | .min_uV = 1200000, | ||
488 | .max_uV = 1200000, | ||
489 | .apply_uV = 1, | ||
490 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
491 | REGULATOR_CHANGE_STATUS, | ||
492 | }, | ||
493 | .num_consumer_supplies = 1, | ||
494 | .consumer_supplies = &buck1_consumer, | ||
495 | }; | ||
496 | |||
497 | static struct regulator_init_data goni_buck2_data = { | ||
498 | .constraints = { | ||
499 | .name = "VINT_1.2V", | ||
500 | .min_uV = 1200000, | ||
501 | .max_uV = 1200000, | ||
502 | .apply_uV = 1, | ||
503 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
504 | REGULATOR_CHANGE_STATUS, | ||
505 | }, | ||
506 | .num_consumer_supplies = 1, | ||
507 | .consumer_supplies = &buck2_consumer, | ||
508 | }; | ||
509 | |||
510 | static struct regulator_init_data goni_buck3_data = { | ||
511 | .constraints = { | ||
512 | .name = "VCC_1.8V", | ||
513 | .min_uV = 1800000, | ||
514 | .max_uV = 1800000, | ||
515 | .apply_uV = 1, | ||
516 | .state_mem = { | ||
517 | .enabled = 1, | ||
518 | }, | ||
519 | }, | ||
520 | .num_consumer_supplies = 1, | ||
521 | .consumer_supplies = &buck3_consumer, | ||
522 | }; | ||
523 | |||
524 | static struct regulator_init_data goni_buck4_data = { | ||
525 | .constraints = { | ||
526 | .name = "CAM_CORE_1.2V", | ||
527 | .min_uV = 1200000, | ||
528 | .max_uV = 1200000, | ||
529 | .apply_uV = 1, | ||
530 | .always_on = 1, | ||
531 | }, | ||
532 | }; | ||
533 | |||
534 | static struct max8998_regulator_data goni_regulators[] = { | ||
535 | { MAX8998_LDO2, &goni_ldo2_data }, | ||
536 | { MAX8998_LDO3, &goni_ldo3_data }, | ||
537 | { MAX8998_LDO4, &goni_ldo4_data }, | ||
538 | { MAX8998_LDO5, &goni_ldo5_data }, | ||
539 | { MAX8998_LDO6, &goni_ldo6_data }, | ||
540 | { MAX8998_LDO7, &goni_ldo7_data }, | ||
541 | { MAX8998_LDO8, &goni_ldo8_data }, | ||
542 | { MAX8998_LDO9, &goni_ldo9_data }, | ||
543 | { MAX8998_LDO10, &goni_ldo10_data }, | ||
544 | { MAX8998_LDO11, &goni_ldo11_data }, | ||
545 | { MAX8998_LDO12, &goni_ldo12_data }, | ||
546 | { MAX8998_LDO13, &goni_ldo13_data }, | ||
547 | { MAX8998_LDO14, &goni_ldo14_data }, | ||
548 | { MAX8998_LDO15, &goni_ldo15_data }, | ||
549 | { MAX8998_LDO16, &goni_ldo16_data }, | ||
550 | { MAX8998_LDO17, &goni_ldo17_data }, | ||
551 | { MAX8998_BUCK1, &goni_buck1_data }, | ||
552 | { MAX8998_BUCK2, &goni_buck2_data }, | ||
553 | { MAX8998_BUCK3, &goni_buck3_data }, | ||
554 | { MAX8998_BUCK4, &goni_buck4_data }, | ||
555 | }; | ||
556 | |||
557 | static struct max8998_platform_data goni_max8998_pdata = { | ||
558 | .num_regulators = ARRAY_SIZE(goni_regulators), | ||
559 | .regulators = goni_regulators, | ||
560 | .buck1_set1 = S5PV210_GPH0(3), | ||
561 | .buck1_set2 = S5PV210_GPH0(4), | ||
562 | .buck2_set3 = S5PV210_GPH0(5), | ||
563 | .buck1_voltage = { 1200000, 1200000, 1200000, 1200000 }, | ||
564 | .buck2_voltage = { 1200000, 1200000 }, | ||
565 | }; | ||
566 | #endif | ||
567 | |||
568 | static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = { | ||
569 | REGULATOR_SUPPLY("DBVDD", "5-001a"), | ||
570 | REGULATOR_SUPPLY("AVDD2", "5-001a"), | ||
571 | REGULATOR_SUPPLY("CPVDD", "5-001a"), | ||
572 | }; | ||
573 | |||
574 | static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = { | ||
575 | REGULATOR_SUPPLY("SPKVDD1", "5-001a"), | ||
576 | REGULATOR_SUPPLY("SPKVDD2", "5-001a"), | ||
577 | }; | ||
578 | |||
579 | static struct regulator_init_data wm8994_fixed_voltage0_init_data = { | ||
580 | .constraints = { | ||
581 | .always_on = 1, | ||
582 | }, | ||
583 | .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage0_supplies), | ||
584 | .consumer_supplies = wm8994_fixed_voltage0_supplies, | ||
585 | }; | ||
586 | |||
587 | static struct regulator_init_data wm8994_fixed_voltage1_init_data = { | ||
588 | .constraints = { | ||
589 | .always_on = 1, | ||
590 | }, | ||
591 | .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage1_supplies), | ||
592 | .consumer_supplies = wm8994_fixed_voltage1_supplies, | ||
593 | }; | ||
594 | |||
595 | static struct fixed_voltage_config wm8994_fixed_voltage0_config = { | ||
596 | .supply_name = "VCC_1.8V_PDA", | ||
597 | .microvolts = 1800000, | ||
598 | .gpio = -EINVAL, | ||
599 | .init_data = &wm8994_fixed_voltage0_init_data, | ||
600 | }; | ||
601 | |||
602 | static struct fixed_voltage_config wm8994_fixed_voltage1_config = { | ||
603 | .supply_name = "V_BAT", | ||
604 | .microvolts = 3700000, | ||
605 | .gpio = -EINVAL, | ||
606 | .init_data = &wm8994_fixed_voltage1_init_data, | ||
607 | }; | ||
608 | |||
609 | static struct platform_device wm8994_fixed_voltage0 = { | ||
610 | .name = "reg-fixed-voltage", | ||
611 | .id = 0, | ||
612 | .dev = { | ||
613 | .platform_data = &wm8994_fixed_voltage0_config, | ||
614 | }, | ||
615 | }; | ||
616 | |||
617 | static struct platform_device wm8994_fixed_voltage1 = { | ||
618 | .name = "reg-fixed-voltage", | ||
619 | .id = 1, | ||
620 | .dev = { | ||
621 | .platform_data = &wm8994_fixed_voltage1_config, | ||
622 | }, | ||
623 | }; | ||
624 | |||
625 | static struct regulator_consumer_supply wm8994_avdd1_supply = | ||
626 | REGULATOR_SUPPLY("AVDD1", "5-001a"); | ||
627 | |||
628 | static struct regulator_consumer_supply wm8994_dcvdd_supply = | ||
629 | REGULATOR_SUPPLY("DCVDD", "5-001a"); | ||
630 | |||
631 | static struct regulator_init_data wm8994_ldo1_data = { | ||
632 | .constraints = { | ||
633 | .name = "AVDD1_3.0V", | ||
634 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
635 | }, | ||
636 | .num_consumer_supplies = 1, | ||
637 | .consumer_supplies = &wm8994_avdd1_supply, | ||
638 | }; | ||
639 | |||
640 | static struct regulator_init_data wm8994_ldo2_data = { | ||
641 | .constraints = { | ||
642 | .name = "DCVDD_1.0V", | ||
643 | }, | ||
644 | .num_consumer_supplies = 1, | ||
645 | .consumer_supplies = &wm8994_dcvdd_supply, | ||
646 | }; | ||
647 | |||
648 | static struct wm8994_pdata wm8994_platform_data = { | ||
649 | /* configure gpio1 function: 0x0001(Logic level input/output) */ | ||
650 | .gpio_defaults[0] = 0x0001, | ||
651 | /* configure gpio3/4/5/7 function for AIF2 voice */ | ||
652 | .gpio_defaults[2] = 0x8100, | ||
653 | .gpio_defaults[3] = 0x8100, | ||
654 | .gpio_defaults[4] = 0x8100, | ||
655 | .gpio_defaults[6] = 0x0100, | ||
656 | /* configure gpio8/9/10/11 function for AIF3 BT */ | ||
657 | .gpio_defaults[7] = 0x8100, | ||
658 | .gpio_defaults[8] = 0x0100, | ||
659 | .gpio_defaults[9] = 0x0100, | ||
660 | .gpio_defaults[10] = 0x0100, | ||
661 | .ldo[0] = { S5PV210_MP03(6), &wm8994_ldo1_data }, /* XM0FRNB_2 */ | ||
662 | .ldo[1] = { 0, &wm8994_ldo2_data }, | ||
663 | }; | ||
664 | |||
665 | /* GPIO I2C PMIC */ | ||
666 | #define AP_I2C_GPIO_PMIC_BUS_4 4 | ||
667 | static struct i2c_gpio_platform_data goni_i2c_gpio_pmic_data = { | ||
668 | .sda_pin = S5PV210_GPJ4(0), /* XMSMCSN */ | ||
669 | .scl_pin = S5PV210_GPJ4(3), /* XMSMIRQN */ | ||
670 | }; | ||
671 | |||
672 | static struct platform_device goni_i2c_gpio_pmic = { | ||
673 | .name = "i2c-gpio", | ||
674 | .id = AP_I2C_GPIO_PMIC_BUS_4, | ||
675 | .dev = { | ||
676 | .platform_data = &goni_i2c_gpio_pmic_data, | ||
677 | }, | ||
678 | }; | ||
679 | |||
680 | static struct i2c_board_info i2c_gpio_pmic_devs[] __initdata = { | ||
681 | #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE) | ||
682 | { | ||
683 | /* 0xCC when SRAD = 0 */ | ||
684 | I2C_BOARD_INFO("max8998", 0xCC >> 1), | ||
685 | .platform_data = &goni_max8998_pdata, | ||
686 | }, | ||
687 | #endif | ||
688 | }; | ||
689 | |||
690 | /* GPIO I2C AP 1.8V */ | ||
691 | #define AP_I2C_GPIO_BUS_5 5 | ||
692 | static struct i2c_gpio_platform_data goni_i2c_gpio5_data = { | ||
693 | .sda_pin = S5PV210_MP05(3), /* XM0ADDR_11 */ | ||
694 | .scl_pin = S5PV210_MP05(2), /* XM0ADDR_10 */ | ||
695 | }; | ||
696 | |||
697 | static struct platform_device goni_i2c_gpio5 = { | ||
698 | .name = "i2c-gpio", | ||
699 | .id = AP_I2C_GPIO_BUS_5, | ||
700 | .dev = { | ||
701 | .platform_data = &goni_i2c_gpio5_data, | ||
702 | }, | ||
703 | }; | ||
704 | |||
705 | static struct i2c_board_info i2c_gpio5_devs[] __initdata = { | ||
706 | { | ||
707 | /* CS/ADDR = low 0x34 (FYI: high = 0x36) */ | ||
708 | I2C_BOARD_INFO("wm8994", 0x1a), | ||
709 | .platform_data = &wm8994_platform_data, | ||
710 | }, | ||
711 | }; | ||
712 | |||
713 | /* PMIC Power button */ | ||
714 | static struct gpio_keys_button goni_gpio_keys_table[] = { | ||
715 | { | ||
716 | .code = KEY_POWER, | ||
717 | .gpio = S5PV210_GPH2(6), | ||
718 | .desc = "gpio-keys: KEY_POWER", | ||
719 | .type = EV_KEY, | ||
720 | .active_low = 1, | ||
721 | .wakeup = 1, | ||
722 | .debounce_interval = 1, | ||
723 | }, | ||
724 | }; | ||
725 | |||
726 | static struct gpio_keys_platform_data goni_gpio_keys_data = { | ||
727 | .buttons = goni_gpio_keys_table, | ||
728 | .nbuttons = ARRAY_SIZE(goni_gpio_keys_table), | ||
729 | }; | ||
730 | |||
731 | static struct platform_device goni_device_gpiokeys = { | ||
732 | .name = "gpio-keys", | ||
733 | .dev = { | ||
734 | .platform_data = &goni_gpio_keys_data, | ||
735 | }, | ||
736 | }; | ||
737 | |||
738 | static void __init goni_pmic_init(void) | ||
739 | { | ||
740 | /* AP_PMIC_IRQ: EINT7 */ | ||
741 | s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_SFN(0xf)); | ||
742 | s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_UP); | ||
743 | |||
744 | /* nPower: EINT22 */ | ||
745 | s3c_gpio_cfgpin(S5PV210_GPH2(6), S3C_GPIO_SFN(0xf)); | ||
746 | s3c_gpio_setpull(S5PV210_GPH2(6), S3C_GPIO_PULL_UP); | ||
747 | } | ||
748 | |||
749 | /* MoviNAND */ | ||
750 | static struct s3c_sdhci_platdata goni_hsmmc0_data __initdata = { | ||
751 | .max_width = 4, | ||
752 | .cd_type = S3C_SDHCI_CD_PERMANENT, | ||
753 | }; | ||
754 | |||
755 | /* Wireless LAN */ | ||
756 | static struct s3c_sdhci_platdata goni_hsmmc1_data __initdata = { | ||
757 | .max_width = 4, | ||
758 | .cd_type = S3C_SDHCI_CD_EXTERNAL, | ||
759 | /* ext_cd_{init,cleanup} callbacks will be added later */ | ||
760 | }; | ||
761 | |||
762 | /* External Flash */ | ||
763 | #define GONI_EXT_FLASH_EN S5PV210_MP05(4) | ||
764 | #define GONI_EXT_FLASH_CD S5PV210_GPH3(4) | ||
765 | static struct s3c_sdhci_platdata goni_hsmmc2_data __initdata = { | ||
766 | .max_width = 4, | ||
767 | .cd_type = S3C_SDHCI_CD_GPIO, | ||
768 | .ext_cd_gpio = GONI_EXT_FLASH_CD, | ||
769 | .ext_cd_gpio_invert = 1, | ||
770 | }; | ||
771 | |||
772 | static struct regulator_consumer_supply mmc2_supplies[] = { | ||
773 | REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"), | ||
774 | }; | ||
775 | |||
776 | static struct regulator_init_data mmc2_fixed_voltage_init_data = { | ||
777 | .constraints = { | ||
778 | .name = "V_TF_2.8V", | ||
779 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
780 | }, | ||
781 | .num_consumer_supplies = ARRAY_SIZE(mmc2_supplies), | ||
782 | .consumer_supplies = mmc2_supplies, | ||
783 | }; | ||
784 | |||
785 | static struct fixed_voltage_config mmc2_fixed_voltage_config = { | ||
786 | .supply_name = "EXT_FLASH_EN", | ||
787 | .microvolts = 2800000, | ||
788 | .gpio = GONI_EXT_FLASH_EN, | ||
789 | .enable_high = true, | ||
790 | .init_data = &mmc2_fixed_voltage_init_data, | ||
791 | }; | ||
792 | |||
793 | static struct platform_device mmc2_fixed_voltage = { | ||
794 | .name = "reg-fixed-voltage", | ||
795 | .id = 2, | ||
796 | .dev = { | ||
797 | .platform_data = &mmc2_fixed_voltage_config, | ||
798 | }, | ||
799 | }; | ||
800 | |||
801 | static void goni_setup_sdhci(void) | ||
802 | { | ||
803 | s3c_sdhci0_set_platdata(&goni_hsmmc0_data); | ||
804 | s3c_sdhci1_set_platdata(&goni_hsmmc1_data); | ||
805 | s3c_sdhci2_set_platdata(&goni_hsmmc2_data); | ||
806 | }; | ||
807 | |||
808 | /* Audio device */ | ||
809 | static struct platform_device goni_device_audio = { | ||
810 | .name = "smdk-audio", | ||
811 | .id = -1, | ||
812 | }; | ||
813 | |||
814 | static struct platform_device *goni_devices[] __initdata = { | ||
815 | &s3c_device_fb, | ||
816 | &s5p_device_onenand, | ||
817 | &goni_spi_gpio, | ||
818 | &goni_i2c_gpio_pmic, | ||
819 | &goni_i2c_gpio5, | ||
820 | &goni_device_audio, | ||
821 | &mmc2_fixed_voltage, | ||
822 | &goni_device_gpiokeys, | ||
823 | &s5p_device_mfc, | ||
824 | &s5p_device_mfc_l, | ||
825 | &s5p_device_mfc_r, | ||
826 | &s5p_device_mixer, | ||
827 | &s5p_device_sdo, | ||
828 | &s3c_device_i2c0, | ||
829 | &s3c_device_hsmmc0, | ||
830 | &s3c_device_hsmmc1, | ||
831 | &s3c_device_hsmmc2, | ||
832 | &s5pv210_device_iis0, | ||
833 | &s3c_device_usb_hsotg, | ||
834 | &samsung_device_keypad, | ||
835 | &s3c_device_i2c1, | ||
836 | &s3c_device_i2c2, | ||
837 | &wm8994_fixed_voltage0, | ||
838 | &wm8994_fixed_voltage1, | ||
839 | }; | ||
840 | |||
841 | static void __init goni_sound_init(void) | ||
842 | { | ||
843 | /* Ths main clock of WM8994 codec uses the output of CLKOUT pin. | ||
844 | * The CLKOUT[9:8] set to 0x3(XUSBXTI) of 0xE010E000(OTHERS) | ||
845 | * because it needs 24MHz clock to operate WM8994 codec. | ||
846 | */ | ||
847 | __raw_writel(__raw_readl(S5P_OTHERS) | (0x3 << 8), S5P_OTHERS); | ||
848 | } | ||
849 | |||
850 | static void __init goni_map_io(void) | ||
851 | { | ||
852 | s5pv210_init_io(NULL, 0); | ||
853 | s3c24xx_init_clocks(clk_xusbxti.rate); | ||
854 | s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); | ||
855 | samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4); | ||
856 | } | ||
857 | |||
858 | static void __init goni_reserve(void) | ||
859 | { | ||
860 | s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20); | ||
861 | } | ||
862 | |||
863 | static void __init goni_machine_init(void) | ||
864 | { | ||
865 | /* Radio: call before I2C 1 registeration */ | ||
866 | goni_radio_init(); | ||
867 | |||
868 | /* I2C0 */ | ||
869 | s3c_i2c0_set_platdata(NULL); | ||
870 | |||
871 | /* I2C1 */ | ||
872 | s3c_i2c1_set_platdata(NULL); | ||
873 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | ||
874 | |||
875 | /* TSP: call before I2C 2 registeration */ | ||
876 | goni_tsp_init(); | ||
877 | |||
878 | /* I2C2 */ | ||
879 | s3c_i2c2_set_platdata(&i2c2_data); | ||
880 | i2c_register_board_info(2, i2c2_devs, ARRAY_SIZE(i2c2_devs)); | ||
881 | |||
882 | /* PMIC */ | ||
883 | goni_pmic_init(); | ||
884 | i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs, | ||
885 | ARRAY_SIZE(i2c_gpio_pmic_devs)); | ||
886 | /* SDHCI */ | ||
887 | goni_setup_sdhci(); | ||
888 | |||
889 | /* SOUND */ | ||
890 | goni_sound_init(); | ||
891 | i2c_register_board_info(AP_I2C_GPIO_BUS_5, i2c_gpio5_devs, | ||
892 | ARRAY_SIZE(i2c_gpio5_devs)); | ||
893 | |||
894 | /* FB */ | ||
895 | s3c_fb_set_platdata(&goni_lcd_pdata); | ||
896 | |||
897 | s3c_hsotg_set_platdata(&goni_hsotg_pdata); | ||
898 | |||
899 | /* SPI */ | ||
900 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); | ||
901 | |||
902 | /* KEYPAD */ | ||
903 | samsung_keypad_set_platdata(&keypad_data); | ||
904 | |||
905 | platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices)); | ||
906 | } | ||
907 | |||
908 | MACHINE_START(GONI, "GONI") | ||
909 | /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */ | ||
910 | .atag_offset = 0x100, | ||
911 | .init_irq = s5pv210_init_irq, | ||
912 | .map_io = goni_map_io, | ||
913 | .init_machine = goni_machine_init, | ||
914 | .init_time = samsung_timer_init, | ||
915 | .reserve = &goni_reserve, | ||
916 | .restart = s5pv210_restart, | ||
917 | MACHINE_END | ||