mach-nuri.c 29 KB

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