Re: [patch] input: Fix CLOCK_TICK_RATE usage ... [8/13]

Vojtech Pavlik (vojtech@suse.cz)
Wed, 25 Jun 2003 21:58:47 +0200


On Wed, Jun 25, 2003 at 10:20:59AM -0700, David Mosberger wrote:

> Moreover, the current drivers would compile just fine on ia64, even
> though they could not possibly work correctly with the current use of
> CLOCK_TICK_RATE. With a separate header file (and a config option),
> these dependencies would be made explicit and that would improve
> overall cleanliness.
>
> In other words, I still think the right way to go about this is to
> have <asm/pit.h>. On x86, this could be:
>
> --
> #include <asm/timex.h>
>
> #define PIT_FREQ CLOCK_TICK_RATE
> #define PIT_LATCH ((PIT_FREQ + HZ/2) / HZ)
> --

Actually, I think it should be the other way around:

asm-i386/pit.h:

#define PIT_FREQ 1193182
#define PIT_LATCH ((PIT_FREQ + HZ/2) / HZ)

asm-i386/timex.h:

#include <asm/pit.h>
#define CLOCK_TICK_RATE PIT_FREQ

> If you insist, you could even put this in asm-generic, though
> personally I don't think that's terribly elegant.
>
> On ia64, <asm/pit.h> could be:
>
> #ifdef CONFIG_PIT
> # define PIT_FREQ 1193182
> # define PIT_LATCH ((PIT_FREQ + HZ/2) / HZ)
> #endif
>
> --david

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/