* [PATCH] input: use PIT_TICK_RATE in vt beep ioctl
[not found] <20090511222702.352192505@arndb.de>
@ 2009-05-11 22:58 ` Arnd Bergmann
2009-05-12 9:31 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2009-05-11 22:58 UTC (permalink / raw)
To: linux-kernel, Alan Cox; +Cc: Dmitry Torokhov, linux-input
The KIOCSOUND and KDMKTONE ioctls are based on the
CLOCK_TICK_RATE, which is architecture and sometimes
configuration specific.
In practice, most user applications assume that it
is actually defined as the i8253 PIT base clock of
1193182 Hz, which is true on some architectures
but not on others.
This patch makes the vt code use the PIT frequency
on all architectures, which is much more well-defined.
It will change the behavior of user applications
sending the beep ioctl on all architectures that
define CLOCK_TICK_RATE different from PIT_TICK_RATE.
Hopefully, this change will make the frequency correct
in more cases than it will make it incorrect.
This patch depends on "move PIT_TICK_RATE to linux/timex.h"
in order to build on architectures that previously did not
define PIT_TICK_RATE.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/char/vt_ioctl.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index e6ce632..00f96b6 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -404,7 +404,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
supported and somehow separate the historic advertised
tick rate from any real one */
if (arg)
- arg = CLOCK_TICK_RATE / arg;
+ arg = PIT_TICK_RATE / arg;
kd_mksound(arg, 0);
break;
@@ -424,7 +424,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
supported and somehow separate the historic advertised
tick rate from any real one */
if (count)
- count = CLOCK_TICK_RATE / count;
+ count = PIT_TICK_RATE / count;
kd_mksound(count, ticks);
break;
}
--
1.6.0.4
--
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] input: use PIT_TICK_RATE in vt beep ioctl
2009-05-11 22:58 ` [PATCH] input: use PIT_TICK_RATE in vt beep ioctl Arnd Bergmann
@ 2009-05-12 9:31 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2009-05-12 9:31 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-kernel, Dmitry Torokhov, linux-input
> This patch depends on "move PIT_TICK_RATE to linux/timex.h"
> in order to build on architectures that previously did not
> define PIT_TICK_RATE.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alan Cox <alan@linux.intel.com>
I think this is probably the lesser of the evils here.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-12 9:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20090511222702.352192505@arndb.de>
2009-05-11 22:58 ` [PATCH] input: use PIT_TICK_RATE in vt beep ioctl Arnd Bergmann
2009-05-12 9:31 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).