1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ata_wait_register</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="libATA Developer's Guide"><link rel="up" href="libataExt.html" title="Chapter 4. libata Library"><link rel="prev" href="API-ata-msleep.html" title="ata_msleep"><link rel="next" href="API-sata-lpm-ignore-phy-events.html" title="sata_lpm_ignore_phy_events"></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"><span class="phrase">ata_wait_register</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-ata-msleep.html">Prev</a> </td><th width="60%" align="center">Chapter 4. libata Library</th><td width="20%" align="right"> <a accesskey="n" href="API-sata-lpm-ignore-phy-events.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-ata-wait-register"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ata_wait_register — 2 wait until register value changes 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">u32 <b class="fsfunc">ata_wait_register </b>(</code></td><td>struct ata_port * <var class="pdparam">ap</var>, </td></tr><tr><td> </td><td>void __iomem * <var class="pdparam">reg</var>, </td></tr><tr><td> </td><td>u32 <var class="pdparam">mask</var>, </td></tr><tr><td> </td><td>u32 <var class="pdparam">val</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">interval</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">timeout</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1123927676"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>ap</code></em></span></dt><dd><p> 4 ATA port to wait register for, can be NULL 5 </p></dd><dt><span class="term"><em class="parameter"><code>reg</code></em></span></dt><dd><p> 6 IO-mapped register 7 </p></dd><dt><span class="term"><em class="parameter"><code>mask</code></em></span></dt><dd><p> 8 Mask to apply to read register value 9 </p></dd><dt><span class="term"><em class="parameter"><code>val</code></em></span></dt><dd><p> 10 Wait condition 11 </p></dd><dt><span class="term"><em class="parameter"><code>interval</code></em></span></dt><dd><p> 12 polling interval in milliseconds 13 </p></dd><dt><span class="term"><em class="parameter"><code>timeout</code></em></span></dt><dd><p> 14 timeout in milliseconds 15 </p></dd></dl></div></div><div class="refsect1"><a name="idp1123934212"></a><h2>Description</h2><p> 16 Waiting for some bits of register to change is a common 17 operation for ATA controllers. This function reads 32bit LE 18 IO-mapped register <em class="parameter"><code>reg</code></em> and tests for the following condition. 19 </p><p> 20 21 (*<em class="parameter"><code>reg</code></em> & mask) != val 22 </p><p> 23 24 If the condition is met, it returns; otherwise, the process is 25 repeated after <em class="parameter"><code>interval_msec</code></em> until timeout. 26</p></div><div class="refsect1"><a name="idp1123936332"></a><h2>LOCKING</h2><p> 27 Kernel thread context (may sleep) 28</p></div><div class="refsect1"><a name="idp1123936956"></a><h2>RETURNS</h2><p> 29 The final register value. 30</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-ata-msleep.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="libataExt.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-sata-lpm-ignore-phy-events.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">ata_msleep</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">sata_lpm_ignore_phy_events</span></td></tr></table></div></body></html> 31