diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-08-03 01:19:58 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-09-20 22:57:47 -0400 |
commit | ad89f87a84040a57c4a78ca2759b364f72f423ab (patch) | |
tree | a34207175da4338cc8e4e7b7ea323193e199eb3c /arch/sh/kernel/cpu/sh3/setup-sh7710.c | |
parent | 7da3b8ef662af6252aa17c55cc0aa6d74cbf02e4 (diff) |
rtc: rtc-sh: Support 4-digit year on SH7705/SH7710/SH7712.
All SH-4 parts have a 4-digit year, while the SH-3 parts typically
only use a 2-digit one. The SH7705, SH7710, and SH7712 SH-3 parts
however opted to extend it to 4-digit and still look and act like
an SH-3 RTC in all other ways.
This adds a capability flag (RTC_CAP_4_DIGIT_YEAR) that these
corner-case CPU subtypes can set in their platform data and cleans
up some of the ifdef mess in the driver as a result.
Reported-by: Markus Brunner <super.firetwister@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh3/setup-sh7710.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7710.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c index 07f26ab75d97..eb55ac9dbf71 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SH3 Setup code for SH7710, SH7712 | 2 | * SH3 Setup code for SH7710, SH7712 |
3 | * | 3 | * |
4 | * Copyright (C) 2006 Paul Mundt | 4 | * Copyright (C) 2006, 2007 Paul Mundt |
5 | * Copyright (C) 2007 Nobuhiro Iwamatsu | 5 | * Copyright (C) 2007 Nobuhiro Iwamatsu |
6 | * | 6 | * |
7 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/serial.h> | 14 | #include <linux/serial.h> |
15 | #include <asm/sci.h> | 15 | #include <asm/sci.h> |
16 | #include <asm/rtc.h> | ||
16 | 17 | ||
17 | enum { | 18 | enum { |
18 | UNUSED = 0, | 19 | UNUSED = 0, |
@@ -130,11 +131,18 @@ static struct resource rtc_resources[] = { | |||
130 | }, | 131 | }, |
131 | }; | 132 | }; |
132 | 133 | ||
134 | static struct sh_rtc_platform_info rtc_info = { | ||
135 | .capabilities = RTC_CAP_4_DIGIT_YEAR, | ||
136 | }; | ||
137 | |||
133 | static struct platform_device rtc_device = { | 138 | static struct platform_device rtc_device = { |
134 | .name = "sh-rtc", | 139 | .name = "sh-rtc", |
135 | .id = -1, | 140 | .id = -1, |
136 | .num_resources = ARRAY_SIZE(rtc_resources), | 141 | .num_resources = ARRAY_SIZE(rtc_resources), |
137 | .resource = rtc_resources, | 142 | .resource = rtc_resources, |
143 | .dev = { | ||
144 | .platform_data = &rtc_info, | ||
145 | }, | ||
138 | }; | 146 | }; |
139 | 147 | ||
140 | static struct plat_sci_port sci_platform_data[] = { | 148 | static struct plat_sci_port sci_platform_data[] = { |