diff mbox

[6/8] char/genrtc: parisc: use asm-generic/rtc.h

Message ID 1461707052-1337718-7-git-send-email-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann April 26, 2016, 9:44 p.m. UTC
The asm-generic/rtc.h header can now be included by
architectures that provide their own set_rtc_time/get_rtc_time
macros, letting us remove most of the common contents in
the powerpc implementation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/parisc/include/asm/rtc.h | 38 +++++---------------------------------
 1 file changed, 5 insertions(+), 33 deletions(-)

Comments

Rolf Eike Beer April 26, 2016, 10:07 p.m. UTC | #1
Arnd Bergmann wrote:
> The asm-generic/rtc.h header can now be included by
> architectures that provide their own set_rtc_time/get_rtc_time
> macros, letting us remove most of the common contents in
> the powerpc implementation.

parisc in this case.

Eike
Arnd Bergmann April 27, 2016, 11:21 a.m. UTC | #2
On Wednesday 27 April 2016 00:07:47 Rolf Eike Beer wrote:
> Arnd Bergmann wrote:
> > The asm-generic/rtc.h header can now be included by
> > architectures that provide their own set_rtc_time/get_rtc_time
> > macros, letting us remove most of the common contents in
> > the powerpc implementation.
> 
> parisc in this case.
> 

Fixed, thanks!

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann April 27, 2016, 11:35 a.m. UTC | #3
On Wednesday 27 April 2016 13:21:16 Arnd Bergmann wrote:
> On Wednesday 27 April 2016 00:07:47 Rolf Eike Beer wrote:
> > Arnd Bergmann wrote:
> > > The asm-generic/rtc.h header can now be included by
> > > architectures that provide their own set_rtc_time/get_rtc_time
> > > macros, letting us remove most of the common contents in
> > > the powerpc implementation.
> > 
> > parisc in this case.
> > 
> 
> Fixed, thanks!

Actually, after the comment about just removing the gen_rtc driver
in the long run, I checked again and found that PARISC unconditionally
selects RTC_CLASS, so this driver can't even be built here.
We should just remove the header and drop PARISC from the list.

If we also drop m68k, that just leaves powerpc.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven April 27, 2016, 11:55 a.m. UTC | #4
On Wed, Apr 27, 2016 at 1:35 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 27 April 2016 13:21:16 Arnd Bergmann wrote:
>> On Wednesday 27 April 2016 00:07:47 Rolf Eike Beer wrote:
>> > Arnd Bergmann wrote:
>> > > The asm-generic/rtc.h header can now be included by
>> > > architectures that provide their own set_rtc_time/get_rtc_time
>> > > macros, letting us remove most of the common contents in
>> > > the powerpc implementation.
>> >
>> > parisc in this case.
>> >
>>
>> Fixed, thanks!
>
> Actually, after the comment about just removing the gen_rtc driver
> in the long run, I checked again and found that PARISC unconditionally
> selects RTC_CLASS, so this driver can't even be built here.
> We should just remove the header and drop PARISC from the list.
>
> If we also drop m68k, that just leaves powerpc.

I've just checked Debian's unofficial linux-image-4.5.0-1-m68k_4.5.1-1_m68k,
and it also enables RTC_CLASS and CONFIG_RTC_DRV_GENERIC, so gen_rtc
can be dropped on m68k for sure.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann April 27, 2016, 12:44 p.m. UTC | #5
On Wednesday 27 April 2016 13:55:43 Geert Uytterhoeven wrote:
> On Wed, Apr 27, 2016 at 1:35 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Wednesday 27 April 2016 13:21:16 Arnd Bergmann wrote:
> >> On Wednesday 27 April 2016 00:07:47 Rolf Eike Beer wrote:
> >> > Arnd Bergmann wrote:
> >> > > The asm-generic/rtc.h header can now be included by
> >> > > architectures that provide their own set_rtc_time/get_rtc_time
> >> > > macros, letting us remove most of the common contents in
> >> > > the powerpc implementation.
> >> >
> >> > parisc in this case.
> >> >
> >>
> >> Fixed, thanks!
> >
> > Actually, after the comment about just removing the gen_rtc driver
> > in the long run, I checked again and found that PARISC unconditionally
> > selects RTC_CLASS, so this driver can't even be built here.
> > We should just remove the header and drop PARISC from the list.
> >
> > If we also drop m68k, that just leaves powerpc.
> 
> I've just checked Debian's unofficial linux-image-4.5.0-1-m68k_4.5.1-1_m68k,
> and it also enables RTC_CLASS and CONFIG_RTC_DRV_GENERIC, so gen_rtc
> can be dropped on m68k for sure.

Ok, excellent. I'll try to rework the series then to completely eliminate
the driver (or leaving it ppc-only).

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/parisc/include/asm/rtc.h b/arch/parisc/include/asm/rtc.h
index 099d641a42c2..d06cc581ecc2 100644
--- a/arch/parisc/include/asm/rtc.h
+++ b/arch/parisc/include/asm/rtc.h
@@ -12,26 +12,15 @@ 
 
 #ifdef __KERNEL__
 
-#include <linux/rtc.h>
+#define get_rtc_time parisc_get_rtc_time
+#define set_rtc_time parisc_set_rtc_time
+#include <asm-generic/rtc.h>
 
 #include <asm/pdc.h>
 
 #define SECS_PER_HOUR   (60 * 60)
 #define SECS_PER_DAY    (SECS_PER_HOUR * 24)
 
-
-#define RTC_PIE 0x40		/* periodic interrupt enable */
-#define RTC_AIE 0x20		/* alarm interrupt enable */
-#define RTC_UIE 0x10		/* update-finished interrupt enable */
-
-#define RTC_BATT_BAD 0x100	/* battery bad */
-
-/* some dummy definitions */
-#define RTC_SQWE 0x08		/* enable square-wave output */
-#define RTC_DM_BINARY 0x04	/* all time/date values are BCD if clear */
-#define RTC_24H 0x02		/* 24 hour mode - else hours bit 7 means pm */
-#define RTC_DST_EN 0x01	        /* auto switch DST - works f. USA only */
-
 # define __isleap(year) \
   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
 
@@ -44,7 +33,7 @@  static const unsigned short int __mon_yday[2][13] =
 	{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
 };
 
-static inline unsigned int get_rtc_time(struct rtc_time *wtime)
+static inline unsigned int parisc_get_rtc_time(struct rtc_time *wtime)
 {
 	struct pdc_tod tod_data;
 	long int days, rem, y;
@@ -96,7 +85,7 @@  static inline unsigned int get_rtc_time(struct rtc_time *wtime)
 	return RTC_24H;
 }
 
-static int set_rtc_time(struct rtc_time *wtime)
+static int parisc_set_rtc_time(struct rtc_time *wtime)
 {
 	u_int32_t secs;
 
@@ -110,22 +99,5 @@  static int set_rtc_time(struct rtc_time *wtime)
 
 }
 
-static inline unsigned int get_rtc_ss(void)
-{
-	struct rtc_time h;
-
-	get_rtc_time(&h);
-	return h.tm_sec;
-}
-
-static inline int get_rtc_pll(struct rtc_pll_info *pll)
-{
-	return -EINVAL;
-}
-static inline int set_rtc_pll(struct rtc_pll_info *pll)
-{
-	return -EINVAL;
-}
-
 #endif /* __KERNEL__ */
 #endif /* __ASM_RTC_H__ */