1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>struct pwm_ops</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-struct-pwm-device.html" title="struct pwm_device"><link rel="next" href="API-struct-pwm-chip.html" title="struct pwm_chip"></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">struct pwm_ops</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-pwm-device.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-struct-pwm-chip.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-pwm-ops"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct pwm_ops — 
2     PWM controller operations
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4struct pwm_ops {
5  int (* request) (struct pwm_chip *chip, struct pwm_device *pwm);
6  void (* free) (struct pwm_chip *chip, struct pwm_device *pwm);
7  int (* config) (struct pwm_chip *chip, struct pwm_device *pwm,int duty_ns, int period_ns);
8  int (* set_polarity) (struct pwm_chip *chip, struct pwm_device *pwm,enum pwm_polarity polarity);
9  int (* enable) (struct pwm_chip *chip, struct pwm_device *pwm);
10  void (* disable) (struct pwm_chip *chip, struct pwm_device *pwm);
11#ifdef CONFIG_DEBUG_FS
12  void (* dbg_show) (struct pwm_chip *chip, struct seq_file *s);
13#endif
14  struct module * owner;
15};  </pre></div><div class="refsect1"><a name="id-1.15.8.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">request</span></dt><dd><p>
16   optional hook for requesting a PWM
17      </p></dd><dt><span class="term">free</span></dt><dd><p>
18   optional hook for freeing a PWM
19      </p></dd><dt><span class="term">config</span></dt><dd><p>
20   configure duty cycles and period length for this PWM
21      </p></dd><dt><span class="term">set_polarity</span></dt><dd><p>
22   configure the polarity of this PWM
23      </p></dd><dt><span class="term">enable</span></dt><dd><p>
24   enable PWM output toggling
25      </p></dd><dt><span class="term">disable</span></dt><dd><p>
26   disable PWM output toggling
27      </p></dd><dt><span class="term">dbg_show</span></dt><dd><p>
28   optional routine to show contents in debugfs
29      </p></dd><dt><span class="term">owner</span></dt><dd><p>
30   helps prevent removal of modules exporting active PWMs
31      </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-pwm-device.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-struct-pwm-chip.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct pwm_device</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 pwm_chip</span></td></tr></table></div></body></html>
32