aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-10-23 09:24:10 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-10-23 09:24:10 -0400
commitd9214556b11a8d18ff588e60824c12041d30f791 (patch)
tree04ab59d13961675811a55c96fb12b2b167b72318 /arch/avr32/mach-at32ap
parent72a1419a9d4c859a3345e4b83f8ef7d599d3818c (diff)
parente82c6106b04b85879d802bbbeaed30d9b10a92e2 (diff)
Merge branches 'boards' and 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
Diffstat (limited to 'arch/avr32/mach-at32ap')
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c7
-rw-r--r--arch/avr32/mach-at32ap/cpufreq.c15
-rw-r--r--arch/avr32/mach-at32ap/extint.c8
-rw-r--r--arch/avr32/mach-at32ap/include/mach/board.h10
4 files changed, 31 insertions, 9 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index caec25a2eec6..0c6e02f80a31 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -813,7 +813,7 @@ static struct resource pio4_resource[] = {
813DEFINE_DEV(pio, 4); 813DEFINE_DEV(pio, 4);
814DEV_CLK(mck, pio4, pba, 14); 814DEV_CLK(mck, pio4, pba, 14);
815 815
816void __init at32_add_system_devices(void) 816static int __init system_device_init(void)
817{ 817{
818 platform_device_register(&at32_pm0_device); 818 platform_device_register(&at32_pm0_device);
819 platform_device_register(&at32_intc0_device); 819 platform_device_register(&at32_intc0_device);
@@ -832,7 +832,10 @@ void __init at32_add_system_devices(void)
832 platform_device_register(&pio2_device); 832 platform_device_register(&pio2_device);
833 platform_device_register(&pio3_device); 833 platform_device_register(&pio3_device);
834 platform_device_register(&pio4_device); 834 platform_device_register(&pio4_device);
835
836 return 0;
835} 837}
838core_initcall(system_device_init);
836 839
837/* -------------------------------------------------------------------- 840/* --------------------------------------------------------------------
838 * PSIF 841 * PSIF
@@ -1474,7 +1477,7 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
1474 pin_mask = ATMEL_LCDC_PRI_24BIT | ATMEL_LCDC_PRI_CONTROL; 1477 pin_mask = ATMEL_LCDC_PRI_24BIT | ATMEL_LCDC_PRI_CONTROL;
1475 1478
1476 /* LCDC on port C */ 1479 /* LCDC on port C */
1477 portc_mask = (pin_mask & 0xfff80000) >> 19; 1480 portc_mask = pin_mask & 0xfff80000;
1478 select_peripheral(PIOC, portc_mask, PERIPH_A, 0); 1481 select_peripheral(PIOC, portc_mask, PERIPH_A, 0);
1479 1482
1480 /* LCDC on port D */ 1483 /* LCDC on port D */
diff --git a/arch/avr32/mach-at32ap/cpufreq.c b/arch/avr32/mach-at32ap/cpufreq.c
index 5dd8d25428bf..024c586e936c 100644
--- a/arch/avr32/mach-at32ap/cpufreq.c
+++ b/arch/avr32/mach-at32ap/cpufreq.c
@@ -40,6 +40,9 @@ static unsigned int at32_get_speed(unsigned int cpu)
40 return (unsigned int)((clk_get_rate(cpuclk) + 500) / 1000); 40 return (unsigned int)((clk_get_rate(cpuclk) + 500) / 1000);
41} 41}
42 42
43static unsigned int ref_freq;
44static unsigned long loops_per_jiffy_ref;
45
43static int at32_set_target(struct cpufreq_policy *policy, 46static int at32_set_target(struct cpufreq_policy *policy,
44 unsigned int target_freq, 47 unsigned int target_freq,
45 unsigned int relation) 48 unsigned int relation)
@@ -61,8 +64,19 @@ static int at32_set_target(struct cpufreq_policy *policy,
61 freqs.cpu = 0; 64 freqs.cpu = 0;
62 freqs.flags = 0; 65 freqs.flags = 0;
63 66
67 if (!ref_freq) {
68 ref_freq = freqs.old;
69 loops_per_jiffy_ref = boot_cpu_data.loops_per_jiffy;
70 }
71
64 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 72 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
73 if (freqs.old < freqs.new)
74 boot_cpu_data.loops_per_jiffy = cpufreq_scale(
75 loops_per_jiffy_ref, ref_freq, freqs.new);
65 clk_set_rate(cpuclk, freq); 76 clk_set_rate(cpuclk, freq);
77 if (freqs.new < freqs.old)
78 boot_cpu_data.loops_per_jiffy = cpufreq_scale(
79 loops_per_jiffy_ref, ref_freq, freqs.new);
66 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 80 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
67 81
68 pr_debug("cpufreq: set frequency %lu Hz\n", freq); 82 pr_debug("cpufreq: set frequency %lu Hz\n", freq);
@@ -87,7 +101,6 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy)
87 policy->cur = at32_get_speed(0); 101 policy->cur = at32_get_speed(0);
88 policy->min = policy->cpuinfo.min_freq; 102 policy->min = policy->cpuinfo.min_freq;
89 policy->max = policy->cpuinfo.max_freq; 103 policy->max = policy->cpuinfo.max_freq;
90 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
91 104
92 printk("cpufreq: AT32AP CPU frequency driver\n"); 105 printk("cpufreq: AT32AP CPU frequency driver\n");
93 106
diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c
index c36a6d59d6f0..310477ba1bbf 100644
--- a/arch/avr32/mach-at32ap/extint.c
+++ b/arch/avr32/mach-at32ap/extint.c
@@ -191,7 +191,7 @@ static int __init eic_probe(struct platform_device *pdev)
191 struct eic *eic; 191 struct eic *eic;
192 struct resource *regs; 192 struct resource *regs;
193 unsigned int i; 193 unsigned int i;
194 unsigned int nr_irqs; 194 unsigned int nr_of_irqs;
195 unsigned int int_irq; 195 unsigned int int_irq;
196 int ret; 196 int ret;
197 u32 pattern; 197 u32 pattern;
@@ -224,7 +224,7 @@ static int __init eic_probe(struct platform_device *pdev)
224 eic_writel(eic, IDR, ~0UL); 224 eic_writel(eic, IDR, ~0UL);
225 eic_writel(eic, MODE, ~0UL); 225 eic_writel(eic, MODE, ~0UL);
226 pattern = eic_readl(eic, MODE); 226 pattern = eic_readl(eic, MODE);
227 nr_irqs = fls(pattern); 227 nr_of_irqs = fls(pattern);
228 228
229 /* Trigger on low level unless overridden by driver */ 229 /* Trigger on low level unless overridden by driver */
230 eic_writel(eic, EDGE, 0UL); 230 eic_writel(eic, EDGE, 0UL);
@@ -232,7 +232,7 @@ static int __init eic_probe(struct platform_device *pdev)
232 232
233 eic->chip = &eic_chip; 233 eic->chip = &eic_chip;
234 234
235 for (i = 0; i < nr_irqs; i++) { 235 for (i = 0; i < nr_of_irqs; i++) {
236 set_irq_chip_and_handler(eic->first_irq + i, &eic_chip, 236 set_irq_chip_and_handler(eic->first_irq + i, &eic_chip,
237 handle_level_irq); 237 handle_level_irq);
238 set_irq_chip_data(eic->first_irq + i, eic); 238 set_irq_chip_data(eic->first_irq + i, eic);
@@ -256,7 +256,7 @@ static int __init eic_probe(struct platform_device *pdev)
256 eic->regs, int_irq); 256 eic->regs, int_irq);
257 dev_info(&pdev->dev, 257 dev_info(&pdev->dev,
258 "Handling %u external IRQs, starting with IRQ %u\n", 258 "Handling %u external IRQs, starting with IRQ %u\n",
259 nr_irqs, eic->first_irq); 259 nr_of_irqs, eic->first_irq);
260 260
261 return 0; 261 return 0;
262 262
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h
index c48386d66bc3..aafaf7a78886 100644
--- a/arch/avr32/mach-at32ap/include/mach/board.h
+++ b/arch/avr32/mach-at32ap/include/mach/board.h
@@ -14,8 +14,14 @@
14 */ 14 */
15extern unsigned long at32_board_osc_rates[]; 15extern unsigned long at32_board_osc_rates[];
16 16
17/* Add basic devices: system manager, interrupt controller, portmuxes, etc. */ 17/*
18void at32_add_system_devices(void); 18 * This used to add essential system devices, but this is now done
19 * automatically. Please don't use it in new board code.
20 */
21static inline void __deprecated at32_add_system_devices(void)
22{
23
24}
19 25
20#define ATMEL_MAX_UART 4 26#define ATMEL_MAX_UART 4
21extern struct platform_device *atmel_default_console_device; 27extern struct platform_device *atmel_default_console_device;