summary refs log tree commit diff stats
path: root/docs/devel/clocks.rst
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-02-19 14:45:35 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-03-08 17:20:01 +0000
commite4341623a3b87e7eca87d42b7b88da967cd21c49 (patch)
tree302b7562c81f41d7d93b5d1eadc6986742b2390f /docs/devel/clocks.rst
parent5ee0abed51231949ef91d7f8e1115be69ed91e93 (diff)
downloadfocaccia-qemu-e4341623a3b87e7eca87d42b7b88da967cd21c49.tar.gz
focaccia-qemu-e4341623a3b87e7eca87d42b7b88da967cd21c49.zip
clock: Add ClockPreUpdate callback event type
Add a new callback event type ClockPreUpdate, which is called on
period changes before the period is updated.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Luc Michel <luc@lmichel.fr>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210219144617.4782-3-peter.maydell@linaro.org
Diffstat (limited to 'docs/devel/clocks.rst')
-rw-r--r--docs/devel/clocks.rst9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/devel/clocks.rst b/docs/devel/clocks.rst
index cd344e3fe5..f0391e76b4 100644
--- a/docs/devel/clocks.rst
+++ b/docs/devel/clocks.rst
@@ -181,7 +181,14 @@ events.
 
 The events currently supported are:
 
- * ``ClockUpdate`` : called after the input clock's period has changed
+ * ``ClockPreUpdate`` : called when the input clock's period is about to
+   update. This is useful if the device needs to do some action for
+   which it needs to know the old value of the clock period. During
+   this callback, Clock API functions like ``clock_get()`` or
+   ``clock_ticks_to_ns()`` will use the old period.
+ * ``ClockUpdate`` : called after the input clock's period has changed.
+   During this callback, Clock API functions like ``clock_ticks_to_ns()``
+   will use the new period.
 
 Note that a clock only has one callback: it is not possible to register
 different functions for different events. You must register a single