pinctrl: add pinconf-generic defines for output
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 4 Jan 2013 16:57:40 +0000 (17:57 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 11 Jan 2013 20:49:20 +0000 (21:49 +0100)
This adds a definition of a generic output configuration
for a certain pin when using the generic pin configuration
library. Whereas driving pins low/high is usually a GPIO
business, you may want to set up pins into a default state
using hogs, and never touch them again. This helps out
with that scenario.

Based on a patch from Patrice Chotard.

Signed-off-by: Patrice Chotard <patrice.chotard@stericsson.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinconf-generic.c
include/linux/pinctrl/pinconf-generic.h

index 833a36458157dd4c15ce0361ee84ced454cd93f4..bcf8157ceea731d22833bcbb20792fd5a8fb8c6c 100644 (file)
@@ -46,6 +46,7 @@ struct pin_config_item conf_items[] = {
        PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "time units"),
        PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector"),
        PCONFDUMP(PIN_CONFIG_LOW_POWER_MODE, "pin low power", "mode"),
+       PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level"),
 };
 
 void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev,
index 47a1bdd88878da4b6a7be614b654b8b0ce228006..b23d99da3b4b6fec8623a7654042e9d26bd628b3 100644 (file)
@@ -62,6 +62,8 @@
  *     operation, if several modes of operation are supported these can be
  *     passed in the argument on a custom form, else just use argument 1
  *     to indicate low power mode, argument 0 turns low power mode off.
+ * @PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument
+ *     1 to indicate high level, argument 0 to indicate low level.
  * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
  *     you need to pass in custom configurations to the pin controller, use
  *     PIN_CONFIG_END+1 as the base offset.
@@ -79,6 +81,7 @@ enum pin_config_param {
        PIN_CONFIG_INPUT_DEBOUNCE,
        PIN_CONFIG_POWER_SOURCE,
        PIN_CONFIG_LOW_POWER_MODE,
+       PIN_CONFIG_OUTPUT,
        PIN_CONFIG_END = 0x7FFF,
 };