deliverable/linux.git
11 years agopinctrl: mvebu: testing the wrong variable
Dan Carpenter [Mon, 26 Aug 2013 16:36:38 +0000 (19:36 +0300)] 
pinctrl: mvebu: testing the wrong variable

We wanted to test "*map" here instead of "map".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: abx500: fix bitwise AND test
Dan Carpenter [Mon, 26 Aug 2013 16:03:50 +0000 (19:03 +0300)] 
pinctrl: abx500: fix bitwise AND test

The intent here was to test if the bit was set or not but there is a
logical vs bitwise AND typo so it is true if any bits are set.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: mvebu: Convert to use devm_ioremap_resource
Jisheng Zhang [Tue, 27 Aug 2013 04:41:16 +0000 (12:41 +0800)] 
pinctrl: mvebu: Convert to use devm_ioremap_resource

The resource mapped by of_iomap() isn't unmapped in error path. This
patch fix the resource leakage by using devm_ioremap_resource() instead
of of_iomap().

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Reviewed-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: Pass all configs to driver on pin_config_set()
Sherman Yin [Tue, 27 Aug 2013 18:32:12 +0000 (11:32 -0700)] 
pinctrl: Pass all configs to driver on pin_config_set()

When setting pin configuration in the pinctrl framework, pin_config_set() or
pin_config_group_set() is called in a loop to set one configuration at a time
for the specified pin or group.

This patch 1) removes the loop and 2) changes the API to pass the whole pin
config array to the driver.  It is now up to the driver to loop through the
configs.  This allows the driver to potentially combine configs and reduce the
number of writes to pin config registers.

All c files changed have been build-tested to verify the change compiles and
that the corresponding .o is successfully generated.

Signed-off-by: Sherman Yin <syin@broadcom.com>
Reviewed-by: Christian Daudt <csd@broadcom.com>
Reviewed-by: Matt Porter <matt.porter@linaro.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: tz1090-pdc: Convert to devm_ioremap_resource
Axel Lin [Mon, 26 Aug 2013 02:22:31 +0000 (10:22 +0800)] 
pinctrl: tz1090-pdc: Convert to devm_ioremap_resource

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: tz1090: Convert to devm_ioremap_resource
Axel Lin [Mon, 26 Aug 2013 02:21:44 +0000 (10:21 +0800)] 
pinctrl: tz1090: Convert to devm_ioremap_resource

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: tegra: Convert to devm_ioremap_resource
Axel Lin [Tue, 27 Aug 2013 01:07:23 +0000 (09:07 +0800)] 
pinctrl: tegra: Convert to devm_ioremap_resource

Using the new devm_ioremap_resource() we can greatly simplify resource handling.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: rockchip: Simplify pin_to_bank equation
Axel Lin [Fri, 23 Aug 2013 07:49:00 +0000 (15:49 +0800)] 
pinctrl: rockchip: Simplify pin_to_bank equation

If (b->pin_base + b->nr_pins - 1) < pin is true, pin >= b->pin_base is always
true because b->nr_pins is never less than 0.
Thus this patch simplify the equation.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: spear: Convert to devm_ioremap_resource
Axel Lin [Mon, 26 Aug 2013 00:20:45 +0000 (08:20 +0800)] 
pinctrl: spear: Convert to devm_ioremap_resource

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: rockchip: Remove of_match_ptr macro for DT only driver
Axel Lin [Fri, 23 Aug 2013 06:27:53 +0000 (14:27 +0800)] 
pinctrl: rockchip: Remove of_match_ptr macro for DT only driver

This is a DT only driver and rockchip_pinctrl_dt_match is always compiled in.
Thus remove of_match_ptr macro.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: palmas: PINCTRL_PALMAS needs to select PINMUX
Axel Lin [Thu, 22 Aug 2013 06:30:08 +0000 (14:30 +0800)] 
pinctrl: palmas: PINCTRL_PALMAS needs to select PINMUX

Fix below build error if !PINMUX.

  CC      drivers/pinctrl/pinctrl-palmas.o
drivers/pinctrl/pinctrl-palmas.c:741:21: error: variable 'palmas_pinmux_ops' has initializer but incomplete type
drivers/pinctrl/pinctrl-palmas.c:742:2: error: unknown field 'get_functions_count' specified in initializer
drivers/pinctrl/pinctrl-palmas.c:742:2: warning: excess elements in struct initializer [enabled by default]
drivers/pinctrl/pinctrl-palmas.c:742:2: warning: (near initialization for 'palmas_pinmux_ops') [enabled by default]
drivers/pinctrl/pinctrl-palmas.c:743:2: error: unknown field 'get_function_name' specified in initializer
drivers/pinctrl/pinctrl-palmas.c:743:2: warning: excess elements in struct initializer [enabled by default]
drivers/pinctrl/pinctrl-palmas.c:743:2: warning: (near initialization for 'palmas_pinmux_ops') [enabled by default]
drivers/pinctrl/pinctrl-palmas.c:744:2: error: unknown field 'get_function_groups' specified in initializer
drivers/pinctrl/pinctrl-palmas.c:744:2: warning: excess elements in struct initializer [enabled by default]
drivers/pinctrl/pinctrl-palmas.c:744:2: warning: (near initialization for 'palmas_pinmux_ops') [enabled by default]
drivers/pinctrl/pinctrl-palmas.c:745:2: error: unknown field 'enable' specified in initializer
drivers/pinctrl/pinctrl-palmas.c:745:2: warning: excess elements in struct initializer [enabled by default]
drivers/pinctrl/pinctrl-palmas.c:745:2: warning: (near initialization for 'palmas_pinmux_ops') [enabled by default]
make[2]: *** [drivers/pinctrl/pinctrl-palmas.o] Error 1
make[1]: *** [drivers/pinctrl] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: core: Add proper mutex lock in pinctrl_request_gpio
Axel Lin [Mon, 19 Aug 2013 02:07:46 +0000 (10:07 +0800)] 
pinctrl: core: Add proper mutex lock in pinctrl_request_gpio

This one is missed in commit 42fed7ba "pinctrl: move subsystem mutex to
pinctrl_dev struct".

I think this fixes the race between pin_free() and pin_request() calls.
It protects accessing the members of pctldev->desc.
(e.g. update desc->mux_usecount, desc->gpio_owner, desc->mux_owner, etc)
Current code grabs pctldev->mutex before calling pinmux_free_gpio(),
but did not grab the mutex while calling pinmux_request_gpio().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: imx: Fix compilation with DEBUG enabled
Sascha Hauer [Fri, 23 Aug 2013 08:38:57 +0000 (10:38 +0200)] 
pinctrl: imx: Fix compilation with DEBUG enabled

This became broken with converting the pinmux arrays into struct
types. While at it replace the preprocessor magic with a simple
dev_dbg.

Reported-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: rockchip: Simplify for loop iteration
Axel Lin [Wed, 21 Aug 2013 02:28:50 +0000 (10:28 +0800)] 
pinctrl: rockchip: Simplify for loop iteration

Just return once a match found makes the code simpler and shorter.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: tegra: use pinctrl-utils APIs for mapping
Laxman Dewangan [Wed, 21 Aug 2013 11:23:38 +0000 (16:53 +0530)] 
pinctrl: tegra: use pinctrl-utils APIs for mapping

Pin control utility functions provides the function for creating
map lists.

In place of implementing APIs locally in Tegra pin control driver
for creating map lists, use the utility functions. This reduces
the code size and avoid duplication.

Changes from V1:
- Rebased change on top of V1.
- Use pinctrl_utils_dt_free_map

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: utils : add support to pass config type in generic util APIs
Laxman Dewangan [Wed, 21 Aug 2013 11:23:37 +0000 (16:53 +0530)] 
pinctrl: utils : add support to pass config type in generic util APIs

Add support to pass the config type like GROUP or PIN when using
the utils or generic pin configuration APIs. This will make the
APIs more generic.

Added additional inline APIs such that it can be use directly as
callback for the pinctrl_ops.

Changes from V1:
- Remove separate implementation for pins and group for
  pinctrl_utils_dt_free_map and improve this function
  to support both i.e. PINS and GROUPs.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: samsung: Parse pin groups before calling pinctrl_register()
Tomasz Figa [Tue, 20 Aug 2013 16:16:21 +0000 (18:16 +0200)] 
pinctrl: samsung: Parse pin groups before calling pinctrl_register()

Calling pinctrl_register() means that the driver is fully initialized
and might accept pinmux/pinconf requests, so pin groups must be parsed
before.

This patch fixes this problem by moving device tree parsing before call
to pinctrl_register(). In addition, this fixes support for hogs on
pin controllers handled by pinctrl-samsung driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: palmas: Fix device name in Kconfig text
Mark Brown [Mon, 19 Aug 2013 15:07:26 +0000 (16:07 +0100)] 
pinctrl: palmas: Fix device name in Kconfig text

The device family is called Palmas so there should be a 's' on the end of
the name.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: SPEAr310: Pass correct of_device_id table name to MODULE_DEVICE_TABLE
Axel Lin [Tue, 20 Aug 2013 05:58:00 +0000 (13:58 +0800)] 
pinctrl: SPEAr310: Pass correct of_device_id table name to MODULE_DEVICE_TABLE

The symbol SPEAr310_pinctrl_of_match does not exist at all. Fix it.
We didn't hit the compile error because this driver can only be built-in now.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: sunxi: Add Allwinner A20 pins set
Maxime Ripard [Sun, 4 Aug 2013 09:58:45 +0000 (11:58 +0200)] 
pinctrl: sunxi: Add Allwinner A20 pins set

The Allwinner A20 is pin-compatible with the older A10, so the two pin
set are quite similar. However, since the A20 has new features, we can't
just use the A10 pin set as is, and we need to define our own for the
A20.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: sunxi: Add Allwinner A31 pins set
Maxime Ripard [Sun, 4 Aug 2013 09:47:34 +0000 (11:47 +0200)] 
pinctrl: sunxi: Add Allwinner A31 pins set

The Allwinner A31 SoC uses the same IP than the one found in the
A10/A13, with only different pins. Add the pins and the associated
functions found in the A31.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: sunxi: Fix inconsistent indentation
Maxime Ripard [Sun, 4 Aug 2013 09:58:46 +0000 (11:58 +0200)] 
pinctrl: sunxi: Fix inconsistent indentation

Some pin functions in the array were not indented like the other
functions in this array. Fix this.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: core: Remove unnecessary test for desc->name
Axel Lin [Mon, 19 Aug 2013 02:06:29 +0000 (10:06 +0800)] 
pinctrl: core: Remove unnecessary test for desc->name

The implementation in pinctrl_register_one_pin() ensures pindesc->name is always
not NULL before insert the pindesc to radix tree.
If the desc return from pin_desc_get is not NULL, desc->name is always not NULL.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoDocumentation: pinctrl: Fix example code for pinctrl_register
Axel Lin [Sun, 18 Aug 2013 12:43:33 +0000 (20:43 +0800)] 
Documentation: pinctrl: Fix example code for pinctrl_register

pinctrl_register() returns NULL on error, fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: core: Hold pctldev->mutex mutex lock while traversing gpio_ranges list
Axel Lin [Sun, 18 Aug 2013 12:40:29 +0000 (20:40 +0800)] 
pinctrl: core: Hold pctldev->mutex mutex lock while traversing gpio_ranges list

Hold pctldev->mutex mutex_lock when traverse the list.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: core: Hold pinctrldev_list_mutex mutex while traversing pinctrldev_list
Axel Lin [Sun, 18 Aug 2013 12:34:22 +0000 (20:34 +0800)] 
pinctrl: core: Hold pinctrldev_list_mutex mutex while traversing pinctrldev_list

This one is missed in commit 44d5f7bb "pinctrl: sink pinctrldev_list_mutex".

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: sirf: add lost atlas6 uart0-no-stream-control pingroup
Qipan Li [Mon, 19 Aug 2013 08:15:49 +0000 (16:15 +0800)] 
pinctrl: sirf: add lost atlas6 uart0-no-stream-control pingroup

the old codes defined uart0_nostreamctrl_pins, but missed pingroup
and padmux definition for it. this patch fixes it.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: imx: Use struct type for pins
Sascha Hauer [Sun, 28 Jul 2013 14:29:22 +0000 (16:29 +0200)] 
pinctrl: imx: Use struct type for pins

The i.MX pinctrl driver uses 5 different arrays for storing the
informations for pins. This requires five allocations. Instead,
use a struct type which is more cache friendly, readable and
requires less allocations. One array of integers is still needed
since the pinctrl framework forces us to maintain it.
This also adds checks whether the allocations are succesful which
were missing.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: imx: do not fail when parsing a function fails
Sascha Hauer [Fri, 9 Aug 2013 12:20:53 +0000 (14:20 +0200)] 
pinctrl: imx: do not fail when parsing a function fails

When parsing a function fails this is no reason to make the whole
driver fail. Just continue with the next function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: imx: do not fail when parsing a group fails
Sascha Hauer [Fri, 9 Aug 2013 12:20:52 +0000 (14:20 +0200)] 
pinctrl: imx: do not fail when parsing a group fails

The i.MX pinctrl driver completely bails out when it detects an error
in the pinctrl nodes. This usually means that whatever error a
devicetree has the user is left blind because even the console cannot
be initialized without working pinmux.

Instead of bailing out completely, just continue probing. This makes
the pinctrl driver work, only the erroneous groups will fail later
during pin request time.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: imx: Catch no fsl,pins property
Sascha Hauer [Fri, 9 Aug 2013 12:20:51 +0000 (14:20 +0200)] 
pinctrl: imx: Catch no fsl,pins property

Instead of crashing the kernel print an error message when
the fsl,pins property is missing.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: imx: make error messages more informative
Sascha Hauer [Fri, 9 Aug 2013 12:20:50 +0000 (14:20 +0200)] 
pinctrl: imx: make error messages more informative

When printing error messages about errors in the devicetree also print
the offending node to give the use a hint what might be wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: nomadik: simplify use of devm_ioremap_resource
Julia Lawall [Wed, 14 Aug 2013 09:11:05 +0000 (11:11 +0200)] 
pinctrl: nomadik: simplify use of devm_ioremap_resource

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.

Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more clear.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: add includes and ifdefs for non-DT builds
Linus Walleij [Thu, 15 Aug 2013 19:38:49 +0000 (21:38 +0200)] 
pinctrl: add includes and ifdefs for non-DT builds

Commit e81c8f18afc4fdd6e34d8c83814b8b5134dbb30f
"pinctrl: pinconf-generic: add generic APIs for mapping pinctrl node"
Added function prototypes with implicit dependencies
on other header files causing build warnings like this:

In file included from
arch/arm/mach-ux500/board-mop500-pins.c:12:0:
include/linux/pinctrl/pinconf-generic.h:142:3:
warning: 'struct device_node' declared inside parameter list [enabled
by default]
   unsigned *reserved_maps, unsigned *num_maps);
   ^
include/linux/pinctrl/pinconf-generic.h:142:3:
warning: its scope is only this definition or declaration, which is
probably not what you want [enabled by default]
include/linux/pinctrl/pinconf-generic.h:142:3:
warning: 'struct pinctrl_dev' declared inside parameter list [enabled
by default]
include/linux/pinctrl/pinconf-generic.h:145:3:
warning: 'struct device_node' declared inside parameter list [enabled
by default]
   unsigned *num_maps);
   ^
Let's just add ifdefs for non-DT systems (the actual code is
already ifdefed) and #include <linux/device.h> to get the
most important structs and forward-declare the pinctrl
core structs.

Reported-by: Olof Johansson <olof@lixom.net>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: nomadik: shut up a warning for flags
Linus Walleij [Thu, 15 Aug 2013 19:26:26 +0000 (21:26 +0200)] 
pinctrl: nomadik: shut up a warning for flags

The irq flags variable gets a warning like this after
commit bf4dae5ce1b95a5932e43036edcf3f1b324758c6
"pinctrl: nomadik: delete ancient pin control API":

In file included from include/linux/seqlock.h:29:0,
                 from include/linux/time.h:5,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from
drivers/pinctrl/pinctrl-nomadik.c:14:
drivers/pinctrl/pinctrl-nomadik.c: In function 'nmk_pmx_enable':
include/linux/spinlock.h:348:122: warning:
'flags' may be used uninitialized in this function
[-Wmaybe-uninitialized]
  raw_spin_unlock_irqrestore(&lock->rlock, flags);
                                                   ^
drivers/pinctrl/pinctrl-nomadik.c:1515:16: note:
'flags' was declared here
  unsigned long flags;

The function is question was never changed but it appears
the semantic checker could previously determine that the code
path that would use the flags was going to either use it or
not, but now it can't for some reason. Just fix it up.

Reported-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agogpio: clean up gpio-ranges documentation
Stephen Warren [Fri, 9 Aug 2013 16:57:46 +0000 (10:57 -0600)] 
gpio: clean up gpio-ranges documentation

This change makes documentation of the the gpio-ranges property shorter
and more succinct, more consistent with the style of the rest of the
document, and not mention Linux-specifics such as the API
pinctrl_request_gpio(); DT binding documents should be OS independant
where at all possible. As part of this, the gpio-ranges property's format
is described in BNF form, in order to match the rest of the document.

This change also deprecates the #gpio-range-cells property. Such
properties are useful when one node references a second node, and that
second node dictates the format of the reference. However, that is not
the case here; the definition of gpio-ranges itself always dictates its
format entirely, and hence the value #gpio-range-cells must always be 3,
and hence there is no point requiring any referenced node to include
this property. The only remaining need for this property is to ensure
compatibility of DTs with older SW that was written to support the
previous version of the binding.

v4:
* Mention #gpio-range-cells as being deprecated, rather than removing all
  documentation of that property. This allows DTs to be written in a
  backwards-compatible way if desired, and also allows older DTs to be
  interpreted fully using the latest documentation.
v3:
* Mention BNF in commit description.
* Fixed typo.
* Dropped patch that removed the deprecated property from *.dts, since
  it's required to boot older kernels.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl/lantiq: add missing gphy led setup
John Crispin [Fri, 9 Aug 2013 18:38:15 +0000 (20:38 +0200)] 
pinctrl/lantiq: add missing gphy led setup

We found out how to set the gphy led pinmuxing.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl/lantiq: add missing pin definition to falcon pinctrl driver
Thomas Langer [Fri, 9 Aug 2013 18:38:14 +0000 (20:38 +0200)] 
pinctrl/lantiq: add missing pin definition to falcon pinctrl driver

The pps pin definition is missing in the current code.

Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
Acked-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoMAINTAINERS: Update sirf patterns
Joe Perches [Mon, 22 Jul 2013 00:15:40 +0000 (17:15 -0700)] 
MAINTAINERS: Update sirf patterns

commit 3370dc916c ("pinctrl:sirf:re-arch and add support for
new SiRFatlas6 SoC") moved the files, update the patterns.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Barry Song <21cnbao@gmail.com>
cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoDocumentation: pinctrl: Fix example code
Sachin Kamat [Thu, 8 Aug 2013 05:20:59 +0000 (10:50 +0530)] 
Documentation: pinctrl: Fix example code

__initdata should be placed between the variable name and equal
sign for the variable to be placed in the intended section. Fix
the examples.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7790: Add DU pin groups and functions
Laurent Pinchart [Wed, 7 Aug 2013 12:02:23 +0000 (14:02 +0200)] 
sh-pfc: r8a7790: Add DU pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7790: Rename DU1_DOTCLKIN to DU_DOTCLKIN1
Laurent Pinchart [Wed, 7 Aug 2013 12:02:22 +0000 (14:02 +0200)] 
sh-pfc: r8a7790: Rename DU1_DOTCLKIN to DU_DOTCLKIN1

Name the DU clock input 1 consistently with clock inputs 0 and 2.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: improve warning messages
Linus Walleij [Wed, 14 Aug 2013 16:23:33 +0000 (18:23 +0200)] 
pinctrl: improve warning messages

Print out the affected group name on activation of pin mux
settings, and warn if you cannot free a pin that should have
been part of a certain setting.

ChangeLog v1->v2:
- Also print the pin name in the error messages.

Cc: Sonic Zhang <sonic.zhang@analog.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: palmas: add pincontrol driver
Laxman Dewangan [Tue, 6 Aug 2013 13:12:35 +0000 (18:42 +0530)] 
pinctrl: palmas: add pincontrol driver

TI Palmas series Power Management IC have multiple pins which can be
configured for different functionality. This pins can be configured
for different function. Also their properties like pull up/down,
open drain enable/disable are configurable.

Add support for pincontrol driver Palmas series device like TPS65913,
TPS80036. The driver supports to be register from DT only.

Changes from V1:
- Add generic property for pins and functions in pinconf-generic.
- Add APIs to map the DT and subnode.
- Move common utils APIs to the pinctrl-utils from this file.
- Update the binding document accordingly.
Changes from V2:
- Add ack by Lee.
- Correct the binding docs.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: pinconf-generic: add generic APIs for mapping pinctrl node
Laxman Dewangan [Tue, 6 Aug 2013 13:12:34 +0000 (18:42 +0530)] 
pinctrl: pinconf-generic: add generic APIs for mapping pinctrl node

Add generic APIs to map the DT node and its sub node in pinconf generic
driver. These APIs can be used from driver to parse the DT node who
uses the pinconf generic APIs for defining their nodes.

Changes from V1:
- Add generic property for pins and functions in pinconf-generic.
- Add APIs to map the DT and subnode.
- Move common utils APIs to the pinctrl-utils from this file.
- Update the binding document accordingly.
Changes from V2:
- Rebased the pinctrl binding doc on top of Stephen's cleanup.
- Rename properties "pinctrl-pins" and "pinctrl-function" to
  "pins" and "function".

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: add utility functions for add map/configs
Laxman Dewangan [Tue, 6 Aug 2013 13:12:33 +0000 (18:42 +0530)] 
pinctrl: add utility functions for add map/configs

Some of pincontrol driver needs the utility function to create map
list. The utility function needed for adding mux, configs etc.

In place of duplicating this in each driver, add the common utility
function in common file and use from device specific driver. This will
reduce the duplicating of code across drivers.

Changes from V1:
- Add this files in this patch and add common utility APIs to here.

Changes from V2:
- Nothing in code.
- Added Reviewed by Stephen.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: pinmux: Don't free pins requested by other devices in pinmux_disable_setting.
Sonic Zhang [Wed, 14 Aug 2013 05:26:43 +0000 (13:26 +0800)] 
pinctrl: pinmux: Don't free pins requested by other devices in pinmux_disable_setting.

One peripheral may share part of its pins with the 2nd
peripheral and the other pins with the 3rd. If it requests all pins
when part of them has already be requested and owned by the 2nd
peripheral, this request fails and pinmux_disable_setting() is called.
The pinmux_disable_setting() frees all pins of the first peripheral
without checking if the pin is owned by itself or the 2nd, which
results in the malfunction of the 2nd peripheral driver.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: nomadik: delete ancient pin control API
Linus Walleij [Wed, 7 Aug 2013 20:21:57 +0000 (22:21 +0200)] 
pinctrl: nomadik: delete ancient pin control API

The pin control subsystem was created to do away with custom pin
control APIs such as this one. It was kept for backward-compatibility
but is completely unused in the current kernel, so let's delete
it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: add generic pins and functions properties
Stephen Warren [Tue, 6 Aug 2013 17:10:32 +0000 (11:10 -0600)] 
pinctrl: add generic pins and functions properties

pinctrl bindings can benefit from generic property names that define
which pins a "pin configuration node" affects, and which mux function
to select onto those pins. Document new properties for this purpose so
that other bindings may refer to them.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: sirf: add missing __iomem annotation
Jingoo Han [Tue, 6 Aug 2013 09:14:12 +0000 (18:14 +0900)] 
pinctrl: sirf: add missing __iomem annotation

Added missing __iomem annotation in order to fix the following
sparse warnings:

drivers/pinctrl/sirf/pinctrl-sirf.c:846:14: warning: incorrect type in assignment (different address spaces)
drivers/pinctrl/sirf/pinctrl-sirf.c:846:14:    expected void *regs
drivers/pinctrl/sirf/pinctrl-sirf.c:846:14:    got void [noderef] <asn:2>*
drivers/pinctrl/sirf/pinctrl-sirf.c:869:33: warning: incorrect type in assignment (different address spaces)
drivers/pinctrl/sirf/pinctrl-sirf.c:869:33:    expected void [noderef] <asn:2>*regs
drivers/pinctrl/sirf/pinctrl-sirf.c:869:33:    got void *regs
drivers/pinctrl/sirf/pinctrl-sirf.c:909:17: warning: incorrect type in argument 1 (different address spaces)
drivers/pinctrl/sirf/pinctrl-sirf.c:909:17:    expected void volatile [noderef] <asn:2>*addr
drivers/pinctrl/sirf/pinctrl-sirf.c:909:17:    got void *regs

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: pinconf: fix comparison of different types
Jingoo Han [Tue, 6 Aug 2013 09:10:20 +0000 (18:10 +0900)] 
pinctrl: pinconf: fix comparison of different types

Fix the following sparse warning:

drivers/pinctrl/pinconf.c:521:20: error: incompatible types in comparison expression (different type sizes)

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: clean up pinconfig-generic documentation
Stephen Warren [Mon, 5 Aug 2013 21:55:59 +0000 (15:55 -0600)] 
pinctrl: clean up pinconfig-generic documentation

Reword the section of pinctrl-bindings.txt that describes generic
properties that pinctrl bindings may use. The aim is to make the text
clearer, and more explicitly call out the responsibility of individual
bindings that use the generic properties to define which of the
properties are used, and how.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: at91: choose appropriate handler for level interrupts
Boris BREZILLON [Sat, 20 Jul 2013 14:51:33 +0000 (16:51 +0200)] 
pinctrl: at91: choose appropriate handler for level interrupts

The current implementation handle both edge and level interrupts with the
'handle_simple_irq' handler.

Level interrupts are active as long as the pin stays at the configured
level (low or high). In this case we have to use 'handle_level_irq' which
mask the interrupt until the handle has treated it.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Tested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: st: Staticize local symbols
Sachin Kamat [Mon, 29 Jul 2013 04:22:56 +0000 (09:52 +0530)] 
pinctrl: st: Staticize local symbols

Symbols used only in this file are made static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: st: Convert to use devm_ioremap_resource
Sachin Kamat [Mon, 29 Jul 2013 04:22:55 +0000 (09:52 +0530)] 
pinctrl: st: Convert to use devm_ioremap_resource

devm_request_and_ioremap is deprecated. Use devm_ioremap_resource
instead.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: imx: work around select input quirk
Shawn Guo [Sun, 4 Aug 2013 13:39:23 +0000 (21:39 +0800)] 
pinctrl: imx: work around select input quirk

The select input for some pin may not be implemented using the regular
select input register but the general purpose register.  A real example
is that imx6q designers found the select input for USB OTG ID pin is
missing at the very late stage, and can not add a new select input
register but have to use a general purpose register bit to implement it.

The patch adds a workaround for such select input quirk by interpreting
the input_val cell of pin function ID in a different way, so that all
the info that needed for setting up select input bits in general purpose
register could be decoded from there.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: sunxi: Fix incorrect NULL check
Sachin Kamat [Mon, 29 Jul 2013 08:19:32 +0000 (13:49 +0530)] 
pinctrl: sunxi: Fix incorrect NULL check

*map should be tested for NULL instead of map as kmalloc pointer
is assigned to it. This also fixes a potential null pointer dereference
bug later in the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: shut up a couple of pinctrl warnings
Russell King - ARM Linux [Sun, 28 Jul 2013 12:13:00 +0000 (13:13 +0100)] 
pinctrl: shut up a couple of pinctrl warnings

So, I notice that we get a couple of warnings from the pinctrl code:

drivers/pinctrl/pinconf.c: In function 'pinconf_dbg_config_print':
drivers/pinctrl/pinconf.c:433:36: warning: 'configs' may be used uninitialized in this function
drivers/pinctrl/pinconf.c: In function 'pinconf_dbg_config_write':
drivers/pinctrl/pinconf.c:511:36: warning: 'configs' may be used uninitialized in this function

While the compiler might not be able to work out that "configs" is
safe, the code doesn't lend itself very well to identifying that
fact when reading it either.  This can be trivially solved by a slight
restructuring of the code - which also reduces the LOC.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agodrivers/pinctrl: don't check resource with devm_ioremap_resource
Wolfram Sang [Tue, 23 Jul 2013 18:01:47 +0000 (20:01 +0200)] 
drivers/pinctrl: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agopinctrl: rockchip: include correct clk header
Heiko Stübner [Tue, 23 Jul 2013 11:34:20 +0000 (13:34 +0200)] 
pinctrl: rockchip: include correct clk header

The correct header to include for clock handling is clk.h .
clk-provider.h should not be used in simple clock consumers.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoMerge branch 'pinmux/next/fixes' of git://linuxtv.org/pinchartl/fbdev into devel
Linus Walleij [Mon, 29 Jul 2013 14:33:57 +0000 (16:33 +0200)] 
Merge branch 'pinmux/next/fixes' of git://linuxtv.org/pinchartl/fbdev into devel

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoMerge branch 'pinmux/next/pin-no-gpio' of git://linuxtv.org/pinchartl/fbdev into...
Linus Walleij [Mon, 29 Jul 2013 14:30:55 +0000 (16:30 +0200)] 
Merge branch 'pinmux/next/pin-no-gpio' of git://linuxtv.org/pinchartl/fbdev into devel

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7790: Add VIN pin groups and functions
Shinobu Uehara [Thu, 27 Jun 2013 10:38:02 +0000 (19:38 +0900)] 
sh-pfc: r8a7790: Add VIN pin groups and functions

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Add USB pin groups and functions
Shinobu Uehara [Wed, 26 Jun 2013 00:39:34 +0000 (09:39 +0900)] 
sh-pfc: r8a7790: Add USB pin groups and functions

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Add SCIF2 pin groups and functions
Laurent Pinchart [Wed, 24 Jul 2013 00:02:58 +0000 (02:02 +0200)] 
sh-pfc: r8a7790: Add SCIF2 pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Add MSIOF pin groups and functions
Kunihito Higashiyama [Fri, 28 Jun 2013 00:36:09 +0000 (09:36 +0900)] 
sh-pfc: r8a7790: Add MSIOF pin groups and functions

Signed-off-by: Kunihito Higashiyama <kunihito.higashiyama.ur@renesas.com>
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Sort pin groups and functions alphabetically
Laurent Pinchart [Tue, 23 Jul 2013 23:47:29 +0000 (01:47 +0200)] 
sh-pfc: r8a7790: Sort pin groups and functions alphabetically

Navigating through the source code is hard enough without having to
manually search for groups and functions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Fix miscellaneous pinmux configuration tables mistakes
Shinya Kuribayashi [Mon, 27 May 2013 08:10:11 +0000 (17:10 +0900)] 
sh-pfc: r8a7790: Fix miscellaneous pinmux configuration tables mistakes

Fix erroneous entries in the pinmux configuration tables that affect
HSCIF, I2C, LBSC, SCIF, SSI and VIN operation.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Add SCIF2 pins configuration support
Shinya Kuribayashi [Fri, 24 May 2013 07:56:54 +0000 (16:56 +0900)] 
sh-pfc: r8a7790: Add SCIF2 pins configuration support

Update the pinmux configuration tables to support the SCIF2 pins
(TX2/TX2_B, RX2/RX2_B, SCK2).

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Add TCLK1 pin configuration support
Shinya Kuribayashi [Fri, 24 May 2013 07:31:32 +0000 (16:31 +0900)] 
sh-pfc: r8a7790: Add TCLK1 pin configuration support

Update the pinmux configuration tables to support the TCLK1 pin.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Swap SCIFA2_RXD_B and HRX0_C configurations
Shinya Kuribayashi [Fri, 24 May 2013 08:50:44 +0000 (17:50 +0900)] 
sh-pfc: r8a7790: Swap SCIFA2_RXD_B and HRX0_C configurations

The SCIFA2 RXD_B and HRX0_C pins have their pinmux configuration data
swapped, fix it.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Remove deprecated SPV_EVEN pin
Shinya Kuribayashi [Fri, 24 May 2013 08:26:08 +0000 (17:26 +0900)] 
sh-pfc: r8a7790: Remove deprecated SPV_EVEN pin

The pins have been removed from the datasheet, remove them here as well.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Remove deprecated RDS pins
Shinya Kuribayashi [Fri, 24 May 2013 07:14:24 +0000 (16:14 +0900)] 
sh-pfc: r8a7790: Remove deprecated RDS pins

The pins have been removed from the datasheet, remove them here as well.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Remove deprecated Ethernet MII/RMII pins
Shinya Kuribayashi [Wed, 22 May 2013 10:55:08 +0000 (19:55 +0900)] 
sh-pfc: r8a7790: Remove deprecated Ethernet MII/RMII pins

The pins have been removed from the datasheet, remove them here as well.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Remove trailing '_TANS' string from RTS/CTS pins
Shinya Kuribayashi [Fri, 24 May 2013 08:28:17 +0000 (17:28 +0900)] 
sh-pfc: r8a7790: Remove trailing '_TANS' string from RTS/CTS pins

The RTS/CTS pins have been renamed in the datasheet, rename them here as
well.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7790: Rename I2C SDA/SCL pins
Shinya Kuribayashi [Wed, 22 May 2013 10:46:16 +0000 (19:46 +0900)] 
sh-pfc: r8a7790: Rename I2C SDA/SCL pins

The I2C pins have been renamed in the datasheet, rename them here as
well.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7779: Add I2C pin groups
Phil Edworthy [Wed, 17 Jul 2013 11:00:48 +0000 (12:00 +0100)] 
sh-pfc: r8a7779: Add I2C pin groups

Add all I2C pin groups to R8A7779 PFC driver.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: sh73a0: Remove EXT_IRQ16L and EXT_IRQ16H macros
Laurent Pinchart [Tue, 23 Jul 2013 23:24:15 +0000 (01:24 +0200)] 
sh-pfc: sh73a0: Remove EXT_IRQ16L and EXT_IRQ16H macros

The macros expand to irq_pin() calls and where most probably introduced
from a copy&paste of the sh7372 PFC data. Replace them with irq_pin().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
11 years agosh-pfc: sh7372: Replace <mach/irqs.h> with <linux/sh_intc.h>
Laurent Pinchart [Tue, 23 Jul 2013 22:25:16 +0000 (00:25 +0200)] 
sh-pfc: sh7372: Replace <mach/irqs.h> with <linux/sh_intc.h>

The mach/irqs.h header is included only to get the evt2irq macro
definition. The macro is defined in linux/sh_intc.h, include it directly
instead of the mach-specific header.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
11 years agosh-pfc: Remove unneeded mach/<soc>.h includes
Laurent Pinchart [Tue, 23 Jul 2013 21:08:10 +0000 (23:08 +0200)] 
sh-pfc: Remove unneeded mach/<soc>.h includes

The SoC-specific mach/<soc>.h headers are included needlesly. Don't
include them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
11 years agosh-pfc: Support pins not associated with a GPIO port
Laurent Pinchart [Mon, 15 Jul 2013 19:10:54 +0000 (21:10 +0200)] 
sh-pfc: Support pins not associated with a GPIO port

Pins with selectable functions but without a GPIO port can't be named
PORT_# or GP_#_#. Add a SH_PFC_PIN_NAMED macro to declare such pins in
the pinmux pins array, naming them with the PIN_ prefix followed by the
pin physical position.

In order to make sure not to register those pins as GPIOs, add a
SH_PFC_PIN_CFG_NO_GPIO pin flag to denote pins without a GPIO port.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Compute pin ranges automatically
Laurent Pinchart [Mon, 15 Jul 2013 16:38:30 +0000 (18:38 +0200)] 
sh-pfc: Compute pin ranges automatically

Remove the manually specified ranges from PFC SoC data and compute the
ranges automatically. This prevents ranges from being out-of-sync with
pins definitions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Rename struct sh_pfc nr_pins field to nr_gpio_pins
Laurent Pinchart [Mon, 15 Jul 2013 11:48:56 +0000 (13:48 +0200)] 
sh-pfc: Rename struct sh_pfc nr_pins field to nr_gpio_pins

The field contains the number of pins with an associated GPIO port. This
is currently equal to the total number of pins but will be modified when
adding support for pins without a GPIO port. Rename the field
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Add pin number to struct sh_pfc_pin
Laurent Pinchart [Wed, 13 Feb 2013 23:59:49 +0000 (00:59 +0100)] 
sh-pfc: Add pin number to struct sh_pfc_pin

The pin number is usually equal to the GPIO number but can differ when
GPIO numbering is sparse.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Pass the pin number down to the port function macro
Laurent Pinchart [Wed, 13 Feb 2013 23:41:57 +0000 (00:41 +0100)] 
sh-pfc: Pass the pin number down to the port function macro

The PORT_1 macro invokes a macro passed as a parameter. Pass the pin
number down to that macro at the bottom of the call stack. This will be
used to compute the pin ranges automatically.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Add port numbers to the CPU_ALL_PORT macro
Laurent Pinchart [Wed, 13 Feb 2013 23:24:32 +0000 (00:24 +0100)] 
sh-pfc: Add port numbers to the CPU_ALL_PORT macro

Pass down the port number down to the PORT_1 macro. The port number will
be used to compute the pin ranges automatically.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Don't duplicate argument to PINMUX_GPIO macro
Laurent Pinchart [Mon, 15 Jul 2013 19:16:25 +0000 (21:16 +0200)] 
sh-pfc: Don't duplicate argument to PINMUX_GPIO macro

The PINMUX_GPIO macro takes a port name and a data mark, respectively of
the form GPIO_name and name_DATA. Modify the macro to take the name as a
single argument and derive the port name and data mark from it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: shx3: Remove shx3_ prefix from static symbols
Laurent Pinchart [Mon, 15 Jul 2013 15:13:51 +0000 (17:13 +0200)] 
sh-pfc: shx3: Remove shx3_ prefix from static symbols

Unlike all other PFC SoC data, the shx3 data prefix all static symbols
with shx3_. Remove the prefix to be consistent with the other source
files.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: sh7734: Use the common GP port style macros
Laurent Pinchart [Mon, 15 Jul 2013 14:07:08 +0000 (16:07 +0200)] 
sh-pfc: sh7734: Use the common GP port style macros

The SoC has a bank-style PFC. Replace the custom-defined macros with
common macros from sh-pfc.h.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: Consolidate pin definition macros
Laurent Pinchart [Mon, 15 Jul 2013 15:42:48 +0000 (17:42 +0200)] 
sh-pfc: Consolidate pin definition macros

Move the pin definition macros to a common header file.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Consolidate PFC SoC data macros
Laurent Pinchart [Mon, 15 Jul 2013 13:14:22 +0000 (15:14 +0200)] 
sh-pfc: Consolidate PFC SoC data macros

Move macros defined in several SoC data files to a common location and
document them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Rename gpio arguments to be consistent with the rest of the code
Laurent Pinchart [Mon, 15 Jul 2013 11:25:08 +0000 (13:25 +0200)] 
sh-pfc: Rename gpio arguments to be consistent with the rest of the code

The gpio_get_data_reg() and gpio_setup_data_reg() functions both take an
argument named gpio. The argument contains a GPIO offset for the first
function and a pin index for the second one. Rename them to offset and
idx respectively to match the rest of the code.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Replace pinmux_enum_id typedef with u16
Laurent Pinchart [Mon, 15 Jul 2013 11:03:20 +0000 (13:03 +0200)] 
sh-pfc: Replace pinmux_enum_id typedef with u16

The typedef only conceals the real variable type without bringing any
additional value (see Documentation/CodingStyle, section 5.b). Moreover,
it polutes the pinmux namespace. Replace it with the integer type it
used to hide.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Don't overallocate memory for the GPIO chip pins array
Laurent Pinchart [Mon, 15 Jul 2013 11:36:39 +0000 (13:36 +0200)] 
sh-pfc: Don't overallocate memory for the GPIO chip pins array

The GPIO driver uses an array of sh_pfc_gpio_pin structures to store
per-GPIO pin data. The array size is miscomputed at allocation time by
using the number of the last pin instead of the number of pins. When the
pin space contains holes this leads to memory overallocation. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Remove unused GPIO_PORT_ALL macro
Laurent Pinchart [Mon, 15 Jul 2013 13:21:28 +0000 (15:21 +0200)] 
sh-pfc: Remove unused GPIO_PORT_ALL macro

The macro isn't used, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Remove unneeded const keywords
Laurent Pinchart [Sun, 14 Jul 2013 18:04:53 +0000 (20:04 +0200)] 
sh-pfc: Remove unneeded const keywords

Two integer field structures are needlesly defined as const. Remove the
const keyword.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Remove unused macro and enum entries
Laurent Pinchart [Sun, 14 Jul 2013 17:59:50 +0000 (19:59 +0200)] 
sh-pfc: Remove unused macro and enum entries

The SH_PFC_MARK_INVALID macro and the PINMUX_FLAG_TYPE, GPIO_CFG_REQ and
GPIO_CFG_FREE enum entries are used, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Remove unused PORT_DATA_* macros
Laurent Pinchart [Sun, 14 Jul 2013 17:58:57 +0000 (19:58 +0200)] 
sh-pfc: Remove unused PORT_DATA_* macros

Most of the PORT_DATA_* macros are not used, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: Remove unused input_pd and input_pu ranges
Laurent Pinchart [Tue, 16 Jul 2013 00:01:00 +0000 (02:01 +0200)] 
sh-pfc: Remove unused input_pd and input_pu ranges

The ranges are not used anymore, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
11 years agosh-pfc: shx3: Remove unused input_pu range
Laurent Pinchart [Mon, 15 Jul 2013 23:54:13 +0000 (01:54 +0200)] 
sh-pfc: shx3: Remove unused input_pu range

The PFC SHX3 SoC data contains a input_pu range used to configure
pull-up resistors using the legacy non-pinconf API. That API has been
removed from the driver, the range is thus not used anymore. Remove it.

If required, configuring pull-up resistors for the SHX3 can be
implemented using the pinconf API, as done for the SH-Mobile, R-Mobile
and R-Car platforms.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
This page took 0.044616 seconds and 5 git commands to generate.