diff options
Diffstat (limited to 'arch/arm/mach-s3c2440')
-rw-r--r-- | arch/arm/mach-s3c2440/Kconfig | 13 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/irq.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-anubis.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-at2440evb.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-mini2440.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-osiris-dvs.c | 194 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-osiris.c | 47 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-rx3715.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-smdk2440.c | 2 |
10 files changed, 286 insertions, 29 deletions
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index ce7bfe4dde22..80879358eb2f 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig | |||
@@ -51,6 +51,19 @@ config MACH_OSIRIS | |||
51 | Say Y here if you are using the Simtec IM2440D20 module, also | 51 | Say Y here if you are using the Simtec IM2440D20 module, also |
52 | known as the Osiris. | 52 | known as the Osiris. |
53 | 53 | ||
54 | config MACH_OSIRIS_DVS | ||
55 | tristate "Simtec IM2440D20 (OSIRIS) Dynamic Voltage Scaling driver" | ||
56 | depends on MACH_OSIRIS | ||
57 | select TPS65010 | ||
58 | help | ||
59 | Say Y/M here if you want to have dynamic voltage scaling support | ||
60 | on the Simtec IM2440D20 (OSIRIS) module via the TPS65011. | ||
61 | |||
62 | The DVS driver alters the voltage supplied to the ARM core | ||
63 | depending on the frequency it is running at. The driver itself | ||
64 | does not do any of the frequency alteration, which is left up | ||
65 | to the cpufreq driver. | ||
66 | |||
54 | config MACH_RX3715 | 67 | config MACH_RX3715 |
55 | bool "HP iPAQ rx3715" | 68 | bool "HP iPAQ rx3715" |
56 | select CPU_S3C2440 | 69 | select CPU_S3C2440 |
diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile index bfadcf684a2a..5f3224531885 100644 --- a/arch/arm/mach-s3c2440/Makefile +++ b/arch/arm/mach-s3c2440/Makefile | |||
@@ -23,3 +23,7 @@ obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o | |||
23 | obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o | 23 | obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o |
24 | obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o | 24 | obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o |
25 | obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o | 25 | obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o |
26 | |||
27 | # extra machine support | ||
28 | |||
29 | obj-$(CONFIG_MACH_OSIRIS_DVS) += mach-osiris-dvs.o | ||
diff --git a/arch/arm/mach-s3c2440/irq.c b/arch/arm/mach-s3c2440/irq.c index 63c5ab65727f..0c049b95c378 100644 --- a/arch/arm/mach-s3c2440/irq.c +++ b/arch/arm/mach-s3c2440/irq.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/mach-s3c2440/irq.c | 1 | /* linux/arch/arm/mach-s3c2440/irq.c |
2 | * | 2 | * |
3 | * Copyright (c) 2003,2004 Simtec Electronics | 3 | * Copyright (c) 2003-2004 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c index 68f3870991bf..62a4c3eba97f 100644 --- a/arch/arm/mach-s3c2440/mach-anubis.c +++ b/arch/arm/mach-s3c2440/mach-anubis.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/mach-s3c2440/mach-anubis.c | 1 | /* linux/arch/arm/mach-s3c2440/mach-anubis.c |
2 | * | 2 | * |
3 | * Copyright (c) 2003-2005,2008 Simtec Electronics | 3 | * Copyright 2003-2009 Simtec Electronics |
4 | * http://armlinux.simtec.co.uk/ | 4 | * http://armlinux.simtec.co.uk/ |
5 | * Ben Dooks <ben@simtec.co.uk> | 5 | * Ben Dooks <ben@simtec.co.uk> |
6 | * | 6 | * |
@@ -53,8 +53,9 @@ | |||
53 | #include <plat/clock.h> | 53 | #include <plat/clock.h> |
54 | #include <plat/devs.h> | 54 | #include <plat/devs.h> |
55 | #include <plat/cpu.h> | 55 | #include <plat/cpu.h> |
56 | #include <plat/audio-simtec.h> | ||
56 | 57 | ||
57 | #define COPYRIGHT ", (c) 2005 Simtec Electronics" | 58 | #define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics" |
58 | 59 | ||
59 | static struct map_desc anubis_iodesc[] __initdata = { | 60 | static struct map_desc anubis_iodesc[] __initdata = { |
60 | /* ISA IO areas */ | 61 | /* ISA IO areas */ |
@@ -138,7 +139,7 @@ static int external_map[] = { 2 }; | |||
138 | static int chip0_map[] = { 0 }; | 139 | static int chip0_map[] = { 0 }; |
139 | static int chip1_map[] = { 1 }; | 140 | static int chip1_map[] = { 1 }; |
140 | 141 | ||
141 | static struct mtd_partition anubis_default_nand_part[] = { | 142 | static struct mtd_partition __initdata anubis_default_nand_part[] = { |
142 | [0] = { | 143 | [0] = { |
143 | .name = "Boot Agent", | 144 | .name = "Boot Agent", |
144 | .size = SZ_16K, | 145 | .size = SZ_16K, |
@@ -161,7 +162,7 @@ static struct mtd_partition anubis_default_nand_part[] = { | |||
161 | } | 162 | } |
162 | }; | 163 | }; |
163 | 164 | ||
164 | static struct mtd_partition anubis_default_nand_part_large[] = { | 165 | static struct mtd_partition __initdata anubis_default_nand_part_large[] = { |
165 | [0] = { | 166 | [0] = { |
166 | .name = "Boot Agent", | 167 | .name = "Boot Agent", |
167 | .size = SZ_128K, | 168 | .size = SZ_128K, |
@@ -191,7 +192,7 @@ static struct mtd_partition anubis_default_nand_part_large[] = { | |||
191 | * socket. | 192 | * socket. |
192 | */ | 193 | */ |
193 | 194 | ||
194 | static struct s3c2410_nand_set anubis_nand_sets[] = { | 195 | static struct s3c2410_nand_set __initdata anubis_nand_sets[] = { |
195 | [1] = { | 196 | [1] = { |
196 | .name = "External", | 197 | .name = "External", |
197 | .nr_chips = 1, | 198 | .nr_chips = 1, |
@@ -233,7 +234,7 @@ static void anubis_nand_select(struct s3c2410_nand_set *set, int slot) | |||
233 | __raw_writeb(tmp, ANUBIS_VA_CTRL1); | 234 | __raw_writeb(tmp, ANUBIS_VA_CTRL1); |
234 | } | 235 | } |
235 | 236 | ||
236 | static struct s3c2410_platform_nand anubis_nand_info = { | 237 | static struct s3c2410_platform_nand __initdata anubis_nand_info = { |
237 | .tacls = 25, | 238 | .tacls = 25, |
238 | .twrph0 = 55, | 239 | .twrph0 = 55, |
239 | .twrph1 = 40, | 240 | .twrph1 = 40, |
@@ -437,6 +438,17 @@ static struct i2c_board_info anubis_i2c_devs[] __initdata = { | |||
437 | } | 438 | } |
438 | }; | 439 | }; |
439 | 440 | ||
441 | /* Audio setup */ | ||
442 | static struct s3c24xx_audio_simtec_pdata __initdata anubis_audio = { | ||
443 | .have_mic = 1, | ||
444 | .have_lout = 1, | ||
445 | .output_cdclk = 1, | ||
446 | .use_mpllin = 1, | ||
447 | .amp_gpio = S3C2410_GPB(2), | ||
448 | .amp_gain[0] = S3C2410_GPD(10), | ||
449 | .amp_gain[1] = S3C2410_GPD(11), | ||
450 | }; | ||
451 | |||
440 | static void __init anubis_map_io(void) | 452 | static void __init anubis_map_io(void) |
441 | { | 453 | { |
442 | /* initialise the clocks */ | 454 | /* initialise the clocks */ |
@@ -454,8 +466,6 @@ static void __init anubis_map_io(void) | |||
454 | 466 | ||
455 | s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks)); | 467 | s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks)); |
456 | 468 | ||
457 | s3c_device_nand.dev.platform_data = &anubis_nand_info; | ||
458 | |||
459 | s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc)); | 469 | s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc)); |
460 | s3c24xx_init_clocks(0); | 470 | s3c24xx_init_clocks(0); |
461 | s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs)); | 471 | s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs)); |
@@ -476,6 +486,9 @@ static void __init anubis_map_io(void) | |||
476 | static void __init anubis_init(void) | 486 | static void __init anubis_init(void) |
477 | { | 487 | { |
478 | s3c_i2c0_set_platdata(NULL); | 488 | s3c_i2c0_set_platdata(NULL); |
489 | s3c_nand_set_platdata(&anubis_nand_info); | ||
490 | simtec_audio_add(NULL, false, &anubis_audio); | ||
491 | |||
479 | platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices)); | 492 | platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices)); |
480 | 493 | ||
481 | i2c_register_board_info(0, anubis_i2c_devs, | 494 | i2c_register_board_info(0, anubis_i2c_devs, |
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c index dfc7010935da..aa69290e04c6 100644 --- a/arch/arm/mach-s3c2440/mach-at2440evb.c +++ b/arch/arm/mach-s3c2440/mach-at2440evb.c | |||
@@ -96,7 +96,7 @@ static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = { | |||
96 | 96 | ||
97 | /* NAND Flash on AT2440EVB board */ | 97 | /* NAND Flash on AT2440EVB board */ |
98 | 98 | ||
99 | static struct mtd_partition at2440evb_default_nand_part[] = { | 99 | static struct mtd_partition __initdata at2440evb_default_nand_part[] = { |
100 | [0] = { | 100 | [0] = { |
101 | .name = "Boot Agent", | 101 | .name = "Boot Agent", |
102 | .size = SZ_256K, | 102 | .size = SZ_256K, |
@@ -114,7 +114,7 @@ static struct mtd_partition at2440evb_default_nand_part[] = { | |||
114 | }, | 114 | }, |
115 | }; | 115 | }; |
116 | 116 | ||
117 | static struct s3c2410_nand_set at2440evb_nand_sets[] = { | 117 | static struct s3c2410_nand_set __initdata at2440evb_nand_sets[] = { |
118 | [0] = { | 118 | [0] = { |
119 | .name = "nand", | 119 | .name = "nand", |
120 | .nr_chips = 1, | 120 | .nr_chips = 1, |
@@ -123,7 +123,7 @@ static struct s3c2410_nand_set at2440evb_nand_sets[] = { | |||
123 | }, | 123 | }, |
124 | }; | 124 | }; |
125 | 125 | ||
126 | static struct s3c2410_platform_nand at2440evb_nand_info = { | 126 | static struct s3c2410_platform_nand __initdata at2440evb_nand_info = { |
127 | .tacls = 25, | 127 | .tacls = 25, |
128 | .twrph0 = 55, | 128 | .twrph0 = 55, |
129 | .twrph1 = 40, | 129 | .twrph1 = 40, |
@@ -216,8 +216,6 @@ static struct platform_device *at2440evb_devices[] __initdata = { | |||
216 | 216 | ||
217 | static void __init at2440evb_map_io(void) | 217 | static void __init at2440evb_map_io(void) |
218 | { | 218 | { |
219 | s3c_device_nand.dev.platform_data = &at2440evb_nand_info; | ||
220 | s3c_device_sdi.name = "s3c2440-sdi"; | ||
221 | s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata; | 219 | s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata; |
222 | 220 | ||
223 | s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc)); | 221 | s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc)); |
@@ -228,6 +226,7 @@ static void __init at2440evb_map_io(void) | |||
228 | static void __init at2440evb_init(void) | 226 | static void __init at2440evb_init(void) |
229 | { | 227 | { |
230 | s3c24xx_fb_set_platdata(&at2440evb_fb_info); | 228 | s3c24xx_fb_set_platdata(&at2440evb_fb_info); |
229 | s3c_nand_set_platdata(&at2440evb_nand_info); | ||
231 | s3c_i2c0_set_platdata(NULL); | 230 | s3c_i2c0_set_platdata(NULL); |
232 | 231 | ||
233 | platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices)); | 232 | platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices)); |
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c index 1c3382fefdd2..547d4fc99131 100644 --- a/arch/arm/mach-s3c2440/mach-mini2440.c +++ b/arch/arm/mach-s3c2440/mach-mini2440.c | |||
@@ -532,7 +532,6 @@ static void __init mini2440_map_io(void) | |||
532 | s3c24xx_init_clocks(12000000); | 532 | s3c24xx_init_clocks(12000000); |
533 | s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs)); | 533 | s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs)); |
534 | 534 | ||
535 | s3c_device_nand.dev.platform_data = &mini2440_nand_info; | ||
536 | s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg; | 535 | s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg; |
537 | } | 536 | } |
538 | 537 | ||
@@ -677,8 +676,11 @@ static void __init mini2440_init(void) | |||
677 | printk("\n"); | 676 | printk("\n"); |
678 | s3c24xx_fb_set_platdata(&mini2440_fb_info); | 677 | s3c24xx_fb_set_platdata(&mini2440_fb_info); |
679 | } | 678 | } |
679 | |||
680 | s3c24xx_udc_set_platdata(&mini2440_udc_cfg); | 680 | s3c24xx_udc_set_platdata(&mini2440_udc_cfg); |
681 | s3c_nand_set_platdata(&mini2440_nand_info); | ||
681 | s3c_i2c0_set_platdata(NULL); | 682 | s3c_i2c0_set_platdata(NULL); |
683 | |||
682 | i2c_register_board_info(0, mini2440_i2c_devs, | 684 | i2c_register_board_info(0, mini2440_i2c_devs, |
683 | ARRAY_SIZE(mini2440_i2c_devs)); | 685 | ARRAY_SIZE(mini2440_i2c_devs)); |
684 | 686 | ||
diff --git a/arch/arm/mach-s3c2440/mach-osiris-dvs.c b/arch/arm/mach-s3c2440/mach-osiris-dvs.c new file mode 100644 index 000000000000..ad2792dfbee1 --- /dev/null +++ b/arch/arm/mach-s3c2440/mach-osiris-dvs.c | |||
@@ -0,0 +1,194 @@ | |||
1 | /* linux/arch/arm/mach-s3c2440/mach-osiris-dvs.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * Simtec Osiris Dynamic Voltage Scaling support. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/cpufreq.h> | ||
18 | #include <linux/gpio.h> | ||
19 | |||
20 | #include <linux/i2c/tps65010.h> | ||
21 | |||
22 | #include <plat/cpu-freq.h> | ||
23 | |||
24 | #define OSIRIS_GPIO_DVS S3C2410_GPB(5) | ||
25 | |||
26 | static bool dvs_en; | ||
27 | |||
28 | static void osiris_dvs_tps_setdvs(bool on) | ||
29 | { | ||
30 | unsigned vregs1 = 0, vdcdc2 = 0; | ||
31 | |||
32 | if (!on) { | ||
33 | vdcdc2 = TPS_VCORE_DISCH | TPS_LP_COREOFF; | ||
34 | vregs1 = TPS_LDO1_OFF; /* turn off in low-power mode */ | ||
35 | } | ||
36 | |||
37 | dvs_en = on; | ||
38 | vdcdc2 |= TPS_VCORE_1_3V | TPS_VCORE_LP_1_0V; | ||
39 | vregs1 |= TPS_LDO2_ENABLE | TPS_LDO1_ENABLE; | ||
40 | |||
41 | tps65010_config_vregs1(vregs1); | ||
42 | tps65010_config_vdcdc2(vdcdc2); | ||
43 | } | ||
44 | |||
45 | static bool is_dvs(struct s3c_freq *f) | ||
46 | { | ||
47 | /* at the moment, we assume ARMCLK = HCLK => DVS */ | ||
48 | return f->armclk == f->hclk; | ||
49 | } | ||
50 | |||
51 | /* keep track of current state */ | ||
52 | static bool cur_dvs = false; | ||
53 | |||
54 | static int osiris_dvs_notify(struct notifier_block *nb, | ||
55 | unsigned long val, void *data) | ||
56 | { | ||
57 | struct cpufreq_freqs *cf = data; | ||
58 | struct s3c_cpufreq_freqs *freqs = to_s3c_cpufreq(cf); | ||
59 | bool old_dvs = is_dvs(&freqs->old); | ||
60 | bool new_dvs = is_dvs(&freqs->new); | ||
61 | int ret = 0; | ||
62 | |||
63 | if (!dvs_en) | ||
64 | return 0; | ||
65 | |||
66 | printk(KERN_DEBUG "%s: old %ld,%ld new %ld,%ld\n", __func__, | ||
67 | freqs->old.armclk, freqs->old.hclk, | ||
68 | freqs->new.armclk, freqs->new.hclk); | ||
69 | |||
70 | switch (val) { | ||
71 | case CPUFREQ_PRECHANGE: | ||
72 | if (old_dvs & !new_dvs || | ||
73 | cur_dvs & !new_dvs) { | ||
74 | pr_debug("%s: exiting dvs\n", __func__); | ||
75 | cur_dvs = false; | ||
76 | gpio_set_value(OSIRIS_GPIO_DVS, 1); | ||
77 | } | ||
78 | break; | ||
79 | case CPUFREQ_POSTCHANGE: | ||
80 | if (!old_dvs & new_dvs || | ||
81 | !cur_dvs & new_dvs) { | ||
82 | pr_debug("entering dvs\n"); | ||
83 | cur_dvs = true; | ||
84 | gpio_set_value(OSIRIS_GPIO_DVS, 0); | ||
85 | } | ||
86 | break; | ||
87 | } | ||
88 | |||
89 | return ret; | ||
90 | } | ||
91 | |||
92 | static struct notifier_block osiris_dvs_nb = { | ||
93 | .notifier_call = osiris_dvs_notify, | ||
94 | }; | ||
95 | |||
96 | static int __devinit osiris_dvs_probe(struct platform_device *pdev) | ||
97 | { | ||
98 | int ret; | ||
99 | |||
100 | dev_info(&pdev->dev, "initialising\n"); | ||
101 | |||
102 | ret = gpio_request(OSIRIS_GPIO_DVS, "osiris-dvs"); | ||
103 | if (ret) { | ||
104 | dev_err(&pdev->dev, "cannot claim gpio\n"); | ||
105 | goto err_nogpio; | ||
106 | } | ||
107 | |||
108 | /* start with dvs disabled */ | ||
109 | gpio_direction_output(OSIRIS_GPIO_DVS, 1); | ||
110 | |||
111 | ret = cpufreq_register_notifier(&osiris_dvs_nb, | ||
112 | CPUFREQ_TRANSITION_NOTIFIER); | ||
113 | if (ret) { | ||
114 | dev_err(&pdev->dev, "failed to register with cpufreq\n"); | ||
115 | goto err_nofreq; | ||
116 | } | ||
117 | |||
118 | osiris_dvs_tps_setdvs(true); | ||
119 | |||
120 | return 0; | ||
121 | |||
122 | err_nofreq: | ||
123 | gpio_free(OSIRIS_GPIO_DVS); | ||
124 | |||
125 | err_nogpio: | ||
126 | return ret; | ||
127 | } | ||
128 | |||
129 | static int __devexit osiris_dvs_remove(struct platform_device *pdev) | ||
130 | { | ||
131 | dev_info(&pdev->dev, "exiting\n"); | ||
132 | |||
133 | /* disable any current dvs */ | ||
134 | gpio_set_value(OSIRIS_GPIO_DVS, 1); | ||
135 | osiris_dvs_tps_setdvs(false); | ||
136 | |||
137 | cpufreq_unregister_notifier(&osiris_dvs_nb, | ||
138 | CPUFREQ_TRANSITION_NOTIFIER); | ||
139 | |||
140 | gpio_free(OSIRIS_GPIO_DVS); | ||
141 | |||
142 | return 0; | ||
143 | } | ||
144 | |||
145 | /* the CONFIG_PM block is so small, it isn't worth actaully compiling it | ||
146 | * out if the configuration isn't set. */ | ||
147 | |||
148 | static int osiris_dvs_suspend(struct device *dev) | ||
149 | { | ||
150 | gpio_set_value(OSIRIS_GPIO_DVS, 1); | ||
151 | osiris_dvs_tps_setdvs(false); | ||
152 | cur_dvs = false; | ||
153 | |||
154 | return 0; | ||
155 | } | ||
156 | |||
157 | static int osiris_dvs_resume(struct device *dev) | ||
158 | { | ||
159 | osiris_dvs_tps_setdvs(true); | ||
160 | return 0; | ||
161 | } | ||
162 | |||
163 | static const struct dev_pm_ops osiris_dvs_pm = { | ||
164 | .suspend = osiris_dvs_suspend, | ||
165 | .resume = osiris_dvs_resume, | ||
166 | }; | ||
167 | |||
168 | static struct platform_driver osiris_dvs_driver = { | ||
169 | .probe = osiris_dvs_probe, | ||
170 | .remove = __devexit_p(osiris_dvs_remove), | ||
171 | .driver = { | ||
172 | .name = "osiris-dvs", | ||
173 | .owner = THIS_MODULE, | ||
174 | .pm = &osiris_dvs_pm, | ||
175 | }, | ||
176 | }; | ||
177 | |||
178 | static int __init osiris_dvs_init(void) | ||
179 | { | ||
180 | return platform_driver_register(&osiris_dvs_driver); | ||
181 | } | ||
182 | |||
183 | static void __exit osiris_dvs_exit(void) | ||
184 | { | ||
185 | platform_driver_unregister(&osiris_dvs_driver); | ||
186 | } | ||
187 | |||
188 | module_init(osiris_dvs_init); | ||
189 | module_exit(osiris_dvs_exit); | ||
190 | |||
191 | MODULE_DESCRIPTION("Simtec OSIRIS DVS support"); | ||
192 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | ||
193 | MODULE_LICENSE("GPL"); | ||
194 | MODULE_ALIAS("platform:osiris-dvs"); | ||
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c index 2105a41281a4..015dfb2a80da 100644 --- a/arch/arm/mach-s3c2440/mach-osiris.c +++ b/arch/arm/mach-s3c2440/mach-osiris.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/mach-s3c2440/mach-osiris.c | 1 | /* linux/arch/arm/mach-s3c2440/mach-osiris.c |
2 | * | 2 | * |
3 | * Copyright (c) 2005,2008 Simtec Electronics | 3 | * Copyright (c) 2005-2008 Simtec Electronics |
4 | * http://armlinux.simtec.co.uk/ | 4 | * http://armlinux.simtec.co.uk/ |
5 | * Ben Dooks <ben@simtec.co.uk> | 5 | * Ben Dooks <ben@simtec.co.uk> |
6 | * | 6 | * |
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | 25 | ||
26 | #include <linux/i2c/tps65010.h> | ||
27 | |||
26 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
28 | #include <asm/mach/irq.h> | 30 | #include <asm/mach/irq.h> |
@@ -148,7 +150,7 @@ static int external_map[] = { 2 }; | |||
148 | static int chip0_map[] = { 0 }; | 150 | static int chip0_map[] = { 0 }; |
149 | static int chip1_map[] = { 1 }; | 151 | static int chip1_map[] = { 1 }; |
150 | 152 | ||
151 | static struct mtd_partition osiris_default_nand_part[] = { | 153 | static struct mtd_partition __initdata osiris_default_nand_part[] = { |
152 | [0] = { | 154 | [0] = { |
153 | .name = "Boot Agent", | 155 | .name = "Boot Agent", |
154 | .size = SZ_16K, | 156 | .size = SZ_16K, |
@@ -171,7 +173,7 @@ static struct mtd_partition osiris_default_nand_part[] = { | |||
171 | } | 173 | } |
172 | }; | 174 | }; |
173 | 175 | ||
174 | static struct mtd_partition osiris_default_nand_part_large[] = { | 176 | static struct mtd_partition __initdata osiris_default_nand_part_large[] = { |
175 | [0] = { | 177 | [0] = { |
176 | .name = "Boot Agent", | 178 | .name = "Boot Agent", |
177 | .size = SZ_128K, | 179 | .size = SZ_128K, |
@@ -201,7 +203,7 @@ static struct mtd_partition osiris_default_nand_part_large[] = { | |||
201 | * socket. | 203 | * socket. |
202 | */ | 204 | */ |
203 | 205 | ||
204 | static struct s3c2410_nand_set osiris_nand_sets[] = { | 206 | static struct s3c2410_nand_set __initdata osiris_nand_sets[] = { |
205 | [1] = { | 207 | [1] = { |
206 | .name = "External", | 208 | .name = "External", |
207 | .nr_chips = 1, | 209 | .nr_chips = 1, |
@@ -243,7 +245,7 @@ static void osiris_nand_select(struct s3c2410_nand_set *set, int slot) | |||
243 | __raw_writeb(tmp, OSIRIS_VA_CTRL0); | 245 | __raw_writeb(tmp, OSIRIS_VA_CTRL0); |
244 | } | 246 | } |
245 | 247 | ||
246 | static struct s3c2410_platform_nand osiris_nand_info = { | 248 | static struct s3c2410_platform_nand __initdata osiris_nand_info = { |
247 | .tacls = 25, | 249 | .tacls = 25, |
248 | .twrph0 = 60, | 250 | .twrph0 = 60, |
249 | .twrph1 = 60, | 251 | .twrph1 = 60, |
@@ -326,12 +328,44 @@ static struct sys_device osiris_pm_sysdev = { | |||
326 | .cls = &osiris_pm_sysclass, | 328 | .cls = &osiris_pm_sysclass, |
327 | }; | 329 | }; |
328 | 330 | ||
331 | /* Link for DVS driver to TPS65011 */ | ||
332 | |||
333 | static void osiris_tps_release(struct device *dev) | ||
334 | { | ||
335 | /* static device, do not need to release anything */ | ||
336 | } | ||
337 | |||
338 | static struct platform_device osiris_tps_device = { | ||
339 | .name = "osiris-dvs", | ||
340 | .id = -1, | ||
341 | .dev.release = osiris_tps_release, | ||
342 | }; | ||
343 | |||
344 | static int osiris_tps_setup(struct i2c_client *client, void *context) | ||
345 | { | ||
346 | osiris_tps_device.dev.parent = &client->dev; | ||
347 | return platform_device_register(&osiris_tps_device); | ||
348 | } | ||
349 | |||
350 | static int osiris_tps_remove(struct i2c_client *client, void *context) | ||
351 | { | ||
352 | platform_device_unregister(&osiris_tps_device); | ||
353 | return 0; | ||
354 | } | ||
355 | |||
356 | static struct tps65010_board osiris_tps_board = { | ||
357 | .base = -1, /* GPIO can go anywhere at the moment */ | ||
358 | .setup = osiris_tps_setup, | ||
359 | .teardown = osiris_tps_remove, | ||
360 | }; | ||
361 | |||
329 | /* I2C devices fitted. */ | 362 | /* I2C devices fitted. */ |
330 | 363 | ||
331 | static struct i2c_board_info osiris_i2c_devs[] __initdata = { | 364 | static struct i2c_board_info osiris_i2c_devs[] __initdata = { |
332 | { | 365 | { |
333 | I2C_BOARD_INFO("tps65011", 0x48), | 366 | I2C_BOARD_INFO("tps65011", 0x48), |
334 | .irq = IRQ_EINT20, | 367 | .irq = IRQ_EINT20, |
368 | .platform_data = &osiris_tps_board, | ||
335 | }, | 369 | }, |
336 | }; | 370 | }; |
337 | 371 | ||
@@ -377,8 +411,6 @@ static void __init osiris_map_io(void) | |||
377 | 411 | ||
378 | s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks)); | 412 | s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks)); |
379 | 413 | ||
380 | s3c_device_nand.dev.platform_data = &osiris_nand_info; | ||
381 | |||
382 | s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc)); | 414 | s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc)); |
383 | s3c24xx_init_clocks(0); | 415 | s3c24xx_init_clocks(0); |
384 | s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs)); | 416 | s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs)); |
@@ -408,6 +440,7 @@ static void __init osiris_init(void) | |||
408 | sysdev_register(&osiris_pm_sysdev); | 440 | sysdev_register(&osiris_pm_sysdev); |
409 | 441 | ||
410 | s3c_i2c0_set_platdata(NULL); | 442 | s3c_i2c0_set_platdata(NULL); |
443 | s3c_nand_set_platdata(&osiris_nand_info); | ||
411 | 444 | ||
412 | s3c_cpufreq_setboard(&osiris_cpufreq); | 445 | s3c_cpufreq_setboard(&osiris_cpufreq); |
413 | 446 | ||
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c index bc8d8d1ebd1a..a952a13afb1f 100644 --- a/arch/arm/mach-s3c2440/mach-rx3715.c +++ b/arch/arm/mach-s3c2440/mach-rx3715.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/mach-s3c2440/mach-rx3715.c | 1 | /* linux/arch/arm/mach-s3c2440/mach-rx3715.c |
2 | * | 2 | * |
3 | * Copyright (c) 2003,2004 Simtec Electronics | 3 | * Copyright (c) 2003-2004 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
5 | * | 5 | * |
6 | * http://www.handhelds.org/projects/rx3715.html | 6 | * http://www.handhelds.org/projects/rx3715.html |
@@ -149,7 +149,7 @@ static struct s3c2410fb_mach_info rx3715_fb_info __initdata = { | |||
149 | .gpdup_mask = 0xffffffff, | 149 | .gpdup_mask = 0xffffffff, |
150 | }; | 150 | }; |
151 | 151 | ||
152 | static struct mtd_partition rx3715_nand_part[] = { | 152 | static struct mtd_partition __initdata rx3715_nand_part[] = { |
153 | [0] = { | 153 | [0] = { |
154 | .name = "Whole Flash", | 154 | .name = "Whole Flash", |
155 | .offset = 0, | 155 | .offset = 0, |
@@ -158,7 +158,7 @@ static struct mtd_partition rx3715_nand_part[] = { | |||
158 | } | 158 | } |
159 | }; | 159 | }; |
160 | 160 | ||
161 | static struct s3c2410_nand_set rx3715_nand_sets[] = { | 161 | static struct s3c2410_nand_set __initdata rx3715_nand_sets[] = { |
162 | [0] = { | 162 | [0] = { |
163 | .name = "Internal", | 163 | .name = "Internal", |
164 | .nr_chips = 1, | 164 | .nr_chips = 1, |
@@ -167,7 +167,7 @@ static struct s3c2410_nand_set rx3715_nand_sets[] = { | |||
167 | }, | 167 | }, |
168 | }; | 168 | }; |
169 | 169 | ||
170 | static struct s3c2410_platform_nand rx3715_nand_info = { | 170 | static struct s3c2410_platform_nand __initdata rx3715_nand_info = { |
171 | .tacls = 25, | 171 | .tacls = 25, |
172 | .twrph0 = 50, | 172 | .twrph0 = 50, |
173 | .twrph1 = 15, | 173 | .twrph1 = 15, |
@@ -186,8 +186,6 @@ static struct platform_device *rx3715_devices[] __initdata = { | |||
186 | 186 | ||
187 | static void __init rx3715_map_io(void) | 187 | static void __init rx3715_map_io(void) |
188 | { | 188 | { |
189 | s3c_device_nand.dev.platform_data = &rx3715_nand_info; | ||
190 | |||
191 | s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); | 189 | s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); |
192 | s3c24xx_init_clocks(16934000); | 190 | s3c24xx_init_clocks(16934000); |
193 | s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); | 191 | s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); |
@@ -205,6 +203,7 @@ static void __init rx3715_init_machine(void) | |||
205 | #endif | 203 | #endif |
206 | s3c_pm_init(); | 204 | s3c_pm_init(); |
207 | 205 | ||
206 | s3c_nand_set_platdata(&rx3715_nand_info); | ||
208 | s3c24xx_fb_set_platdata(&rx3715_fb_info); | 207 | s3c24xx_fb_set_platdata(&rx3715_fb_info); |
209 | platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices)); | 208 | platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices)); |
210 | } | 209 | } |
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c index db6eafbd4d90..ec13e748ccc5 100644 --- a/arch/arm/mach-s3c2440/mach-smdk2440.c +++ b/arch/arm/mach-s3c2440/mach-smdk2440.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/mach-s3c2440/mach-smdk2440.c | 1 | /* linux/arch/arm/mach-s3c2440/mach-smdk2440.c |
2 | * | 2 | * |
3 | * Copyright (c) 2004,2005 Simtec Electronics | 3 | * Copyright (c) 2004-2005 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
5 | * | 5 | * |
6 | * http://www.fluff.org/ben/smdk2440/ | 6 | * http://www.fluff.org/ben/smdk2440/ |