1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter 17. Clock Framework</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="index.html" title="The Linux Kernel API"><link rel="prev" href="API-misc-deregister.html" title="misc_deregister"><link rel="next" href="API-struct-clk-notifier.html" title="struct clk_notifier"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. Clock Framework</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-misc-deregister.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="API-struct-clk-notifier.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="clk"></a>Chapter 17. Clock Framework</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-clk-notifier.html"><span class="phrase">struct clk_notifier</span></a></span><span class="refpurpose"> — 2 associate a clk with a notifier 3 </span></dt><dt><span class="refentrytitle"><a href="API-struct-clk-notifier-data.html"><span class="phrase">struct clk_notifier_data</span></a></span><span class="refpurpose"> — 4 rate data to pass to the notifier callback 5 </span></dt><dt><span class="refentrytitle"><a href="API-clk-notifier-register.html"><span class="phrase">clk_notifier_register</span></a></span><span class="refpurpose"> — 6 change notifier callback 7 </span></dt><dt><span class="refentrytitle"><a href="API-clk-notifier-unregister.html"><span class="phrase">clk_notifier_unregister</span></a></span><span class="refpurpose"> — 8 change notifier callback 9 </span></dt><dt><span class="refentrytitle"><a href="API-clk-get-accuracy.html"><span class="phrase">clk_get_accuracy</span></a></span><span class="refpurpose"> — 10 obtain the clock accuracy in ppb (parts per billion) for a clock source. 11 </span></dt><dt><span class="refentrytitle"><a href="API-clk-set-phase.html"><span class="phrase">clk_set_phase</span></a></span><span class="refpurpose"> — 12 adjust the phase shift of a clock signal 13 </span></dt><dt><span class="refentrytitle"><a href="API-clk-get-phase.html"><span class="phrase">clk_get_phase</span></a></span><span class="refpurpose"> — 14 return the phase shift of a clock signal 15 </span></dt><dt><span class="refentrytitle"><a href="API-clk-is-match.html"><span class="phrase">clk_is_match</span></a></span><span class="refpurpose"> — 16 check if two clk's point to the same hardware clock 17 </span></dt><dt><span class="refentrytitle"><a href="API-clk-prepare.html"><span class="phrase">clk_prepare</span></a></span><span class="refpurpose"> — 18 prepare a clock source 19 </span></dt><dt><span class="refentrytitle"><a href="API-clk-unprepare.html"><span class="phrase">clk_unprepare</span></a></span><span class="refpurpose"> — 20 undo preparation of a clock source 21 </span></dt><dt><span class="refentrytitle"><a href="API-clk-get.html"><span class="phrase">clk_get</span></a></span><span class="refpurpose"> — 22 lookup and obtain a reference to a clock producer. 23 </span></dt><dt><span class="refentrytitle"><a href="API-devm-clk-get.html"><span class="phrase">devm_clk_get</span></a></span><span class="refpurpose"> — 24 lookup and obtain a managed reference to a clock producer. 25 </span></dt><dt><span class="refentrytitle"><a href="API-clk-enable.html"><span class="phrase">clk_enable</span></a></span><span class="refpurpose"> — 26 inform the system when the clock source should be running. 27 </span></dt><dt><span class="refentrytitle"><a href="API-clk-disable.html"><span class="phrase">clk_disable</span></a></span><span class="refpurpose"> — 28 inform the system when the clock source is no longer required. 29 </span></dt><dt><span class="refentrytitle"><a href="API-clk-get-rate.html"><span class="phrase">clk_get_rate</span></a></span><span class="refpurpose"> — 30 obtain the current clock rate (in Hz) for a clock source. This is only valid once the clock source has been enabled. 31 </span></dt><dt><span class="refentrytitle"><a href="API-clk-put.html"><span class="phrase">clk_put</span></a></span><span class="refpurpose"> — 32 "free" the clock source 33 </span></dt><dt><span class="refentrytitle"><a href="API-devm-clk-put.html"><span class="phrase">devm_clk_put</span></a></span><span class="refpurpose"> — 34 "free" a managed clock source 35 </span></dt><dt><span class="refentrytitle"><a href="API-clk-round-rate.html"><span class="phrase">clk_round_rate</span></a></span><span class="refpurpose"> — 36 adjust a rate to the exact rate a clock can provide 37 </span></dt><dt><span class="refentrytitle"><a href="API-clk-set-rate.html"><span class="phrase">clk_set_rate</span></a></span><span class="refpurpose"> — 38 set the clock rate for a clock source 39 </span></dt><dt><span class="refentrytitle"><a href="API-clk-has-parent.html"><span class="phrase">clk_has_parent</span></a></span><span class="refpurpose"> — 40 check if a clock is a possible parent for another 41 </span></dt><dt><span class="refentrytitle"><a href="API-clk-set-rate-range.html"><span class="phrase">clk_set_rate_range</span></a></span><span class="refpurpose"> — 42 set a rate range for a clock source 43 </span></dt><dt><span class="refentrytitle"><a href="API-clk-set-min-rate.html"><span class="phrase">clk_set_min_rate</span></a></span><span class="refpurpose"> — 44 set a minimum clock rate for a clock source 45 </span></dt><dt><span class="refentrytitle"><a href="API-clk-set-max-rate.html"><span class="phrase">clk_set_max_rate</span></a></span><span class="refpurpose"> — 46 set a maximum clock rate for a clock source 47 </span></dt><dt><span class="refentrytitle"><a href="API-clk-set-parent.html"><span class="phrase">clk_set_parent</span></a></span><span class="refpurpose"> — 48 set the parent clock source for this clock 49 </span></dt><dt><span class="refentrytitle"><a href="API-clk-get-parent.html"><span class="phrase">clk_get_parent</span></a></span><span class="refpurpose"> — 50 get the parent clock source for this clock 51 </span></dt><dt><span class="refentrytitle"><a href="API-clk-get-sys.html"><span class="phrase">clk_get_sys</span></a></span><span class="refpurpose"> — 52 get a clock based upon the device name 53 </span></dt><dt><span class="refentrytitle"><a href="API-clk-add-alias.html"><span class="phrase">clk_add_alias</span></a></span><span class="refpurpose"> — 54 add a new clock alias 55 </span></dt></dl></div><p> 56 The clock framework defines programming interfaces to support 57 software management of the system clock tree. 58 This framework is widely used with System-On-Chip (SOC) platforms 59 to support power management and various devices which may need 60 custom clock rates. 61 Note that these "clocks" don't relate to timekeeping or real 62 time clocks (RTCs), each of which have separate frameworks. 63 These <span class="structname">struct clk</span> instances may be used 64 to manage for example a 96 MHz signal that is used to shift bits 65 into and out of peripherals or busses, or otherwise trigger 66 synchronous state machine transitions in system hardware. 67 </p><p> 68 Power management is supported by explicit software clock gating: 69 unused clocks are disabled, so the system doesn't waste power 70 changing the state of transistors that aren't in active use. 71 On some systems this may be backed by hardware clock gating, 72 where clocks are gated without being disabled in software. 73 Sections of chips that are powered but not clocked may be able 74 to retain their last state. 75 This low power state is often called a <span class="emphasis"><em>retention 76 mode</em></span>. 77 This mode still incurs leakage currents, especially with finer 78 circuit geometries, but for CMOS circuits power is mostly used 79 by clocked state changes. 80 </p><p> 81 Power-aware drivers only enable their clocks when the device 82 they manage is in active use. Also, system sleep states often 83 differ according to which clock domains are active: while a 84 "standby" state may allow wakeup from several active domains, a 85 "mem" (suspend-to-RAM) state may require a more wholesale shutdown 86 of clocks derived from higher speed PLLs and oscillators, limiting 87 the number of possible wakeup event sources. A driver's suspend 88 method may need to be aware of system-specific clock constraints 89 on the target sleep state. 90 </p><p> 91 Some platforms support programmable clock generators. These 92 can be used by external chips of various kinds, such as other 93 CPUs, multimedia codecs, and devices with strict requirements 94 for interface clocking. 95 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-misc-deregister.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="API-struct-clk-notifier.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">misc_deregister</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">struct clk_notifier</span></td></tr></table></div></body></html> 96