2 * linux/arch/arm/mach-s5pv310/mach-q1_c210.c
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
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.
11 #include <linux/platform_device.h>
12 #include <linux/serial_core.h>
13 #include <linux/input.h>
14 #include <linux/gpio.h>
15 #include <linux/gpio_keys.h>
16 #include <linux/delay.h>
17 #include <linux/cma.h>
18 #include <linux/lcd.h>
19 #include <linux/spi/spi.h>
20 #include <linux/spi/spi_gpio.h>
21 #include <linux/i2c.h>
22 #include <linux/i2c-gpio.h>
23 #include <linux/i2c/atmel_mxt_ts.h>
24 #include <linux/i2c/cypress_touchkey.h>
25 #include <linux/clk.h>
26 #include <linux/ntc.h>
27 #include <linux/regulator/machine.h>
28 #include <linux/regulator/fixed.h>
29 #include <linux/mfd/max8997.h>
30 #include <linux/mfd/max8997-private.h>
31 #include <linux/mfd/mc1n2_pdata.h>
32 #include <linux/power/max17042_battery.h>
33 #include <linux/power/max8903_charger.h>
34 #include <linux/ramoops.h>
35 #include <linux/mmcoops.h>
36 #include <linux/uart_select.h>
37 #include <linux/memblock.h>
38 #include <linux/rtc/rtc-s3c.h>
39 #include <linux/jack.h>
40 #include <linux/k3g.h>
41 #include <linux/kr3dh.h>
42 #include <linux/micro_usb_switch.h>
43 #include <linux/bh1721.h>
44 #include <linux/sii9234_platform.h>
45 #include <linux/cpufreq.h>
46 #include <linux/modem/xmm6260.h>
47 #include <linux/power/charger-manager.h>
48 #include <linux/host_notify.h>
49 #include <linux/switch.h>
51 #include <asm/mach-types.h>
52 #include <asm/mach/arch.h>
53 #include <asm/setup.h>
56 #include <mach/gpio.h>
57 #include <mach/regs-clock.h>
58 #include <mach/regs-pmu.h>
59 #include <mach/pm-core.h>
60 #include <mach/universal.h>
63 #include <plat/clock.h>
64 #include <plat/devs.h>
65 #include <plat/gpio-cfg.h>
66 #include <plat/gpio-core.h>
68 #ifdef CONFIG_VIDEO_FIMC
69 #include <plat/fimc.h>
71 #include <plat/fimg2d.h>
72 #include <plat/mali.h>
75 #include <plat/regs-otg.h>
76 #include <plat/regs-serial.h>
77 #include <plat/s5pv310.h>
79 #include <plat/fimd_drm.h>
80 #include <plat/tvout.h>
82 #include <plat/s5p_fimd_ext.h>
83 #include <plat/s5p_fimd_lite.h>
84 #include <plat/mdnie.h>
85 #include <plat/mipi_dsim.h>
86 #include <plat/usb_ehci.h>
87 #include <plat/sysmmu.h>
88 #include <plat/s5p-otghost.h>
89 #include <plat/udc-hs.h>
91 #include <media/s5p_fimc.h>
92 #include <media/m5mols.h>
93 #include <media/s5k6aafx.h>
95 #include "gpio-mobile.h"
97 #include "board-mobile.h"
98 #include "../../../drivers/usb/gadget/s3c_udc.h"
100 #ifdef CONFIG_EPEN_WACOM_G5SP
101 #include <linux/wacom_i2c.h>
102 static struct wacom_g5_callbacks *wacom_callbacks;
103 #endif /* CONFIG_EPEN_WACOM_G5SP */
105 #ifdef CONFIG_SMB328_CHARGER
106 #include <linux/power/smb328_charger.h>
109 /* Following are default values for UCON, ULCON and UFCON UART registers */
110 #define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
111 S3C2410_UCON_RXILEVEL | \
112 S3C2410_UCON_TXIRQMODE | \
113 S3C2410_UCON_RXIRQMODE | \
114 S3C2410_UCON_RXFIFO_TOI | \
115 S3C2443_UCON_RXERR_IRQEN)
117 #define UNIVERSAL_ULCON_DEFAULT S3C2410_LCON_CS8
119 #define UNIVERSAL_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
120 S5PV210_UFCON_TXTRIG256 | \
121 S5PV210_UFCON_RXTRIG256)
123 enum fixed_regulator_id {
124 FIXED_REG_ID_MMC = 0,
132 static struct s3c2410_uartcfg q1_uartcfgs[] __initdata = {
135 .ucon = UNIVERSAL_UCON_DEFAULT,
136 .ulcon = UNIVERSAL_ULCON_DEFAULT,
137 .ufcon = UNIVERSAL_UFCON_DEFAULT,
141 .ucon = UNIVERSAL_UCON_DEFAULT,
142 .ulcon = UNIVERSAL_ULCON_DEFAULT,
143 .ufcon = UNIVERSAL_UFCON_DEFAULT,
147 .ucon = UNIVERSAL_UCON_DEFAULT,
148 .ulcon = UNIVERSAL_ULCON_DEFAULT,
149 .ufcon = UNIVERSAL_UFCON_DEFAULT,
153 .ucon = UNIVERSAL_UCON_DEFAULT,
154 .ulcon = UNIVERSAL_ULCON_DEFAULT,
155 .ufcon = UNIVERSAL_UFCON_DEFAULT,
159 static struct s3c2410_platform_i2c q1_i2c0_platdata __initdata = {
160 .frequency = 300 * 1000,
164 static struct k3g_platform_data q1_k3g_data = {
166 .powerdown = K3G_POWERDOWN_NORMAL,
170 .block_data_update = K3G_BLOCK_DATA_UPDATE,
171 .fullscale = K3G_FULL_SCALE_2000DPS,
172 .fifo_mode = K3G_FIFO_FIFO_MODE,
173 .int2_src = K3G_INT2_OVERRUN,
174 .fifo_threshold = 16,
175 .int1_enable = K3G_INT1_EN,
176 .int1_z_high_enable = K3G_Z_HIGH_INT_EN,
177 .int1_y_high_enable = K3G_Y_HIGH_INT_EN,
178 .int1_x_high_enable = K3G_X_HIGH_INT_EN,
179 .int1_latch = K3G_INTERRUPT_LATCHED,
180 .int1_z_threshold = 0x12,
181 .int1_y_threshold = 0x25,
182 .int1_x_threshold = 0x25,
183 .int1_wait_enable = K3G_INT1_WAIT_EN,
184 .int1_wait_duration = 0x10,
187 static struct kr3dh_platform_data q1_kr3dh_data = {
188 .power_mode = KR3DH_LOW_POWER_10HZ,
189 .data_rate = KR3DH_ODR_50HZ,
194 .int1_cfg = KR3DH_INT_SOURCE,
195 .block_data_update = 1,
196 .fullscale = KR3DH_RANGE_2G,
197 .int1_combination = KR3DH_OR_COMBINATION,
199 .int1_z_high_enable = 1,
200 .int1_z_low_enable = 1,
201 .int1_y_high_enable = 1,
202 .int1_y_low_enable = 1,
203 .int1_x_high_enable = 1,
204 .int1_x_low_enable = 1,
205 .int1_threshold = 0x25,
206 .int1_duration = 0x01,
214 static struct i2c_board_info i2c1_devs[] __initdata = {
217 I2C_BOARD_INFO("K3G", 0x69),
218 .platform_data = &q1_k3g_data,
222 I2C_BOARD_INFO("KR3DH", 0x19),
223 .platform_data = &q1_kr3dh_data,
228 #ifdef CONFIG_CPU_FREQ_TICKLE
229 static void user_input_response_work(struct work_struct *work)
231 /* core 0's cpufreq controls both cores */
232 cpufreq_tickle_cpu(100, 0);
234 /* turn the core 1 on */
235 s5pv310_pm_hotplug_tickle();
238 static DECLARE_WORK(uir_work, user_input_response_work);
240 static void user_input_response(void *data)
242 if (!work_pending(&uir_work))
243 schedule_work_on(0, &uir_work);
249 /* FIXME: Only use for tuning */
250 static u8 mxt_init_vals_ver_22[] __initdata = {
252 /* MXT_GEN_COMMAND(6) */
254 /* MXT_GEN_POWER(7) */
256 /* MXT_GEN_ACQUIRE(8) */
257 68, 0, 5, 1, 0, 0, 4, 30, 8, 180,
258 /* MXT_TOUCH_MULTI(9) */
259 0, 0, 0, 0, 0, 0, 0, 0, 2, 6,
260 10, 10, 1, 47, 10, 20, 40, 20, 0, 0,
261 0, 0, 253, 3, 254, 2, 136, 60, 136, 40,
263 /* MXT_TOUCH_KEYARRAY(15) */
264 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
265 /* MXT_SPT_COMMSCONFIG(18) */
267 /* MXT_SPT_GPIOPWM(19) */
268 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
270 /* MXT_PROCI_ONETOUCH(24) */
271 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
272 0, 0, 0, 0, 0, 0, 0, 0, 0,
273 /* MXT_SPT_SELFTEST(25) */
274 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
275 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
277 /* MXT_PROCI_TWOTOUCH(27) */
279 /* MXT_MXT_DEBUG_DIAGNOSTIC(37) */
280 /* MXT_SPT_USERDATA(38) */
281 /* MXT_PROCI_GRIPSUPPRESSION(40) */
283 /* MXT_PROCI_TOUCHSUPPRESSION(42) */
284 0, 0, 0, 0, 0, 0, 0, 0,
285 /* MXT_SPT_DIGITIZER(43) */
288 /* MXT_SPT_CTECONFIG(46) */
289 0, 0, 24, 36, 0, 0, 1, 0, 0,
290 /* MXT_PROCI_STYLUS(47) */
291 0, 30, 60, 15, 2, 20, 20, 150, 0, 32,
292 /* MXT_PROCG_NOISESUPPRESSION(48) */
293 3, 132, 96, 0, 0, 0, 0, 0, 10, 20,
294 0, 0, 0, 6, 6, 0, 0, 64, 4, 64,
295 10, 0, 20, 6, 0, 46, 0, 1, 0, 0,
296 0, 0, 0, 0, 160, 40, 2, 10, 1, 47,
297 10, 5, 20, 253, 3, 254, 2, 136, 60, 136,
298 40, 18, 12, 0, 0, 0, 0, 0, 0, 0,
299 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
301 /* MXT_TOUCH_PROXKEY(52) */
302 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
307 static struct mxt_platform_data mxt_platform_data __refconst = {
308 .config = mxt_init_vals_ver_22,
309 .config_length = ARRAY_SIZE(mxt_init_vals_ver_22),
317 .orient = MXT_ROTATED_180,
318 .irqflags = IRQF_TRIGGER_FALLING,
320 #ifdef CONFIG_CPU_FREQ_TICKLE
321 /* For the faster user response */
322 .input_event = user_input_response,
326 #ifdef CONFIG_EPEN_WACOM_G5SP
327 static int q1_wacom_init_hw(void);
328 static int q1_wacom_exit_hw(void);
329 static int q1_wacom_suspend_hw(void);
330 static int q1_wacom_resume_hw(void);
331 static int q1_wacom_reset_hw(void);
332 static void q1_wacom_register_callbacks(struct wacom_g5_callbacks *cb);
334 static struct wacom_g5_platform_data q1_wacom_platform_data = {
338 .init_platform_hw = q1_wacom_init_hw,
339 /* .exit_platform_hw =, */
340 .suspend_platform_hw = q1_wacom_suspend_hw,
341 .resume_platform_hw = q1_wacom_resume_hw,
342 .register_cb = q1_wacom_register_callbacks,
345 static int q1_wacom_suspend_hw(void)
347 gpio_set_value(S5PV310_GPE0(2), 0);
351 static int q1_wacom_resume_hw(void)
353 gpio_set_value(S5PV310_GPE0(2), 1);
357 static void q1_wacom_register_callbacks(struct wacom_g5_callbacks *cb)
359 wacom_callbacks = cb;
363 static struct i2c_board_info i2c3_devs[] __initdata = {
365 I2C_BOARD_INFO("atmel_mxt_ts", 0x4c),
366 .platform_data = &mxt_platform_data,
371 static void __init q1_tsp_init(void)
375 /* TSP_LDO_ON: XGNSS_QSIGN */
376 gpio = S5PV310_GPL0(3);
377 gpio_request(gpio, "TSP_LDO_ON");
378 gpio_direction_output(gpio, 1);
379 gpio_export(gpio, 0);
381 /* TSP_INT: XEINT[4] */
382 gpio = S5PV310_GPX0(4);
383 gpio_request(gpio, "TSP_INT");
384 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
387 * Note that because TSP_LDO provides an external pull-up to TSP_INT,
388 * the pull-up setting at GPE1(7) is useless and may be omitted in
389 * order to reduce idle current. However, it probably needs some
390 * sleep/delay from TSP_LDO_ON = true event because there could be
391 * "ramp-up" delay. Before knowing this, let's just use PULL_UP here.
393 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
397 extern struct max8997_platform_data q1_max8997_pdata;
398 extern void __init q1_pmic_init(void);
400 static struct regulator_consumer_supply haptic_inmotor_supplies[] = {
401 REGULATOR_SUPPLY("in_motor", "max8997-haptic"),
404 static struct regulator_init_data haptic_inmotor_init_data = {
406 .name = "VCC_3.0V_MOTOR",
407 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
409 .num_consumer_supplies = ARRAY_SIZE(haptic_inmotor_supplies),
410 .consumer_supplies = haptic_inmotor_supplies,
413 static struct fixed_voltage_config haptic_inmotor_config = {
414 .supply_name = "MOTOR_EN",
415 .microvolts = 3000000,
416 .gpio = S5PV310_GPL2(4),
418 .init_data = &haptic_inmotor_init_data,
421 static struct platform_device haptic_inmotor_fixed_voltage = {
422 .name = "reg-fixed-voltage",
423 .id = FIXED_REG_ID_HAPTIC,
425 .platform_data = &haptic_inmotor_config,
429 struct max8997_haptic_platform_data q1_haptic_pdata = {
435 static struct i2c_board_info i2c4_devs[] __initdata = {
437 I2C_BOARD_INFO("si470x", 0x10),
441 static void __init q1_radio_init(void)
445 gpio = S5PV310_GPX2(4); /* XEINT_20 */
446 gpio_request(gpio, "FM_INT");
447 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
448 i2c4_devs[0].irq = gpio_to_irq(gpio);
450 gpio = S5PV310_GPB(0); /* XSPICLK_0 */
451 gpio_request(gpio, "FM_RST");
452 gpio_direction_output(gpio, 1);
455 /* GPIO I2C 5 (PMIC) */
456 enum { I2C5_MAX8997 };
457 static struct i2c_board_info i2c5_devs[] __initdata = {
459 I2C_BOARD_INFO("max8997", 0xCC >> 1),
460 .platform_data = &q1_max8997_pdata,
464 static void sec_set_sub_mic_bias(bool on)
467 gpio = MOBILE_GPIO(SUB_MICBIAS_EN);
468 gpio_set_value(gpio, on);
469 pr_err(KERN_ERR "SUB_MIC_BIAS_EN GPIO set [%d] !\n", on);
472 static void sec_set_main_mic_bias(bool on)
475 gpio = MOBILE_GPIO(MICBIAS_EN);
476 gpio_set_value(gpio, on);
477 pr_err(KERN_ERR "MAIN_MIC_BIAS_EN GPIO set [%d] !\n", on);
480 static struct mc1n2_platform_data mc1n2_pdata = {
481 .set_main_mic_bias = sec_set_main_mic_bias,
482 .set_sub_mic_bias = sec_set_sub_mic_bias,
486 static struct i2c_board_info i2c6_devs[] __initdata = {
489 I2C_BOARD_INFO("mc1n2", 0x3a),
490 .platform_data = &mc1n2_pdata,
492 #ifdef CONFIG_EPEN_WACOM_G5SP
494 I2C_BOARD_INFO("wacom_g5sp_i2c", 0x56),
495 .platform_data = &q1_wacom_platform_data,
501 static struct i2c_board_info i2c7_devs[] __initdata = {
504 I2C_BOARD_INFO("ak8975", 0x0c),
508 static void __init q1_sensor_init(void)
512 gpio = S5PV310_GPX2(2); /* XEINT_18 */
513 gpio_request(gpio, "MSENSE_INT");
514 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
515 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
516 i2c7_devs[0].irq = gpio_to_irq(gpio);
518 gpio = S5PV310_GPX0(0); /* XEINT_0 */
519 gpio_request(gpio, "GYRO_INT");
520 gpio_direction_input(gpio);
521 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_DOWN);
523 gpio = S5PV310_GPX0(1); /* XEINT_1 */
524 gpio_request(gpio, "GYRO_INT1");
525 gpio_direction_input(gpio);
526 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_DOWN);
528 gpio = S5PV310_GPX3(0); /* XEINT_24 */
529 gpio_request(gpio, "ACC_INT");
530 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
531 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_DOWN);
533 gpio = S5PV310_GPX0(2); /* XEINT_2 */
534 gpio_request(gpio, "PS_INT");
535 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
536 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
540 static struct i2c_gpio_platform_data i2c9_gpio_data = {
541 .sda_pin = S5PV310_GPY4(0), /* XM0ADDR_8 */
542 .scl_pin = S5PV310_GPY4(1), /* XM0ADDR_9 */
544 static struct platform_device i2c9_gpio = {
548 .platform_data = &i2c9_gpio_data,
551 static struct max17042_reg_data max17042_init_data[] = {
552 { MAX17042_CGAIN, 0x0000 },
553 { MAX17042_COFF, 0x0000 },
554 { MAX17042_MiscCFG, 0x0003 },
555 { MAX17042_LearnCFG, 0x0007 },
557 /* Alert only when the battery is removed or inserted */
558 static struct max17042_reg_data max17042_alert_init_data[] = {
559 /* SALRT Threshold setting (disable) unsigned MAX/MIN */
560 { MAX17042_SALRT_Th, 0xFF00 },
561 /* VALRT Threshold setting (disable) unsigned MAX/MIN */
562 { MAX17042_VALRT_Th, 0xFF00 },
563 /* TALRT Threshold setting (disable) signed MAX/MIN */
564 { MAX17042_TALRT_Th, 0x7F80 },
566 static struct max17042_platform_data q1_battery_platform_data = {
567 .init_data = max17042_init_data,
568 .num_init_data = ARRAY_SIZE(max17042_init_data),
569 .alrt_data = max17042_alert_init_data,
570 .num_alrt_data = ARRAY_SIZE(max17042_alert_init_data),
571 .irq_base = IRQ_FUEL_BASE,
572 .enable_alert = true,
574 .r_sns = 10000, /* 10m Ohm */
576 static struct i2c_board_info i2c9_devs[] __initdata = {
578 I2C_BOARD_INFO("max17042", 0x36),
579 .platform_data = &q1_battery_platform_data,
584 static struct cypress_pin cypress_tk_pin = {
585 .gpio_int = S5PV310_GPL0(5),
586 .gpio_sda = S5PV310_GPK1(2),
587 .gpio_scl = S5PV310_GPK1(0),
590 static void cypress_tk_cfg_pin(void)
592 s3c_gpio_setpull(cypress_tk_pin.gpio_sda, S3C_GPIO_PULL_NONE);
593 s3c_gpio_setpull(cypress_tk_pin.gpio_scl, S3C_GPIO_PULL_NONE);
595 s3c_gpio_cfgpin(cypress_tk_pin.gpio_sda, S3C_GPIO_SFN(2));
596 s3c_gpio_cfgpin(cypress_tk_pin.gpio_scl, S3C_GPIO_SFN(2));
598 s3c_gpio_cfgpin(cypress_tk_pin.gpio_int, S3C_GPIO_SFN(0xf));
601 static int cypress_touchkey_power(int onoff)
603 struct regulator *regulator;
605 regulator = regulator_get(NULL, "touch_2.8v");
606 if (IS_ERR(regulator)) {
607 printk(KERN_ERR "[TK][ERROR] regulator_get fail\n");
612 regulator_enable(regulator);
614 if (regulator_is_enabled(regulator))
615 regulator_force_disable(regulator);
617 regulator_put(regulator);
623 static int cypress_touchled_power(int onoff)
625 struct regulator *regulator;
627 regulator = regulator_get(NULL, "touch_led_3.3v");
628 if (IS_ERR(regulator)) {
629 printk(KERN_ERR "[TK][ERROR] regulator_get fail\n");
634 regulator_enable(regulator);
636 if (regulator_is_enabled(regulator))
637 regulator_force_disable(regulator);
639 regulator_put(regulator);
645 static unsigned int q1_cypress_touch_keycode[] = {
646 KEY_PHONE, /* not use this value 0x00 */
647 KEY_PHONE, /* KEY_SEND 0x01 */
648 KEY_BACK, /* KEY_END 0x02 */
651 static unsigned char q1_cypress_keycode_setbit[] = {
657 static struct cypress_platform_data cypress_tk_data = {
658 .cfg_pin = cypress_tk_cfg_pin,
659 .power_pin = cypress_touchkey_power,
660 .led_pin = cypress_touchled_power,
661 .pin = &cypress_tk_pin,
662 .keycode = q1_cypress_touch_keycode,
663 .keycode_size = ARRAY_SIZE(q1_cypress_touch_keycode),
664 .keycode_setbit = q1_cypress_keycode_setbit,
668 static struct i2c_gpio_platform_data i2c12_gpio_data = {
669 .sda_pin = S5PV310_GPK1(2), /* XMMC1CDN */
670 .scl_pin = S5PV310_GPK1(0), /* XMMC1CLK */
673 static struct platform_device i2c12_gpio = {
677 .platform_data = &i2c12_gpio_data,
681 static struct i2c_board_info i2c12_devs[] __initdata = {
683 I2C_BOARD_INFO("cypress_tk", 0x20),
684 .platform_data = &cypress_tk_data,
688 static struct i2c_gpio_platform_data i2c14_gpio_data = {
689 .sda_pin = S5PV310_GPK2(2), /* XMMC2CDn */
690 .scl_pin = S5PV310_GPK3(2), /* XMMC3CDn */
691 .udelay = 1, /* 500kHz */
694 static struct platform_device i2c14_gpio = {
698 .platform_data = &i2c14_gpio_data,
702 static void __init q1_sound_init(void)
708 /* Set PMU register to set CLK_OUT to use XUSBXTI
709 * as codec source clock */
711 __raw_writel(val, S5P_PMREG(0xA00));
713 gpio = MOBILE_GPIO(MICBIAS_EN);
714 err = gpio_request(gpio, "MICBIAS_EN");
716 pr_err(KERN_ERR "MIC_BIAS_EN GPIO set error!\n");
719 gpio_direction_output(gpio, 1);
720 gpio_set_value(gpio, 0);
722 gpio = MOBILE_GPIO(EAR_MICBIAS_EN);
723 err = gpio_request(gpio, "EAR_MICBIAS_EN");
725 pr_err(KERN_ERR "EAR_MIC_BIAS_EN GPIO set error!\n");
728 gpio_direction_output(gpio, 1);
729 gpio_set_value(gpio, 0);
731 gpio = MOBILE_GPIO(SUB_MICBIAS_EN);
732 err = gpio_request(gpio, "submic_bias");
734 pr_err(KERN_ERR "SUB_MIC_BIAS_EN GPIO set error!\n");
737 gpio_direction_output(gpio, 0);
741 #if defined(CONFIG_VIDEO_S5K5BAFX)
742 #define VT_CAM_SDA_18V S5PV310_GPC1(0)
743 #define VT_CAM_SCL_18V S5PV310_GPC1(2)
745 static struct i2c_gpio_platform_data i2c17_gpio_data = {
746 .sda_pin = VT_CAM_SDA_18V,
747 .scl_pin = VT_CAM_SCL_18V,
749 .sda_is_open_drain = 0,
750 .scl_is_open_drain = 0,
751 .scl_is_output_only = 0,
754 static struct platform_device i2c17_gpio = {
758 .platform_data = &i2c17_gpio_data,
764 static struct jack_platform_data q1_jack_data = {
766 .charger_online = -1,
775 static struct platform_device q1_jack = {
779 .platform_data = &q1_jack_data,
784 static struct platform_device q1_tzpc = {
790 static struct s3c_adc_platform_data s3c_adc_pdata __initdata = {
794 .max_adc_voltage_uV = 3300000,
797 static void __init q1_adc_init(void)
799 s3c_adc_set_platdata(&s3c_adc_pdata);
802 static void ramoops_enable(int enable)
806 clk = clk_get(NULL, "modem");
814 static struct ramoops_platform_data q1_ramoops_data = {
815 .mem_address = 0x13A00000, /* MODEM I/F */
817 .enable = ramoops_enable,
820 static struct platform_device q1_ramoops = {
823 .platform_data = &q1_ramoops_data,
828 static struct s5p_usb_ehci_platdata q1_usb_ehci_pdata;
830 static void __init q1_usb_ehci_init(void)
832 struct s5p_usb_ehci_platdata *pdata = &q1_usb_ehci_pdata;
834 /* The gpios is initialized from modem_init */
835 pdata->gpio_active = MOBILE_GPIO(ACTIVE_STATE_HSIC);
837 s5p_usb_ehci_set_platdata(pdata);
841 /* we don't use OTGDRVVBUS pin for powering up otg charging pump */
842 static void q1_otg_power_cb(int enable)
844 /* We need to control new device SMB328 for powering up,
845 * but SMB328 driver is not yet added. (20120315)
847 pr_info("%s:otg_power_cb doesn't work(%d)\n", __func__, enable);
850 static void __init q1_usb_otg_init(void)
852 struct host_notify_dev *q1_otg_ndev =
853 dev_get_platdata(&s3c_device_usbgadget.dev);
854 struct sec_otghost_data *q1_otg_host_data =
855 dev_get_platdata(&s3c_device_usb_otghcd.dev);
857 q1_otg_ndev->set_booster = q1_otg_power_cb;
858 q1_otg_host_data->set_pwr_cb = q1_otg_power_cb;
862 static struct platform_device q1_modem_net = {
867 /* XMM6260 control */
868 static struct xmm6260_gpios q1_xmm6260_gpios;
870 static struct xmm6260_platform_data q1_xmm6260_pdata = {
871 .gpios = &q1_xmm6260_gpios,
875 static struct platform_device q1_xmm6260 = {
876 /* FIXME: Use modemctl name because of platform dependency */
880 .platform_data = &q1_xmm6260_pdata,
884 static void __init q1_modem_init(void)
886 struct xmm6260_gpios *gpios = &q1_xmm6260_gpios;
889 gpio = MOBILE_GPIO(CP_ON);
890 gpio_request(gpio, "CP_ON");
891 gpio_direction_output(gpio, 0);
894 gpio = MOBILE_GPIO(PHONE_ACTIVE);
895 gpio_request(gpio, "PHONE_ACTIVE");
896 gpios->phone_active = gpio;
898 gpio = MOBILE_GPIO(PDA_ACTIVE);
899 gpio_request(gpio, "PDA_ACTIVE");
900 gpio_direction_output(gpio, 0);
901 gpios->pda_active = gpio;
903 gpio = MOBILE_GPIO(CP_DUMP_INT);
904 gpio_request(gpio, "CP_DUMP_INT");
905 gpios->cp_dump_int = gpio;
907 gpio = MOBILE_GPIO(CP_PMU_RST);
908 gpio_request(gpio, "CP_PMU_RST");
909 gpio_direction_output(gpio, 0);
910 gpios->cp_pmu_rst = gpio;
912 gpio = MOBILE_GPIO(RESET_REQ_N);
913 gpio_request(gpio, "RESET_REQ_N");
914 gpio_direction_output(gpio, 0);
915 gpios->reset_req_n = gpio;
917 gpio = MOBILE_GPIO(IPC_SLAVE_WAKEUP);
918 gpio_request(gpio, "IPC_SLAVE_WAKEUP");
919 gpio_direction_output(gpio, 0);
920 gpios->ipc_slave_wakeup = gpio;
922 gpio = MOBILE_GPIO(IPC_HOST_WAKEUP);
923 gpio_request(gpio, "IPC_HOST_WAKEUP");
924 gpios->ipc_host_wakeup = gpio;
926 gpio = MOBILE_GPIO(SUSPEND_REQUEST_HSIC);
927 gpio_request(gpio, "SUSPEND_REQUEST_HSIC");
928 gpios->suspend_request_hsic = gpio;
930 gpio = MOBILE_GPIO(ACTIVE_STATE_HSIC);
931 gpio_request(gpio, "ACTIVE_STATE_HSIC");
932 gpio_direction_output(gpio, 0);
933 gpios->active_state_hsic = gpio;
936 static struct regulator_consumer_supply emmc_supplies[] = {
937 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
938 REGULATOR_SUPPLY("vmmc", "dw_mmc"),
941 static struct regulator_init_data emmc_fixed_voltage_init_data = {
943 .name = "VMEM_VDD_2.8/VDDF_3.0V",
944 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
946 .num_consumer_supplies = ARRAY_SIZE(emmc_supplies),
947 .consumer_supplies = emmc_supplies,
950 static struct fixed_voltage_config emmc_fixed_voltage_config = {
951 .supply_name = "eMMC_EN",
952 .microvolts = 2800000,
953 .gpio = S5PV310_GPK0(2),
955 .init_data = &emmc_fixed_voltage_init_data,
958 static struct platform_device emmc_fixed_voltage = {
959 .name = "reg-fixed-voltage",
960 .id = FIXED_REG_ID_MMC,
962 .platform_data = &emmc_fixed_voltage_config,
967 #ifdef CONFIG_DRM_MALI
968 static struct platform_device s5p_device_mali_drm = {
975 #ifdef CONFIG_DRM_FIMD
976 static struct resource fimd_drm_resource[] = {
978 .start = S5P_PA_LCD0,
979 .end = S5P_PA_LCD0 + S5P_SZ_LCD0 - 1,
980 .flags = IORESOURCE_MEM,
983 .start = S5P_PA_LCD1,
984 .end = S5P_PA_LCD1 + S5P_SZ_LCD1 - 1,
985 .flags = IORESOURCE_MEM,
990 .flags = IORESOURCE_IRQ,
995 .flags = IORESOURCE_IRQ,
999 static struct fimd_drm_platform_data fimd_drm_pd = {
1003 static struct platform_device s5p_device_fimd_drm = {
1006 .num_resources = ARRAY_SIZE(fimd_drm_resource),
1007 .resource = fimd_drm_resource,
1009 .platform_data = &fimd_drm_pd,
1014 #ifdef CONFIG_ANDROID_RAM_CONSOLE
1015 static struct resource ram_console_resource[] = {
1017 .flags = IORESOURCE_MEM,
1021 static struct platform_device ram_console_device = {
1022 .name = "ram_console",
1024 .num_resources = ARRAY_SIZE(ram_console_resource),
1025 .resource = ram_console_resource,
1029 static void __init q1_map_io(void)
1031 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
1032 s5p_xtal_set_parent(CLK_XUSBXTI);
1033 s3c24xx_init_clocks(24000000);
1034 s3c24xx_init_uarts(q1_uartcfgs, ARRAY_SIZE(q1_uartcfgs));
1037 static unsigned long fbmem_start, fbmem_size;
1038 static int __init early_fbmem(char *p)
1045 fbmem_size = memparse(p, &endp);
1047 fbmem_start = memparse(endp + 1, &endp);
1049 return endp > p ? 0 : -EINVAL;
1051 early_param("fbmem", early_fbmem);
1053 static void __init s5pv310_reserve(void)
1055 static struct cma_region regions[] = {
1056 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMD0
1059 .size = (CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMD0
1060 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMD1
1061 + CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMD1
1066 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC0
1069 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC0 * SZ_1K,
1073 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC1
1076 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC1 * SZ_1K,
1080 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC2
1083 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC2 * SZ_1K,
1087 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC3
1090 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC3 * SZ_1K,
1095 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_S3C_MEM_CMA
1097 .name = "s3c-mem-cma",
1098 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_S3C_MEM_CMA * SZ_1K,
1103 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_JPEG
1106 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_JPEG * SZ_1K,
1109 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC
1112 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC * SZ_1K,
1115 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC0
1118 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC0 * SZ_1K,
1120 .alignment = 1 << 17,
1124 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC1
1127 .size = CONFIG_VIDEO_SAMSUNG_MEMSIZE_MFC1 * SZ_1K,
1129 .alignment = 1 << 17,
1133 #ifdef CONFIG_VIDEO_SAMSUNG_S5P_MFC
1137 { .alignment = 128 << 10 },
1138 .start = 0x42000000,
1143 .start = 0x43000000,
1148 .start = 0x51000000,
1151 #ifdef CONFIG_SEC_DEBUG
1155 .start = 0x40003000,
1161 static const char map[] __initconst =
1163 #ifdef CONFIG_VIDEO_FIMC
1169 #ifdef CONFIG_S3C_MEM_CMA_ALLOC
1170 "s3c-mem=s3c-mem-cma;"
1174 #ifdef CONFIG_SEC_DEBUG
1175 "s3c-getlog=getlog;"
1177 #if defined(CONFIG_VIDEO_SAMSUNG_S5P_MFC)
1178 "mfc=mfc,mfc0,mfc1;"
1179 "s5p-mfc/f=fw;s5p-mfc/a=b1;s5p-mfc/b=b2;"
1181 #ifdef CONFIG_VIDEO_SAMSUNG_MEMSIZE_PROFILING
1182 "s3c-mfc/mfc=mfc;s3c-mfc/mfc0=mfc0;s3c-mfc/mfc1=mfc1;"
1184 "s3c-mfc=mfc,mfc0,mfc1;"
1191 #ifdef CONFIG_ANDROID_RAM_CONSOLE
1194 /* FIXME: ram console MUST be reserved at first time */
1195 addr = memblock_alloc_base(SZ_1M, SZ_4K, 0x60000000);
1196 ram_console_resource[0].start = addr;
1197 ram_console_resource[0].end = addr + SZ_1M - 1;
1198 pr_info("ram_console: 0x%08x ~ 0x%08x (1MB)\n",
1199 addr, addr + SZ_1M);
1203 regions[0].start = (dma_addr_t)fbmem_start;
1205 regions[0].size = (size_t)fbmem_size;
1207 cma_set_defaults(regions, map);
1208 cma_early_regions_reserve(NULL);
1210 for (; i < ARRAY_SIZE(regions) - 1 /* terminator */; ++i) {
1211 pr_info("cma: region: %-8s: 0x%08x ~ 0x%08x (%dMB)\n",
1212 regions[i].name, regions[i].start,
1213 regions[i].start + regions[i].size,
1214 regions[i].size / SZ_1M);
1219 * GPX are saved and restored at plat-samsung/pm.c:s5c_pm_enter.
1220 * However, they are inside of pm_prepare and pm_finish, so it
1221 * does not save ours against universal_pm_prepare:2.
1223 static struct sleep_save s5pc210_gpx[] = {
1224 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C00),
1225 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C04),
1226 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C08),
1227 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C0C),
1228 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C20),
1229 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C24),
1230 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C28),
1231 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C2C),
1232 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C40),
1233 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C44),
1234 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C48),
1235 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C4C),
1236 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C60),
1237 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C64),
1238 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C68),
1239 SAVE_ITEM(S5P_VA_GPIO2 + 0x0C6C),
1243 static struct gpio_keys_button q1_gpio_keys_tables[] = {
1245 .code = KEY_VOLUMEUP,
1246 .gpio = S5PV310_GPX2(0), /* XEINT16 */
1247 .desc = "gpio-keys: KEY_VOLUMEUP",
1250 .debounce_interval = 1,
1252 .code = KEY_VOLUMEDOWN,
1253 .gpio = S5PV310_GPX2(1), /* XEINT17 */
1254 .desc = "gpio-keys: KEY_VOLUMEDOWN",
1257 .debounce_interval = 1,
1260 .gpio = S5PV310_GPX2(7), /* XEINT23 */
1261 .desc = "gpio-keys: KEY_POWER",
1265 .debounce_interval = 1,
1268 .gpio = S5PV310_GPX3(5), /* XEINT29 */
1269 .desc = "gpio-keys: KEY_HOME",
1272 .debounce_interval = 1,
1276 static struct gpio_keys_platform_data q1_gpio_keys_data = {
1277 .buttons = q1_gpio_keys_tables,
1278 .nbuttons = ARRAY_SIZE(q1_gpio_keys_tables),
1281 static struct platform_device q1_gpio_keys = {
1282 .name = "gpio-keys",
1284 .platform_data = &q1_gpio_keys_data,
1287 /* s6e8aa0 panel. */
1288 static struct s3cfb_lcd s6e8aa0 = {
1305 .cmd_allow_len = 0xf,
1315 static int lcd_power_on(struct lcd_device *ld, int enable)
1317 struct regulator *regulator;
1320 printk(KERN_ERR "lcd device object is NULL.\n");
1325 regulator = regulator_get(&ld->dev, "vcc_1.8v");
1326 if (IS_ERR(regulator))
1328 regulator_enable(regulator);
1329 regulator_put(regulator);
1330 regulator = regulator_get(&ld->dev, "vcc_2.1v");
1331 if (IS_ERR(regulator))
1333 regulator_enable(regulator);
1334 regulator_put(regulator);
1336 regulator = regulator_get(&ld->dev, "vcc_3.1v");
1337 if (IS_ERR(regulator))
1339 regulator_enable(regulator);
1340 regulator_put(regulator);
1342 regulator = regulator_get(&ld->dev, "vcc_1.8v");
1343 if (IS_ERR(regulator))
1345 if (regulator_is_enabled(regulator))
1346 regulator_disable(regulator);
1347 regulator_put(regulator);
1349 regulator = regulator_get(&ld->dev, "vcc_2.1v");
1350 if (IS_ERR(regulator))
1352 if (regulator_is_enabled(regulator))
1353 regulator_disable(regulator);
1354 regulator_put(regulator);
1356 regulator = regulator_get(&ld->dev, "vcc_3.1v");
1357 if (IS_ERR(regulator))
1359 if (regulator_is_enabled(regulator))
1360 regulator_disable(regulator);
1361 regulator_put(regulator);
1367 static int reset_lcd(struct lcd_device *ld)
1369 static unsigned int first = 1;
1370 int reset_gpio = -1;
1372 reset_gpio = S5PV310_GPY4(5);
1375 gpio_request(reset_gpio, "MLCD_RST");
1380 gpio_direction_output(reset_gpio, 0);
1382 gpio_direction_output(reset_gpio, 1);
1387 static int s5p_mipi_dphy_power(struct platform_device *pdev, unsigned int enable)
1389 struct regulator *regulator;
1392 regulator = regulator_get(&pdev->dev, "vmipi_1.1v");
1393 if (IS_ERR(regulator))
1395 regulator_enable(regulator);
1396 regulator_put(regulator);
1397 regulator = regulator_get(&pdev->dev, "vmipi_1.8v");
1398 if (IS_ERR(regulator))
1400 regulator_enable(regulator);
1401 regulator_put(regulator);
1403 regulator = regulator_get(&pdev->dev, "vmipi_1.1v");
1404 if (IS_ERR(regulator))
1406 if (regulator_is_enabled(regulator))
1407 regulator_disable(regulator);
1408 regulator_put(regulator);
1410 regulator = regulator_get(&pdev->dev, "vmipi_1.8v");
1411 if (IS_ERR(regulator))
1413 if (regulator_is_enabled(regulator))
1414 regulator_disable(regulator);
1415 regulator_put(regulator);
1419 printk("[%d] %s : %s\n", __LINE__, __func__, dev_name(&pdev->dev));
1423 static struct mipi_dsim_config dsim_config = {
1424 .e_interface = DSIM_VIDEO,
1425 .e_virtual_ch = DSIM_VIRTUAL_CH_0,
1426 .e_pixel_format = DSIM_24BPP_888,
1427 .e_burst_mode = DSIM_BURST_SYNC_EVENT,
1428 .e_no_data_lane = DSIM_DATA_LANE_4,
1429 .e_byte_clk = DSIM_PLL_OUT_DIV8,
1432 * ===========================================
1433 * | P | M | S | MHz |
1434 * -------------------------------------------
1435 * | 3 | 100 | 3 | 100 |
1436 * | 3 | 100 | 2 | 200 |
1437 * | 3 | 63 | 1 | 252 |
1438 * | 4 | 100 | 1 | 300 |
1439 * | 4 | 110 | 1 | 330 |
1440 * | 12 | 350 | 1 | 350 |
1441 * | 3 | 100 | 1 | 400 |
1442 * | 4 | 150 | 1 | 450 |
1443 * | 6 | 118 | 1 | 472 |
1444 * | 12 | 250 | 0 | 500 |
1445 * | 4 | 100 | 0 | 600 |
1446 * | 3 | 81 | 0 | 648 |
1447 * | 3 | 88 | 0 | 704 |
1448 * | 3 | 90 | 0 | 720 |
1449 * | 3 | 100 | 0 | 800 |
1450 * | 12 | 425 | 0 | 850 |
1451 * | 4 | 150 | 0 | 900 |
1452 * | 12 | 475 | 0 | 950 |
1453 * | 6 | 250 | 0 | 1000 |
1454 * -------------------------------------------
1461 /* D-PHY PLL stable time spec :min = 200usec ~ max 400usec */
1462 .pll_stable_time = 500,
1464 /* escape clk : 10MHz */
1465 .esc_clk = 10 * 1000000,
1467 /* stop state holding counter after bta change count 0 ~ 0xfff */
1468 .stop_holding_cnt = 0x7ff,
1469 /* bta timeout 0 ~ 0xff */
1470 .bta_timeout = 0xff,
1471 /* lp rx timeout 0 ~ 0xffff */
1472 .rx_timeout = 0xffff,
1475 static struct s5p_platform_mipi_dsim dsim_platform_data = {
1478 .phy_enable = s5p_dsim_phy_enable,
1479 .dsim_config = &dsim_config,
1482 static struct lcd_platform_data s6e8aa0_pd = {
1484 .power_on = lcd_power_on,
1486 .power_off_delay = 120,
1487 .power_on_delay = 120,
1490 static struct mipi_dsim_lcd_device mipi_lcd_device = {
1492 .panel_id = "ams529ha01", /* Q1 */
1496 .platform_data = (void *)&s6e8aa0_pd,
1499 #ifdef CONFIG_VIDEO_FIMG2D
1500 static struct fimg2d_platdata fimg2d_data __initdata = {
1502 .parent_clkname = "mout_g2d0",
1503 .clkname = "sclk_fimg2d",
1504 .gate_clkname = "fimg2d",
1505 .smmu_gate_clkname = "smmu_fimg2d",
1506 .clkrate = 250 * 1000000,
1510 static struct s3c_platform_fb fb_platform_data __initdata = {
1513 #ifdef CONFIG_FB_S3C_DEFAULT_WINDOW
1514 .default_win = CONFIG_FB_S3C_DEFAULT_WINDOW,
1518 .swap = FB_SWAP_HWORD | FB_SWAP_WORD,
1521 #ifdef CONFIG_FB_S3C_HIBERNATION_LOADING
1522 #include <linux/hib_ani.h>
1524 static struct s3cfb_hib_ani hib_ani_set __initdata = {
1546 .hib_animation = hib_anis,
1552 static struct resource s5p_fimd_lite_resource[] = {
1554 .start = S5P_PA_LCD_LITE0,
1555 .end = S5P_PA_LCD_LITE0 + S5P_SZ_LCD_LITE0 - 1,
1556 .flags = IORESOURCE_MEM,
1559 .start = IRQ_LCD_LITE0,
1560 .end = IRQ_LCD_LITE0,
1561 .flags = IORESOURCE_IRQ,
1565 static struct resource s5p_mdnie_resource[] = {
1567 .start = S5P_PA_MDNIE0,
1568 .end = S5P_PA_MDNIE0 + S5P_SZ_MDNIE0 - 1,
1569 .flags = IORESOURCE_MEM,
1573 extern struct mdnie_tables cmc623_tables;
1574 static struct mdnie_platform_data q1_mdnie_pd = {
1578 .tables = &cmc623_tables,
1581 static struct s5p_fimd_ext_device q1_fimd_lite_device = {
1582 .name = "fimd_lite",
1584 .num_resources = ARRAY_SIZE(s5p_fimd_lite_resource),
1585 .resource = s5p_fimd_lite_resource,
1587 .platform_data = &s6e8aa0,
1591 static struct s5p_fimd_ext_device q1_mdnie_device = {
1594 .num_resources = ARRAY_SIZE(s5p_mdnie_resource),
1595 .resource = s5p_mdnie_resource,
1597 .platform_data = &q1_mdnie_pd,
1601 static void __init q1_fb_init(void)
1603 struct device *dev = s3c_device_fb.dev.parent;
1604 struct samsung_pd_info *pdinfo;
1605 struct s5p_platform_mipi_dsim *dsim_pd;
1608 pdinfo = (struct samsung_pd_info *)dev->platform_data;
1609 /* fimd driver have to know LCD domain power status. */
1611 fb_platform_data.boot_on = pdinfo->boot_on;
1615 fb_platform_data.logo_on = 1;
1617 s5p_device_mipi_dsim0.dev.platform_data = (void *)&dsim_platform_data;
1618 dsim_pd = (struct s5p_platform_mipi_dsim *)&dsim_platform_data;
1620 strcpy(dsim_pd->lcd_panel_name, "s6e8aa0");
1621 dsim_pd->mipi_power = s5p_mipi_dphy_power;
1622 dsim_pd->lcd_panel_info = &s6e8aa0;
1623 s5p_mipi_dsi_register_lcd_device(&mipi_lcd_device);
1624 platform_device_register(&s5p_device_mipi_dsim0);
1626 #ifdef CONFIG_FB_S3C_HIBERNATION_LOADING
1627 fb_platform_data.hib_ani = (void *)&hib_ani_set;
1630 fb_platform_data.lcd_data = (struct s3cfb_lcd *)&s6e8aa0;
1631 s3cfb_set_platdata(&fb_platform_data);
1633 s3cfb_cfg_gpio(NULL);
1636 static void q1_pm_finish(void)
1638 /* Restore GPX conf */
1639 s3c_pm_do_restore(s5pc210_gpx, ARRAY_SIZE(s5pc210_gpx));
1642 static void q1_pm_prepare(void)
1644 /* 1. Save GPX conf */
1645 s3c_pm_do_save(s5pc210_gpx, ARRAY_SIZE(s5pc210_gpx));
1647 /* 2. Set GPX as Power Save Mode */
1649 /* 3. Debug: Look at the diff */
1650 mobile_gpios_groupx_difference();
1654 int q1_common_setup_clock(const char *sclk_name, const char *pclk_name,
1655 unsigned long rate, unsigned int rate_set)
1657 struct clk *sclk = NULL;
1658 struct clk *pclk = NULL;
1660 sclk = clk_get(NULL, sclk_name);
1662 printk(KERN_ERR "failed to get %s clock.\n", sclk_name);
1666 pclk = clk_get(NULL, pclk_name);
1668 printk(KERN_ERR "failed to get %s clock.\n", pclk_name);
1672 clk_set_parent(sclk, pclk);
1674 printk(KERN_INFO "set parent clock of %s to %s\n", sclk_name,
1682 clk_set_rate(sclk, rate);
1683 printk(KERN_INFO "set %s rate to %lu\n", sclk_name, rate);
1700 #ifdef CONFIG_S5PV310_DEV_PD
1701 static inline void powerdomain_boot_on(int pd)
1703 struct samsung_pd_info *pdinfo = (struct samsung_pd_info *)
1704 s5pv310_device_pd[pd].dev.platform_data;
1706 pdinfo->boot_on = true;
1710 static struct regulator_consumer_supply supplies_cam_io_en[] = {
1711 REGULATOR_SUPPLY("vdda", "17-002d"),
1712 REGULATOR_SUPPLY("a_sensor", "0-001f"),
1715 static struct regulator_consumer_supply supplies_vt_cam_15v_en[] = {
1716 REGULATOR_SUPPLY("vt_core", "17-002d"),
1719 static struct regulator_consumer_supply supplies_cam_af_28v[] = {
1720 REGULATOR_SUPPLY("af_28", "0-001f"),
1723 static struct regulator_consumer_supply supplies_cam_sensor_core_12v_en[] = {
1724 REGULATOR_SUPPLY("dig_12", "0-001f"),
1725 REGULATOR_SUPPLY("dig_12", "17-002d"),
1728 static struct regulator_init_data cam_fixreg_init_data[] = {
1730 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
1731 .num_consumer_supplies = ARRAY_SIZE(supplies_cam_io_en),
1732 .consumer_supplies = supplies_cam_io_en,
1735 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
1736 .num_consumer_supplies = ARRAY_SIZE(supplies_vt_cam_15v_en),
1737 .consumer_supplies = supplies_vt_cam_15v_en,
1740 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
1741 .num_consumer_supplies = ARRAY_SIZE(supplies_cam_sensor_core_12v_en),
1742 .consumer_supplies = supplies_cam_sensor_core_12v_en,
1745 .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS },
1746 .num_consumer_supplies = ARRAY_SIZE(supplies_cam_af_28v),
1747 .consumer_supplies = supplies_cam_af_28v,
1751 static struct fixed_voltage_config cam_fixreg_cfg[] = {
1753 .supply_name = "CAM_IO_EN",
1754 .microvolts = 2800000,
1755 .gpio = S5PV310_GPE2(1),
1757 .init_data = &cam_fixreg_init_data[0],
1760 .supply_name = "VT_CAM_1.5V_EN",
1761 .microvolts = 1500000,
1762 .gpio = S5PV310_GPE2(2),
1764 .init_data = &cam_fixreg_init_data[1],
1767 .supply_name = "CAM_SENSOR_CORE_1.2V_EN",
1768 .microvolts = 1200000,
1769 .gpio = S5PV310_GPE2(5),
1771 .init_data = &cam_fixreg_init_data[2],
1774 .supply_name = "CAM_AF_2.8V",
1775 .microvolts = 2800000,
1776 .gpio = S5PV310_GPK1(1),
1778 .init_data = &cam_fixreg_init_data[3],
1782 static struct platform_device camera_fixed_reg_dev[] = {
1784 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM0,
1785 .dev = { .platform_data = &cam_fixreg_cfg[0] },
1787 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM1,
1788 .dev = { .platform_data = &cam_fixreg_cfg[1] },
1790 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM2,
1791 .dev = { .platform_data = &cam_fixreg_cfg[2] },
1793 .name = "reg-fixed-voltage", .id = FIXED_REG_ID_CAM3,
1794 .dev = { .platform_data = &cam_fixreg_cfg[3] },
1798 static int q1_host_notify_cb(int enable)
1800 struct host_notify_dev *ndev = NULL;
1802 if (s3c_device_usbgadget.dev.platform_data)
1803 ndev = s3c_device_usbgadget.dev.platform_data;
1805 pr_err("%s: ndev is null.\n", __func__);
1809 ndev->booster = enable ? NOTIFY_POWER_ON : NOTIFY_POWER_OFF;
1810 pr_info("%s: mode %d, enable %d\n", __func__, ndev->mode, enable);
1814 static struct switch_dev switch_dock = {
1818 static const char *switch_cable_names[] = {
1824 static struct switch_dev switch_usb = {
1825 .name = "switch-usb",
1826 .supported_cable = switch_cable_names,
1829 static void q1_switch_dev_init(void)
1833 /* for CarDock, DeskDock */
1834 ret = switch_dev_register(&switch_dock);
1836 pr_err("Failed to register dock switch. %d\n", ret);
1838 ret = switch_dev_register(&switch_usb);
1840 pr_err("Failed to register switch-usb. %d\n", ret);
1843 static bool is_cable_attached;
1845 static int q1_charger_cb(cable_type_t cable_type)
1847 struct power_supply *psy = power_supply_get_by_name("smb328-charger");
1848 union power_supply_propval value;
1851 switch (cable_type) {
1852 case CABLE_TYPE_NONE:
1853 case CABLE_TYPE_OTG:
1854 case CABLE_TYPE_JIG_UART_OFF:
1855 value.intval = POWER_SUPPLY_TYPE_BATTERY;
1856 is_cable_attached = false;
1858 case CABLE_TYPE_USB:
1859 case CABLE_TYPE_JIG_USB_OFF:
1860 case CABLE_TYPE_JIG_USB_ON:
1861 value.intval = POWER_SUPPLY_TYPE_USB;
1862 is_cable_attached = true;
1864 case CABLE_TYPE_DESKDOCK:
1865 case CABLE_TYPE_CARDOCK:
1866 value.intval = POWER_SUPPLY_TYPE_DOCK;
1867 is_cable_attached = true;
1870 case CABLE_TYPE_JIG_UART_OFF_VB:
1871 value.intval = POWER_SUPPLY_TYPE_MAINS;
1872 is_cable_attached = true;
1875 pr_err("%s: invalid type:%d\n", __func__, cable_type);
1879 /* need to check for q1
1880 * if (charging_cbs.tsp_set_charging_cable)
1881 * charging_cbs.tsp_set_charging_cable(value.intval);
1884 psy->set_property(psy, POWER_SUPPLY_PROP_ONLINE, &value);
1886 #ifdef CONFIG_JACK_MON
1887 jack_event_handler("charger", is_cable_attached);
1893 static struct regulator *regulator_vbus_ap;
1894 static bool ap_enabled;
1895 static DEFINE_MUTEX(usb_ap_lock);
1897 static int q1_charger_topoff_cb(void)
1899 struct power_supply *psy = power_supply_get_by_name("battery");
1900 union power_supply_propval value;
1903 pr_err("%s: fail to get battery ps\n", __func__);
1907 value.intval = POWER_SUPPLY_STATUS_FULL;
1908 return psy->set_property(psy, POWER_SUPPLY_PROP_STATUS, &value);
1911 static void q1_usb_cb(u8 usb_mode)
1914 struct s3c_udc *udc = platform_get_drvdata(&s3c_device_usbgadget);
1915 struct sec_otghost_data *otg_data =
1916 dev_get_platdata(&s3c_device_usb_otghcd.dev);
1918 unsigned long inform6 = __raw_readl(S5P_INFORM6);
1920 pr_info("%s: usb mode=%d, inform6=0x%08lx\n",
1921 __func__, usb_mode, inform6);
1923 if (inform6 & RST_FLAG_CHARGE_REBOOT_CHECK) {
1924 pr_info("%s: lpcharging: disable USB\n", __func__);
1925 ret = udc->change_usb_mode(USB_CABLE_DETACHED);
1927 pr_warn("%s: fail to change mode!!!\n", __func__);
1929 mutex_lock(&usb_ap_lock);
1931 if (regulator_vbus_ap == NULL)
1933 regulator_get_exclusive(NULL, "usb_vbus_ap_5v");
1934 if (IS_ERR_OR_NULL(regulator_vbus_ap)) {
1935 pr_err("%s: fail to get regulator\n", __func__);
1936 regulator_vbus_ap = NULL;
1941 ret = regulator_disable(regulator_vbus_ap);
1947 mutex_unlock(&usb_ap_lock);
1952 if (usb_mode == USB_OTGHOST_ATTACHED) {
1953 otg_data->set_pwr_cb(1);
1954 q1_charger_cb(CABLE_TYPE_OTG);
1957 pr_info("%s: prev_usb_mode=%d\n",
1958 __func__, udc->get_usb_mode());
1960 ret = udc->change_usb_mode(usb_mode);
1962 pr_err("%s: fail to change mode!!!\n", __func__);
1964 if (usb_mode == USB_OTGHOST_DETACHED)
1965 otg_data->set_pwr_cb(0);
1967 #ifdef CONFIG_JACK_MON
1968 if (usb_mode == USB_OTGHOST_ATTACHED)
1969 jack_event_handler("host", USB_CABLE_ATTACHED);
1970 else if (usb_mode == USB_OTGHOST_DETACHED)
1971 jack_event_handler("host", USB_CABLE_DETACHED);
1972 else if ((usb_mode == USB_CABLE_ATTACHED)
1973 || (usb_mode == USB_CABLE_DETACHED))
1974 jack_event_handler("usb", usb_mode);
1979 static bool q1_is_mhl_attached(void)
1984 gpio = MOBILE_GPIO(MHL_SEL);
1985 gpio_request(gpio, "MHL_SEL");
1986 val = gpio_get_value(gpio);
1992 static int q1_set_safeout(int path)
1994 static struct regulator *regulator_vbus_cp;
1995 static bool cp_enabled;
1998 mutex_lock(&usb_ap_lock);
2000 if (regulator_vbus_ap == NULL)
2002 regulator_get_exclusive(NULL, "usb_vbus_ap_5v");
2003 if (IS_ERR_OR_NULL(regulator_vbus_ap)) {
2005 regulator_vbus_ap = NULL;
2009 if (regulator_vbus_cp == NULL)
2011 regulator_get_exclusive(NULL, "usb_vbus_cp_5v");
2012 if (IS_ERR_OR_NULL(regulator_vbus_cp)) {
2014 regulator_vbus_cp = NULL;
2018 if (path == CP_USB_MODE) {
2020 ret = regulator_disable(regulator_vbus_ap);
2027 /* regulator_vbus_cp is exclusively got */
2028 if (!regulator_is_enabled(regulator_vbus_cp))
2029 ret = regulator_enable(regulator_vbus_cp);
2035 /* AP_USB_MODE || AUDIO_MODE */
2037 /* regulator_vbus_ap is exclusively got */
2038 if (!regulator_is_enabled(regulator_vbus_ap))
2039 ret = regulator_enable(regulator_vbus_ap);
2046 ret = regulator_disable(regulator_vbus_cp);
2053 mutex_unlock(&usb_ap_lock);
2056 struct max8997_muic_platform_data q1_muic_pdata = {
2057 .usb_cb = q1_usb_cb, /* done */
2058 .charger_cb = q1_charger_cb,
2059 .is_mhl_attached = q1_is_mhl_attached, /* done */
2060 .set_safeout = q1_set_safeout, /* done */
2061 .host_notify_cb = q1_host_notify_cb, /* done */
2062 .gpio_usb_sel = S5PV310_GPL0(6), /* done */
2063 .uart_path = -1, /* muic does not control uart path*/
2066 #ifdef CONFIG_CHARGER_MANAGER
2067 extern struct platform_device q1_charger_manager;
2068 extern struct platform_device q1_ncp15wb473_thermistor;
2069 extern struct charger_global_desc q1_charger_g_desc;
2072 #ifdef CONFIG_SMB328_CHARGER
2073 #define GPIO_CHG_SDA S5PV310_GPY0(4)
2074 #define GPIO_CHG_SCL S5PV310_GPY0(5)
2075 #define GPIO_CHG_EN S5PV310_GPL2(2)
2076 #define GPIO_OTG_EN S5PV310_GPX3(3)
2077 #define GPIO_CHG_ING_N S5PV310_GPL2(5)
2079 static struct regulator_consumer_supply supplies_smb328[] = {
2080 REGULATOR_SUPPLY("vinchg2", "charger-manager.0"),
2081 REGULATOR_SUPPLY("vinchg2_mach", NULL),
2084 static struct regulator_init_data smb328_charger_en_data = {
2086 .name = "SMB328_CHARGER",
2089 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
2090 REGULATOR_CHANGE_CURRENT,
2092 .num_consumer_supplies = ARRAY_SIZE(supplies_smb328),
2093 .consumer_supplies = supplies_smb328,
2096 static struct smb328_platform_data smb328_pdata = {
2097 .topoff_cb = q1_charger_topoff_cb,
2098 .gpio_chg_ing = GPIO_CHG_ING_N,
2099 .gpio_ta_nconnected = NULL, /*GPIO_TA_nCONNECTED,*/
2100 .init_data = &smb328_charger_en_data,
2103 static struct platform_device smb328_device_charger = {
2104 .name = "smb328-charger",
2106 .dev.platform_data = &smb328_pdata,
2109 static struct i2c_gpio_platform_data gpio_i2c_data19 = {
2110 .sda_pin = GPIO_CHG_SDA,
2111 .scl_pin = GPIO_CHG_SCL,
2114 static struct platform_device s3c_device_i2c19 = {
2117 .dev.platform_data = &gpio_i2c_data19,
2120 static struct i2c_board_info i2c_devs19_emul[] __initdata = {
2122 I2C_BOARD_INFO("smb328-charger", SMB328_SLAVE_ADDR>>1),
2123 .platform_data = &smb328_pdata,
2126 #endif /* CONFIG_SMB328_CHARGER */
2128 static struct platform_device *q1_devices[] __initdata = {
2129 /* Samsung Platform Devices */
2130 #ifdef CONFIG_S5PV310_DEV_PD
2131 &s5pv310_device_pd[PD_MFC],
2132 &s5pv310_device_pd[PD_G3D],
2133 &s5pv310_device_pd[PD_LCD0],
2134 &s5pv310_device_pd[PD_LCD1],
2135 &s5pv310_device_pd[PD_TV],
2136 &s5pv310_device_pd[PD_CAM],
2137 &s5pv310_device_pd[PD_GPS],
2139 #ifdef CONFIG_DRM_MALI
2140 &s5p_device_mali_drm,
2142 #ifdef CONFIG_DRM_FIMD
2143 &s5p_device_fimd_drm,
2152 #if defined(CONFIG_SMB328_CHARGER)
2160 &s3c_device_timer[0],
2161 &s3c_device_timer[1],
2162 &s5p_device_usb_ehci,
2167 #ifdef CONFIG_SMB328_CHARGER
2168 &smb328_device_charger,
2170 &camera_fixed_reg_dev[0],
2171 &camera_fixed_reg_dev[1],
2172 &camera_fixed_reg_dev[2],
2173 &camera_fixed_reg_dev[3],
2174 #ifdef CONFIG_VIDEO_FIMC_MIPI
2178 #ifdef CONFIG_VIDEO_FIMC
2184 #ifdef CONFIG_VIDEO_JPEG
2188 #ifdef CONFIG_S3C_DEV_HSMMC4
2193 &emmc_fixed_voltage,
2194 &haptic_inmotor_fixed_voltage,
2197 #ifdef CONFIG_SND_S3C64XX_SOC_I2S_V4
2198 &s5pv310_device_iis0,
2200 #ifdef CONFIG_SND_S3C_SOC_PCM
2201 &s5pv310_device_pcm1,
2203 #ifdef CONFIG_SND_SOC_SMDK_WM9713
2204 &s5pv310_device_ac97,
2206 #ifdef CONFIG_SND_SAMSUNG_SOC_SPDIF
2207 &s5pv310_device_spdif,
2209 #ifdef CONFIG_SND_S5P_RP
2218 #ifdef CONFIG_FB_S3C
2221 #ifdef CONFIG_VIDEO_FIMG2D
2224 #if defined(CONFIG_VIDEO_MFC5X) || defined(CONFIG_VIDEO_SAMSUNG_S5P_MFC)
2227 #ifdef CONFIG_S5P_SYSMMU
2228 &s5p_device_sysmmu[SYSMMU_G2D],
2229 &s5p_device_sysmmu[SYSMMU_MFC_L],
2230 &s5p_device_sysmmu[SYSMMU_MFC_R],
2231 &s5p_device_sysmmu[SYSMMU_FIMC0],
2232 &s5p_device_sysmmu[SYSMMU_FIMC1],
2233 &s5p_device_sysmmu[SYSMMU_FIMC2],
2234 &s5p_device_sysmmu[SYSMMU_FIMC3],
2236 #ifdef CONFIG_ANDROID_RAM_CONSOLE
2237 &ram_console_device,
2239 #ifdef CONFIG_CHARGER_MANAGER
2240 /* Should be placed after fuel gauge, charger control chips, pmics */
2241 &q1_ncp15wb473_thermistor,
2242 &q1_charger_manager,
2244 #ifdef CONFIG_SEC_DEBUG
2247 #ifdef CONFIG_USB_GADGET
2248 &s3c_device_usbgadget,
2250 #ifdef CONFIG_USB_ANDROID_RNDIS
2253 #ifdef CONFIG_USB_ANDROID_ECM
2256 #ifdef CONFIG_USB_ANDROID
2257 &s3c_device_android_usb,
2258 &s3c_device_usb_mass_storage,
2260 #ifdef CONFIG_USB_S3C_OTG_HOST
2261 &s3c_device_usb_otghcd,
2265 #ifdef CONFIG_EPEN_WACOM_G5SP
2266 static int q1_wacom_init_hw(void)
2271 gpio = S5PV310_GPE0(2); /*XMDMRN*/
2272 ret = gpio_request(gpio, "PEN_RESET");
2273 s3c_gpio_cfgpin(gpio, S3C_GPIO_OUTPUT);
2274 gpio_direction_output(gpio, 1);
2276 gpio = S5PV310_GPE1(7); /*XMDMADDR_7*/
2277 ret = gpio_request(gpio, "PEN_SLP");
2278 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0x1));
2279 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
2280 gpio_direction_output(gpio, 0);
2282 gpio = S5PV310_GPE1(6); /*XMDMADDR_6*/
2283 ret = gpio_request(gpio, "PEN_PDCT");
2284 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
2285 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
2286 gpio_direction_input(gpio);
2288 set_irq_type(gpio_to_irq(gpio), IRQ_TYPE_EDGE_BOTH);
2290 gpio = S5PV310_GPE0(0); /*XMDMWEN*/
2291 ret = gpio_request(gpio, "PEN_IRQ");
2292 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
2293 gpio_direction_input(gpio);
2295 i2c6_devs[1].irq = gpio_to_irq(gpio);
2296 set_irq_type(i2c6_devs[1].irq, IRQ_TYPE_EDGE_RISING);
2298 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
2303 static int __init q1_wacom_init(void)
2306 printk(KERN_INFO "[E-PEN] : wacom IC initialized.\n");
2311 static void __init q1_machine_init(void)
2315 /* Initialize GPIO default setting */
2316 mobile_gpios_init();
2318 q1_switch_dev_init();
2320 s3c_i2c0_set_platdata(&q1_i2c0_platdata);
2322 s3c_i2c1_set_platdata(NULL);
2323 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
2326 s3c_i2c3_set_platdata(NULL);
2327 i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
2330 #ifdef CONFIG_S5PV310_DEV_PD
2331 #ifdef CONFIG_FB_S3C
2332 s3c_device_fb.dev.parent = &s5pv310_device_pd[PD_LCD0].dev;
2333 powerdomain_boot_on(PD_LCD0);
2337 s3c_i2c4_set_platdata(NULL);
2338 i2c_register_board_info(4, i2c4_devs, ARRAY_SIZE(i2c4_devs));
2342 q1_common_setup_clock("sclk_mdnie0", "mout_mpll", 400 * MHZ, 1);
2344 #ifdef CONFIG_S5PV310_DEV_PD
2345 #if defined(CONFIG_VIDEO_MFC5X) || defined(CONFIG_VIDEO_SAMSUNG_S5P_MFC)
2346 s5p_device_mfc.dev.parent = &s5pv310_device_pd[PD_MFC].dev;
2347 q1_common_setup_clock("mout_mfc0", "mout_mpll", 0, 0);
2348 q1_common_setup_clock("sclk_mfc", "mout_mfc0", 200 * MHZ, 1);
2352 s3c_i2c5_set_platdata(NULL);
2353 i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(S5PV310_GPX0(7)),
2354 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
2357 #ifdef CONFIG_EPEN_WACOM_G5SP
2360 s3c_i2c6_set_platdata(NULL);
2361 i2c_register_board_info(6, i2c6_devs, ARRAY_SIZE(i2c6_devs));
2364 s3c_i2c7_set_platdata(NULL);
2365 i2c_register_board_info(7, i2c7_devs, ARRAY_SIZE(i2c7_devs));
2367 gpio = S5PV310_GPX2(3);
2368 gpio_request(gpio, "FUEL_ALERT");
2369 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
2370 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
2371 i2c9_devs[0].irq = gpio_to_irq(gpio);
2372 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs));
2374 gpio = S5PV310_GPL0(5); /* XGNSS_MCLK */
2375 gpio_request(gpio, "3_TOUCH_INT");
2376 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
2377 i2c12_devs[0].irq = gpio_to_irq(gpio);
2378 i2c_register_board_info(12, i2c12_devs, ARRAY_SIZE(i2c12_devs));
2380 s5pv310_sdhci_init();
2386 s3c_usb_set_serial();
2388 #if defined(CONFIG_SMB328_CHARGER)
2389 i2c_register_board_info(19, i2c_devs19_emul, ARRAY_SIZE(i2c_devs19_emul));
2392 #ifdef CONFIG_VIDEO_FIMG2D
2393 s5p_fimg2d_set_platdata(&fimg2d_data);
2394 #ifdef CONFIG_S5PV310_DEV_PD
2395 s5p_device_fimg2d.dev.parent = &s5pv310_device_pd[PD_LCD0].dev;
2400 pm_cpu_prepare = q1_pm_prepare;
2401 pm_cpu_finish = q1_pm_finish;
2404 s3c_irq_wake(IRQ_RTC_ALARM, 1);
2407 #if defined(CONFIG_S5PV310_DEV_PD) && !defined(CONFIG_PM_RUNTIME)
2409 * These power domains should be always on
2410 * without runtime pm support.
2412 s5pv310_pd_enable(&s5pv310_device_pd[PD_MFC].dev);
2413 s5pv310_pd_enable(&s5pv310_device_pd[PD_G3D].dev);
2414 s5pv310_pd_enable(&s5pv310_device_pd[PD_LCD0].dev);
2415 s5pv310_pd_enable(&s5pv310_device_pd[PD_LCD1].dev);
2416 s5pv310_pd_enable(&s5pv310_device_pd[PD_CAM].dev);
2417 s5pv310_pd_enable(&s5pv310_device_pd[PD_TV].dev);
2418 s5pv310_pd_enable(&s5pv310_device_pd[PD_GPS].dev);
2421 #ifdef CONFIG_VIDEO_FIMG2D
2422 /* setup fimg2d parent clock. */
2423 universal_fimg2d_setup_clock("mout_g2d0", "mout_mpll");
2426 #ifdef CONFIG_S5P_ADC
2430 #ifdef CONFIG_VIDEO_JPEG
2431 #ifdef CONFIG_S5PV310_DEV_PD
2432 s5p_device_jpeg.dev.parent = &s5pv310_device_pd[PD_CAM].dev;
2436 #ifdef CONFIG_CHARGER_MANAGER
2437 setup_charger_manager(&q1_charger_g_desc);
2440 s5pv310_camera_init();
2443 platform_add_devices(q1_devices, ARRAY_SIZE(q1_devices));
2446 MACHINE_START(Q1_C210, "Q1SLP_C210")
2447 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
2448 .phys_io = S3C_PA_UART & 0xfff00000,
2449 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
2450 .boot_params = S5P_PA_SDRAM + 0x100,
2451 .init_irq = s5pv310_init_irq,
2452 .map_io = q1_map_io,
2453 .init_machine = q1_machine_init,
2454 .timer = &s5pv310_timer,
2455 .reserve = &s5pv310_reserve,