Pin Control APIs
This topic provides details for the pinctrl APIs.
pinctrl_get
| Synopsis |
|
| Description | Obtains a handle to the pin control resources for the specified device |
| Parameter | dev: The target device |
| Return |
|
pinctrl_put
This interface can be used only after pinctrl_get has been used. Otherwise, its use is invalid.
| Synopsis |
|
| Description | Discounts usage on a previously claimed pin control handle.
It must be used in pair with the pinctrl_get()
function. |
| Parameter | p: The pinctrl handle to release. |
| Return | None |
devm_pinctrl_get
| Synopsis |
|
| Description | Equal to pinctrl_get, but with resource management capabilities. |
| Parameter | dev: The device to which the pin operation applies. |
| Return |
|
| Example | The following call example obtains a handle to the pin
control resources for the PCIe
device. |
devm_pinctrl_put
This interface can be used only after pinctrl_get has been used. Otherwise, its use is invalid. Normally, you may not need this function, as it may release all resources.
| Synopsis |
|
| Description | Equal to pinctrl_put, but with resource management capabilities. You can
de-allocate a struct pinctrl obtained via
devm_pinctrl_get() |
| Parameter | p: The pinctrl handle to release. |
| Return | None |
pinctrl_lookup_state
| Synopsis |
|
| Description | Looks up named pin states from the handle you obtained with
devm_pinctrl_get(). |
| Parameter |
|
| Return |
|
| Example | The following call example looks for the states named
"perst-default", "perst-active" and
"power-active". |
pinctrl_select_state
| Synopsis |
|
| Description | Selects, activates or programs a pin control state to the hardware. |
| Parameter |
|
| Return |
|
| Example | The following call example sets the PCIe power pin to active
(high) and the PCIe reset pin to active
(low). |