Commit Graph

426184 Commits

Author SHA1 Message Date
Linus Walleij 17cdc926ec pinctrl: msm: fix up out-of-order merge conflict
Commit 051a58b462
"pinctrl: msm: Simplify msm_config_reg() and callers"
removed the local "reg" variable in the msm_config_reg()
function, but the earlier
commit ed118a5fd9
"pinctrl-msm: Support output-{high,low} configuration"
introduced a new switchclause using it.

Fix this up by removing the offending register assignment.

Reported-by: Kbuild test robot <fengguang.wu@intel.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-14 16:32:23 +01:00
Srinivas Kandagatla bcca9220b2 pinctrl: st: Fix error check for of_irq_to_resource usage
This patch fixes an error check while using of_irq_to_resource.
of_irq_to_resource returns non-zero interrupt number on success and zero
on error. The driver was using error check is wrong way.

Without this patch the driver will configure interrupt zero if there is
no interrupt specified in the node.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:53:44 +01:00
Stephen Warren 93cfb2d862 pinctrl: tegra: consistency cleanup
Fix Tegra30/114/124 pinmux drivers consistency issues.
* Sort all lists of the same object type (e.g. #defines for pins, and
  the array that defines their names) in the same order.
* Whitespace fixes.
* Consistency in layout between the 3 drivers.

These driver files were also auto-generated, which should allow us to
make e.g. the U-Boot drivers completely consistent with the kernel in
the future:-)

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:27:33 +01:00
Stephen Warren ce43625466 pinctrl: tegra: dynamically calculate function list of groups
The per-SoC data structures for Tegra pinctrl stored some information
in a redundant way. Specifically, the list of groups that each function
could be muxed onto was stored once explicitly, and also as part of the
definition of each group. Eliminate this redundancy, and calculate each
function's list of valid groups at pinctrl probe time. This removes
thousands of lines of code from the pinctrl driver and ~16K from the
vmlinux binary size, and adds only about 500uS to the boot process (on
Tegra30; newer SoCs will likely be faster still).

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:23:41 +01:00
Stephen Warren edfab368c8 pinctrl: tegra: init Tegra20/30 at module_init time
The Tegra20/30 pinctrl drivers currently initializes at arch_initcall,
whereas Tegra114/124 pinctrl drivers initialize at module_init time.
Convert Tegra20/30 to work the same way as the other drivers.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:22:29 +01:00
Maxime COQUELIN 88430acf38 pinctrl: st: Use ARRAY_SIZE instead of raw value for number of delays
This patch replaces the raw values with ARRAY_SIZE for assigning the
ninput_delays and noutput_delays fields of STiH416's st_pctl_data struct.

Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:18:24 +01:00
Giuseppe Cavallaro 7ce717db38 pinctrl: st: add pinctrl support for the STiH407 SoC
This patch adds the initial support for pinctrl based on H407 SoC.

Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:17:07 +01:00
Giuseppe Cavallaro 4e6a609fb7 pinctrl: st: Enhance the controller to manage unavailable registers
This patch adds a new logic inside the st pinctrl to manage
an unsupported scenario: some sysconfig are not available!

This is the case of STiH407 where, although documented, the
following registers from SYSCFG_FLASH have been removed from the SoC.

SYSTEM_CONFIG3040
   Output Enable pad control for all PIO Alternate Functions
and
SYSTEM_ CONFIG3050
   Pull Up pad control for all PIO Alternate Functions

Without managing this condition an imprecise external abort
will be detect.

To do this the patch also reviews the st_parse_syscfgs
and other routines to manipulate the registers only if
actually available.
In any case, for example the st_parse_syscfgs detected
an error condition but no action was made in the
st_pctl_probe_dt.

Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:15:34 +01:00
Stephen Boyd 051a58b462 pinctrl: msm: Simplify msm_config_reg() and callers
We don't need to check for a negative reg here because reg is
always the same and is always non-negative. Also, collapse the
switch statement down for the duplicate cases.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:12:29 +01:00
Stephen Boyd 1a0840ae03 pinctrl: msm: Remove impossible WARN_ON()s
All these functions are limited in what they can pass as the gpio
or irq number to whatever is setup during probe. Remove the
checks.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:12:28 +01:00
Stephen Boyd 7cc34e2e1a pinctrl: msm: Replace lookup tables with math
We don't need to waste space with these lookup tables, just do
the math directly.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:12:28 +01:00
Stephen Boyd 5f2449d022 pinctrl: msm: Drop OF_IRQ dependency
This driver doesn't rely on any functionality living in
drivers/of/irq.c to compile. Drop this dependency.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:12:27 +01:00
Stephen Boyd af3e18f13d pinctrl: msm: Drop unused includes
These includes are unused or can be handled via forward
declarations. Remove them.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:12:27 +01:00
Stephen Boyd dcd278b860 pinctrl: msm: Check for ngpios > MAX_NR_GPIO
Fail the probe and print a warning if SoC specific drivers have
more GPIOs than there can be accounted for in the static bitmaps.
This should avoid silent corruption/failures in the future.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:12:27 +01:00
Stephen Boyd 3525f5556a pinctrl: msm: Silence recursive lockdep warning
If a driver calls enable_irq_wake() on a gpio turned interrupt
from the msm pinctrl driver we'll get a lockdep warning like so:

=============================================
[ INFO: possible recursive locking detected ]
3.14.0-rc3 #2 Not tainted
---------------------------------------------
modprobe/52 is trying to acquire lock:
 (&irq_desc_lock_class){-.....}, at: [<c026aea0>] __irq_get_desc_lock+0x48/0x88

but task is already holding lock:
 (&irq_desc_lock_class){-.....}, at: [<c026aea0>] __irq_get_desc_lock+0x48/0x88

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&irq_desc_lock_class);
  lock(&irq_desc_lock_class);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by modprobe/52:
 #0:  (&__lockdep_no_validate__){......}, at: [<c04f2864>] __driver_attach+0x48/0x98
 #1:  (&__lockdep_no_validate__){......}, at: [<c04f2874>] __driver_attach+0x58/0x98
 #2:  (&irq_desc_lock_class){-.....}, at: [<c026aea0>] __irq_get_desc_lock+0x48/0x88
 #3:  (&(&pctrl->lock)->rlock){......}, at: [<c04bb4b8>] msm_gpio_irq_set_wake+0x20/0xa8

Silence it by putting the gpios into their own lock class.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:12:19 +01:00
Sebastian Hesselbarth 3c7d563789 pinctrl: mvebu: silence WARN to dev_warn
Pinctrl will WARN on missing DT resources, which is a little bit too
noisy. Use dev_warn with FW_BUG instead.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 15:00:04 +01:00
Josh Cartwright 6aced33f49 pinctrl: msm: drop wake_irqs bitmap
Currently, the wake_irqs bitmap is used to track whether there are any
gpio's which are configured as wake irqs, and uses this to determine
whether or not to call enable_irq_wake()/disable_irq_wake() on the
summary interrupt.

However, the genirq core already handles this case, by maintaining a
'wake_count' per irq_desc, and only calling into the controlling
irq_chip when wake_count transitions 0 <-> 1.

Drop this bitmap, and unconditionally call irq_set_irq_wake() on the
summary interrupt.

Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-12 14:54:28 +01:00
Chew, Kean Ho 42bd00706c pinctrl-baytrail: add function mux checking in gpio pin request
The requested gpio pin must has the func_pin_mux field set
to GPIO function by BIOS/FW in advanced. Else, the gpio pin
request would fail. This is to ensure that we do not expose
any gpio pins which shall be used for alternate functions,
for eg: wakeup pin, I/O interfaces for LPSS, etc.

Signed-off-by: Chew, Kean Ho <kean.ho.chew@intel.com>
Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-11 11:22:54 +01:00
Stephen Warren a76cbd7eba pinctrl: tegra: fix some typos and inconsistencies
drive_dev3_pins in pinctrl-tegra114.c wasn't used; delete it.

pinctrl-tegra124.c had quite a few typos. Fix those.

pinctrl-tegra124.c had a few mismatches between the *_groups[] ararys
and the function lists in tegra124_groups[]. Fix those.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-11 11:16:28 +01:00
Stephen Boyd 893a7d11a1 devicetree: bindings: Make msm8974-pinctrl documentation match code
The compatible string doesn't have an x in it. Fix it. Also
remove the "qcom" prefix from pins and functions as this binding
uses the generic pinctrl bindings for the pins and functions.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-07 09:28:52 +08:00
Geert Uytterhoeven e6fae2d03d pinctrl: sh-pfc: r8a7791: Add alternative MSIOF pin groups
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-05 09:53:49 +08:00
Geert Uytterhoeven 7033168da5 pinctrl: sh-pfc: r8a7790: Add alternative MSIOF pin groups
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-03-05 09:15:30 +08:00
Linus Walleij a9ea2ed45a Merge branch 'pinctrl-mvebu' into devel 2014-03-03 13:40:22 +08:00
Linus Walleij cdfe3175eb mvebu pinctrl changes for v3.15
- various cleanup and refactorization
  - add drivers for the Armada 375, 380, and 385 SoCs
  - prepare dove for SoC code moving into mach-mvebu
  - DT documentation updates
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTEYbGAAoJEP45WPkGe8ZngdYP/Rey5/+oVGm20eIALN2fjbjv
 bKDXNLeNvbhNaERCUj3NxgY7pm29fTttpImBaOoDkxl2VLgImFSjqJM1Dtx8Xtkc
 P+Noq6zKa0XCi4ebY+Fsm5nFvoDIW2nongMbHQVMeWFb94/DNB2KjqZAIrOtVxhh
 Uz0sVetbd/usvZ8K9pfmajTfS1NF2SlUKx8Np7scyAO9De1ab7w6Nt3/OHb9ypzu
 6ZxON/GIEl4hWJmV4s8yt7nbogEwTUJpn/ZufiSWJD6UHS2ciO5V1QUh/zGEiD19
 vvZyfjf5ZD1cIOvIk6+FJp6cd5L4DVmLKVLOD0GhKYxpy14i3xpuwSnErYF5hCAM
 PeifJTswkeG+BpLe4Xy3j2a8wqtFa7tjuOcuvOzDRgugVSocnypYcO//LkVkXh+J
 gZutUZe/V2p92Nkggke+TdHFgZE5E4ZF4ylUnMpmC8TIcWc+fSVHkg21Qx11VYBW
 KoOrUzQb53f2/Fg9EHgsSMqhY6bAIQGJKFC7piJXF0OJwD82USM7FHkw3CF6PvEj
 MWkZCj3UnuxabWgmfmGRlIAwZZNsaVWGOoJAG2gUeo1Zeaegf+fyupo960lJNqHj
 L4AupMe4LnLjEi8M14/4SSJ8zw/UiUA5PvZs7xMt/70zmzLIVWafL6qWeXur9DKU
 QQTonIizM0dpqoLLDE3y
 =Txkw
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-pinctrl-3.15' of git://git.infradead.org/linux-mvebu into pinctrl-mvebu

mvebu pinctrl changes for v3.15

 - various cleanup and refactorization
 - add drivers for the Armada 375, 380, and 385 SoCs
 - prepare dove for SoC code moving into mach-mvebu
 - DT documentation updates
2014-03-03 13:39:20 +08:00
Jason Cooper 7cab36e5ee Sign for-mvebu/pinctrl-3xx
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTDOcOAAoJEN2kpao7fSL46REP/2EX8ls2mLvOH8XUd9kC8GHS
 qDfsiAwrb84t1PzL3DkWX2eZXbBLZBWI5m0xTcvvnAuEKD/EuMFY13AyqF3fGZYk
 ixMJ0JyQ1ML73boLTdCE4xaS18tRdI7UKi3T1d+K2293oskpkCX+84JYBkMbyr5K
 ShLHDn0EEWMxPOH/PJcle5QM6taB8/vwrQPsTfAJjRoA/1yIJ5o+g8RkfhgGdJuL
 nend3dInAKDHLvjf/Up19j6tjJsaDEILDqVVpN55fhj6+d3yd0dpWg2nh3w/TCPe
 tVXppKIua6vm3t5INN8p55d2yOuSjD7/NR/Dc8sIGOnc99yLaBlilkDnagH19gc8
 PhHd3b3k/clEo2zEF/xy1DqvxS4t5Xd5p2D3lBlA0PCCDdQTbwkMXPdll0TNHV0Y
 AHPGv7VQYLkn1/iMo3UkgGAQOfdaL81NQNkULDlGxjfllX7cjNgePKIf1lCi6pI4
 SYaiqRUNg+5cln3gFfdXc/vcMBF7CLVETFFPK3cmQncdm36LMRE04PKB9hxT2taB
 zdmE3iNRVGsPQEwsDxTnrRU7zbaPCQVjTd4ctqW3SBn/4J9mIhjgEEKWfLFVFbvJ
 4A7UDCWSkRhQHB6pnf0Gvkt2j1PaDUWl0U8PMptwrRqF8JqmQnJ3Me3a1Fun5oV5
 bkRIixitLBfPY5QARgd7
 =BnOr
 -----END PGP SIGNATURE-----

Merge tag 'tags/for-mvebu-pinctrl-3xx' into mvebu/pinctrl

Sign for-mvebu/pinctrl-3xx
2014-03-01 07:03:52 +00:00
Jason Cooper 08d4f0c8b1 Merge remote-tracking branch 'shesselba/for-mvebu/pinctrl-dove' into mvebu/pinctrl 2014-03-01 07:03:36 +00:00
Jason Cooper 55387764c4 Sign for-mvebu/pinctrl-cleanup
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTDOboAAoJEN2kpao7fSL4OhoP/0+ceyuOEUdr3+XKBffHWc63
 7cSlG5jf8CButeqLUos16evAyLEs5Tpgka2r/CJTakI0b8DcTSAu+KkKpkffcLPA
 6mmR1mn2s19yR3JioHjRGSYudG7t62yJWXqdIIlvEJiG9bIFk7oirNtqPw1V0WQP
 z9EeZEEzoavBXmSMaamvOuOgZpfgziKdY9KKoXfFqNXbvvkyeB9H6PxhU6GqZsrT
 KUijbOuzNRjSZrfQeAn8+MR6qjUJuoIERzmNCWiJk0x1TJiiry0bVVhFCHLNwTwk
 /uGa7e+FsjRWfd+rRwgM66qyj+05SptcHZ+nIdUrfcpR6V7MJJKeGkc8v0Tcjx7L
 JYWYkLA3HbUtpxOVfc4JrNWXQg43In0EZ8Wu2JDZBLp570fgi6KX7eVE/NhAEyx2
 UcW0KUpYB31Izs9hPMYa4MCEMRkPziKNFxghKgNqLk49U7gRm1OITYX5bzuMno8i
 foIdQ22dz6czBAJW7GfRYkF8Os0hWopKZao8r0T5NHsnyUSbWD9UUZWiUSGLpcpi
 AaEsJDma/F4v44ondJiaxDeOofPjorz8wmjml39RCu+m8rDEY5afqnXsFfLdp2Hh
 CRN1ae3aQSLChFKAqOlilcIAYcfiJHDjyguoSJqen/QlaeE5CMWublPwlLuq/i1L
 UcFNWE7hu3R3+ZqU+rgX
 =w6Su
 -----END PGP SIGNATURE-----

Merge tag 'tags/for-mvebu-pinctrl-cleanup' into mvebu/pinctrl

Sign for-mvebu/pinctrl-cleanup
2014-03-01 07:03:00 +00:00
Sebastian Hesselbarth 6da67cab4b pinctrl: mvebu: dove: use global register regmap
Now that we have a regmap for global registers, get rid of the last
remaining hardcoded physical addresses. While at it, also remove
DOVE_ prefix from those macros.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2014-02-25 21:16:18 +01:00
Sebastian Hesselbarth 18e6f28e9c pinctrl: mvebu: dove: use remapped pmu_mpp registers
Now that we have ioremapped pmu_mpp registers, get rid of hardcoded
physical addresses. While at it, also remove DOVE_ prefix from those
macros.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2014-02-25 21:16:16 +01:00
Sebastian Hesselbarth 2c4b229baf pinctrl: mvebu: dove: use remapped mpp4 register
Now that we have an ioremapped mpp4 register, get rid of hardcoded
physical addresses. While at it, also remove DOVE_ prefix from those
macros.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2014-02-25 21:16:14 +01:00
Sebastian Hesselbarth 00202b013e pinctrl: mvebu: dove: use remapped mpp base registers
Now that we have ioremapped mpp base registers, get rid of hardcoded
physical addresses. While at it, also remove DOVE_ prefix from those
macros.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2014-02-25 21:16:12 +01:00
Sebastian Hesselbarth e91f7916ea pinctrl: mvebu: dove: request syscon regmap for global registers
Dove pinctrl uses some global config registers to control pins.
This patch requests a syscon regmap for those registers. As this
changes DT to driver requirements, fallback to a self-registered
regmap with hardcoded resources, if the corresponding syscon DT
node is missing. Also, WARN about old DT binding usage to encourage
users to update their DTBs.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2014-02-25 21:16:09 +01:00
Sebastian Hesselbarth 4d73fc7728 pinctrl: mvebu: dove: request additional resources
Dove pinctrl also requires additional registers to control all pins.
This patch requests resources for mpp4 and pmu-mpp register ranges.
As this changes DT to driver requirements, fallback to hardcoded
resources, if the corresponding DT regs have not been set.
Also, WARN about old DT binding usage to encourage users to update
their DTBs.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2014-02-25 21:16:08 +01:00
Sebastian Hesselbarth 356ca6ce0a devicetree: bindings: update MVEBU pinctrl binding documentation
Dove pinctrl binding now requires three different reg properties. This
updates corresponding binding and example accordingly. While at it, also
document reg property as required for the other MVEBU SoC pinctrl nodes.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-02-25 19:07:29 +01:00
Sebastian Hesselbarth 25eeefbf9c devicetree: bindings: add missing Marvell Dove SoC documentation
Marvell Dove SoC binding was not documented, yet. Add the documentation
and also describe Global Configuration register node in it.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-02-25 18:54:02 +01:00
Thomas Petazzoni ca6d9a084b pinctrl: mvebu: add pin-muxing driver for the Marvell Armada 380/385
The Marvell Armada 380/385 are new ARM SoCs from Marvell, part of the
mvebu family, but using a Cortex-A9 CPU core. In terms of pin-muxing,
it is similar to Armada 370 and XP for the register layout, only
different in the number of available pins and their
functions. Therefore, we simply use the existing
drivers/pinctrl/mvebu/ infrastructure, with no other changes that the
list of pins and corresponding functions.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-02-25 18:51:05 +01:00
Thomas Petazzoni ce3ed59dcd pinctrl: mvebu: add pin-muxing driver for the Marvell Armada 375
The Marvell Armada 375 is a new ARM SoC from Marvell, part of the
mvebu family, but using a Cortex-A9 CPU core. In terms of pin-muxing,
it is similar to Armada 370 and XP for the register layout, only
different in the number of available pins and their
functions. Therefore, we simply use the existing
drivers/pinctrl/mvebu/ infrastructure, with no other changes that the
list of pins and corresponding functions.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
2014-02-25 18:51:01 +01:00
Sebastian Hesselbarth 78c2c3d3da pinctrl: mvebu: dove: reuse mpp_{set,get} in pmu callbacks
Dove has pins that can be switched between normal and pmu functions.
Rework pmu_mpp callbacks to reuse default mpp ctrl helpers.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-02-25 18:38:41 +01:00
Sebastian Hesselbarth c2f082fe97 pinctrl: mvebu: dove: consolidate auto-numbered pmu mpp ranges
Passing a NULL name for pin ranges will auto-generate standard names
for each pin. With common pinctrl driver now checking NULL name correctly,
consolidate mpp pins 0-15.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-02-25 18:38:37 +01:00
Thomas Petazzoni cffa7a6b10 pinctrl: mvebu: remove MPP_REG_CTRL macro
Now that each per-SoC pinctrl driver must implement its own get/set
functions, there is no point in keeping the MPP_REG_CTRL macro, whose
purpose was to let the core pinctrl mvebu driver use default get/set
functions. While at it also update the comment about mvebu_mpp_ctrl.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-02-25 18:38:31 +01:00
Sebastian Hesselbarth faaa8325ad pinctrl: mvebu: remove common get/set functions
With every SoC always providing its own get/set callbacks, we can now
remove the generic ones, remove the obsolete base address, and always
use the provided callbacks.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-02-25 18:38:24 +01:00
Sebastian Hesselbarth 1217b790ae pinctrl: mvebu: move resource allocation to SoC specific drivers
The way that mvebu pinctrl is designed, requesting mpp registers
in common pinctrl driver does not allow SoC specific drivers to
access this resource.

Move resource allocation in each SoC pinctrl driver and enable
already provided mpp_{set,get} callbacks.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-02-25 18:37:53 +01:00
Sebastian Hesselbarth ad2a4f2b80 pinctrl: mvebu: armada-xp: provide generic mpp callbacks
We want to get rid of passing register addresses to common pinctrl
driver, so provide set/get callbacks that use generic mpp pins helper
and will be used later.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-02-25 18:35:41 +01:00
Sebastian Hesselbarth 877f01fc4d pinctrl: mvebu: armada-370: provide generic mpp callbacks
We want to get rid of passing register addresses to common pinctrl
driver, so provide set/get callbacks that use generic mpp pins helper
and will be used later.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-02-25 18:35:35 +01:00
Sebastian Hesselbarth 3a25f9f2f7 pinctrl: mvebu: kirkwood: provide generic mpp callbacks
We want to get rid of passing register addresses to common pinctrl
driver, so provide set/get callbacks that use generic mpp pins helper
and will be used later.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
2014-02-25 18:35:30 +01:00
Sebastian Hesselbarth 17bdec6770 pinctrl: mvebu: dove: provide generic mpp callbacks
We want to get rid of passing register addresses to common pinctrl
driver, so provide set/get callbacks that use generic mpp pins helper
and will be used later. While at it, also make use of globally defined
MPP macros.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-02-25 18:35:24 +01:00
Sebastian Hesselbarth f5b85e42d4 pinctrl: mvebu: add common mpp reg helper to mvebu pinctrl include
This adds some defines and helper functions for the common mpp reg
layout to mvebu pinctrl include.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
2014-02-25 18:35:16 +01:00
Sebastian Hesselbarth 2035d39da1 pinctrl: mvebu: remove passing mvebu_mpp_ctrl to callbacks
The only valuable information a special callback can derive from
mvebu_mpp_ctrl passed to it, is the pin id. Instead of passing
the struct, pass the pid directly.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-02-25 18:34:51 +01:00
Sebastian Hesselbarth e310b74544 pinctrl: mvebu: identify generic controls by name
We treat unnamed controls as generic mvebu mpp register controls but
we identify them by not being special controls. Flip the logic and
use the name pointer as identification instead. While at it, add some
comments explaining the not so obvious treatment.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-02-25 18:34:45 +01:00
Sebastian Hesselbarth dc2a90004e pinctrl: mvebu: remove obsolete per-control name buffer allocation
With the introduction of a global name buffer, we can now remove
the allocation and preparation of per-control name buffers.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-02-25 18:34:41 +01:00