diff options
author | Olof Johansson <olof@lixom.net> | 2014-05-21 17:23:56 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-05-21 17:23:56 -0400 |
commit | 486ad2ede13314346226ee52e92b8e8773221f63 (patch) | |
tree | 84b6ed35d2701ececc244fda1163b9db58a4d07c /drivers/pinctrl/pinctrl-as3722.c | |
parent | 9e05f9f300828aecb84659cedc6399b7a76683ef (diff) | |
parent | 6b2c31c71d6fa8896c5f3f2354d790a5bd3f0a1e (diff) |
Merge tag 'vexpress/updates-for-3.16' of git://git.linaro.org/people/pawel.moll/linux into next/cleanup
Merge "ARM Versatile Express updates for 3.16" from Pawel Moll:
This series reworks VE's platform configuration infrastructure by:
- making it possible to instantiate selected devices from the
Device Tree, prior to massive population,
- converting custom "func" API into standard "regmap",
- splitting the existing MFD driver into smaller ones and placing
them into relevant directories.
The common clock framework driver can now be selected individually
(mostly for arm64 sake, where some of them are not used at all).
It also simplifies the machine code, by:
- moving the shed clock info clocksource driver,
- simplifying SMP operations to base them entirely of the DT data,
- moving platform ID checks into relevant driver.
* tag 'vexpress/updates-for-3.16' of git://git.linaro.org/people/pawel.moll/linux:
ARM: vexpress: move HBI check to sysreg driver
ARM: vexpress: Simplify SMP operations for DT-powered system
ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count
clocksource: Sched clock source for Versatile Express
clk: versatile: Split config options for sp810 and vexpress_osc
mfd: vexpress: Define the device as MFD cells
mfd: syscon: Add platform data with a regmap config name
mfd: vexpress: Convert custom func API to regmap
of: Keep track of populated platform devices
+ Linux 3.15-rc5
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/pinctrl/pinctrl-as3722.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-as3722.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c index 92ed4b2e3c07..c862f9c0e9ce 100644 --- a/drivers/pinctrl/pinctrl-as3722.c +++ b/drivers/pinctrl/pinctrl-as3722.c | |||
@@ -64,7 +64,6 @@ struct as3722_pin_function { | |||
64 | }; | 64 | }; |
65 | 65 | ||
66 | struct as3722_gpio_pin_control { | 66 | struct as3722_gpio_pin_control { |
67 | bool enable_gpio_invert; | ||
68 | unsigned mode_prop; | 67 | unsigned mode_prop; |
69 | int io_function; | 68 | int io_function; |
70 | }; | 69 | }; |
@@ -320,10 +319,8 @@ static int as3722_pinctrl_gpio_set_direction(struct pinctrl_dev *pctldev, | |||
320 | return mode; | 319 | return mode; |
321 | } | 320 | } |
322 | 321 | ||
323 | if (as_pci->gpio_control[offset].enable_gpio_invert) | 322 | return as3722_update_bits(as3722, AS3722_GPIOn_CONTROL_REG(offset), |
324 | mode |= AS3722_GPIO_INV; | 323 | AS3722_GPIO_MODE_MASK, mode); |
325 | |||
326 | return as3722_write(as3722, AS3722_GPIOn_CONTROL_REG(offset), mode); | ||
327 | } | 324 | } |
328 | 325 | ||
329 | static const struct pinmux_ops as3722_pinmux_ops = { | 326 | static const struct pinmux_ops as3722_pinmux_ops = { |
@@ -496,10 +493,18 @@ static void as3722_gpio_set(struct gpio_chip *chip, unsigned offset, | |||
496 | { | 493 | { |
497 | struct as3722_pctrl_info *as_pci = to_as_pci(chip); | 494 | struct as3722_pctrl_info *as_pci = to_as_pci(chip); |
498 | struct as3722 *as3722 = as_pci->as3722; | 495 | struct as3722 *as3722 = as_pci->as3722; |
499 | int en_invert = as_pci->gpio_control[offset].enable_gpio_invert; | 496 | int en_invert; |
500 | u32 val; | 497 | u32 val; |
501 | int ret; | 498 | int ret; |
502 | 499 | ||
500 | ret = as3722_read(as3722, AS3722_GPIOn_CONTROL_REG(offset), &val); | ||
501 | if (ret < 0) { | ||
502 | dev_err(as_pci->dev, | ||
503 | "GPIO_CONTROL%d_REG read failed: %d\n", offset, ret); | ||
504 | return; | ||
505 | } | ||
506 | en_invert = !!(val & AS3722_GPIO_INV); | ||
507 | |||
503 | if (value) | 508 | if (value) |
504 | val = (en_invert) ? 0 : AS3722_GPIOn_SIGNAL(offset); | 509 | val = (en_invert) ? 0 : AS3722_GPIOn_SIGNAL(offset); |
505 | else | 510 | else |