aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/timers/hpet_example.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-02 09:58:49 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-02 09:58:49 -0400
commit9e3be1edbe5ca57df51140b523168237b3a01f4d (patch)
treea72c0ec1ce0fbcdcd12ecb6aad9bedcc94b94f9d /Documentation/timers/hpet_example.c
parentASoC: Fix SND_SOC_ALL_CODECS typo for alc5623 (diff)
parentMerge commit 'v2.6.37-rc1' into for-2.6.37 (diff)
downloadlinux-dev-9e3be1edbe5ca57df51140b523168237b3a01f4d.tar.xz
linux-dev-9e3be1edbe5ca57df51140b523168237b3a01f4d.zip
Merge branch 'for-2.6.37' into HEAD
WARN() fix from Joe moved. Conflicts: sound/soc/codecs/wm_hubs.c
Diffstat (limited to 'Documentation/timers/hpet_example.c')
-rw-r--r--Documentation/timers/hpet_example.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c
index 4bfafb7bc4c5..9a3e7012c190 100644
--- a/Documentation/timers/hpet_example.c
+++ b/Documentation/timers/hpet_example.c
@@ -97,6 +97,33 @@ hpet_open_close(int argc, const char **argv)
void
hpet_info(int argc, const char **argv)
{
+ struct hpet_info info;
+ int fd;
+
+ if (argc != 1) {
+ fprintf(stderr, "hpet_info: device-name\n");
+ return;
+ }
+
+ fd = open(argv[0], O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "hpet_info: open of %s failed\n", argv[0]);
+ return;
+ }
+
+ if (ioctl(fd, HPET_INFO, &info) < 0) {
+ fprintf(stderr, "hpet_info: failed to get info\n");
+ goto out;
+ }
+
+ fprintf(stderr, "hpet_info: hi_irqfreq 0x%lx hi_flags 0x%lx ",
+ info.hi_ireqfreq, info.hi_flags);
+ fprintf(stderr, "hi_hpet %d hi_timer %d\n",
+ info.hi_hpet, info.hi_timer);
+
+out:
+ close(fd);
+ return;
}
void