diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-04-30 17:49:49 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-04-30 17:53:58 -0400 |
commit | ca731a5da08926f669360342bcad50353fbe141a (patch) | |
tree | 670a546ca3accd4647d46a6b5c90a6b067fb7a0a /drivers/pinctrl | |
parent | 989b7135666c464d90e296752802b2f37d168588 (diff) | |
parent | c0af14d3212a54c6a11759cd6b78e755c68714a1 (diff) |
Merge branch 'ux500-gpio-pins-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into next/gpio
Linus Walleij <linus.walleij@linaro.org> writes:
This is a pull request for the GPIO and pin control stuff
accumulated in the ST-Ericsson tree. Here we have:
- Improvements and fixes and a custom pin config API from
Rabin Vincent
- Device Tree bindings from Lee Jones
- Some accumulated patches by yours truly.
- A MSP platform data init patch from Ola Lilja that is merged
here due to dependency on pin config work. It is to be
used with work being worked on in parallel in the ALSA
SoC subsystem.
If you wonder about the custom pin config implementation this
is to be used as a transition base as I am rewriting the
driver to use pinctrl. Expect a final pull request on top
of this one that will move the ux500 over to pinctrl.
* 'ux500-gpio-pins-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson:
ARM: ux500: Add support for MSP I2S-devices
drivers/gpio: gpio-nomadik: Add support for irqdomains
drivers/gpio: gpio-nomadik: Apply Device Tree bindings
ARM: ux500: update pin handling
ARM: ux500: implement pin API
ARM: ux500: remove a bunch of internal pull-ups
plat-nomadik: new sleep mode pincfg macros
gpio/nomadik: use ioremap() instead of static mappings
gpio/nomadik: support low EMI mode
gpio/nomadik: fix spurious interrupts with SKE
gpio/nomadik: cache [rf]w?imsc
gpio/nomadik: don't set SLPM to 1 for non-wakeup pins
Also includes an update to v3.4-rc4.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/core.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index ec3b8cc188af..df6296c5f47b 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -908,10 +908,6 @@ static int pinctrl_groups_show(struct seq_file *s, void *what) | |||
908 | const struct pinctrl_ops *ops = pctldev->desc->pctlops; | 908 | const struct pinctrl_ops *ops = pctldev->desc->pctlops; |
909 | unsigned selector = 0; | 909 | unsigned selector = 0; |
910 | 910 | ||
911 | /* No grouping */ | ||
912 | if (!ops) | ||
913 | return 0; | ||
914 | |||
915 | mutex_lock(&pinctrl_mutex); | 911 | mutex_lock(&pinctrl_mutex); |
916 | 912 | ||
917 | seq_puts(s, "registered pin groups:\n"); | 913 | seq_puts(s, "registered pin groups:\n"); |
@@ -1225,6 +1221,19 @@ static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) | |||
1225 | 1221 | ||
1226 | #endif | 1222 | #endif |
1227 | 1223 | ||
1224 | static int pinctrl_check_ops(struct pinctrl_dev *pctldev) | ||
1225 | { | ||
1226 | const struct pinctrl_ops *ops = pctldev->desc->pctlops; | ||
1227 | |||
1228 | if (!ops || | ||
1229 | !ops->list_groups || | ||
1230 | !ops->get_group_name || | ||
1231 | !ops->get_group_pins) | ||
1232 | return -EINVAL; | ||
1233 | |||
1234 | return 0; | ||
1235 | } | ||
1236 | |||
1228 | /** | 1237 | /** |
1229 | * pinctrl_register() - register a pin controller device | 1238 | * pinctrl_register() - register a pin controller device |
1230 | * @pctldesc: descriptor for this pin controller | 1239 | * @pctldesc: descriptor for this pin controller |
@@ -1256,6 +1265,14 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc, | |||
1256 | INIT_LIST_HEAD(&pctldev->gpio_ranges); | 1265 | INIT_LIST_HEAD(&pctldev->gpio_ranges); |
1257 | pctldev->dev = dev; | 1266 | pctldev->dev = dev; |
1258 | 1267 | ||
1268 | /* check core ops for sanity */ | ||
1269 | ret = pinctrl_check_ops(pctldev); | ||
1270 | if (ret) { | ||
1271 | pr_err("%s pinctrl ops lacks necessary functions\n", | ||
1272 | pctldesc->name); | ||
1273 | goto out_err; | ||
1274 | } | ||
1275 | |||
1259 | /* If we're implementing pinmuxing, check the ops for sanity */ | 1276 | /* If we're implementing pinmuxing, check the ops for sanity */ |
1260 | if (pctldesc->pmxops) { | 1277 | if (pctldesc->pmxops) { |
1261 | ret = pinmux_check_ops(pctldev); | 1278 | ret = pinmux_check_ops(pctldev); |