mach-nuri.c 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  1. /*
  2. * linux/arch/arm/mach-exynos4/mach-nuri.c
  3. *
  4. * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  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. #include <linux/platform_device.h>
  11. #include <linux/serial_core.h>
  12. #include <linux/input.h>
  13. #include <linux/i2c.h>
  14. #include <linux/i2c/atmel_mxt_ts.h>
  15. #include <linux/i2c-gpio.h>
  16. #include <linux/gpio_keys.h>
  17. #include <linux/gpio.h>
  18. #include <linux/power/max8903_charger.h>
  19. #include <linux/power/max17042_battery.h>
  20. #include <linux/regulator/machine.h>
  21. #include <linux/regulator/fixed.h>
  22. #include <linux/mfd/max8997.h>
  23. #include <linux/mfd/max8997-private.h>
  24. #include <linux/mmc/host.h>
  25. #include <linux/fb.h>
  26. #include <linux/pwm_backlight.h>
  27. #include <video/platform_lcd.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach-types.h>
  30. #include <plat/adc.h>
  31. #include <plat/regs-fb-v4.h>
  32. #include <plat/regs-serial.h>
  33. #include <plat/exynos4.h>
  34. #include <plat/cpu.h>
  35. #include <plat/devs.h>
  36. #include <plat/fb.h>
  37. #include <plat/sdhci.h>
  38. #include <plat/ehci.h>
  39. #include <plat/clock.h>
  40. #include <plat/gpio-cfg.h>
  41. #include <plat/iic.h>
  42. #include <plat/mfc.h>
  43. #include <plat/pd.h>
  44. #include <mach/map.h>
  45. /* Following are default values for UCON, ULCON and UFCON UART registers */
  46. #define NURI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  47. S3C2410_UCON_RXILEVEL | \
  48. S3C2410_UCON_TXIRQMODE | \
  49. S3C2410_UCON_RXIRQMODE | \
  50. S3C2410_UCON_RXFIFO_TOI | \
  51. S3C2443_UCON_RXERR_IRQEN)
  52. #define NURI_ULCON_DEFAULT S3C2410_LCON_CS8
  53. #define NURI_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  54. S5PV210_UFCON_TXTRIG256 | \
  55. S5PV210_UFCON_RXTRIG256)
  56. enum fixed_regulator_id {
  57. FIXED_REG_ID_MMC = 0,
  58. FIXED_REG_ID_MAX8903,
  59. };
  60. static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = {
  61. {
  62. .hwport = 0,
  63. .ucon = NURI_UCON_DEFAULT,
  64. .ulcon = NURI_ULCON_DEFAULT,
  65. .ufcon = NURI_UFCON_DEFAULT,
  66. },
  67. {
  68. .hwport = 1,
  69. .ucon = NURI_UCON_DEFAULT,
  70. .ulcon = NURI_ULCON_DEFAULT,
  71. .ufcon = NURI_UFCON_DEFAULT,
  72. },
  73. {
  74. .hwport = 2,
  75. .ucon = NURI_UCON_DEFAULT,
  76. .ulcon = NURI_ULCON_DEFAULT,
  77. .ufcon = NURI_UFCON_DEFAULT,
  78. },
  79. {
  80. .hwport = 3,
  81. .ucon = NURI_UCON_DEFAULT,
  82. .ulcon = NURI_ULCON_DEFAULT,
  83. .ufcon = NURI_UFCON_DEFAULT,
  84. },
  85. };
  86. /* eMMC */
  87. static struct s3c_sdhci_platdata nuri_hsmmc0_data __initdata = {
  88. .max_width = 8,
  89. .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
  90. MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
  91. MMC_CAP_DISABLE | MMC_CAP_ERASE),
  92. .cd_type = S3C_SDHCI_CD_PERMANENT,
  93. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  94. };
  95. static struct regulator_consumer_supply emmc_supplies[] = {
  96. REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
  97. REGULATOR_SUPPLY("vmmc", "dw_mmc"),
  98. };
  99. static struct regulator_init_data emmc_fixed_voltage_init_data = {
  100. .constraints = {
  101. .name = "VMEM_VDD_2.8V",
  102. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  103. },
  104. .num_consumer_supplies = ARRAY_SIZE(emmc_supplies),
  105. .consumer_supplies = emmc_supplies,
  106. };
  107. static struct fixed_voltage_config emmc_fixed_voltage_config = {
  108. .supply_name = "MASSMEMORY_EN (inverted)",
  109. .microvolts = 2800000,
  110. .gpio = EXYNOS4_GPL1(1),
  111. .enable_high = false,
  112. .init_data = &emmc_fixed_voltage_init_data,
  113. };
  114. static struct platform_device emmc_fixed_voltage = {
  115. .name = "reg-fixed-voltage",
  116. .id = FIXED_REG_ID_MMC,
  117. .dev = {
  118. .platform_data = &emmc_fixed_voltage_config,
  119. },
  120. };
  121. /* SD */
  122. static struct s3c_sdhci_platdata nuri_hsmmc2_data __initdata = {
  123. .max_width = 4,
  124. .host_caps = MMC_CAP_4_BIT_DATA |
  125. MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
  126. MMC_CAP_DISABLE,
  127. .ext_cd_gpio = EXYNOS4_GPX3(3), /* XEINT_27 */
  128. .ext_cd_gpio_invert = 1,
  129. .cd_type = S3C_SDHCI_CD_GPIO,
  130. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  131. };
  132. /* WLAN */
  133. static struct s3c_sdhci_platdata nuri_hsmmc3_data __initdata = {
  134. .max_width = 4,
  135. .host_caps = MMC_CAP_4_BIT_DATA |
  136. MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
  137. .cd_type = S3C_SDHCI_CD_EXTERNAL,
  138. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  139. };
  140. static void __init nuri_sdhci_init(void)
  141. {
  142. s3c_sdhci0_set_platdata(&nuri_hsmmc0_data);
  143. s3c_sdhci2_set_platdata(&nuri_hsmmc2_data);
  144. s3c_sdhci3_set_platdata(&nuri_hsmmc3_data);
  145. }
  146. /* GPIO KEYS */
  147. static struct gpio_keys_button nuri_gpio_keys_tables[] = {
  148. {
  149. .code = KEY_VOLUMEUP,
  150. .gpio = EXYNOS4_GPX2(0), /* XEINT16 */
  151. .desc = "gpio-keys: KEY_VOLUMEUP",
  152. .type = EV_KEY,
  153. .active_low = 1,
  154. .debounce_interval = 1,
  155. }, {
  156. .code = KEY_VOLUMEDOWN,
  157. .gpio = EXYNOS4_GPX2(1), /* XEINT17 */
  158. .desc = "gpio-keys: KEY_VOLUMEDOWN",
  159. .type = EV_KEY,
  160. .active_low = 1,
  161. .debounce_interval = 1,
  162. }, {
  163. .code = KEY_POWER,
  164. .gpio = EXYNOS4_GPX2(7), /* XEINT23 */
  165. .desc = "gpio-keys: KEY_POWER",
  166. .type = EV_KEY,
  167. .active_low = 1,
  168. .wakeup = 1,
  169. .debounce_interval = 1,
  170. },
  171. };
  172. static struct gpio_keys_platform_data nuri_gpio_keys_data = {
  173. .buttons = nuri_gpio_keys_tables,
  174. .nbuttons = ARRAY_SIZE(nuri_gpio_keys_tables),
  175. };
  176. static struct platform_device nuri_gpio_keys = {
  177. .name = "gpio-keys",
  178. .dev = {
  179. .platform_data = &nuri_gpio_keys_data,
  180. },
  181. };
  182. /* Frame Buffer */
  183. static struct s3c_fb_pd_win nuri_fb_win0 = {
  184. .win_mode = {
  185. .left_margin = 64,
  186. .right_margin = 16,
  187. .upper_margin = 64,
  188. .lower_margin = 1,
  189. .hsync_len = 48,
  190. .vsync_len = 3,
  191. .xres = 1280,
  192. .yres = 800,
  193. .refresh = 60,
  194. },
  195. .max_bpp = 24,
  196. .default_bpp = 16,
  197. .virtual_x = 1280,
  198. .virtual_y = 800,
  199. };
  200. static struct s3c_fb_platdata nuri_fb_pdata __initdata = {
  201. .win[0] = &nuri_fb_win0,
  202. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
  203. VIDCON0_CLKSEL_LCD,
  204. .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
  205. .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
  206. };
  207. static void nuri_lcd_power_on(struct plat_lcd_data *pd, unsigned int power)
  208. {
  209. int gpio = EXYNOS4_GPE1(5);
  210. gpio_request(gpio, "LVDS_nSHDN");
  211. gpio_direction_output(gpio, power);
  212. gpio_free(gpio);
  213. }
  214. static int nuri_bl_init(struct device *dev)
  215. {
  216. int ret, gpio = EXYNOS4_GPE2(3);
  217. ret = gpio_request(gpio, "LCD_LDO_EN");
  218. if (!ret)
  219. gpio_direction_output(gpio, 0);
  220. return ret;
  221. }
  222. static int nuri_bl_notify(struct device *dev, int brightness)
  223. {
  224. if (brightness < 1)
  225. brightness = 0;
  226. gpio_set_value(EXYNOS4_GPE2(3), 1);
  227. return brightness;
  228. }
  229. static void nuri_bl_exit(struct device *dev)
  230. {
  231. gpio_free(EXYNOS4_GPE2(3));
  232. }
  233. /* nuri pwm backlight */
  234. static struct platform_pwm_backlight_data nuri_backlight_data = {
  235. .pwm_id = 0,
  236. .pwm_period_ns = 30000,
  237. .max_brightness = 100,
  238. .dft_brightness = 50,
  239. .init = nuri_bl_init,
  240. .notify = nuri_bl_notify,
  241. .exit = nuri_bl_exit,
  242. };
  243. static struct platform_device nuri_backlight_device = {
  244. .name = "pwm-backlight",
  245. .id = -1,
  246. .dev = {
  247. .parent = &s3c_device_timer[0].dev,
  248. .platform_data = &nuri_backlight_data,
  249. },
  250. };
  251. static struct plat_lcd_data nuri_lcd_platform_data = {
  252. .set_power = nuri_lcd_power_on,
  253. };
  254. static struct platform_device nuri_lcd_device = {
  255. .name = "platform-lcd",
  256. .id = -1,
  257. .dev = {
  258. .platform_data = &nuri_lcd_platform_data,
  259. },
  260. };
  261. /* I2C1 */
  262. static struct i2c_board_info i2c1_devs[] __initdata = {
  263. /* Gyro, To be updated */
  264. };
  265. /* TSP */
  266. static u8 mxt_init_vals[] = {
  267. /* MXT_GEN_COMMAND(6) */
  268. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  269. /* MXT_GEN_POWER(7) */
  270. 0x20, 0xff, 0x32,
  271. /* MXT_GEN_ACQUIRE(8) */
  272. 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0x23,
  273. /* MXT_TOUCH_MULTI(9) */
  274. 0x00, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00,
  275. 0x00, 0x01, 0x01, 0x0e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00,
  276. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  277. 0x00,
  278. /* MXT_TOUCH_KEYARRAY(15) */
  279. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
  280. 0x00,
  281. /* MXT_SPT_GPIOPWM(19) */
  282. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  283. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  284. /* MXT_PROCI_GRIPFACE(20) */
  285. 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x28, 0x04,
  286. 0x0f, 0x0a,
  287. /* MXT_PROCG_NOISE(22) */
  288. 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x23, 0x00,
  289. 0x00, 0x05, 0x0f, 0x19, 0x23, 0x2d, 0x03,
  290. /* MXT_TOUCH_PROXIMITY(23) */
  291. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  292. 0x00, 0x00, 0x00, 0x00, 0x00,
  293. /* MXT_PROCI_ONETOUCH(24) */
  294. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  295. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  296. /* MXT_SPT_SELFTEST(25) */
  297. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  298. 0x00, 0x00, 0x00, 0x00,
  299. /* MXT_PROCI_TWOTOUCH(27) */
  300. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  301. /* MXT_SPT_CTECONFIG(28) */
  302. 0x00, 0x00, 0x02, 0x08, 0x10, 0x00,
  303. };
  304. static struct mxt_platform_data mxt_platform_data = {
  305. .config = mxt_init_vals,
  306. .config_length = ARRAY_SIZE(mxt_init_vals),
  307. .x_line = 18,
  308. .y_line = 11,
  309. .x_size = 1024,
  310. .y_size = 600,
  311. .blen = 0x1,
  312. .threshold = 0x28,
  313. .voltage = 2800000, /* 2.8V */
  314. .orient = MXT_DIAGONAL_COUNTER,
  315. .irqflags = IRQF_TRIGGER_FALLING,
  316. };
  317. static struct s3c2410_platform_i2c i2c3_data __initdata = {
  318. .flags = 0,
  319. .bus_num = 3,
  320. .slave_addr = 0x10,
  321. .frequency = 400 * 1000,
  322. .sda_delay = 100,
  323. };
  324. static struct i2c_board_info i2c3_devs[] __initdata = {
  325. {
  326. I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
  327. .platform_data = &mxt_platform_data,
  328. .irq = IRQ_EINT(4),
  329. },
  330. };
  331. static void __init nuri_tsp_init(void)
  332. {
  333. int gpio;
  334. /* TOUCH_INT: XEINT_4 */
  335. gpio = EXYNOS4_GPX0(4);
  336. gpio_request(gpio, "TOUCH_INT");
  337. s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
  338. s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
  339. }
  340. static struct regulator_consumer_supply __initdata max8997_ldo1_[] = {
  341. REGULATOR_SUPPLY("vdd", "s5p-adc"), /* Used by CPU's ADC drv */
  342. };
  343. static struct regulator_consumer_supply __initdata max8997_ldo3_[] = {
  344. REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */
  345. };
  346. static struct regulator_consumer_supply __initdata max8997_ldo4_[] = {
  347. REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), /* MIPI */
  348. };
  349. static struct regulator_consumer_supply __initdata max8997_ldo5_[] = {
  350. REGULATOR_SUPPLY("vhsic", "modemctl"), /* MODEM */
  351. };
  352. static struct regulator_consumer_supply __initdata max8997_ldo7_[] = {
  353. REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */
  354. };
  355. static struct regulator_consumer_supply __initdata max8997_ldo8_[] = {
  356. REGULATOR_SUPPLY("vusb_d", NULL), /* Used by CPU */
  357. REGULATOR_SUPPLY("vdac", NULL), /* Used by CPU */
  358. };
  359. static struct regulator_consumer_supply __initdata max8997_ldo11_[] = {
  360. REGULATOR_SUPPLY("vcc", "platform-lcd"), /* U804 LVDS */
  361. };
  362. static struct regulator_consumer_supply __initdata max8997_ldo12_[] = {
  363. REGULATOR_SUPPLY("vddio", "6-003c"), /* HDC802 */
  364. };
  365. static struct regulator_consumer_supply __initdata max8997_ldo13_[] = {
  366. REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"), /* TFLASH */
  367. };
  368. static struct regulator_consumer_supply __initdata max8997_ldo14_[] = {
  369. REGULATOR_SUPPLY("inmotor", "max8997-haptic"),
  370. };
  371. static struct regulator_consumer_supply __initdata max8997_ldo15_[] = {
  372. REGULATOR_SUPPLY("avdd", "3-004a"), /* Touch Screen */
  373. };
  374. static struct regulator_consumer_supply __initdata max8997_ldo16_[] = {
  375. REGULATOR_SUPPLY("d_sensor", "0-001f"), /* HDC803 */
  376. };
  377. static struct regulator_consumer_supply __initdata max8997_ldo18_[] = {
  378. REGULATOR_SUPPLY("vdd", "3-004a"), /* Touch Screen */
  379. };
  380. static struct regulator_consumer_supply __initdata max8997_buck1_[] = {
  381. REGULATOR_SUPPLY("vdd_arm", NULL), /* CPUFREQ */
  382. };
  383. static struct regulator_consumer_supply __initdata max8997_buck2_[] = {
  384. REGULATOR_SUPPLY("vdd_int", NULL), /* CPUFREQ */
  385. };
  386. static struct regulator_consumer_supply __initdata max8997_buck3_[] = {
  387. REGULATOR_SUPPLY("vdd", "mali_dev.0"), /* G3D of Exynos 4 */
  388. };
  389. static struct regulator_consumer_supply __initdata max8997_buck4_[] = {
  390. REGULATOR_SUPPLY("core", "0-001f"), /* HDC803 */
  391. };
  392. static struct regulator_consumer_supply __initdata max8997_buck6_[] = {
  393. REGULATOR_SUPPLY("dig_28", "0-001f"), /* pin "7" of HDC803 */
  394. };
  395. static struct regulator_consumer_supply __initdata max8997_esafeout1_[] = {
  396. REGULATOR_SUPPLY("usb_vbus", NULL), /* CPU's USB OTG */
  397. };
  398. static struct regulator_consumer_supply __initdata max8997_esafeout2_[] = {
  399. REGULATOR_SUPPLY("usb_vbus", "modemctl"), /* VBUS of Modem */
  400. };
  401. static struct regulator_consumer_supply __initdata max8997_charger_[] = {
  402. REGULATOR_SUPPLY("vinchg1", "charger-manager.0"),
  403. };
  404. static struct regulator_consumer_supply __initdata max8997_chg_toff_[] = {
  405. REGULATOR_SUPPLY("vinchg_stop", NULL), /* for jack interrupt handlers */
  406. };
  407. static struct regulator_consumer_supply __initdata max8997_32khz_ap_[] = {
  408. REGULATOR_SUPPLY("gps_clk", "bcm4751"),
  409. REGULATOR_SUPPLY("bt_clk", "bcm4330-b1"),
  410. REGULATOR_SUPPLY("wifi_clk", "bcm433-b1"),
  411. };
  412. static struct regulator_init_data __initdata max8997_ldo1_data = {
  413. .constraints = {
  414. .name = "VADC_3.3V_C210",
  415. .min_uV = 3300000,
  416. .max_uV = 3300000,
  417. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  418. .apply_uV = 1,
  419. .state_mem = {
  420. .disabled = 1,
  421. },
  422. },
  423. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo1_),
  424. .consumer_supplies = max8997_ldo1_,
  425. };
  426. static struct regulator_init_data __initdata max8997_ldo2_data = {
  427. .constraints = {
  428. .name = "VALIVE_1.1V_C210",
  429. .min_uV = 1100000,
  430. .max_uV = 1100000,
  431. .apply_uV = 1,
  432. .always_on = 1,
  433. .state_mem = {
  434. .enabled = 1,
  435. },
  436. },
  437. };
  438. static struct regulator_init_data __initdata max8997_ldo3_data = {
  439. .constraints = {
  440. .name = "VUSB_1.1V_C210",
  441. .min_uV = 1100000,
  442. .max_uV = 1100000,
  443. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  444. .apply_uV = 1,
  445. .state_mem = {
  446. .disabled = 1,
  447. },
  448. },
  449. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo3_),
  450. .consumer_supplies = max8997_ldo3_,
  451. };
  452. static struct regulator_init_data __initdata max8997_ldo4_data = {
  453. .constraints = {
  454. .name = "VMIPI_1.8V",
  455. .min_uV = 1800000,
  456. .max_uV = 1800000,
  457. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  458. .apply_uV = 1,
  459. .state_mem = {
  460. .disabled = 1,
  461. },
  462. },
  463. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo4_),
  464. .consumer_supplies = max8997_ldo4_,
  465. };
  466. static struct regulator_init_data __initdata max8997_ldo5_data = {
  467. .constraints = {
  468. .name = "VHSIC_1.2V_C210",
  469. .min_uV = 1200000,
  470. .max_uV = 1200000,
  471. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  472. .apply_uV = 1,
  473. .state_mem = {
  474. .disabled = 1,
  475. },
  476. },
  477. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo5_),
  478. .consumer_supplies = max8997_ldo5_,
  479. };
  480. static struct regulator_init_data __initdata max8997_ldo6_data = {
  481. .constraints = {
  482. .name = "VCC_1.8V_PDA",
  483. .min_uV = 1800000,
  484. .max_uV = 1800000,
  485. .apply_uV = 1,
  486. .always_on = 1,
  487. .state_mem = {
  488. .enabled = 1,
  489. },
  490. },
  491. };
  492. static struct regulator_init_data __initdata max8997_ldo7_data = {
  493. .constraints = {
  494. .name = "CAM_ISP_1.8V",
  495. .min_uV = 1800000,
  496. .max_uV = 1800000,
  497. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  498. .apply_uV = 1,
  499. .state_mem = {
  500. .disabled = 1,
  501. },
  502. },
  503. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo7_),
  504. .consumer_supplies = max8997_ldo7_,
  505. };
  506. static struct regulator_init_data __initdata max8997_ldo8_data = {
  507. .constraints = {
  508. .name = "VUSB/VDAC_3.3V_C210",
  509. .min_uV = 3300000,
  510. .max_uV = 3300000,
  511. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  512. .apply_uV = 1,
  513. .state_mem = {
  514. .disabled = 1,
  515. },
  516. },
  517. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo8_),
  518. .consumer_supplies = max8997_ldo8_,
  519. };
  520. static struct regulator_init_data __initdata max8997_ldo9_data = {
  521. .constraints = {
  522. .name = "VCC_2.8V_PDA",
  523. .min_uV = 2800000,
  524. .max_uV = 2800000,
  525. .apply_uV = 1,
  526. .always_on = 1,
  527. .state_mem = {
  528. .enabled = 1,
  529. },
  530. },
  531. };
  532. static struct regulator_init_data __initdata max8997_ldo10_data = {
  533. .constraints = {
  534. .name = "VPLL_1.1V_C210",
  535. .min_uV = 1100000,
  536. .max_uV = 1100000,
  537. .apply_uV = 1,
  538. .always_on = 1,
  539. .state_mem = {
  540. .disabled = 1,
  541. },
  542. },
  543. };
  544. static struct regulator_init_data __initdata max8997_ldo11_data = {
  545. .constraints = {
  546. .name = "LVDS_VDD3.3V",
  547. .min_uV = 3300000,
  548. .max_uV = 3300000,
  549. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  550. .apply_uV = 1,
  551. .boot_on = 1,
  552. .state_mem = {
  553. .disabled = 1,
  554. },
  555. },
  556. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo11_),
  557. .consumer_supplies = max8997_ldo11_,
  558. };
  559. static struct regulator_init_data __initdata max8997_ldo12_data = {
  560. .constraints = {
  561. .name = "VT_CAM_1.8V",
  562. .min_uV = 1800000,
  563. .max_uV = 1800000,
  564. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  565. .apply_uV = 1,
  566. .state_mem = {
  567. .disabled = 1,
  568. },
  569. },
  570. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo12_),
  571. .consumer_supplies = max8997_ldo12_,
  572. };
  573. static struct regulator_init_data __initdata max8997_ldo13_data = {
  574. .constraints = {
  575. .name = "VTF_2.8V",
  576. .min_uV = 2800000,
  577. .max_uV = 2800000,
  578. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  579. .apply_uV = 1,
  580. .state_mem = {
  581. .disabled = 1,
  582. },
  583. },
  584. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo13_),
  585. .consumer_supplies = max8997_ldo13_,
  586. };
  587. static struct regulator_init_data __initdata max8997_ldo14_data = {
  588. .constraints = {
  589. .name = "VCC_3.0V_MOTOR",
  590. .min_uV = 3000000,
  591. .max_uV = 3000000,
  592. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  593. .apply_uV = 1,
  594. .state_mem = {
  595. .disabled = 1,
  596. },
  597. },
  598. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo14_),
  599. .consumer_supplies = max8997_ldo14_,
  600. };
  601. static struct regulator_init_data __initdata max8997_ldo15_data = {
  602. .constraints = {
  603. .name = "VTOUCH_ADVV2.8V",
  604. .min_uV = 2800000,
  605. .max_uV = 2800000,
  606. .apply_uV = 1,
  607. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  608. .state_mem = {
  609. .disabled = 1,
  610. },
  611. },
  612. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo15_),
  613. .consumer_supplies = max8997_ldo15_,
  614. };
  615. static struct regulator_init_data __initdata max8997_ldo16_data = {
  616. .constraints = {
  617. .name = "CAM_SENSOR_IO_1.8V",
  618. .min_uV = 1800000,
  619. .max_uV = 1800000,
  620. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  621. .apply_uV = 1,
  622. .state_mem = {
  623. .disabled = 1,
  624. },
  625. },
  626. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo16_),
  627. .consumer_supplies = max8997_ldo16_,
  628. };
  629. static struct regulator_init_data __initdata max8997_ldo18_data = {
  630. .constraints = {
  631. .name = "VTOUCH_VDD2.8V",
  632. .min_uV = 2800000,
  633. .max_uV = 2800000,
  634. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  635. .apply_uV = 1,
  636. .state_mem = {
  637. .disabled = 1,
  638. },
  639. },
  640. .num_consumer_supplies = ARRAY_SIZE(max8997_ldo18_),
  641. .consumer_supplies = max8997_ldo18_,
  642. };
  643. static struct regulator_init_data __initdata max8997_ldo21_data = {
  644. .constraints = {
  645. .name = "VDDQ_M1M2_1.2V",
  646. .min_uV = 1200000,
  647. .max_uV = 1200000,
  648. .apply_uV = 1,
  649. .always_on = 1,
  650. .state_mem = {
  651. .disabled = 1,
  652. },
  653. },
  654. };
  655. static struct regulator_init_data __initdata max8997_buck1_data = {
  656. .constraints = {
  657. .name = "VARM_1.2V_C210",
  658. .min_uV = 900000,
  659. .max_uV = 1350000,
  660. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  661. .always_on = 1,
  662. .state_mem = {
  663. .disabled = 1,
  664. },
  665. },
  666. .num_consumer_supplies = ARRAY_SIZE(max8997_buck1_),
  667. .consumer_supplies = max8997_buck1_,
  668. };
  669. static struct regulator_init_data __initdata max8997_buck2_data = {
  670. .constraints = {
  671. .name = "VINT_1.1V_C210",
  672. .min_uV = 900000,
  673. .max_uV = 1100000,
  674. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  675. .always_on = 1,
  676. .state_mem = {
  677. .disabled = 1,
  678. },
  679. },
  680. .num_consumer_supplies = ARRAY_SIZE(max8997_buck2_),
  681. .consumer_supplies = max8997_buck2_,
  682. };
  683. static struct regulator_init_data __initdata max8997_buck3_data = {
  684. .constraints = {
  685. .name = "VG3D_1.1V_C210",
  686. .min_uV = 900000,
  687. .max_uV = 1100000,
  688. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
  689. REGULATOR_CHANGE_STATUS,
  690. .state_mem = {
  691. .disabled = 1,
  692. },
  693. },
  694. .num_consumer_supplies = ARRAY_SIZE(max8997_buck3_),
  695. .consumer_supplies = max8997_buck3_,
  696. };
  697. static struct regulator_init_data __initdata max8997_buck4_data = {
  698. .constraints = {
  699. .name = "CAM_ISP_CORE_1.2V",
  700. .min_uV = 1200000,
  701. .max_uV = 1200000,
  702. .apply_uV = 1,
  703. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  704. .state_mem = {
  705. .disabled = 1,
  706. },
  707. },
  708. .num_consumer_supplies = ARRAY_SIZE(max8997_buck4_),
  709. .consumer_supplies = max8997_buck4_,
  710. };
  711. static struct regulator_init_data __initdata max8997_buck5_data = {
  712. .constraints = {
  713. .name = "VMEM_1.2V_C210",
  714. .min_uV = 1200000,
  715. .max_uV = 1200000,
  716. .apply_uV = 1,
  717. .always_on = 1,
  718. .state_mem = {
  719. .enabled = 1,
  720. },
  721. },
  722. };
  723. static struct regulator_init_data __initdata max8997_buck6_data = {
  724. .constraints = {
  725. .name = "CAM_AF_2.8V",
  726. .min_uV = 2800000,
  727. .max_uV = 2800000,
  728. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  729. .state_mem = {
  730. .disabled = 1,
  731. },
  732. },
  733. .num_consumer_supplies = ARRAY_SIZE(max8997_buck6_),
  734. .consumer_supplies = max8997_buck6_,
  735. };
  736. static struct regulator_init_data __initdata max8997_buck7_data = {
  737. .constraints = {
  738. .name = "VCC_SUB_2.0V",
  739. .min_uV = 2000000,
  740. .max_uV = 2000000,
  741. .apply_uV = 1,
  742. .always_on = 1,
  743. .state_mem = {
  744. .enabled = 1,
  745. },
  746. },
  747. };
  748. static struct regulator_init_data __initdata max8997_32khz_ap_data = {
  749. .constraints = {
  750. .name = "32KHz AP",
  751. .always_on = 1,
  752. .state_mem = {
  753. .enabled = 1,
  754. },
  755. },
  756. .num_consumer_supplies = ARRAY_SIZE(max8997_32khz_ap_),
  757. .consumer_supplies = max8997_32khz_ap_,
  758. };
  759. static struct regulator_init_data __initdata max8997_32khz_cp_data = {
  760. .constraints = {
  761. .name = "32KHz CP",
  762. .state_mem = {
  763. .disabled = 1,
  764. },
  765. },
  766. };
  767. static struct regulator_init_data __initdata max8997_vichg_data = {
  768. .constraints = {
  769. .name = "VICHG",
  770. .state_mem = {
  771. .disabled = 1,
  772. },
  773. },
  774. };
  775. static struct regulator_init_data __initdata max8997_esafeout1_data = {
  776. .constraints = {
  777. .name = "SAFEOUT1",
  778. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  779. .state_mem = {
  780. .disabled = 1,
  781. },
  782. },
  783. .num_consumer_supplies = ARRAY_SIZE(max8997_esafeout1_),
  784. .consumer_supplies = max8997_esafeout1_,
  785. };
  786. static struct regulator_init_data __initdata max8997_esafeout2_data = {
  787. .constraints = {
  788. .name = "SAFEOUT2",
  789. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  790. .state_mem = {
  791. .disabled = 1,
  792. },
  793. },
  794. .num_consumer_supplies = ARRAY_SIZE(max8997_esafeout2_),
  795. .consumer_supplies = max8997_esafeout2_,
  796. };
  797. static struct regulator_init_data __initdata max8997_charger_cv_data = {
  798. .constraints = {
  799. .name = "CHARGER_CV",
  800. .min_uV = 4200000,
  801. .max_uV = 4200000,
  802. .apply_uV = 1,
  803. },
  804. };
  805. static struct regulator_init_data __initdata max8997_charger_data = {
  806. .constraints = {
  807. .name = "CHARGER",
  808. .min_uA = 200000,
  809. .max_uA = 950000,
  810. .boot_on = 1,
  811. .valid_ops_mask = REGULATOR_CHANGE_STATUS |
  812. REGULATOR_CHANGE_CURRENT,
  813. },
  814. .num_consumer_supplies = ARRAY_SIZE(max8997_charger_),
  815. .consumer_supplies = max8997_charger_,
  816. };
  817. static struct regulator_init_data __initdata max8997_charger_topoff_data = {
  818. .constraints = {
  819. .name = "CHARGER TOPOFF",
  820. .min_uA = 50000,
  821. .max_uA = 200000,
  822. .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
  823. },
  824. .num_consumer_supplies = ARRAY_SIZE(max8997_chg_toff_),
  825. .consumer_supplies = max8997_chg_toff_,
  826. };
  827. static struct max8997_regulator_data __initdata nuri_max8997_regulators[] = {
  828. { MAX8997_LDO1, &max8997_ldo1_data },
  829. { MAX8997_LDO2, &max8997_ldo2_data },
  830. { MAX8997_LDO3, &max8997_ldo3_data },
  831. { MAX8997_LDO4, &max8997_ldo4_data },
  832. { MAX8997_LDO5, &max8997_ldo5_data },
  833. { MAX8997_LDO6, &max8997_ldo6_data },
  834. { MAX8997_LDO7, &max8997_ldo7_data },
  835. { MAX8997_LDO8, &max8997_ldo8_data },
  836. { MAX8997_LDO9, &max8997_ldo9_data },
  837. { MAX8997_LDO10, &max8997_ldo10_data },
  838. { MAX8997_LDO11, &max8997_ldo11_data },
  839. { MAX8997_LDO12, &max8997_ldo12_data },
  840. { MAX8997_LDO13, &max8997_ldo13_data },
  841. { MAX8997_LDO14, &max8997_ldo14_data },
  842. { MAX8997_LDO15, &max8997_ldo15_data },
  843. { MAX8997_LDO16, &max8997_ldo16_data },
  844. { MAX8997_LDO18, &max8997_ldo18_data },
  845. { MAX8997_LDO21, &max8997_ldo21_data },
  846. { MAX8997_BUCK1, &max8997_buck1_data },
  847. { MAX8997_BUCK2, &max8997_buck2_data },
  848. { MAX8997_BUCK3, &max8997_buck3_data },
  849. { MAX8997_BUCK4, &max8997_buck4_data },
  850. { MAX8997_BUCK5, &max8997_buck5_data },
  851. { MAX8997_BUCK6, &max8997_buck6_data },
  852. { MAX8997_BUCK7, &max8997_buck7_data },
  853. { MAX8997_EN32KHZ_AP, &max8997_32khz_ap_data },
  854. { MAX8997_EN32KHZ_CP, &max8997_32khz_cp_data },
  855. { MAX8997_ENVICHG, &max8997_vichg_data },
  856. { MAX8997_ESAFEOUT1, &max8997_esafeout1_data },
  857. { MAX8997_ESAFEOUT2, &max8997_esafeout2_data },
  858. { MAX8997_CHARGER_CV, &max8997_charger_cv_data },
  859. { MAX8997_CHARGER, &max8997_charger_data },
  860. { MAX8997_CHARGER_TOPOFF, &max8997_charger_topoff_data },
  861. };
  862. static struct max8997_platform_data __initdata nuri_max8997_pdata = {
  863. .wakeup = 1,
  864. .num_regulators = ARRAY_SIZE(nuri_max8997_regulators),
  865. .regulators = nuri_max8997_regulators,
  866. .buck125_gpios = { EXYNOS4_GPX0(5), EXYNOS4_GPX0(6), EXYNOS4_GPL0(0) },
  867. .buck2_gpiodvs = true,
  868. .buck1_voltage[0] = 1350000, /* 1.35V */
  869. .buck1_voltage[1] = 1300000, /* 1.3V */
  870. .buck1_voltage[2] = 1250000, /* 1.25V */
  871. .buck1_voltage[3] = 1200000, /* 1.2V */
  872. .buck1_voltage[4] = 1150000, /* 1.15V */
  873. .buck1_voltage[5] = 1100000, /* 1.1V */
  874. .buck1_voltage[6] = 1000000, /* 1.0V */
  875. .buck1_voltage[7] = 950000, /* 0.95V */
  876. .buck2_voltage[0] = 1100000, /* 1.1V */
  877. .buck2_voltage[1] = 1000000, /* 1.0V */
  878. .buck2_voltage[2] = 950000, /* 0.95V */
  879. .buck2_voltage[3] = 900000, /* 0.9V */
  880. .buck2_voltage[4] = 1100000, /* 1.1V */
  881. .buck2_voltage[5] = 1000000, /* 1.0V */
  882. .buck2_voltage[6] = 950000, /* 0.95V */
  883. .buck2_voltage[7] = 900000, /* 0.9V */
  884. .buck5_voltage[0] = 1200000, /* 1.2V */
  885. .buck5_voltage[1] = 1200000, /* 1.2V */
  886. .buck5_voltage[2] = 1200000, /* 1.2V */
  887. .buck5_voltage[3] = 1200000, /* 1.2V */
  888. .buck5_voltage[4] = 1200000, /* 1.2V */
  889. .buck5_voltage[5] = 1200000, /* 1.2V */
  890. .buck5_voltage[6] = 1200000, /* 1.2V */
  891. .buck5_voltage[7] = 1200000, /* 1.2V */
  892. };
  893. /* GPIO I2C 5 (PMIC) */
  894. enum { I2C5_MAX8997 };
  895. static struct i2c_board_info i2c5_devs[] __initdata = {
  896. [I2C5_MAX8997] = {
  897. I2C_BOARD_INFO("max8997", 0xCC >> 1),
  898. .platform_data = &nuri_max8997_pdata,
  899. },
  900. };
  901. static struct max17042_platform_data nuri_battery_platform_data = {
  902. };
  903. /* GPIO I2C 9 (Fuel Gauge) */
  904. static struct i2c_gpio_platform_data i2c9_gpio_data = {
  905. .sda_pin = EXYNOS4_GPY4(0), /* XM0ADDR_8 */
  906. .scl_pin = EXYNOS4_GPY4(1), /* XM0ADDR_9 */
  907. };
  908. static struct platform_device i2c9_gpio = {
  909. .name = "i2c-gpio",
  910. .id = 9,
  911. .dev = {
  912. .platform_data = &i2c9_gpio_data,
  913. },
  914. };
  915. enum { I2C9_MAX17042};
  916. static struct i2c_board_info i2c9_devs[] __initdata = {
  917. [I2C9_MAX17042] = {
  918. I2C_BOARD_INFO("max17042", 0x36),
  919. .platform_data = &nuri_battery_platform_data,
  920. },
  921. };
  922. /* MAX8903 Secondary Charger */
  923. static struct regulator_consumer_supply supplies_max8903[] = {
  924. REGULATOR_SUPPLY("vinchg2", "charger-manager.0"),
  925. };
  926. static struct regulator_init_data max8903_charger_en_data = {
  927. .constraints = {
  928. .name = "VOUT_CHARGER",
  929. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  930. .boot_on = 1,
  931. },
  932. .num_consumer_supplies = ARRAY_SIZE(supplies_max8903),
  933. .consumer_supplies = supplies_max8903,
  934. };
  935. static struct fixed_voltage_config max8903_charger_en = {
  936. .supply_name = "VOUT_CHARGER",
  937. .microvolts = 5000000, /* Assume 5VDC */
  938. .gpio = EXYNOS4_GPY4(5), /* TA_EN negaged */
  939. .enable_high = 0, /* Enable = Low */
  940. .enabled_at_boot = 1,
  941. .init_data = &max8903_charger_en_data,
  942. };
  943. static struct platform_device max8903_fixed_reg_dev = {
  944. .name = "reg-fixed-voltage",
  945. .id = FIXED_REG_ID_MAX8903,
  946. .dev = { .platform_data = &max8903_charger_en },
  947. };
  948. static struct max8903_pdata nuri_max8903 = {
  949. /*
  950. * cen: don't control with the driver, let it be
  951. * controlled by regulator above
  952. */
  953. .dok = EXYNOS4_GPX1(4), /* TA_nCONNECTED */
  954. /* uok, usus: not connected */
  955. .chg = EXYNOS4_GPE2(0), /* TA_nCHG */
  956. /* flt: vcc_1.8V_pda */
  957. .dcm = EXYNOS4_GPL0(1), /* CURR_ADJ */
  958. .dc_valid = true,
  959. .usb_valid = false, /* USB is not wired to MAX8903 */
  960. };
  961. static struct platform_device nuri_max8903_device = {
  962. .name = "max8903-charger",
  963. .dev = {
  964. .platform_data = &nuri_max8903,
  965. },
  966. };
  967. static void __init nuri_power_init(void)
  968. {
  969. int gpio;
  970. int irq_base = IRQ_GPIO_END + 1;
  971. int ta_en = 0;
  972. nuri_max8997_pdata.irq_base = irq_base;
  973. irq_base += MAX8997_IRQ_NR;
  974. gpio = EXYNOS4_GPX0(7);
  975. gpio_request(gpio, "AP_PMIC_IRQ");
  976. s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
  977. s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
  978. gpio = EXYNOS4_GPX2(3);
  979. gpio_request(gpio, "FUEL_ALERT");
  980. s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
  981. s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
  982. gpio = nuri_max8903.dok;
  983. gpio_request(gpio, "TA_nCONNECTED");
  984. s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
  985. s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
  986. ta_en = gpio_get_value(gpio) ? 0 : 1;
  987. gpio = nuri_max8903.chg;
  988. gpio_request(gpio, "TA_nCHG");
  989. gpio_direction_input(gpio);
  990. gpio = nuri_max8903.dcm;
  991. gpio_request(gpio, "CURR_ADJ");
  992. gpio_direction_output(gpio, ta_en);
  993. }
  994. /* USB EHCI */
  995. static struct s5p_ehci_platdata nuri_ehci_pdata;
  996. static void __init nuri_ehci_init(void)
  997. {
  998. struct s5p_ehci_platdata *pdata = &nuri_ehci_pdata;
  999. s5p_ehci_set_platdata(pdata);
  1000. }
  1001. static struct platform_device *nuri_devices[] __initdata = {
  1002. /* Samsung Platform Devices */
  1003. &s3c_device_i2c5, /* PMIC should initialize first */
  1004. &emmc_fixed_voltage,
  1005. &s5p_device_fimd0,
  1006. &s3c_device_hsmmc0,
  1007. &s3c_device_hsmmc2,
  1008. &s3c_device_hsmmc3,
  1009. &s3c_device_wdt,
  1010. &s3c_device_timer[0],
  1011. &s5p_device_ehci,
  1012. &s3c_device_i2c3,
  1013. &i2c9_gpio,
  1014. &s3c_device_adc,
  1015. &s3c_device_rtc,
  1016. &s5p_device_mfc,
  1017. &s5p_device_mfc_l,
  1018. &s5p_device_mfc_r,
  1019. &exynos4_device_pd[PD_MFC],
  1020. &exynos4_device_pd[PD_LCD0],
  1021. /* NURI Devices */
  1022. &nuri_gpio_keys,
  1023. &nuri_lcd_device,
  1024. &nuri_backlight_device,
  1025. &max8903_fixed_reg_dev,
  1026. &nuri_max8903_device,
  1027. };
  1028. static void __init nuri_map_io(void)
  1029. {
  1030. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  1031. s3c24xx_init_clocks(24000000);
  1032. s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs));
  1033. }
  1034. static void __init nuri_reserve(void)
  1035. {
  1036. s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
  1037. }
  1038. static void __init nuri_machine_init(void)
  1039. {
  1040. nuri_sdhci_init();
  1041. nuri_tsp_init();
  1042. nuri_power_init();
  1043. i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
  1044. s3c_i2c3_set_platdata(&i2c3_data);
  1045. i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
  1046. s3c_i2c5_set_platdata(NULL);
  1047. i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7));
  1048. i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
  1049. i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3));
  1050. i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs));
  1051. s5p_fimd0_set_platdata(&nuri_fb_pdata);
  1052. nuri_ehci_init();
  1053. clk_xusbxti.rate = 24000000;
  1054. /* Last */
  1055. platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));
  1056. s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
  1057. s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
  1058. }
  1059. MACHINE_START(NURI, "NURI")
  1060. /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
  1061. .boot_params = S5P_PA_SDRAM + 0x100,
  1062. .init_irq = exynos4_init_irq,
  1063. .map_io = nuri_map_io,
  1064. .init_machine = nuri_machine_init,
  1065. .timer = &exynos4_timer,
  1066. .reserve = &nuri_reserve,
  1067. MACHINE_END