aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/au1000/common/clocks.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 16:29:14 -0400
committerIngo Molnar <mingo@elte.hu>2008-05-12 16:29:14 -0400
commit5aaca7a7a5db157530d195c4b93c8fc4682f8a48 (patch)
tree1c9a2a7e898c8a460bc10d7f3c5c8308188c0072 /arch/mips/au1000/common/clocks.c
parent8c6b0ef2ea1bb42cd72d987389297f66cd25790b (diff)
parent9404ef02974a5411687b6c1b8ef3984305620e02 (diff)
Merge branch 'linus' into x86/urgent
Diffstat (limited to 'arch/mips/au1000/common/clocks.c')
-rw-r--r--arch/mips/au1000/common/clocks.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/mips/au1000/common/clocks.c b/arch/mips/au1000/common/clocks.c
index 3ce6cace0eb0..46f8ee0e2657 100644
--- a/arch/mips/au1000/common/clocks.c
+++ b/arch/mips/au1000/common/clocks.c
@@ -1,10 +1,9 @@
1/* 1/*
2 * BRIEF MODULE DESCRIPTION 2 * BRIEF MODULE DESCRIPTION
3 * Simple Au1000 clocks routines. 3 * Simple Au1xx0 clocks routines.
4 * 4 *
5 * Copyright 2001 MontaVista Software Inc. 5 * Copyright 2001, 2008 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. 6 * Author: MontaVista Software, Inc. <source@mvista.com>
7 * ppopov@mvista.com or source@mvista.com
8 * 7 *
9 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
@@ -30,8 +29,8 @@
30#include <linux/module.h> 29#include <linux/module.h>
31#include <asm/mach-au1x00/au1000.h> 30#include <asm/mach-au1x00/au1000.h>
32 31
33static unsigned int au1x00_clock; // Hz 32static unsigned int au1x00_clock; /* Hz */
34static unsigned int lcd_clock; // KHz 33static unsigned int lcd_clock; /* KHz */
35static unsigned long uart_baud_base; 34static unsigned long uart_baud_base;
36 35
37/* 36/*
@@ -47,8 +46,6 @@ unsigned int get_au1x00_speed(void)
47 return au1x00_clock; 46 return au1x00_clock;
48} 47}
49 48
50
51
52/* 49/*
53 * The UART baud base is not known at compile time ... if 50 * The UART baud base is not known at compile time ... if
54 * we want to be able to use the same code on different 51 * we want to be able to use the same code on different
@@ -73,24 +70,23 @@ void set_au1x00_uart_baud_base(unsigned long new_baud_base)
73void set_au1x00_lcd_clock(void) 70void set_au1x00_lcd_clock(void)
74{ 71{
75 unsigned int static_cfg0; 72 unsigned int static_cfg0;
76 unsigned int sys_busclk = 73 unsigned int sys_busclk = (get_au1x00_speed() / 1000) /
77 (get_au1x00_speed()/1000) / 74 ((int)(au_readl(SYS_POWERCTRL) & 0x03) + 2);
78 ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2);
79 75
80 static_cfg0 = au_readl(MEM_STCFG0); 76 static_cfg0 = au_readl(MEM_STCFG0);
81 77
82 if (static_cfg0 & (1<<11)) 78 if (static_cfg0 & (1 << 11))
83 lcd_clock = sys_busclk / 5; /* note: BCLK switching fails with D5 */ 79 lcd_clock = sys_busclk / 5; /* note: BCLK switching fails with D5 */
84 else 80 else
85 lcd_clock = sys_busclk / 4; 81 lcd_clock = sys_busclk / 4;
86 82
87 if (lcd_clock > 50000) /* Epson MAX */ 83 if (lcd_clock > 50000) /* Epson MAX */
88 printk("warning: LCD clock too high (%d KHz)\n", lcd_clock); 84 printk(KERN_WARNING "warning: LCD clock too high (%u KHz)\n",
85 lcd_clock);
89} 86}
90 87
91unsigned int get_au1x00_lcd_clock(void) 88unsigned int get_au1x00_lcd_clock(void)
92{ 89{
93 return lcd_clock; 90 return lcd_clock;
94} 91}
95
96EXPORT_SYMBOL(get_au1x00_lcd_clock); 92EXPORT_SYMBOL(get_au1x00_lcd_clock);