Commit Graph

783 Commits

Author SHA1 Message Date
黄涛
c7412991e9 Merge remote-tracking branch 'origin/develop-3.10' into develop-3.10-next
Conflicts:
	arch/arm/mach-rockchip/vcodec_service.c
	drivers/input/Makefile
2014-08-08 10:21:50 +08:00
黄涛
fcef60e36f Merge tag 'lsk-v3.10-android-14.07' into develop-3.10
LSK v3.10 Android 14.07 release

Conflicts:
	drivers/clocksource/arm_arch_timer.c
	lib/Makefile
2014-08-06 15:34:14 +08:00
luowei
47bddb4a9a pinctrl:fix rk312x gpio2c_iomux2 offset error 2014-08-05 15:20:37 +08:00
luowei
4552ee7de8 pinctrl:fix debug command bug for rk3036/rk312x
cat /sys/kernel/debug/rockchip_pinctrl/registers
2014-08-04 09:51:47 +08:00
luowei
e5c80d8c68 pinctrl:add pinctrl dts for rk312x 2014-07-24 11:16:39 +08:00
luowei
9620f4d406 pinctrl:delete unused definition for rk3036 2014-07-11 17:10:21 +08:00
luowei
5dc9dc6260 pinctrl:add rk3036 handler in pinctrl driver 2014-07-10 22:44:20 +08:00
黄涛
a9cd539a61 pinctrl: rockchip: fix compilation warning 2014-06-16 20:16:15 +08:00
Alex Shi
a0f2073644 Merge branch 'v3.10/topic/pinctrl' into linux-linaro-lsk 2014-06-16 12:06:26 +08:00
Sherman Yin
1881384399 pinctrl: Fix pin_config_*_set_bulk APIs
In commit baeae2041e, Linaro-specific
APIs pin_config_set_bulk and pin_config_group_set_bulk were introduced.
However, pinconf_check_ops was not updated, and the wrong function was
used in the PIN_MAP_TYPE_CONFIGS_PIN case in pinconf_apply_setting.

Change-Id: Idc4a802f3d0086b927b808f65270e548b5b927be
Signed-off-by: Sherman Yin <syin@broadcom.com>
2014-06-16 11:58:47 +08:00
ddl
c76142ff64 camsys_drv: v0.7.0 camsys_head: v0.6.0 2014-05-06 16:11:52 +08:00
黄涛
7fe47454f2 Merge tag 'lsk-android-14.04' into develop-3.10
lsk-android 14.04

Conflicts:
	Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
	drivers/pinctrl/pinconf-generic.c
	include/linux/pinctrl/consumer.h
	include/linux/pinctrl/pinconf-generic.h
2014-04-24 19:04:10 +08:00
luowei
12c4ae3031 pinctrl:clear iomux bits before setting 2014-04-24 18:28:56 +08:00
luowei
bddbdaf42a pinctrl:add gpio init support 2014-04-18 18:20:35 +08:00
黄涛
0ffd56dafe Merge tag 'lsk-android-14.03' into develop-3.10
lsk 14.03 Android release
2014-04-15 12:51:10 +08:00
Mark Brown
b0f285eeb0 Merge branch 'v3.10/topic/pinctrl' of git://git.linaro.org/kernel/linux-linaro-stable into linux-linaro-lsk 2014-04-10 12:36:26 +01:00
luowei
a3f6602089 pinctrl:add pin debug support and fix bank0 iomux bug 2014-04-09 16:07:46 +08:00
Mark Brown
270cfc4788 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.

[For LSK restore the original API and add a _new() variant of the
functions for external consumption instead, maintaining the existing API
-- broonie]

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>
(cherry-picked from commit 3287c24088)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 21:39:02 +01:00
Mark Brown
baeae2041e 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.

[For LSK this has been modified such that the old API is still present and
instead a new pinconf_set_bulk() callback has been added in order to avoid
breaking other users in the stable kernel -- broonie]

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>
(cherry picked from commit 03b054e969)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 20:20:07 +01:00
Laxman Dewangan
0f9f831b34 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>
(cherry picked from commit 1eb207a9ec)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:24:15 +01:00
Sherman Yin
150e48fdb3 pinctrl: Adds slew-rate, input-enable/disable
This commit adds slew-rate and input-enable/disable support for pinconf
-generic.

Signed-off-by: Sherman Yin <syin@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 8ba3f4d000)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:24:06 +01:00
Axel Lin
bede3529a4 pinctrl: pinconf-generic: Remove ti prefix in dev_err messages
It does not make sense to show ti prefix in pinconf_generic_dt_subnode_to_map()
dev_err messages.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit acf564a8f3)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:23:49 +01:00
Laxman Dewangan
9ce1c71276 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>
(cherry picked from commit e81c8f18af)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:23:33 +01:00
Heiko Stübner
aaba68a91d pinctrl: remove bindings for pinconf options needing more thought
Some options currently take arguments in unspecified driver-specific units.
As pointed out by Stephen Warren, driver specific values should not be part
of generic devicetree bindings describing the hardware.

Therefore remove the critical bindings again, before they become part of
an official release.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 5b81d55c4c)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:23:01 +01:00
Heiko Stübner
6d27cf9086 pinctrl: set unit for debounce time pinconfig to usec
Currently the debounce time pinconfig option uses an unspecified
"time units" unit. As pinconfig options should use SI units and a
real unit is also necessary for generic dt bindings, change it
to usec. Currently no driver is using the generic pinconfig option
for this, so the unit change is safe to do.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 256aeb6487)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:22:53 +01:00
Heiko Stübner
2feed75860 pinctrl: dynamically alloc temp array when parsing dt pinconf options
Allocating the temorary array in pinconf_generic_parse_dt_config on stack
might cause problems later on, when the number of options grows over time.
Therefore also allocate this array dynamically to be on the safe side.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 6abab2d4be)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:22:41 +01:00
Heiko Stübner
374b02f771 pinctrl: handle zero found dt pinconfig properties better
This adds a shortcut when no valid pinconf properties are found
in the parsed dt node, to set the values immediately and return.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit e4a8844c04)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:20:40 +01:00
Heiko Stübner
255b8fa40a pinctrl: clarify some dt pinconfig options
The bias-pull-* options use values > 0 to indicate that the pull should
be activated and optionally also indicate the strength of the pull.
Therefore use an default value of 1 for these options.

Split the low-power-mode option into low-power-enable and -disable.

Update the documentation to describe the param arguments better.

Reported-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 9ee1f7d266)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:20:25 +01:00
Heiko Stübner
a3aadc7709 pinctrl: add function to parse generic pinconfig properties from a dt node
pinconf_generic_parse_dt_config() takes a node as input and generates an
array of generic pinconfig values from the properties of this node.

As I couldn't find a mechanism to count the number of properties of a node
the function uses internally an array to accept one of parameter and copies
the real present options to a smaller variable at its end.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 7db9af4b6e)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:20:17 +01:00
Heiko Stübner
fd08eab34a pinctrl: add pinconf-generic define for a pin-default pull
There exist controllers that don't support to set the pull to up or down
separately but instead automatically set the pull direction based on
embedded knowledge inside the controller, for example depending on the
selected mux function of the pin.

Therefore this patch adds another config option to use this default
pull-state for a pin where it is not possible to know or decide if the
pin will be pulled up or down.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 7970cb770d)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:20:06 +01:00
James Hogan
5a585d47f7 pinconf-generic: add BIAS_BUS_HOLD pinconf
Add a new PIN_CONFIG_BIAS_BUS_HOLD pin configuration for a bus holder
pin mode (also known as bus keeper, or repeater). This is a weak latch
which drives the last value on a tristate bus. Another device on the bus
can drive the bus high or low before going tristate to change the value
driven by the pin.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit a2df4269ca)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:19:56 +01:00
James Hogan
9ae6a79ed2 pinconf-generic: add drive strength to debugfs output
Add the drive strength pinconf to debugfs output (with the unit "mA").

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 73ae368cd3)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:19:46 +01:00
Linus Walleij
a11975a78b pinctrl: rip out the direct pinconf API
From the inception ot the pin config API there has been the
possibility to get a handle at a pin directly and configure
its electrical characteristics. For this reason we had:

int pin_config_get(const char *dev_name, const char *name,
               unsigned long *config);
int pin_config_set(const char *dev_name, const char *name,
               unsigned long config);
int pin_config_group_get(const char *dev_name,
               const char *pin_group,
               unsigned long *config);
int pin_config_group_set(const char *dev_name,
               const char *pin_group,
               unsigned long config);

After the introduction of the pin control states that will
control pins associated with devices, and its subsequent
introduction to the device core, as well as the
introduction of pin control hogs that can set up states on
boot and optionally also at sleep, this direct pin control
API is a thing of the past.

As could be expected, it has zero in-kernel users.
Let's delete this API and make our world simpler.

Reported-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit ad42fc6c84)
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-04 16:19:04 +01:00
luowei
e5802a4d63 pinctrl:fix _rockchip_pinconf_set bug 2014-03-31 16:36:09 +08:00
luowei
551fcbfe9f delete RK3288_GRF_GPIO0_D_IOMUX according to new datasheet 2014-03-28 17:13:25 +08:00
luowei
e336df04c0 add rockchip-pinctrl.txt 2014-03-28 15:42:50 +08:00
luowei
a9a0597e22 delete spi1_cs1 dts code for rk3288 2014-03-27 11:55:02 +08:00
luowei
03317364ff pinctrl:modify something debug infomation 2014-03-25 19:21:17 +08:00
luowei
a4b25edbe9 pinctrl:add bank debug support 2014-03-24 21:16:27 +08:00
luowei
d4f2455a81 pinctrl:fix some iomux registers offset bug 2014-03-21 19:47:50 +08:00
luowei
13ff4a4289 pinctrl:modify bank0 reg_base 2014-03-20 19:54:32 +08:00
luowei
d4cd11715b pinctrl:modify rk3288 dts function name 2014-03-18 15:14:54 +08:00
luowei
58c3a833a1 pinctrl:add vol_domain and iomux operation for RK3288 2014-03-17 19:35:11 +08:00
luowei
181391482c pinctrl:divide address of pinctrl dts 2014-03-14 19:30:06 +08:00
luowei
ec30763386 fix pinctrl bug for voltage domain setting 2014-03-13 20:43:28 +08:00
黄涛
9983901d21 Merge tag 'lsk-android-14.02' into develop-3.10
lsk 14.02 Android release
2014-03-12 21:33:38 +08:00
luowei
35f085632d pinctrl:add debug function support 2014-03-12 20:37:49 +08:00
luowei
e29aa922de pinctrl:add suspend and resume function 2014-03-03 15:47:40 +08:00
luowei
db944ccc1e add rk3288 pinctrl dts code 2014-02-27 16:34:12 +08:00
Stanislaw Gruszka
1fc42b84b4 pinctrl: protect pinctrl_list add
commit 7b320cb1ed upstream.

We have few fedora bug reports about list corruption on pinctrl,
for example:
https://bugzilla.redhat.com/show_bug.cgi?id=1051918

Most likely corruption happen due lack of protection of pinctrl_list
when adding new nodes to it. Patch corrects that.

Fixes: 42fed7ba44 ("pinctrl: move subsystem mutex to pinctrl_dev struct")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-20 11:06:11 -08:00