mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Habil Eren Türker" <habilerenturker@gmail.com>
To: corbet@lwn.net, clemens@ladisch.de, tglx@kernel.org
Cc: anna-maria@linutronix.de, frederic@kernel.org,
	skhan@linuxfoundation.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	"Habil Eren Türker" <habilerenturker@hotmail.com>
Subject: [PATCH v3 2/2] docs: timers: hpet: Document userspace API and ioctl commands
Date: Sun, 27 Sep 2026 10:23:16 +0300	[thread overview]
Message-ID: <20260927072425.7892-3-habilerenturker@hotmail.com> (raw)
In-Reply-To: <20260927072425.7892-1-habilerenturker@hotmail.com>

Add a dedicated 'Userspace API and ioctl Commands' section to clearly
document the supported ioctl interfaces extrapolated from
include/uapi/linux/hpet.h, including the layout of struct hpet_info.

Assisted-by: Google Gemini
Signed-off-by: Habil Eren Türker <habilerenturker@hotmail.com>
---
 Documentation/timers/hpet.rst | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/Documentation/timers/hpet.rst b/Documentation/timers/hpet.rst
index 8bb51d971..007e906ae 100644
--- a/Documentation/timers/hpet.rst
+++ b/Documentation/timers/hpet.rst
@@ -28,3 +28,32 @@ initialization.  An example of this initialization can be found in
 The driver provides a userspace API which resembles the API found in the
 RTC driver framework.  An example user space program is provided in
 ``samples/timers/hpet_example.c``
+
+Userspace API and ioctl Commands
+================================
+
+* ``HPET_IE_ON`` / ``HPET_IE_OFF``
+  Enables or disables the interrupt generation for the timer channel.
+
+* ``HPET_INFO``
+  It is used to query the capabilities and current status of the HPET. 
+  When the ioctl call is made, the kernel populates the ``struct hpet_info`` 
+  structure and returns it to userspace:
+
+  .. code-block:: c
+
+     struct hpet_info {
+         unsigned long hi_ireqfreq;	/* Hz */
+         unsigned long hi_flags;	/* information */
+         unsigned short hi_hpet;
+         unsigned short hi_timer;
+     };
+
+* ``HPET_EPI`` / ``HPET_DPI``
+  Enables or disables periodic interrupts. When activated, the timer 
+  triggers continuously at the specified frequency.
+
+* ``HPET_IRQFREQ``
+  Sets the interrupt frequency for the periodic timer. This request 
+  takes an unsigned long argument specifying the desired frequency in Hz.
+
-- 
2.47.3


  parent reply	other threads:[~2026-09-27  7:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87o72mg21g.fsf@moria.home.lwn.net>
2026-09-26 18:08 ` [PATCH v2 0/2] docs: timers: hpet: Modernize and document API Habil Eren Türker
2026-09-26 18:08   ` [PATCH v2 1/2] [PATCH v2 1/2] docs: timers: hpet: Modernize file references Habil Eren Türker
2026-09-26 21:46     ` Jonathan Corbet
2026-09-26 21:48       ` Jonathan Corbet
2026-09-27  7:19         ` Habil Eren Türker
2026-09-27  7:23         ` [PATCH v3 0/2] docs: timers: hpet: Modernize and document API Habil Eren Türker
2026-09-27  7:23           ` [PATCH v3 1/2] docs: timers: hpet: Modernize file references Habil Eren Türker
2026-09-27  7:23           ` Habil Eren Türker [this message]
2026-09-26 18:08   ` [PATCH v2 2/2] [PATCH v2 2/2] docs: timers: hpet: Document userspace API and ioctl commands Habil Eren Türker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260927072425.7892-3-habilerenturker@hotmail.com \
    --to=habilerenturker@gmail.com \
    --cc=anna-maria@linutronix.de \
    --cc=clemens@ladisch.de \
    --cc=corbet@lwn.net \
    --cc=frederic@kernel.org \
    --cc=habilerenturker@hotmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®