1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>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-of-pwm-get.html" title="of_pwm_get"><link rel="next" href="API-pwm-put.html" title="pwm_put"></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">pwm_get</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-of-pwm-get.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-put.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-pwm-get"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>pwm_get — 
2     look up and request a PWM device
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">pwm_get </b>(</code></td><td><a class="link" href="API-struct-device.html" title="struct device">struct device</a> * <var class="pdparam">dev</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.23.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>dev</code></em></span></dt><dd><p>
4     device for PWM consumer
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.23.6"></a><h2>Description</h2><p>
8   Lookup is first attempted using DT. If the device was not instantiated from
9   a device tree, a PWM chip and a relative index is looked up via a table
10   supplied by board setup code (see <code class="function">pwm_add_table</code>).
11   </p><p>
12
13   Once a PWM chip has been found the specified PWM device will be requested
14   and is ready to be used.
15</p></div><div class="refsect1"><a name="id-1.15.23.7"></a><h2>Returns</h2><p>
16   A pointer to the requested PWM device or an <code class="function">ERR_PTR</code>-encoded
17   error code on failure.
18</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-of-pwm-get.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-put.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">of_pwm_get</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_put</span></td></tr></table></div></body></html>
19