1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>of_pwm_get</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="pwm.html" title="Chapter 13. Pulse-Width Modulation (PWM)"><link rel="prev" href="API-pwm-disable.html" title="pwm_disable"><link rel="next" href="API-pwm-get.html" title="pwm_get"></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">of_pwm_get</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-pwm-disable.html">Prev</a> </td><th width="60%" align="center">Chapter 13. Pulse-Width Modulation (PWM)</th><td width="20%" align="right"> <a accesskey="n" href="API-pwm-get.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-of-pwm-get"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>of_pwm_get — 2 request a PWM via the PWM framework 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"><a class="link" href="API-struct-pwm-device.html" title="struct pwm_device">struct pwm_device</a> * <b class="fsfunc">of_pwm_get </b>(</code></td><td>struct device_node * <var class="pdparam">np</var>, </td></tr><tr><td> </td><td>const char * <var class="pdparam">con_id</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.15.22.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>np</code></em></span></dt><dd><p> 4 device node to get the PWM from 5 </p></dd><dt><span class="term"><em class="parameter"><code>con_id</code></em></span></dt><dd><p> 6 consumer name 7 </p></dd></dl></div></div><div class="refsect1"><a name="id-1.15.22.6"></a><h2>Description</h2><p> 8 Returns the PWM device parsed from the phandle and index specified in the 9 <span class="quote">“<span class="quote">pwms</span>”</span> property of a device tree node or a negative error-code on failure. 10 Values parsed from the device tree are stored in the returned PWM device 11 object. 12 </p><p> 13 14 If con_id is NULL, the first PWM device listed in the <span class="quote">“<span class="quote">pwms</span>”</span> property will 15 be requested. Otherwise the <span class="quote">“<span class="quote">pwm-names</span>”</span> property is used to do a reverse 16 lookup of the PWM index. This also means that the <span class="quote">“<span class="quote">pwm-names</span>”</span> property 17 becomes mandatory for devices that look up the PWM device via the con_id 18 parameter. 19</p></div><div class="refsect1"><a name="id-1.15.22.7"></a><h2>Returns</h2><p> 20 A pointer to the requested PWM device or an <code class="function">ERR_PTR</code>-encoded 21 error code on failure. 22</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-pwm-disable.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pwm.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-pwm-get.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">pwm_disable</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">pwm_get</span></td></tr></table></div></body></html> 23