diff options
Diffstat (limited to 'arch/arm/mach-exynos4')
-rw-r--r-- | arch/arm/mach-exynos4/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/cpuidle.c | 86 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/mach-nuri.c | 89 |
4 files changed, 178 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig index 805196207ce8..b92c1e557145 100644 --- a/arch/arm/mach-exynos4/Kconfig +++ b/arch/arm/mach-exynos4/Kconfig | |||
@@ -169,9 +169,11 @@ config MACH_NURI | |||
169 | select S3C_DEV_HSMMC2 | 169 | select S3C_DEV_HSMMC2 |
170 | select S3C_DEV_HSMMC3 | 170 | select S3C_DEV_HSMMC3 |
171 | select S3C_DEV_I2C1 | 171 | select S3C_DEV_I2C1 |
172 | select S3C_DEV_I2C3 | ||
172 | select S3C_DEV_I2C5 | 173 | select S3C_DEV_I2C5 |
173 | select S5P_DEV_USB_EHCI | 174 | select S5P_DEV_USB_EHCI |
174 | select EXYNOS4_SETUP_I2C1 | 175 | select EXYNOS4_SETUP_I2C1 |
176 | select EXYNOS4_SETUP_I2C3 | ||
175 | select EXYNOS4_SETUP_I2C5 | 177 | select EXYNOS4_SETUP_I2C5 |
176 | select EXYNOS4_SETUP_SDHCI | 178 | select EXYNOS4_SETUP_SDHCI |
177 | select SAMSUNG_DEV_PWM | 179 | select SAMSUNG_DEV_PWM |
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile index 777897551e42..683fc387c8af 100644 --- a/arch/arm/mach-exynos4/Makefile +++ b/arch/arm/mach-exynos4/Makefile | |||
@@ -16,6 +16,7 @@ obj-$(CONFIG_CPU_EXYNOS4210) += cpu.o init.o clock.o irq-combiner.o | |||
16 | obj-$(CONFIG_CPU_EXYNOS4210) += setup-i2c0.o gpiolib.o irq-eint.o dma.o | 16 | obj-$(CONFIG_CPU_EXYNOS4210) += setup-i2c0.o gpiolib.o irq-eint.o dma.o |
17 | obj-$(CONFIG_PM) += pm.o sleep.o | 17 | obj-$(CONFIG_PM) += pm.o sleep.o |
18 | obj-$(CONFIG_CPU_FREQ) += cpufreq.o | 18 | obj-$(CONFIG_CPU_FREQ) += cpufreq.o |
19 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | ||
19 | 20 | ||
20 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 21 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
21 | 22 | ||
diff --git a/arch/arm/mach-exynos4/cpuidle.c b/arch/arm/mach-exynos4/cpuidle.c new file mode 100644 index 000000000000..bf7e96f2793a --- /dev/null +++ b/arch/arm/mach-exynos4/cpuidle.c | |||
@@ -0,0 +1,86 @@ | |||
1 | /* linux/arch/arm/mach-exynos4/cpuidle.c | ||
2 | * | ||
3 | * Copyright (c) 2011 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/init.h> | ||
13 | #include <linux/cpuidle.h> | ||
14 | #include <linux/io.h> | ||
15 | |||
16 | #include <asm/proc-fns.h> | ||
17 | |||
18 | static int exynos4_enter_idle(struct cpuidle_device *dev, | ||
19 | struct cpuidle_state *state); | ||
20 | |||
21 | static struct cpuidle_state exynos4_cpuidle_set[] = { | ||
22 | [0] = { | ||
23 | .enter = exynos4_enter_idle, | ||
24 | .exit_latency = 1, | ||
25 | .target_residency = 100000, | ||
26 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
27 | .name = "IDLE", | ||
28 | .desc = "ARM clock gating(WFI)", | ||
29 | }, | ||
30 | }; | ||
31 | |||
32 | static DEFINE_PER_CPU(struct cpuidle_device, exynos4_cpuidle_device); | ||
33 | |||
34 | static struct cpuidle_driver exynos4_idle_driver = { | ||
35 | .name = "exynos4_idle", | ||
36 | .owner = THIS_MODULE, | ||
37 | }; | ||
38 | |||
39 | static int exynos4_enter_idle(struct cpuidle_device *dev, | ||
40 | struct cpuidle_state *state) | ||
41 | { | ||
42 | struct timeval before, after; | ||
43 | int idle_time; | ||
44 | |||
45 | local_irq_disable(); | ||
46 | do_gettimeofday(&before); | ||
47 | |||
48 | cpu_do_idle(); | ||
49 | |||
50 | do_gettimeofday(&after); | ||
51 | local_irq_enable(); | ||
52 | idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC + | ||
53 | (after.tv_usec - before.tv_usec); | ||
54 | |||
55 | return idle_time; | ||
56 | } | ||
57 | |||
58 | static int __init exynos4_init_cpuidle(void) | ||
59 | { | ||
60 | int i, max_cpuidle_state, cpu_id; | ||
61 | struct cpuidle_device *device; | ||
62 | |||
63 | cpuidle_register_driver(&exynos4_idle_driver); | ||
64 | |||
65 | for_each_cpu(cpu_id, cpu_online_mask) { | ||
66 | device = &per_cpu(exynos4_cpuidle_device, cpu_id); | ||
67 | device->cpu = cpu_id; | ||
68 | |||
69 | device->state_count = (sizeof(exynos4_cpuidle_set) / | ||
70 | sizeof(struct cpuidle_state)); | ||
71 | |||
72 | max_cpuidle_state = device->state_count; | ||
73 | |||
74 | for (i = 0; i < max_cpuidle_state; i++) { | ||
75 | memcpy(&device->states[i], &exynos4_cpuidle_set[i], | ||
76 | sizeof(struct cpuidle_state)); | ||
77 | } | ||
78 | |||
79 | if (cpuidle_register_device(device)) { | ||
80 | printk(KERN_ERR "CPUidle register device failed\n,"); | ||
81 | return -EIO; | ||
82 | } | ||
83 | } | ||
84 | return 0; | ||
85 | } | ||
86 | device_initcall(exynos4_init_cpuidle); | ||
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c index bb5d12f43af8..642702bb5b12 100644 --- a/arch/arm/mach-exynos4/mach-nuri.c +++ b/arch/arm/mach-exynos4/mach-nuri.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/serial_core.h> | 12 | #include <linux/serial_core.h> |
13 | #include <linux/input.h> | 13 | #include <linux/input.h> |
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/i2c/atmel_mxt_ts.h> | ||
15 | #include <linux/gpio_keys.h> | 16 | #include <linux/gpio_keys.h> |
16 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
17 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
@@ -32,6 +33,8 @@ | |||
32 | #include <plat/sdhci.h> | 33 | #include <plat/sdhci.h> |
33 | #include <plat/ehci.h> | 34 | #include <plat/ehci.h> |
34 | #include <plat/clock.h> | 35 | #include <plat/clock.h> |
36 | #include <plat/gpio-cfg.h> | ||
37 | #include <plat/iic.h> | ||
35 | 38 | ||
36 | #include <mach/map.h> | 39 | #include <mach/map.h> |
37 | 40 | ||
@@ -259,6 +262,88 @@ static struct i2c_board_info i2c1_devs[] __initdata = { | |||
259 | /* Gyro, To be updated */ | 262 | /* Gyro, To be updated */ |
260 | }; | 263 | }; |
261 | 264 | ||
265 | /* TSP */ | ||
266 | static u8 mxt_init_vals[] = { | ||
267 | /* MXT_GEN_COMMAND(6) */ | ||
268 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
269 | /* MXT_GEN_POWER(7) */ | ||
270 | 0x20, 0xff, 0x32, | ||
271 | /* MXT_GEN_ACQUIRE(8) */ | ||
272 | 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0x23, | ||
273 | /* MXT_TOUCH_MULTI(9) */ | ||
274 | 0x00, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00, | ||
275 | 0x00, 0x01, 0x01, 0x0e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, | ||
276 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
277 | 0x00, | ||
278 | /* MXT_TOUCH_KEYARRAY(15) */ | ||
279 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, | ||
280 | 0x00, | ||
281 | /* MXT_SPT_GPIOPWM(19) */ | ||
282 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
283 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
284 | /* MXT_PROCI_GRIPFACE(20) */ | ||
285 | 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x28, 0x04, | ||
286 | 0x0f, 0x0a, | ||
287 | /* MXT_PROCG_NOISE(22) */ | ||
288 | 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x23, 0x00, | ||
289 | 0x00, 0x05, 0x0f, 0x19, 0x23, 0x2d, 0x03, | ||
290 | /* MXT_TOUCH_PROXIMITY(23) */ | ||
291 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
292 | 0x00, 0x00, 0x00, 0x00, 0x00, | ||
293 | /* MXT_PROCI_ONETOUCH(24) */ | ||
294 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
295 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
296 | /* MXT_SPT_SELFTEST(25) */ | ||
297 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
298 | 0x00, 0x00, 0x00, 0x00, | ||
299 | /* MXT_PROCI_TWOTOUCH(27) */ | ||
300 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
301 | /* MXT_SPT_CTECONFIG(28) */ | ||
302 | 0x00, 0x00, 0x02, 0x08, 0x10, 0x00, | ||
303 | }; | ||
304 | |||
305 | static struct mxt_platform_data mxt_platform_data = { | ||
306 | .config = mxt_init_vals, | ||
307 | .config_length = ARRAY_SIZE(mxt_init_vals), | ||
308 | |||
309 | .x_line = 18, | ||
310 | .y_line = 11, | ||
311 | .x_size = 1024, | ||
312 | .y_size = 600, | ||
313 | .blen = 0x1, | ||
314 | .threshold = 0x28, | ||
315 | .voltage = 2800000, /* 2.8V */ | ||
316 | .orient = MXT_DIAGONAL_COUNTER, | ||
317 | .irqflags = IRQF_TRIGGER_FALLING, | ||
318 | }; | ||
319 | |||
320 | static struct s3c2410_platform_i2c i2c3_data __initdata = { | ||
321 | .flags = 0, | ||
322 | .bus_num = 3, | ||
323 | .slave_addr = 0x10, | ||
324 | .frequency = 400 * 1000, | ||
325 | .sda_delay = 100, | ||
326 | }; | ||
327 | |||
328 | static struct i2c_board_info i2c3_devs[] __initdata = { | ||
329 | { | ||
330 | I2C_BOARD_INFO("atmel_mxt_ts", 0x4a), | ||
331 | .platform_data = &mxt_platform_data, | ||
332 | .irq = IRQ_EINT(4), | ||
333 | }, | ||
334 | }; | ||
335 | |||
336 | static void __init nuri_tsp_init(void) | ||
337 | { | ||
338 | int gpio; | ||
339 | |||
340 | /* TOUCH_INT: XEINT_4 */ | ||
341 | gpio = EXYNOS4_GPX0(4); | ||
342 | gpio_request(gpio, "TOUCH_INT"); | ||
343 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
344 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); | ||
345 | } | ||
346 | |||
262 | /* GPIO I2C 5 (PMIC) */ | 347 | /* GPIO I2C 5 (PMIC) */ |
263 | static struct i2c_board_info i2c5_devs[] __initdata = { | 348 | static struct i2c_board_info i2c5_devs[] __initdata = { |
264 | /* max8997, To be updated */ | 349 | /* max8997, To be updated */ |
@@ -283,6 +368,7 @@ static struct platform_device *nuri_devices[] __initdata = { | |||
283 | &s3c_device_wdt, | 368 | &s3c_device_wdt, |
284 | &s3c_device_timer[0], | 369 | &s3c_device_timer[0], |
285 | &s5p_device_ehci, | 370 | &s5p_device_ehci, |
371 | &s3c_device_i2c3, | ||
286 | 372 | ||
287 | /* NURI Devices */ | 373 | /* NURI Devices */ |
288 | &nuri_gpio_keys, | 374 | &nuri_gpio_keys, |
@@ -300,8 +386,11 @@ static void __init nuri_map_io(void) | |||
300 | static void __init nuri_machine_init(void) | 386 | static void __init nuri_machine_init(void) |
301 | { | 387 | { |
302 | nuri_sdhci_init(); | 388 | nuri_sdhci_init(); |
389 | nuri_tsp_init(); | ||
303 | 390 | ||
304 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | 391 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
392 | s3c_i2c3_set_platdata(&i2c3_data); | ||
393 | i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); | ||
305 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); | 394 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); |
306 | 395 | ||
307 | nuri_ehci_init(); | 396 | nuri_ehci_init(); |