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