mach-nuri.c 30 KB

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