mach-nuri.c 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  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 struct device *nuri_cm_devices[] = {
  968. &s3c_device_i2c5.dev,
  969. &s3c_device_adc.dev,
  970. NULL, /* Reserved for UART */
  971. NULL,
  972. };
  973. static void __init nuri_power_init(void)
  974. {
  975. int gpio;
  976. int irq_base = IRQ_GPIO_END + 1;
  977. int ta_en = 0;
  978. nuri_max8997_pdata.irq_base = irq_base;
  979. irq_base += MAX8997_IRQ_NR;
  980. gpio = EXYNOS4_GPX0(7);
  981. gpio_request(gpio, "AP_PMIC_IRQ");
  982. s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
  983. s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
  984. gpio = EXYNOS4_GPX2(3);
  985. gpio_request(gpio, "FUEL_ALERT");
  986. s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
  987. s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
  988. gpio = nuri_max8903.dok;
  989. gpio_request(gpio, "TA_nCONNECTED");
  990. s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
  991. s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
  992. ta_en = gpio_get_value(gpio) ? 0 : 1;
  993. gpio = nuri_max8903.chg;
  994. gpio_request(gpio, "TA_nCHG");
  995. gpio_direction_input(gpio);
  996. gpio = nuri_max8903.dcm;
  997. gpio_request(gpio, "CURR_ADJ");
  998. gpio_direction_output(gpio, ta_en);
  999. }
  1000. /* USB EHCI */
  1001. static struct s5p_ehci_platdata nuri_ehci_pdata;
  1002. static void __init nuri_ehci_init(void)
  1003. {
  1004. struct s5p_ehci_platdata *pdata = &nuri_ehci_pdata;
  1005. s5p_ehci_set_platdata(pdata);
  1006. }
  1007. static struct platform_device *nuri_devices[] __initdata = {
  1008. /* Samsung Platform Devices */
  1009. &s3c_device_i2c5, /* PMIC should initialize first */
  1010. &emmc_fixed_voltage,
  1011. &s5p_device_fimd0,
  1012. &s3c_device_hsmmc0,
  1013. &s3c_device_hsmmc2,
  1014. &s3c_device_hsmmc3,
  1015. &s3c_device_wdt,
  1016. &s3c_device_timer[0],
  1017. &s5p_device_ehci,
  1018. &s3c_device_i2c3,
  1019. &i2c9_gpio,
  1020. &s3c_device_adc,
  1021. &s3c_device_rtc,
  1022. &s5p_device_mfc,
  1023. &s5p_device_mfc_l,
  1024. &s5p_device_mfc_r,
  1025. &exynos4_device_pd[PD_MFC],
  1026. &exynos4_device_pd[PD_LCD0],
  1027. /* NURI Devices */
  1028. &nuri_gpio_keys,
  1029. &nuri_lcd_device,
  1030. &nuri_backlight_device,
  1031. &max8903_fixed_reg_dev,
  1032. &nuri_max8903_device,
  1033. };
  1034. static void __init nuri_map_io(void)
  1035. {
  1036. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  1037. s3c24xx_init_clocks(24000000);
  1038. s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs));
  1039. }
  1040. static void __init nuri_reserve(void)
  1041. {
  1042. s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
  1043. }
  1044. static void __init nuri_machine_init(void)
  1045. {
  1046. nuri_sdhci_init();
  1047. nuri_tsp_init();
  1048. nuri_power_init();
  1049. i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
  1050. s3c_i2c3_set_platdata(&i2c3_data);
  1051. i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
  1052. s3c_i2c5_set_platdata(NULL);
  1053. i2c5_devs[I2C5_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(7));
  1054. i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
  1055. i2c9_devs[I2C9_MAX17042].irq = gpio_to_irq(EXYNOS4_GPX2(3));
  1056. i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs));
  1057. s5p_fimd0_set_platdata(&nuri_fb_pdata);
  1058. nuri_ehci_init();
  1059. clk_xusbxti.rate = 24000000;
  1060. /* Last */
  1061. platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));
  1062. s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
  1063. s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
  1064. }
  1065. MACHINE_START(NURI, "NURI")
  1066. /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
  1067. .atag_offset = 0x100,
  1068. .init_irq = exynos4_init_irq,
  1069. .map_io = nuri_map_io,
  1070. .init_machine = nuri_machine_init,
  1071. .timer = &exynos4_timer,
  1072. .reserve = &nuri_reserve,
  1073. MACHINE_END