Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/mach-s5pv210/mach-goni.c |
| 2 | * |
| 3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com/ |
| 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 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/types.h> |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/serial_core.h> |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 15 | #include <linux/fb.h> |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 16 | #include <linux/i2c.h> |
| 17 | #include <linux/i2c-gpio.h> |
Dmitry Torokhov | 964de52 | 2011-02-02 23:21:58 -0800 | [diff] [blame] | 18 | #include <linux/i2c/atmel_mxt_ts.h> |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 19 | #include <linux/mfd/max8998.h> |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 20 | #include <linux/mfd/wm8994/pdata.h> |
Marek Szyprowski | e9dde6f1 | 2010-09-29 22:05:19 +0900 | [diff] [blame] | 21 | #include <linux/regulator/fixed.h> |
Marek Szyprowski | 8415d5c | 2010-10-04 16:39:20 +0900 | [diff] [blame] | 22 | #include <linux/spi/spi.h> |
| 23 | #include <linux/spi/spi_gpio.h> |
| 24 | #include <linux/lcd.h> |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 25 | #include <linux/gpio_keys.h> |
| 26 | #include <linux/input.h> |
| 27 | #include <linux/gpio.h> |
Marek Szyprowski | 9b4d1cbb | 2012-04-24 17:28:12 -0700 | [diff] [blame] | 28 | #include <linux/mmc/host.h> |
Iiro Valkonen | 919ed89 | 2011-02-15 13:36:52 -0800 | [diff] [blame] | 29 | #include <linux/interrupt.h> |
Lukasz Majewski | 126625e | 2012-05-09 13:16:53 +0200 | [diff] [blame] | 30 | #include <linux/platform_data/s3c-hsotg.h> |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 31 | |
| 32 | #include <asm/mach/arch.h> |
| 33 | #include <asm/mach/map.h> |
| 34 | #include <asm/setup.h> |
| 35 | #include <asm/mach-types.h> |
| 36 | |
Leela Krishna Amudala | 5a213a5 | 2012-08-08 09:44:49 +0900 | [diff] [blame] | 37 | #include <video/samsung_fimd.h> |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 38 | #include <mach/map.h> |
| 39 | #include <mach/regs-clock.h> |
| 40 | |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 41 | #include <plat/gpio-cfg.h> |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 42 | #include <plat/regs-serial.h> |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 43 | #include <plat/devs.h> |
| 44 | #include <plat/cpu.h> |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 45 | #include <plat/fb.h> |
Arnd Bergmann | 436d42c | 2012-08-24 15:22:12 +0200 | [diff] [blame] | 46 | #include <linux/platform_data/i2c-s3c2410.h> |
Joonyoung Shim | 2a55558 | 2010-09-09 08:17:43 +0900 | [diff] [blame] | 47 | #include <plat/keypad.h> |
Marek Szyprowski | 19b90c7 | 2010-08-05 18:00:18 +0900 | [diff] [blame] | 48 | #include <plat/sdhci.h> |
Marek Szyprowski | d5889d5 | 2010-09-30 20:59:46 +0900 | [diff] [blame] | 49 | #include <plat/clock.h> |
Sangbeom Kim | 20780fc | 2011-03-12 08:02:12 +0900 | [diff] [blame] | 50 | #include <plat/s5p-time.h> |
Kamil Debski | 66eb123 | 2011-07-21 16:43:14 +0900 | [diff] [blame] | 51 | #include <plat/mfc.h> |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 52 | #include <plat/camport.h> |
| 53 | |
| 54 | #include <media/v4l2-mediabus.h> |
| 55 | #include <media/s5p_fimc.h> |
| 56 | #include <media/noon010pc30.h> |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 57 | |
Kukjin Kim | 3fa754c | 2011-12-22 23:32:07 +0100 | [diff] [blame] | 58 | #include "common.h" |
| 59 | |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 60 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 61 | #define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 62 | S3C2410_UCON_RXILEVEL | \ |
| 63 | S3C2410_UCON_TXIRQMODE | \ |
| 64 | S3C2410_UCON_RXIRQMODE | \ |
| 65 | S3C2410_UCON_RXFIFO_TOI | \ |
| 66 | S3C2443_UCON_RXERR_IRQEN) |
| 67 | |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 68 | #define GONI_ULCON_DEFAULT S3C2410_LCON_CS8 |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 69 | |
Kukjin Kim | f2b7e3c | 2010-08-06 21:34:55 +0900 | [diff] [blame] | 70 | #define GONI_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 71 | |
| 72 | static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = { |
| 73 | [0] = { |
| 74 | .hwport = 0, |
| 75 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 76 | .ucon = GONI_UCON_DEFAULT, |
| 77 | .ulcon = GONI_ULCON_DEFAULT, |
Kukjin Kim | f2b7e3c | 2010-08-06 21:34:55 +0900 | [diff] [blame] | 78 | .ufcon = GONI_UFCON_DEFAULT | |
Joonyoung Shim | bbf7b35 | 2010-06-24 19:28:55 +0900 | [diff] [blame] | 79 | S5PV210_UFCON_TXTRIG256 | S5PV210_UFCON_RXTRIG256, |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 80 | }, |
| 81 | [1] = { |
| 82 | .hwport = 1, |
| 83 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 84 | .ucon = GONI_UCON_DEFAULT, |
| 85 | .ulcon = GONI_ULCON_DEFAULT, |
Kukjin Kim | f2b7e3c | 2010-08-06 21:34:55 +0900 | [diff] [blame] | 86 | .ufcon = GONI_UFCON_DEFAULT | |
Joonyoung Shim | bbf7b35 | 2010-06-24 19:28:55 +0900 | [diff] [blame] | 87 | S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64, |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 88 | }, |
| 89 | [2] = { |
| 90 | .hwport = 2, |
| 91 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 92 | .ucon = GONI_UCON_DEFAULT, |
| 93 | .ulcon = GONI_ULCON_DEFAULT, |
Kukjin Kim | f2b7e3c | 2010-08-06 21:34:55 +0900 | [diff] [blame] | 94 | .ufcon = GONI_UFCON_DEFAULT | |
Joonyoung Shim | bbf7b35 | 2010-06-24 19:28:55 +0900 | [diff] [blame] | 95 | S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16, |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 96 | }, |
| 97 | [3] = { |
| 98 | .hwport = 3, |
| 99 | .flags = 0, |
Kukjin Kim | c8def08 | 2010-07-21 09:19:51 +0900 | [diff] [blame] | 100 | .ucon = GONI_UCON_DEFAULT, |
| 101 | .ulcon = GONI_ULCON_DEFAULT, |
Kukjin Kim | f2b7e3c | 2010-08-06 21:34:55 +0900 | [diff] [blame] | 102 | .ufcon = GONI_UFCON_DEFAULT | |
Joonyoung Shim | bbf7b35 | 2010-06-24 19:28:55 +0900 | [diff] [blame] | 103 | S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16, |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 104 | }, |
| 105 | }; |
| 106 | |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 107 | /* Frame Buffer */ |
| 108 | static struct s3c_fb_pd_win goni_fb_win0 = { |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 109 | .max_bpp = 32, |
| 110 | .default_bpp = 16, |
Thomas Abraham | 79d3c41 | 2012-03-24 21:58:48 +0530 | [diff] [blame] | 111 | .xres = 480, |
| 112 | .yres = 800, |
Sylwester Nawrocki | c472da6 | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 113 | .virtual_x = 480, |
| 114 | .virtual_y = 2 * 800, |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 115 | }; |
| 116 | |
Thomas Abraham | 79d3c41 | 2012-03-24 21:58:48 +0530 | [diff] [blame] | 117 | static struct fb_videomode goni_lcd_timing = { |
| 118 | .left_margin = 16, |
| 119 | .right_margin = 16, |
| 120 | .upper_margin = 2, |
| 121 | .lower_margin = 28, |
| 122 | .hsync_len = 2, |
| 123 | .vsync_len = 1, |
| 124 | .xres = 480, |
| 125 | .yres = 800, |
| 126 | .refresh = 55, |
| 127 | }; |
| 128 | |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 129 | static struct s3c_fb_platdata goni_lcd_pdata __initdata = { |
| 130 | .win[0] = &goni_fb_win0, |
Thomas Abraham | 79d3c41 | 2012-03-24 21:58:48 +0530 | [diff] [blame] | 131 | .vtiming = &goni_lcd_timing, |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 132 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB | |
| 133 | VIDCON0_CLKSEL_LCD, |
| 134 | .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN |
| 135 | | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, |
| 136 | .setup_gpio = s5pv210_fb_gpio_setup_24bpp, |
| 137 | }; |
| 138 | |
Marek Szyprowski | 8415d5c | 2010-10-04 16:39:20 +0900 | [diff] [blame] | 139 | static int lcd_power_on(struct lcd_device *ld, int enable) |
| 140 | { |
| 141 | return 1; |
| 142 | } |
| 143 | |
| 144 | static int reset_lcd(struct lcd_device *ld) |
| 145 | { |
| 146 | static unsigned int first = 1; |
| 147 | int reset_gpio = -1; |
| 148 | |
| 149 | reset_gpio = S5PV210_MP05(5); |
| 150 | |
| 151 | if (first) { |
| 152 | gpio_request(reset_gpio, "MLCD_RST"); |
| 153 | first = 0; |
| 154 | } |
| 155 | |
| 156 | gpio_direction_output(reset_gpio, 1); |
| 157 | return 1; |
| 158 | } |
| 159 | |
| 160 | static struct lcd_platform_data goni_lcd_platform_data = { |
| 161 | .reset = reset_lcd, |
| 162 | .power_on = lcd_power_on, |
| 163 | .lcd_enabled = 0, |
| 164 | .reset_delay = 120, /* 120ms */ |
| 165 | .power_on_delay = 25, /* 25ms */ |
| 166 | .power_off_delay = 200, /* 200ms */ |
| 167 | }; |
| 168 | |
| 169 | #define LCD_BUS_NUM 3 |
| 170 | static struct spi_board_info spi_board_info[] __initdata = { |
| 171 | { |
| 172 | .modalias = "s6e63m0", |
| 173 | .platform_data = &goni_lcd_platform_data, |
| 174 | .max_speed_hz = 1200000, |
| 175 | .bus_num = LCD_BUS_NUM, |
| 176 | .chip_select = 0, |
| 177 | .mode = SPI_MODE_3, |
| 178 | .controller_data = (void *)S5PV210_MP01(1), /* DISPLAY_CS */ |
| 179 | }, |
| 180 | }; |
| 181 | |
| 182 | static struct spi_gpio_platform_data lcd_spi_gpio_data = { |
| 183 | .sck = S5PV210_MP04(1), /* DISPLAY_CLK */ |
| 184 | .mosi = S5PV210_MP04(3), /* DISPLAY_SI */ |
| 185 | .miso = SPI_GPIO_NO_MISO, |
| 186 | .num_chipselect = 1, |
| 187 | }; |
| 188 | |
| 189 | static struct platform_device goni_spi_gpio = { |
| 190 | .name = "spi_gpio", |
| 191 | .id = LCD_BUS_NUM, |
| 192 | .dev = { |
| 193 | .parent = &s3c_device_fb.dev, |
| 194 | .platform_data = &lcd_spi_gpio_data, |
| 195 | }, |
| 196 | }; |
| 197 | |
Joonyoung Shim | 2a55558 | 2010-09-09 08:17:43 +0900 | [diff] [blame] | 198 | /* KEYPAD */ |
| 199 | static uint32_t keymap[] __initdata = { |
| 200 | /* KEY(row, col, keycode) */ |
| 201 | KEY(0, 1, KEY_MENU), /* Send */ |
| 202 | KEY(0, 2, KEY_BACK), /* End */ |
| 203 | KEY(1, 1, KEY_CONFIG), /* Half shot */ |
| 204 | KEY(1, 2, KEY_VOLUMEUP), |
| 205 | KEY(2, 1, KEY_CAMERA), /* Full shot */ |
| 206 | KEY(2, 2, KEY_VOLUMEDOWN), |
| 207 | }; |
| 208 | |
| 209 | static struct matrix_keymap_data keymap_data __initdata = { |
| 210 | .keymap = keymap, |
| 211 | .keymap_size = ARRAY_SIZE(keymap), |
| 212 | }; |
| 213 | |
| 214 | static struct samsung_keypad_platdata keypad_data __initdata = { |
| 215 | .keymap_data = &keymap_data, |
| 216 | .rows = 3, |
| 217 | .cols = 3, |
| 218 | }; |
| 219 | |
Marek Szyprowski | 528ef1b | 2010-10-04 16:39:22 +0900 | [diff] [blame] | 220 | /* Radio */ |
| 221 | static struct i2c_board_info i2c1_devs[] __initdata = { |
| 222 | { |
| 223 | I2C_BOARD_INFO("si470x", 0x10), |
| 224 | }, |
| 225 | }; |
| 226 | |
| 227 | static void __init goni_radio_init(void) |
| 228 | { |
| 229 | int gpio; |
| 230 | |
| 231 | gpio = S5PV210_GPJ2(4); /* XMSMDATA_4 */ |
| 232 | gpio_request(gpio, "FM_INT"); |
| 233 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); |
| 234 | i2c1_devs[0].irq = gpio_to_irq(gpio); |
| 235 | |
| 236 | gpio = S5PV210_GPJ2(5); /* XMSMDATA_5 */ |
Jingoo Han | 2f4f0b4 | 2011-12-24 11:57:09 +0900 | [diff] [blame] | 237 | gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "FM_RST"); |
Marek Szyprowski | 528ef1b | 2010-10-04 16:39:22 +0900 | [diff] [blame] | 238 | } |
| 239 | |
Marek Szyprowski | b4a0dca | 2010-10-04 18:38:12 +0900 | [diff] [blame] | 240 | /* TSP */ |
Iiro Valkonen | 7686b10 | 2011-02-02 23:21:58 -0800 | [diff] [blame] | 241 | static struct mxt_platform_data qt602240_platform_data = { |
Marek Szyprowski | b4a0dca | 2010-10-04 18:38:12 +0900 | [diff] [blame] | 242 | .x_line = 17, |
| 243 | .y_line = 11, |
| 244 | .x_size = 800, |
| 245 | .y_size = 480, |
| 246 | .blen = 0x21, |
| 247 | .threshold = 0x28, |
| 248 | .voltage = 2800000, /* 2.8V */ |
Iiro Valkonen | 7686b10 | 2011-02-02 23:21:58 -0800 | [diff] [blame] | 249 | .orient = MXT_DIAGONAL, |
Iiro Valkonen | 919ed89 | 2011-02-15 13:36:52 -0800 | [diff] [blame] | 250 | .irqflags = IRQF_TRIGGER_FALLING, |
Marek Szyprowski | b4a0dca | 2010-10-04 18:38:12 +0900 | [diff] [blame] | 251 | }; |
| 252 | |
| 253 | static struct s3c2410_platform_i2c i2c2_data __initdata = { |
| 254 | .flags = 0, |
| 255 | .bus_num = 2, |
| 256 | .slave_addr = 0x10, |
| 257 | .frequency = 400 * 1000, |
| 258 | .sda_delay = 100, |
| 259 | }; |
| 260 | |
| 261 | static struct i2c_board_info i2c2_devs[] __initdata = { |
| 262 | { |
| 263 | I2C_BOARD_INFO("qt602240_ts", 0x4a), |
| 264 | .platform_data = &qt602240_platform_data, |
| 265 | }, |
| 266 | }; |
| 267 | |
| 268 | static void __init goni_tsp_init(void) |
| 269 | { |
| 270 | int gpio; |
| 271 | |
| 272 | gpio = S5PV210_GPJ1(3); /* XMSMADDR_11 */ |
Jingoo Han | 2f4f0b4 | 2011-12-24 11:57:09 +0900 | [diff] [blame] | 273 | gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "TSP_LDO_ON"); |
Marek Szyprowski | b4a0dca | 2010-10-04 18:38:12 +0900 | [diff] [blame] | 274 | gpio_export(gpio, 0); |
| 275 | |
| 276 | gpio = S5PV210_GPJ0(5); /* XMSMADDR_5 */ |
| 277 | gpio_request(gpio, "TSP_INT"); |
| 278 | |
| 279 | s5p_register_gpio_interrupt(gpio); |
| 280 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); |
| 281 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); |
| 282 | i2c2_devs[0].irq = gpio_to_irq(gpio); |
| 283 | } |
| 284 | |
Lukasz Majewski | 460dcb0 | 2012-05-13 08:24:14 +0900 | [diff] [blame] | 285 | /* USB OTG */ |
| 286 | static struct s3c_hsotg_plat goni_hsotg_pdata; |
| 287 | |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 288 | static void goni_camera_init(void) |
| 289 | { |
| 290 | s5pv210_fimc_setup_gpio(S5P_CAMPORT_A); |
| 291 | |
| 292 | /* Set max driver strength on CAM_A_CLKOUT pin. */ |
| 293 | s5p_gpio_set_drvstr(S5PV210_GPE1(3), S5P_GPIO_DRVSTR_LV4); |
| 294 | } |
| 295 | |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 296 | /* MAX8998 regulators */ |
| 297 | #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE) |
| 298 | |
Marek Szyprowski | 1d017fe | 2011-02-24 10:06:25 +0900 | [diff] [blame] | 299 | static struct regulator_consumer_supply goni_ldo3_consumers[] = { |
| 300 | REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"), |
| 301 | }; |
| 302 | |
Marek Szyprowski | e9dde6f1 | 2010-09-29 22:05:19 +0900 | [diff] [blame] | 303 | static struct regulator_consumer_supply goni_ldo5_consumers[] = { |
| 304 | REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"), |
| 305 | }; |
| 306 | |
Marek Szyprowski | 1d017fe | 2011-02-24 10:06:25 +0900 | [diff] [blame] | 307 | static struct regulator_consumer_supply goni_ldo8_consumers[] = { |
| 308 | REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"), |
Tomasz Stanislawski | b74f2fb | 2011-09-16 18:48:52 +0900 | [diff] [blame] | 309 | REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"), |
Marek Szyprowski | 1d017fe | 2011-02-24 10:06:25 +0900 | [diff] [blame] | 310 | }; |
| 311 | |
Sylwester Nawrocki | 9a16afd | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 312 | static struct regulator_consumer_supply goni_ldo11_consumers[] = { |
| 313 | REGULATOR_SUPPLY("vddio", "0-0030"), /* "CAM_IO_2.8V" */ |
| 314 | }; |
| 315 | |
| 316 | static struct regulator_consumer_supply goni_ldo13_consumers[] = { |
| 317 | REGULATOR_SUPPLY("vdda", "0-0030"), /* "CAM_A_2.8V" */ |
| 318 | }; |
| 319 | |
| 320 | static struct regulator_consumer_supply goni_ldo14_consumers[] = { |
| 321 | REGULATOR_SUPPLY("vdd_core", "0-0030"), /* "CAM_CIF_1.8V" */ |
| 322 | }; |
| 323 | |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 324 | static struct regulator_init_data goni_ldo2_data = { |
| 325 | .constraints = { |
| 326 | .name = "VALIVE_1.1V", |
| 327 | .min_uV = 1100000, |
| 328 | .max_uV = 1100000, |
| 329 | .apply_uV = 1, |
| 330 | .always_on = 1, |
| 331 | .state_mem = { |
| 332 | .enabled = 1, |
| 333 | }, |
| 334 | }, |
| 335 | }; |
| 336 | |
| 337 | static struct regulator_init_data goni_ldo3_data = { |
| 338 | .constraints = { |
Marek Szyprowski | d106133 | 2011-02-18 17:51:43 +0900 | [diff] [blame] | 339 | .name = "VUSB+MIPI_1.1V", |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 340 | .min_uV = 1100000, |
| 341 | .max_uV = 1100000, |
| 342 | .apply_uV = 1, |
Marek Szyprowski | 1d017fe | 2011-02-24 10:06:25 +0900 | [diff] [blame] | 343 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 344 | }, |
Marek Szyprowski | 1d017fe | 2011-02-24 10:06:25 +0900 | [diff] [blame] | 345 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo3_consumers), |
| 346 | .consumer_supplies = goni_ldo3_consumers, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 347 | }; |
| 348 | |
| 349 | static struct regulator_init_data goni_ldo4_data = { |
| 350 | .constraints = { |
| 351 | .name = "VDAC_3.3V", |
| 352 | .min_uV = 3300000, |
| 353 | .max_uV = 3300000, |
| 354 | .apply_uV = 1, |
| 355 | }, |
| 356 | }; |
| 357 | |
| 358 | static struct regulator_init_data goni_ldo5_data = { |
| 359 | .constraints = { |
| 360 | .name = "VTF_2.8V", |
| 361 | .min_uV = 2800000, |
| 362 | .max_uV = 2800000, |
| 363 | .apply_uV = 1, |
Marek Szyprowski | 9b8306c | 2011-02-24 10:03:54 +0900 | [diff] [blame] | 364 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 365 | }, |
Marek Szyprowski | e9dde6f1 | 2010-09-29 22:05:19 +0900 | [diff] [blame] | 366 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers), |
| 367 | .consumer_supplies = goni_ldo5_consumers, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 368 | }; |
| 369 | |
| 370 | static struct regulator_init_data goni_ldo6_data = { |
| 371 | .constraints = { |
| 372 | .name = "VCC_3.3V", |
| 373 | .min_uV = 3300000, |
| 374 | .max_uV = 3300000, |
| 375 | .apply_uV = 1, |
| 376 | }, |
| 377 | }; |
| 378 | |
| 379 | static struct regulator_init_data goni_ldo7_data = { |
| 380 | .constraints = { |
| 381 | .name = "VLCD_1.8V", |
| 382 | .min_uV = 1800000, |
| 383 | .max_uV = 1800000, |
| 384 | .apply_uV = 1, |
| 385 | .always_on = 1, |
| 386 | }, |
| 387 | }; |
| 388 | |
| 389 | static struct regulator_init_data goni_ldo8_data = { |
| 390 | .constraints = { |
Marek Szyprowski | d106133 | 2011-02-18 17:51:43 +0900 | [diff] [blame] | 391 | .name = "VUSB+VADC_3.3V", |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 392 | .min_uV = 3300000, |
| 393 | .max_uV = 3300000, |
| 394 | .apply_uV = 1, |
Marek Szyprowski | 1d017fe | 2011-02-24 10:06:25 +0900 | [diff] [blame] | 395 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 396 | }, |
Marek Szyprowski | 1d017fe | 2011-02-24 10:06:25 +0900 | [diff] [blame] | 397 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo8_consumers), |
| 398 | .consumer_supplies = goni_ldo8_consumers, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 399 | }; |
| 400 | |
| 401 | static struct regulator_init_data goni_ldo9_data = { |
| 402 | .constraints = { |
Marek Szyprowski | d106133 | 2011-02-18 17:51:43 +0900 | [diff] [blame] | 403 | .name = "VCC+VCAM_2.8V", |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 404 | .min_uV = 2800000, |
| 405 | .max_uV = 2800000, |
| 406 | .apply_uV = 1, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 407 | }, |
| 408 | }; |
| 409 | |
| 410 | static struct regulator_init_data goni_ldo10_data = { |
| 411 | .constraints = { |
| 412 | .name = "VPLL_1.1V", |
| 413 | .min_uV = 1100000, |
| 414 | .max_uV = 1100000, |
| 415 | .apply_uV = 1, |
| 416 | .boot_on = 1, |
| 417 | }, |
| 418 | }; |
| 419 | |
| 420 | static struct regulator_init_data goni_ldo11_data = { |
| 421 | .constraints = { |
| 422 | .name = "CAM_IO_2.8V", |
| 423 | .min_uV = 2800000, |
| 424 | .max_uV = 2800000, |
| 425 | .apply_uV = 1, |
Sylwester Nawrocki | 9a16afd | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 426 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 427 | }, |
Sylwester Nawrocki | 9a16afd | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 428 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo11_consumers), |
| 429 | .consumer_supplies = goni_ldo11_consumers, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 430 | }; |
| 431 | |
| 432 | static struct regulator_init_data goni_ldo12_data = { |
| 433 | .constraints = { |
| 434 | .name = "CAM_ISP_1.2V", |
| 435 | .min_uV = 1200000, |
| 436 | .max_uV = 1200000, |
| 437 | .apply_uV = 1, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 438 | }, |
| 439 | }; |
| 440 | |
| 441 | static struct regulator_init_data goni_ldo13_data = { |
| 442 | .constraints = { |
| 443 | .name = "CAM_A_2.8V", |
| 444 | .min_uV = 2800000, |
| 445 | .max_uV = 2800000, |
| 446 | .apply_uV = 1, |
Sylwester Nawrocki | 9a16afd | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 447 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 448 | }, |
Sylwester Nawrocki | 9a16afd | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 449 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo13_consumers), |
| 450 | .consumer_supplies = goni_ldo13_consumers, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 451 | }; |
| 452 | |
| 453 | static struct regulator_init_data goni_ldo14_data = { |
| 454 | .constraints = { |
| 455 | .name = "CAM_CIF_1.8V", |
| 456 | .min_uV = 1800000, |
| 457 | .max_uV = 1800000, |
| 458 | .apply_uV = 1, |
Sylwester Nawrocki | 9a16afd | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 459 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 460 | }, |
Sylwester Nawrocki | 9a16afd | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 461 | .num_consumer_supplies = ARRAY_SIZE(goni_ldo14_consumers), |
| 462 | .consumer_supplies = goni_ldo14_consumers, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 463 | }; |
| 464 | |
| 465 | static struct regulator_init_data goni_ldo15_data = { |
| 466 | .constraints = { |
| 467 | .name = "CAM_AF_3.3V", |
| 468 | .min_uV = 3300000, |
| 469 | .max_uV = 3300000, |
| 470 | .apply_uV = 1, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 471 | }, |
| 472 | }; |
| 473 | |
| 474 | static struct regulator_init_data goni_ldo16_data = { |
| 475 | .constraints = { |
| 476 | .name = "VMIPI_1.8V", |
| 477 | .min_uV = 1800000, |
| 478 | .max_uV = 1800000, |
| 479 | .apply_uV = 1, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 480 | }, |
| 481 | }; |
| 482 | |
| 483 | static struct regulator_init_data goni_ldo17_data = { |
| 484 | .constraints = { |
| 485 | .name = "VCC_3.0V_LCD", |
| 486 | .min_uV = 3000000, |
| 487 | .max_uV = 3000000, |
| 488 | .apply_uV = 1, |
| 489 | .always_on = 1, |
| 490 | }, |
| 491 | }; |
| 492 | |
| 493 | /* BUCK */ |
Kukjin Kim | d3f9c57 | 2011-01-28 18:22:10 +0900 | [diff] [blame] | 494 | static struct regulator_consumer_supply buck1_consumer = |
| 495 | REGULATOR_SUPPLY("vddarm", NULL); |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 496 | |
Kukjin Kim | d3f9c57 | 2011-01-28 18:22:10 +0900 | [diff] [blame] | 497 | static struct regulator_consumer_supply buck2_consumer = |
| 498 | REGULATOR_SUPPLY("vddint", NULL); |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 499 | |
Tomasz Stanislawski | b74f2fb | 2011-09-16 18:48:52 +0900 | [diff] [blame] | 500 | static struct regulator_consumer_supply buck3_consumer = |
| 501 | REGULATOR_SUPPLY("vdet", "s5p-sdo"); |
| 502 | |
| 503 | |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 504 | static struct regulator_init_data goni_buck1_data = { |
| 505 | .constraints = { |
| 506 | .name = "VARM_1.2V", |
| 507 | .min_uV = 1200000, |
| 508 | .max_uV = 1200000, |
| 509 | .apply_uV = 1, |
| 510 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 511 | REGULATOR_CHANGE_STATUS, |
| 512 | }, |
Kukjin Kim | d3f9c57 | 2011-01-28 18:22:10 +0900 | [diff] [blame] | 513 | .num_consumer_supplies = 1, |
| 514 | .consumer_supplies = &buck1_consumer, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 515 | }; |
| 516 | |
| 517 | static struct regulator_init_data goni_buck2_data = { |
| 518 | .constraints = { |
| 519 | .name = "VINT_1.2V", |
| 520 | .min_uV = 1200000, |
| 521 | .max_uV = 1200000, |
| 522 | .apply_uV = 1, |
| 523 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 524 | REGULATOR_CHANGE_STATUS, |
| 525 | }, |
Kukjin Kim | d3f9c57 | 2011-01-28 18:22:10 +0900 | [diff] [blame] | 526 | .num_consumer_supplies = 1, |
| 527 | .consumer_supplies = &buck2_consumer, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 528 | }; |
| 529 | |
| 530 | static struct regulator_init_data goni_buck3_data = { |
| 531 | .constraints = { |
| 532 | .name = "VCC_1.8V", |
| 533 | .min_uV = 1800000, |
| 534 | .max_uV = 1800000, |
| 535 | .apply_uV = 1, |
| 536 | .state_mem = { |
| 537 | .enabled = 1, |
| 538 | }, |
| 539 | }, |
Tomasz Stanislawski | b74f2fb | 2011-09-16 18:48:52 +0900 | [diff] [blame] | 540 | .num_consumer_supplies = 1, |
| 541 | .consumer_supplies = &buck3_consumer, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 542 | }; |
| 543 | |
| 544 | static struct regulator_init_data goni_buck4_data = { |
| 545 | .constraints = { |
| 546 | .name = "CAM_CORE_1.2V", |
| 547 | .min_uV = 1200000, |
| 548 | .max_uV = 1200000, |
| 549 | .apply_uV = 1, |
| 550 | .always_on = 1, |
| 551 | }, |
| 552 | }; |
| 553 | |
| 554 | static struct max8998_regulator_data goni_regulators[] = { |
| 555 | { MAX8998_LDO2, &goni_ldo2_data }, |
| 556 | { MAX8998_LDO3, &goni_ldo3_data }, |
| 557 | { MAX8998_LDO4, &goni_ldo4_data }, |
| 558 | { MAX8998_LDO5, &goni_ldo5_data }, |
| 559 | { MAX8998_LDO6, &goni_ldo6_data }, |
| 560 | { MAX8998_LDO7, &goni_ldo7_data }, |
| 561 | { MAX8998_LDO8, &goni_ldo8_data }, |
| 562 | { MAX8998_LDO9, &goni_ldo9_data }, |
| 563 | { MAX8998_LDO10, &goni_ldo10_data }, |
| 564 | { MAX8998_LDO11, &goni_ldo11_data }, |
| 565 | { MAX8998_LDO12, &goni_ldo12_data }, |
| 566 | { MAX8998_LDO13, &goni_ldo13_data }, |
| 567 | { MAX8998_LDO14, &goni_ldo14_data }, |
| 568 | { MAX8998_LDO15, &goni_ldo15_data }, |
| 569 | { MAX8998_LDO16, &goni_ldo16_data }, |
| 570 | { MAX8998_LDO17, &goni_ldo17_data }, |
| 571 | { MAX8998_BUCK1, &goni_buck1_data }, |
| 572 | { MAX8998_BUCK2, &goni_buck2_data }, |
| 573 | { MAX8998_BUCK3, &goni_buck3_data }, |
| 574 | { MAX8998_BUCK4, &goni_buck4_data }, |
| 575 | }; |
| 576 | |
| 577 | static struct max8998_platform_data goni_max8998_pdata = { |
| 578 | .num_regulators = ARRAY_SIZE(goni_regulators), |
| 579 | .regulators = goni_regulators, |
Marek Szyprowski | cb18688 | 2010-12-17 14:47:42 +0900 | [diff] [blame] | 580 | .buck1_set1 = S5PV210_GPH0(3), |
| 581 | .buck1_set2 = S5PV210_GPH0(4), |
| 582 | .buck2_set3 = S5PV210_GPH0(5), |
Marek Szyprowski | 979f395 | 2011-02-18 17:47:34 +0900 | [diff] [blame] | 583 | .buck1_voltage1 = 1200000, |
| 584 | .buck1_voltage2 = 1200000, |
| 585 | .buck1_voltage3 = 1200000, |
| 586 | .buck1_voltage4 = 1200000, |
| 587 | .buck2_voltage1 = 1200000, |
| 588 | .buck2_voltage2 = 1200000, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 589 | }; |
| 590 | #endif |
| 591 | |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 592 | static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = { |
Kukjin Kim | d3f9c57 | 2011-01-28 18:22:10 +0900 | [diff] [blame] | 593 | REGULATOR_SUPPLY("DBVDD", "5-001a"), |
| 594 | REGULATOR_SUPPLY("AVDD2", "5-001a"), |
| 595 | REGULATOR_SUPPLY("CPVDD", "5-001a"), |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 596 | }; |
| 597 | |
| 598 | static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = { |
Kukjin Kim | d3f9c57 | 2011-01-28 18:22:10 +0900 | [diff] [blame] | 599 | REGULATOR_SUPPLY("SPKVDD1", "5-001a"), |
| 600 | REGULATOR_SUPPLY("SPKVDD2", "5-001a"), |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 601 | }; |
| 602 | |
| 603 | static struct regulator_init_data wm8994_fixed_voltage0_init_data = { |
| 604 | .constraints = { |
| 605 | .always_on = 1, |
| 606 | }, |
| 607 | .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage0_supplies), |
| 608 | .consumer_supplies = wm8994_fixed_voltage0_supplies, |
| 609 | }; |
| 610 | |
| 611 | static struct regulator_init_data wm8994_fixed_voltage1_init_data = { |
| 612 | .constraints = { |
| 613 | .always_on = 1, |
| 614 | }, |
| 615 | .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage1_supplies), |
| 616 | .consumer_supplies = wm8994_fixed_voltage1_supplies, |
| 617 | }; |
| 618 | |
| 619 | static struct fixed_voltage_config wm8994_fixed_voltage0_config = { |
| 620 | .supply_name = "VCC_1.8V_PDA", |
| 621 | .microvolts = 1800000, |
| 622 | .gpio = -EINVAL, |
| 623 | .init_data = &wm8994_fixed_voltage0_init_data, |
| 624 | }; |
| 625 | |
| 626 | static struct fixed_voltage_config wm8994_fixed_voltage1_config = { |
| 627 | .supply_name = "V_BAT", |
| 628 | .microvolts = 3700000, |
| 629 | .gpio = -EINVAL, |
| 630 | .init_data = &wm8994_fixed_voltage1_init_data, |
| 631 | }; |
| 632 | |
| 633 | static struct platform_device wm8994_fixed_voltage0 = { |
| 634 | .name = "reg-fixed-voltage", |
| 635 | .id = 0, |
| 636 | .dev = { |
| 637 | .platform_data = &wm8994_fixed_voltage0_config, |
| 638 | }, |
| 639 | }; |
| 640 | |
| 641 | static struct platform_device wm8994_fixed_voltage1 = { |
| 642 | .name = "reg-fixed-voltage", |
| 643 | .id = 1, |
| 644 | .dev = { |
| 645 | .platform_data = &wm8994_fixed_voltage1_config, |
| 646 | }, |
| 647 | }; |
| 648 | |
Kukjin Kim | d3f9c57 | 2011-01-28 18:22:10 +0900 | [diff] [blame] | 649 | static struct regulator_consumer_supply wm8994_avdd1_supply = |
| 650 | REGULATOR_SUPPLY("AVDD1", "5-001a"); |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 651 | |
Kukjin Kim | d3f9c57 | 2011-01-28 18:22:10 +0900 | [diff] [blame] | 652 | static struct regulator_consumer_supply wm8994_dcvdd_supply = |
| 653 | REGULATOR_SUPPLY("DCVDD", "5-001a"); |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 654 | |
| 655 | static struct regulator_init_data wm8994_ldo1_data = { |
| 656 | .constraints = { |
| 657 | .name = "AVDD1_3.0V", |
| 658 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 659 | }, |
| 660 | .num_consumer_supplies = 1, |
| 661 | .consumer_supplies = &wm8994_avdd1_supply, |
| 662 | }; |
| 663 | |
| 664 | static struct regulator_init_data wm8994_ldo2_data = { |
| 665 | .constraints = { |
| 666 | .name = "DCVDD_1.0V", |
| 667 | }, |
| 668 | .num_consumer_supplies = 1, |
| 669 | .consumer_supplies = &wm8994_dcvdd_supply, |
| 670 | }; |
| 671 | |
| 672 | static struct wm8994_pdata wm8994_platform_data = { |
| 673 | /* configure gpio1 function: 0x0001(Logic level input/output) */ |
| 674 | .gpio_defaults[0] = 0x0001, |
| 675 | /* configure gpio3/4/5/7 function for AIF2 voice */ |
| 676 | .gpio_defaults[2] = 0x8100, |
| 677 | .gpio_defaults[3] = 0x8100, |
| 678 | .gpio_defaults[4] = 0x8100, |
| 679 | .gpio_defaults[6] = 0x0100, |
| 680 | /* configure gpio8/9/10/11 function for AIF3 BT */ |
| 681 | .gpio_defaults[7] = 0x8100, |
| 682 | .gpio_defaults[8] = 0x0100, |
| 683 | .gpio_defaults[9] = 0x0100, |
| 684 | .gpio_defaults[10] = 0x0100, |
Kukjin Kim | 7049932 | 2012-04-05 15:48:25 -0700 | [diff] [blame] | 685 | .ldo[0] = { S5PV210_MP03(6), &wm8994_ldo1_data }, /* XM0FRNB_2 */ |
| 686 | .ldo[1] = { 0, &wm8994_ldo2_data }, |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 687 | }; |
| 688 | |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 689 | /* GPIO I2C PMIC */ |
| 690 | #define AP_I2C_GPIO_PMIC_BUS_4 4 |
| 691 | static struct i2c_gpio_platform_data goni_i2c_gpio_pmic_data = { |
| 692 | .sda_pin = S5PV210_GPJ4(0), /* XMSMCSN */ |
| 693 | .scl_pin = S5PV210_GPJ4(3), /* XMSMIRQN */ |
| 694 | }; |
| 695 | |
| 696 | static struct platform_device goni_i2c_gpio_pmic = { |
| 697 | .name = "i2c-gpio", |
| 698 | .id = AP_I2C_GPIO_PMIC_BUS_4, |
| 699 | .dev = { |
| 700 | .platform_data = &goni_i2c_gpio_pmic_data, |
| 701 | }, |
| 702 | }; |
| 703 | |
| 704 | static struct i2c_board_info i2c_gpio_pmic_devs[] __initdata = { |
| 705 | #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE) |
| 706 | { |
| 707 | /* 0xCC when SRAD = 0 */ |
| 708 | I2C_BOARD_INFO("max8998", 0xCC >> 1), |
| 709 | .platform_data = &goni_max8998_pdata, |
| 710 | }, |
| 711 | #endif |
| 712 | }; |
| 713 | |
Chanwoo Choi | 5112267 | 2010-10-14 15:02:44 +0900 | [diff] [blame] | 714 | /* GPIO I2C AP 1.8V */ |
| 715 | #define AP_I2C_GPIO_BUS_5 5 |
| 716 | static struct i2c_gpio_platform_data goni_i2c_gpio5_data = { |
| 717 | .sda_pin = S5PV210_MP05(3), /* XM0ADDR_11 */ |
| 718 | .scl_pin = S5PV210_MP05(2), /* XM0ADDR_10 */ |
| 719 | }; |
| 720 | |
| 721 | static struct platform_device goni_i2c_gpio5 = { |
| 722 | .name = "i2c-gpio", |
| 723 | .id = AP_I2C_GPIO_BUS_5, |
| 724 | .dev = { |
| 725 | .platform_data = &goni_i2c_gpio5_data, |
| 726 | }, |
| 727 | }; |
| 728 | |
| 729 | static struct i2c_board_info i2c_gpio5_devs[] __initdata = { |
| 730 | { |
| 731 | /* CS/ADDR = low 0x34 (FYI: high = 0x36) */ |
| 732 | I2C_BOARD_INFO("wm8994", 0x1a), |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 733 | .platform_data = &wm8994_platform_data, |
Chanwoo Choi | 5112267 | 2010-10-14 15:02:44 +0900 | [diff] [blame] | 734 | }, |
| 735 | }; |
| 736 | |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 737 | /* PMIC Power button */ |
| 738 | static struct gpio_keys_button goni_gpio_keys_table[] = { |
| 739 | { |
| 740 | .code = KEY_POWER, |
| 741 | .gpio = S5PV210_GPH2(6), |
| 742 | .desc = "gpio-keys: KEY_POWER", |
| 743 | .type = EV_KEY, |
| 744 | .active_low = 1, |
| 745 | .wakeup = 1, |
| 746 | .debounce_interval = 1, |
| 747 | }, |
| 748 | }; |
| 749 | |
| 750 | static struct gpio_keys_platform_data goni_gpio_keys_data = { |
| 751 | .buttons = goni_gpio_keys_table, |
| 752 | .nbuttons = ARRAY_SIZE(goni_gpio_keys_table), |
| 753 | }; |
| 754 | |
| 755 | static struct platform_device goni_device_gpiokeys = { |
| 756 | .name = "gpio-keys", |
| 757 | .dev = { |
| 758 | .platform_data = &goni_gpio_keys_data, |
| 759 | }, |
| 760 | }; |
| 761 | |
| 762 | static void __init goni_pmic_init(void) |
| 763 | { |
| 764 | /* AP_PMIC_IRQ: EINT7 */ |
| 765 | s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_SFN(0xf)); |
| 766 | s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_UP); |
| 767 | |
| 768 | /* nPower: EINT22 */ |
| 769 | s3c_gpio_cfgpin(S5PV210_GPH2(6), S3C_GPIO_SFN(0xf)); |
| 770 | s3c_gpio_setpull(S5PV210_GPH2(6), S3C_GPIO_PULL_UP); |
| 771 | } |
| 772 | |
Marek Szyprowski | 19b90c7 | 2010-08-05 18:00:18 +0900 | [diff] [blame] | 773 | /* MoviNAND */ |
| 774 | static struct s3c_sdhci_platdata goni_hsmmc0_data __initdata = { |
| 775 | .max_width = 4, |
| 776 | .cd_type = S3C_SDHCI_CD_PERMANENT, |
| 777 | }; |
| 778 | |
| 779 | /* Wireless LAN */ |
| 780 | static struct s3c_sdhci_platdata goni_hsmmc1_data __initdata = { |
| 781 | .max_width = 4, |
| 782 | .cd_type = S3C_SDHCI_CD_EXTERNAL, |
| 783 | /* ext_cd_{init,cleanup} callbacks will be added later */ |
| 784 | }; |
| 785 | |
| 786 | /* External Flash */ |
| 787 | #define GONI_EXT_FLASH_EN S5PV210_MP05(4) |
| 788 | #define GONI_EXT_FLASH_CD S5PV210_GPH3(4) |
| 789 | static struct s3c_sdhci_platdata goni_hsmmc2_data __initdata = { |
| 790 | .max_width = 4, |
| 791 | .cd_type = S3C_SDHCI_CD_GPIO, |
| 792 | .ext_cd_gpio = GONI_EXT_FLASH_CD, |
| 793 | .ext_cd_gpio_invert = 1, |
| 794 | }; |
| 795 | |
Marek Szyprowski | e9dde6f1 | 2010-09-29 22:05:19 +0900 | [diff] [blame] | 796 | static struct regulator_consumer_supply mmc2_supplies[] = { |
| 797 | REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"), |
| 798 | }; |
| 799 | |
| 800 | static struct regulator_init_data mmc2_fixed_voltage_init_data = { |
| 801 | .constraints = { |
| 802 | .name = "V_TF_2.8V", |
| 803 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
| 804 | }, |
| 805 | .num_consumer_supplies = ARRAY_SIZE(mmc2_supplies), |
| 806 | .consumer_supplies = mmc2_supplies, |
| 807 | }; |
| 808 | |
| 809 | static struct fixed_voltage_config mmc2_fixed_voltage_config = { |
| 810 | .supply_name = "EXT_FLASH_EN", |
| 811 | .microvolts = 2800000, |
| 812 | .gpio = GONI_EXT_FLASH_EN, |
| 813 | .enable_high = true, |
| 814 | .init_data = &mmc2_fixed_voltage_init_data, |
| 815 | }; |
| 816 | |
| 817 | static struct platform_device mmc2_fixed_voltage = { |
| 818 | .name = "reg-fixed-voltage", |
| 819 | .id = 2, |
| 820 | .dev = { |
| 821 | .platform_data = &mmc2_fixed_voltage_config, |
| 822 | }, |
| 823 | }; |
| 824 | |
Marek Szyprowski | 19b90c7 | 2010-08-05 18:00:18 +0900 | [diff] [blame] | 825 | static void goni_setup_sdhci(void) |
| 826 | { |
Marek Szyprowski | 19b90c7 | 2010-08-05 18:00:18 +0900 | [diff] [blame] | 827 | s3c_sdhci0_set_platdata(&goni_hsmmc0_data); |
| 828 | s3c_sdhci1_set_platdata(&goni_hsmmc1_data); |
| 829 | s3c_sdhci2_set_platdata(&goni_hsmmc2_data); |
| 830 | }; |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 831 | |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 832 | static struct noon010pc30_platform_data noon010pc30_pldata = { |
| 833 | .clk_rate = 16000000UL, |
| 834 | .gpio_nreset = S5PV210_GPB(2), /* CAM_CIF_NRST */ |
| 835 | .gpio_nstby = S5PV210_GPB(0), /* CAM_CIF_NSTBY */ |
| 836 | }; |
| 837 | |
| 838 | static struct i2c_board_info noon010pc30_board_info = { |
| 839 | I2C_BOARD_INFO("NOON010PC30", 0x60 >> 1), |
| 840 | .platform_data = &noon010pc30_pldata, |
| 841 | }; |
| 842 | |
Sylwester Nawrocki | 56bc911 | 2013-02-01 15:00:40 -0300 | [diff] [blame] | 843 | static struct fimc_source_info goni_camera_sensors[] = { |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 844 | { |
| 845 | .mux_id = 0, |
| 846 | .flags = V4L2_MBUS_PCLK_SAMPLE_FALLING | |
| 847 | V4L2_MBUS_VSYNC_ACTIVE_LOW, |
Arnd Bergmann | 01ffe95 | 2013-02-14 23:11:33 +0100 | [diff] [blame] | 848 | .fimc_bus_type = FIMC_BUS_TYPE_ITU_601, |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 849 | .board_info = &noon010pc30_board_info, |
| 850 | .i2c_bus_num = 0, |
| 851 | .clk_frequency = 16000000UL, |
| 852 | }, |
| 853 | }; |
| 854 | |
Kukjin Kim | 85fd178 | 2012-01-21 11:10:31 +0900 | [diff] [blame] | 855 | static struct s5p_platform_fimc goni_fimc_md_platdata __initdata = { |
Sylwester Nawrocki | 56bc911 | 2013-02-01 15:00:40 -0300 | [diff] [blame] | 856 | .source_info = goni_camera_sensors, |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 857 | .num_clients = ARRAY_SIZE(goni_camera_sensors), |
| 858 | }; |
| 859 | |
Sachin Kamat | d633ada | 2012-07-12 17:48:57 +0900 | [diff] [blame] | 860 | /* Audio device */ |
| 861 | static struct platform_device goni_device_audio = { |
| 862 | .name = "smdk-audio", |
| 863 | .id = -1, |
| 864 | }; |
| 865 | |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 866 | static struct platform_device *goni_devices[] __initdata = { |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 867 | &s3c_device_fb, |
Kukjin Kim | 13904fb | 2010-08-27 13:56:54 +0900 | [diff] [blame] | 868 | &s5p_device_onenand, |
Marek Szyprowski | 8415d5c | 2010-10-04 16:39:20 +0900 | [diff] [blame] | 869 | &goni_spi_gpio, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 870 | &goni_i2c_gpio_pmic, |
Chanwoo Choi | 5112267 | 2010-10-14 15:02:44 +0900 | [diff] [blame] | 871 | &goni_i2c_gpio5, |
Sachin Kamat | d633ada | 2012-07-12 17:48:57 +0900 | [diff] [blame] | 872 | &goni_device_audio, |
Marek Szyprowski | e9dde6f1 | 2010-09-29 22:05:19 +0900 | [diff] [blame] | 873 | &mmc2_fixed_voltage, |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 874 | &goni_device_gpiokeys, |
Kamil Debski | 66eb123 | 2011-07-21 16:43:14 +0900 | [diff] [blame] | 875 | &s5p_device_mfc, |
| 876 | &s5p_device_mfc_l, |
| 877 | &s5p_device_mfc_r, |
Tomasz Stanislawski | b74f2fb | 2011-09-16 18:48:52 +0900 | [diff] [blame] | 878 | &s5p_device_mixer, |
| 879 | &s5p_device_sdo, |
Sylwester Nawrocki | 9c4f0a3 | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 880 | &s3c_device_i2c0, |
Sylwester Nawrocki | 9f488c6 | 2010-08-09 16:55:34 +0900 | [diff] [blame] | 881 | &s5p_device_fimc0, |
| 882 | &s5p_device_fimc1, |
| 883 | &s5p_device_fimc2, |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 884 | &s5p_device_fimc_md, |
Marek Szyprowski | 19b90c7 | 2010-08-05 18:00:18 +0900 | [diff] [blame] | 885 | &s3c_device_hsmmc0, |
| 886 | &s3c_device_hsmmc1, |
| 887 | &s3c_device_hsmmc2, |
Chanwoo Choi | 6c29e71 | 2010-10-14 16:00:42 +0900 | [diff] [blame] | 888 | &s5pv210_device_iis0, |
Marek Szyprowski | d5889d5 | 2010-09-30 20:59:46 +0900 | [diff] [blame] | 889 | &s3c_device_usb_hsotg, |
Joonyoung Shim | 2a55558 | 2010-09-09 08:17:43 +0900 | [diff] [blame] | 890 | &samsung_device_keypad, |
Marek Szyprowski | 528ef1b | 2010-10-04 16:39:22 +0900 | [diff] [blame] | 891 | &s3c_device_i2c1, |
Marek Szyprowski | b4a0dca | 2010-10-04 18:38:12 +0900 | [diff] [blame] | 892 | &s3c_device_i2c2, |
Chanwoo Choi | 8084979 | 2010-10-14 17:25:57 +0900 | [diff] [blame] | 893 | &wm8994_fixed_voltage0, |
| 894 | &wm8994_fixed_voltage1, |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 895 | }; |
| 896 | |
Chanwoo Choi | 6c29e71 | 2010-10-14 16:00:42 +0900 | [diff] [blame] | 897 | static void __init goni_sound_init(void) |
| 898 | { |
| 899 | /* Ths main clock of WM8994 codec uses the output of CLKOUT pin. |
| 900 | * The CLKOUT[9:8] set to 0x3(XUSBXTI) of 0xE010E000(OTHERS) |
| 901 | * because it needs 24MHz clock to operate WM8994 codec. |
| 902 | */ |
| 903 | __raw_writel(__raw_readl(S5P_OTHERS) | (0x3 << 8), S5P_OTHERS); |
| 904 | } |
| 905 | |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 906 | static void __init goni_map_io(void) |
| 907 | { |
Kukjin Kim | 3fa754c | 2011-12-22 23:32:07 +0100 | [diff] [blame] | 908 | s5pv210_init_io(NULL, 0); |
Kukjin Kim | 2e27437 | 2012-07-12 18:03:52 +0900 | [diff] [blame] | 909 | s3c24xx_init_clocks(clk_xusbxti.rate); |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 910 | s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); |
Sangbeom Kim | 20780fc | 2011-03-12 08:02:12 +0900 | [diff] [blame] | 911 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 912 | } |
| 913 | |
Kamil Debski | 66eb123 | 2011-07-21 16:43:14 +0900 | [diff] [blame] | 914 | static void __init goni_reserve(void) |
| 915 | { |
| 916 | s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20); |
| 917 | } |
| 918 | |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 919 | static void __init goni_machine_init(void) |
| 920 | { |
Marek Szyprowski | 528ef1b | 2010-10-04 16:39:22 +0900 | [diff] [blame] | 921 | /* Radio: call before I2C 1 registeration */ |
| 922 | goni_radio_init(); |
| 923 | |
Sylwester Nawrocki | 9c4f0a3 | 2011-02-15 14:27:44 +0900 | [diff] [blame] | 924 | /* I2C0 */ |
| 925 | s3c_i2c0_set_platdata(NULL); |
| 926 | |
Marek Szyprowski | 528ef1b | 2010-10-04 16:39:22 +0900 | [diff] [blame] | 927 | /* I2C1 */ |
| 928 | s3c_i2c1_set_platdata(NULL); |
| 929 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
| 930 | |
Marek Szyprowski | b4a0dca | 2010-10-04 18:38:12 +0900 | [diff] [blame] | 931 | /* TSP: call before I2C 2 registeration */ |
| 932 | goni_tsp_init(); |
| 933 | |
| 934 | /* I2C2 */ |
| 935 | s3c_i2c2_set_platdata(&i2c2_data); |
| 936 | i2c_register_board_info(2, i2c2_devs, ARRAY_SIZE(i2c2_devs)); |
| 937 | |
Marek Szyprowski | ba149f3 | 2010-07-14 19:39:47 +0900 | [diff] [blame] | 938 | /* PMIC */ |
| 939 | goni_pmic_init(); |
| 940 | i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs, |
| 941 | ARRAY_SIZE(i2c_gpio_pmic_devs)); |
Marek Szyprowski | 19b90c7 | 2010-08-05 18:00:18 +0900 | [diff] [blame] | 942 | /* SDHCI */ |
| 943 | goni_setup_sdhci(); |
| 944 | |
Chanwoo Choi | 5112267 | 2010-10-14 15:02:44 +0900 | [diff] [blame] | 945 | /* SOUND */ |
Chanwoo Choi | 6c29e71 | 2010-10-14 16:00:42 +0900 | [diff] [blame] | 946 | goni_sound_init(); |
Chanwoo Choi | 5112267 | 2010-10-14 15:02:44 +0900 | [diff] [blame] | 947 | i2c_register_board_info(AP_I2C_GPIO_BUS_5, i2c_gpio5_devs, |
| 948 | ARRAY_SIZE(i2c_gpio5_devs)); |
| 949 | |
Marek Szyprowski | 3965fde | 2010-07-14 19:38:18 +0900 | [diff] [blame] | 950 | /* FB */ |
| 951 | s3c_fb_set_platdata(&goni_lcd_pdata); |
| 952 | |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 953 | /* FIMC */ |
| 954 | s3c_set_platdata(&goni_fimc_md_platdata, sizeof(goni_fimc_md_platdata), |
| 955 | &s5p_device_fimc_md); |
| 956 | |
Lukasz Majewski | 460dcb0 | 2012-05-13 08:24:14 +0900 | [diff] [blame] | 957 | s3c_hsotg_set_platdata(&goni_hsotg_pdata); |
| 958 | |
Sylwester Nawrocki | 39aefab | 2011-09-27 07:18:55 +0900 | [diff] [blame] | 959 | goni_camera_init(); |
| 960 | |
Marek Szyprowski | 8415d5c | 2010-10-04 16:39:20 +0900 | [diff] [blame] | 961 | /* SPI */ |
| 962 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 963 | |
Joonyoung Shim | 2a55558 | 2010-09-09 08:17:43 +0900 | [diff] [blame] | 964 | /* KEYPAD */ |
| 965 | samsung_keypad_set_platdata(&keypad_data); |
| 966 | |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 967 | platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices)); |
| 968 | } |
| 969 | |
| 970 | MACHINE_START(GONI, "GONI") |
| 971 | /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */ |
Nicolas Pitre | 02350a1f | 2011-07-05 22:38:17 -0400 | [diff] [blame] | 972 | .atag_offset = 0x100, |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 973 | .init_irq = s5pv210_init_irq, |
| 974 | .map_io = goni_map_io, |
| 975 | .init_machine = goni_machine_init, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 976 | .init_time = s5p_timer_init, |
Kamil Debski | 66eb123 | 2011-07-21 16:43:14 +0900 | [diff] [blame] | 977 | .reserve = &goni_reserve, |
Russell King | 1f34f0e | 2011-12-22 23:36:02 +0100 | [diff] [blame] | 978 | .restart = s5pv210_restart, |
Joonyoung Shim | 2e57da4 | 2010-05-19 23:15:32 +0900 | [diff] [blame] | 979 | MACHINE_END |