diff options
Diffstat (limited to 'arch/mips/ite-boards')
-rw-r--r-- | arch/mips/ite-boards/generic/it8172_setup.c | 2 | ||||
-rw-r--r-- | arch/mips/ite-boards/generic/time.c | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/mips/ite-boards/generic/it8172_setup.c b/arch/mips/ite-boards/generic/it8172_setup.c index d808a67294b8..a5f6d84bc181 100644 --- a/arch/mips/ite-boards/generic/it8172_setup.c +++ b/arch/mips/ite-boards/generic/it8172_setup.c | |||
@@ -129,7 +129,7 @@ static void __init it8172_setup(void) | |||
129 | 129 | ||
130 | /* | 130 | /* |
131 | * IO/MEM resources. | 131 | * IO/MEM resources. |
132 | * | 132 | * |
133 | * revisit this area. | 133 | * revisit this area. |
134 | */ | 134 | */ |
135 | set_io_port_base(KSEG1); | 135 | set_io_port_base(KSEG1); |
diff --git a/arch/mips/ite-boards/generic/time.c b/arch/mips/ite-boards/generic/time.c index 30a6c0d5fc50..f5d67ee21ac6 100644 --- a/arch/mips/ite-boards/generic/time.c +++ b/arch/mips/ite-boards/generic/time.c | |||
@@ -72,7 +72,7 @@ static inline int rtc_dm_binary(void) { return saved_control & RTC_DM_BINARY; } | |||
72 | static inline unsigned char | 72 | static inline unsigned char |
73 | bin_to_hw(unsigned char c) | 73 | bin_to_hw(unsigned char c) |
74 | { | 74 | { |
75 | if (rtc_dm_binary()) | 75 | if (rtc_dm_binary()) |
76 | return c; | 76 | return c; |
77 | else | 77 | else |
78 | return ((c/10) << 4) + (c%10); | 78 | return ((c/10) << 4) + (c%10); |
@@ -91,9 +91,9 @@ hw_to_bin(unsigned char c) | |||
91 | static inline unsigned char | 91 | static inline unsigned char |
92 | hour_bin_to_hw(unsigned char c) | 92 | hour_bin_to_hw(unsigned char c) |
93 | { | 93 | { |
94 | if (rtc_24h()) | 94 | if (rtc_24h()) |
95 | return bin_to_hw(c); | 95 | return bin_to_hw(c); |
96 | if (c >= 12) | 96 | if (c >= 12) |
97 | return 0x80 | bin_to_hw((c==12)?12:c-12); /* 12 is 12pm */ | 97 | return 0x80 | bin_to_hw((c==12)?12:c-12); /* 12 is 12pm */ |
98 | else | 98 | else |
99 | return bin_to_hw((c==0)?12:c); /* 0 is 12 AM, not 0 am */ | 99 | return bin_to_hw((c==0)?12:c); /* 0 is 12 AM, not 0 am */ |
@@ -105,9 +105,9 @@ hour_hw_to_bin(unsigned char c) | |||
105 | unsigned char tmp = hw_to_bin(c&0x3f); | 105 | unsigned char tmp = hw_to_bin(c&0x3f); |
106 | if (rtc_24h()) | 106 | if (rtc_24h()) |
107 | return tmp; | 107 | return tmp; |
108 | if (c & 0x80) | 108 | if (c & 0x80) |
109 | return (tmp==12)?12:tmp+12; /* 12pm is 12, not 24 */ | 109 | return (tmp==12)?12:tmp+12; /* 12pm is 12, not 24 */ |
110 | else | 110 | else |
111 | return (tmp==12)?0:tmp; /* 12am is 0 */ | 111 | return (tmp==12)?0:tmp; /* 12am is 0 */ |
112 | } | 112 | } |
113 | 113 | ||
@@ -145,7 +145,7 @@ static unsigned long __init cal_r4koff(void) | |||
145 | return (mips_hpt_frequency / HZ); | 145 | return (mips_hpt_frequency / HZ); |
146 | } | 146 | } |
147 | 147 | ||
148 | static unsigned long | 148 | static unsigned long |
149 | it8172_rtc_get_time(void) | 149 | it8172_rtc_get_time(void) |
150 | { | 150 | { |
151 | unsigned int year, mon, day, hour, min, sec; | 151 | unsigned int year, mon, day, hour, min, sec; |
@@ -166,12 +166,12 @@ it8172_rtc_get_time(void) | |||
166 | hour = hour_hw_to_bin(CMOS_READ(RTC_HOURS)); | 166 | hour = hour_hw_to_bin(CMOS_READ(RTC_HOURS)); |
167 | day = hw_to_bin(CMOS_READ(RTC_DAY_OF_MONTH)); | 167 | day = hw_to_bin(CMOS_READ(RTC_DAY_OF_MONTH)); |
168 | mon = hw_to_bin(CMOS_READ(RTC_MONTH)); | 168 | mon = hw_to_bin(CMOS_READ(RTC_MONTH)); |
169 | year = hw_to_bin(CMOS_READ(RTC_YEAR)) + | 169 | year = hw_to_bin(CMOS_READ(RTC_YEAR)) + |
170 | hw_to_bin(*rtc_century_reg) * 100; | 170 | hw_to_bin(*rtc_century_reg) * 100; |
171 | 171 | ||
172 | /* restore interrupts */ | 172 | /* restore interrupts */ |
173 | local_irq_restore(flags); | 173 | local_irq_restore(flags); |
174 | 174 | ||
175 | return mktime(year, mon, day, hour, min, sec); | 175 | return mktime(year, mon, day, hour, min, sec); |
176 | } | 176 | } |
177 | 177 | ||