diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-11 10:43:14 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-11 10:43:14 -0800 |
commit | c1b30e4d9466000c0e287e9245d4397da4d7d2f9 (patch) | |
tree | 18ac4c6bb435202cee8e7281f58b0c72f7fa0144 /drivers/pinctrl/pinconf-generic.c | |
parent | 92a578b064d0227a3a7fbbdb9e29dbab7f8d400e (diff) | |
parent | 853b6bf044dcced57c523dbddabf8942e907be6e (diff) |
Merge tag 'pinctrl-v3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control changes from Linus Walleij:
"Here is a stash of pin control changes I have collected for the v3.19
series. Mainly new hardware support, with Intels new embedded SoC as
the especially interesting thing standing out, fully using the
subsystem.
- Force conversion of the ux500 pin control device trees and parsers
to use the generic pin control bindings.
- New driver and device tree bindings for the Qualcomm PMIC MPP pin
controller and GPIO.
- Some ACPI infrastructure for pin controllers.
- New driver for the Intel CherryView/Braswell pin controller, the
first Intel pin controller to fully take advantage of the pin
control subsystem.
- Support the Freescale i.MX VF610 variant.
- Support the sunxi A80 variant.
- Support the Samsung Exynos 4415 and Exynos 7 variants.
- Split out Intel pin controllers to their own subdirectory.
- A large slew of rockchip pin control updates, including
suspend/resume support.
- A large slew of Samsung Exynos pin controller updates.
- Various minor updates and fixes"
* tag 'pinctrl-v3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (49 commits)
pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show
pinctrl: meson: add device tree bindings documentation
gpio: tz1090: Fix error handling of irq_of_parse_and_map
pinctrl: tz1090-pinctrl.txt: Fix typo in binding
pinctrl: pinconf-generic: Declare dt_params/conf_items const
pinctrl: exynos: Add support for Exynos4415
pinctrl: exynos: Add initial driver data for Exynos7
pinctrl: exynos: Add irq_chip instance for Exynos7 wakeup interrupts
pinctrl: exynos: Consolidate irq domain callbacks
pinctrl: exynos: Generalize the eint16_31 demux code
pinctrl: samsung: Separate per-bank init and runtime data
pinctrl: samsung: Constify samsung_pin_ctrl struct
pinctrl: samsung: Constify samsung_pin_bank_type struct
pinctrl: samsung: Drop unused label field in samsung_pin_ctrl struct
pinctrl: samsung: Make samsung_pinctrl_get_soc_data use ERR_PTR()
pinctrl: Add Intel Cherryview/Braswell pin controller support
gpio / ACPI: Add knowledge about pin controllers to acpi_get_gpiod()
pinctrl: Fix path error in documentation
pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume
pinctrl: rockchip: add suspend/resume functions
...
Diffstat (limited to 'drivers/pinctrl/pinconf-generic.c')
-rw-r--r-- | drivers/pinctrl/pinconf-generic.c | 71 |
1 files changed, 40 insertions, 31 deletions
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 29ff77f90fcb..f78b416d7984 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -32,30 +32,32 @@ struct pin_config_item { const enum pin_config_param param; const char * const display; const char * const format; + bool has_arg; }; -#define PCONFDUMP(a, b, c) { .param = a, .display = b, .format = c } +#define PCONFDUMP(a, b, c, d) { .param = a, .display = b, .format = c, \ + .has_arg = d } -static struct pin_config_item conf_items[] = { - PCONFDUMP(PIN_CONFIG_BIAS_DISABLE, "input bias disabled", NULL), - PCONFDUMP(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, "input bias high impedance", NULL), - PCONFDUMP(PIN_CONFIG_BIAS_BUS_HOLD, "input bias bus hold", NULL), - PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL), - PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN, "input bias pull down", NULL), +static const struct pin_config_item conf_items[] = { + PCONFDUMP(PIN_CONFIG_BIAS_DISABLE, "input bias disabled", NULL, false), + PCONFDUMP(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, "input bias high impedance", NULL, false), + PCONFDUMP(PIN_CONFIG_BIAS_BUS_HOLD, "input bias bus hold", NULL, false), + PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL, false), + PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN, "input bias pull down", NULL, false), PCONFDUMP(PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, - "input bias pull to pin specific state", NULL), - PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL), - PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL), - PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL), - PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA"), - PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL), - PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL), - PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL), - PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec"), - PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector"), - PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL), - PCONFDUMP(PIN_CONFIG_LOW_POWER_MODE, "pin low power", "mode"), - PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level"), + "input bias pull to pin specific state", NULL, false), + PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL, false), + PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL, false), + PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL, false), + PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA", true), + PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL, false), + PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL, false), + PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL, false), + PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec", true), + PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true), + PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true), + PCONFDUMP(PIN_CONFIG_LOW_POWER_MODE, "pin low power", "mode", true), + PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true), }; void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev, @@ -85,11 +87,14 @@ void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev, seq_puts(s, " "); seq_puts(s, conf_items[i].display); /* Print unit if available */ - if (conf_items[i].format && - pinconf_to_config_argument(config) != 0) - seq_printf(s, " (%u %s)", - pinconf_to_config_argument(config), - conf_items[i].format); + if (conf_items[i].has_arg) { + seq_printf(s, " (%u", + pinconf_to_config_argument(config)); + if (conf_items[i].format) + seq_printf(s, " %s)", conf_items[i].format); + else + seq_puts(s, ")"); + } } } @@ -121,10 +126,14 @@ void pinconf_generic_dump_group(struct pinctrl_dev *pctldev, seq_puts(s, " "); seq_puts(s, conf_items[i].display); /* Print unit if available */ - if (conf_items[i].format && config != 0) - seq_printf(s, " (%u %s)", - pinconf_to_config_argument(config), - conf_items[i].format); + if (conf_items[i].has_arg) { + seq_printf(s, " (%u", + pinconf_to_config_argument(config)); + if (conf_items[i].format) + seq_printf(s, " %s)", conf_items[i].format); + else + seq_puts(s, ")"); + } } } @@ -150,7 +159,7 @@ struct pinconf_generic_dt_params { u32 default_value; }; -static struct pinconf_generic_dt_params dt_params[] = { +static const struct pinconf_generic_dt_params dt_params[] = { { "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 }, { "bias-high-impedance", PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 0 }, { "bias-bus-hold", PIN_CONFIG_BIAS_BUS_HOLD, 0 }, @@ -200,7 +209,7 @@ int pinconf_generic_parse_dt_config(struct device_node *np, return -ENOMEM; for (i = 0; i < ARRAY_SIZE(dt_params); i++) { - struct pinconf_generic_dt_params *par = &dt_params[i]; + const struct pinconf_generic_dt_params *par = &dt_params[i]; ret = of_property_read_u32(np, par->property, &val); /* property not found */ |