diff options
Diffstat (limited to 'static/freebsd/man9/fdt_pinctrl.9 3.html')
| -rw-r--r-- | static/freebsd/man9/fdt_pinctrl.9 3.html | 174 |
1 files changed, 0 insertions, 174 deletions
diff --git a/static/freebsd/man9/fdt_pinctrl.9 3.html b/static/freebsd/man9/fdt_pinctrl.9 3.html deleted file mode 100644 index 4e0102b7..00000000 --- a/static/freebsd/man9/fdt_pinctrl.9 3.html +++ /dev/null @@ -1,174 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">fdt_pinctrl(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">fdt_pinctrl(9)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">fdt_pinctrl</code> — - <span class="Nd">helper functions for FDT pinmux controller - drivers</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="In">#include - <<a class="In">dev/fdt/fdt_pinctrl.h</a>></code></p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">fdt_pinctrl_configure</code>(<var class="Fa" style="white-space: nowrap;">device_t - client</var>, <var class="Fa" style="white-space: nowrap;">u_int - index</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">fdt_pinctrl_configure_by_name</code>(<var class="Fa" style="white-space: nowrap;">device_t - client</var>, <var class="Fa" style="white-space: nowrap;">const char * - name</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">fdt_pinctrl_register</code>(<var class="Fa" style="white-space: nowrap;">device_t - pinctrl</var>, <var class="Fa" style="white-space: nowrap;">const char - *pinprop</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">fdt_pinctrl_configure_tree</code>(<var class="Fa" style="white-space: nowrap;">device_t - pinctrl</var>);</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp"><a class="Xr">fdt_pinctrl(4)</a> provides an API for manipulating - I/O pin configurations on pinmux controllers and pinmux clients. On the - controller side, the standard newbus probe and attach methods are - implemented. As part of handling attach, it calls the - <a class="permalink" href="#fdt_pinctrl_register"><code class="Fn" id="fdt_pinctrl_register">fdt_pinctrl_register</code></a>() - function to register itself as a pinmux controller. Then - <code class="Fn">fdt_pinctrl_configure_tree</code>() is used to walk the - device tree and configure pins specified by the pinctrl-0 property for all - active devices. The driver also implements the - <code class="Fn">fdt_pinctrl_configure</code>() method, which allows client - devices to change their pin configurations after startup. If a client device - requires a pin configuration change at some point of its lifecycle, it uses - the <code class="Fn">fdt_pinctrl_configure</code>() or - <code class="Fn">fdt_pinctrl_configure_by_name</code>() functions.</p> -<p class="Pp" id="fdt_pinctrl_configure"><a class="permalink" href="#fdt_pinctrl_configure"><code class="Fn">fdt_pinctrl_configure</code></a>() - is used by client device <var class="Fa">client</var> to request a pin - configuration described by the pinctrl-N property with index - <var class="Fa">index</var>.</p> -<p class="Pp" id="fdt_pinctrl_configure_by_name"><a class="permalink" href="#fdt_pinctrl_configure_by_name"><code class="Fn">fdt_pinctrl_configure_by_name</code></a>() - is used by client device <var class="Fa">client</var> to request the pin - configuration with name <var class="Fa">name</var>.</p> -<p class="Pp" id="fdt_pinctrl_register~2"><a class="permalink" href="#fdt_pinctrl_register~2"><code class="Fn">fdt_pinctrl_register</code></a>() - registers a pinctrl driver so that it can be used by other devices which - call <code class="Fn">fdt_pinctrl_configure</code>() or - <code class="Fn">fdt_pinctrl_configure_by_name</code>(). It also registers - each child node of the pinctrl driver's node which contains a property with - the name given in <var class="Fa">pinprop</var>. If - <var class="Fa">pinprop</var> is <code class="Dv">NULL</code>, every - descendant node is registered. It is possible for the driver to register - itself as a pinmux controller for more than one pin property type by calling - <code class="Fn">fdt_pinctrl_register</code>() multiple types.</p> -<p class="Pp" id="fdt_pinctrl_configure_tree"><a class="permalink" href="#fdt_pinctrl_configure_tree"><code class="Fn">fdt_pinctrl_configure_tree</code></a>() - walks through enabled devices in the device tree. If the pinctrl-0 property - contains references to child nodes of the specified pinctrl device, their - pins are configured.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> -<div class="Bd Li"> -<pre>static int -foo_configure_pins(device_t dev, phandle_t cfgxref) -{ - phandle_t cfgnode; - uint32_t *pins, *functions; - int npins, nfunctions; - - cfgnode = OF_node_from_xref(cfgxref); - pins = NULL; - npins = OF_getencprop_alloc_multi(cfgnode, "foo,pins", sizeof(*pins), - (void **)&pins); - functions = NULL; - nfunctions = OF_getencprop_alloc_multi(cfgnode, "foo,functions", - sizeof(*functions), (void **)&functions); - ... -} - -static int -foo_is_gpio(device_t dev, device_t gpiodev, bool *is_gpio) -{ - return (foo_is_pin_func_gpio(is_gpio)); -} - -static int -foo_set_flags(device_t dev, device_t gpiodev, uint32_t pin, uint32_t flags) -{ - int rv; - - rv = foo_is_pin_func_gpio(is_gpio); - if (rv != 0) - return (rv); - foo_set_flags(pin, flags); - return (0); -} - -static int -foo_get_flags(device_t dev, device_t gpiodev, uint32_t pin, uint32_t *flags) -{ - int rv; - - rv = foo_is_pin_func_gpio(is_gpio); - if (rv != 0) - return (rv); - foo_get_flags(pin, flags); - return (0); -} - -static int -foo_attach(device_t dev) -{ - ... - - fdt_pinctrl_register(dev, "foo,pins"); - /* - * It is possible to register more than one pinprop handler - */ - fdt_pinctrl_register(dev, "bar,pins"); - fdt_pinctrl_configure_tree(dev); - - return (0); -} - -static device_method_t foo_methods[] = { - ... - - /* fdt_pinctrl interface */ - DEVMETHOD(fdt_pinctrl_configure, foo_configure_pins), - DEVMETHOD(fdt_pinctrl_is_gpio, foo_is_gpio), - DEVMETHOD(fdt_pinctrl_set_flags, foo_set_flags), - DEVMETHOD(fdt_pinctrl_get_flags, foo_get_flags), - - /* Terminate method list */ - DEVMETHOD_END -}; - -DRIVER_MODULE(foo, simplebus, foo_driver, foo_devclass, NULL, NULL);</pre> -</div> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">fdt_pinctrl(4)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp">This manual page was written by <span class="An">Oleksandr - Tymoshenko</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">June 23, 2018</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
