[RFC] Option to disable mapping genrtc calls to ppc_md calls

Mark A. Greer mgreer at mvista.com
Fri Jan 21 10:21:14 EST 2005

Tom Rini wrote:

>So you're saying that using the hook directly isn't a different hook?  I
>suppose we can agree to disagree, since it's not relevant really :)

Well, I could have not used genrtc at all and duplicated the code like 
others have (e.g., ds1302 and ip27-rtc.c) but I chose to reuse code 
that's already there and debugged.  Chosing to interface to genrtc 
instead of ppc_md.xxx is chosing to have it work on a wider variety of 
platforms over flexibility within one particular type of platform.  Pros 
and cons to each.

>It can't work on PPC/MULTIPLATFORM as that's a kernel with multiple rtc
>chips in one binary (pmac, todc for prep, chrp?).

The point I was making is there there is nothing precluding a kernel 
that runs on several boards from using it as long as that's the rtc chip 
on all the platforms  Its already clear that if there are different rtc 
chips, it won't work.

>Why ask the user for something you know he wants?  If they've selected
>GENRTC and are using the board, they'll probably want GENRTC to work.
>It's exactly what you described except the user won't have to know about
>anything going on.

If that's the way you want to go then it should depend on having the rtc 
"driver" selected and rtc.h should look something like:

#if defined(CONFIG_I2C_<rtc_driver_a>) || defined(CONFIG_<rtc_driver_b> ...

For now, it would only have to be #ifdef CONFIG_xxx_M41T00

That's fine with me.

More information about the Linuxppc-dev mailing list