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