diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-12-13 15:21:01 -0700 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-04-18 10:26:39 -0600 |
commit | f30d12b3ffb321c9d29bd1588940704d9bed2643 (patch) | |
tree | 0842183a866a3b45c1881210e423f4b8932b682b /arch/arm/mach-tegra/board-pinmux.h | |
parent | 3e215d0a19c2a0c389bd9117573b6dd8e46f96a8 (diff) |
ARM: tegra: Switch to new pinctrl driver
* Rename old pinmux and new pinctrl platform driver and DT match table
entries, so the new driver gets instantiated.
* Re-write board-pinmux.c, so that it uses pinctrl APIs to configura the
pinmux.
* Re-write board-*-pinmux.c so that the pinmux configuration tables are
in pinctrl format.
Ventana's pin mux table needed some edits on top of the basic format
conversion, since some mux options that were previously marked as
reserved are now valid in the new pinctrl driver. Attempting to use the
old reserved names will result in a failure. Specifically, groups lpw0,
lpw2, lsc1, lsck, and lsda were changed from function rsvd4 to displaya,
and group pta was changed from function rsvd2 to hdmi.
All boards' pin mux tables needed some edits on top of the based format
conversion, since function i2c was split into i2c1 (first general I2C
controller) and i2cp (power I2C controller) to better align function
definitions with HW blocks.
Due to the split of mux tables into pure mux and pull/tristate tables,
many entries in the separate Seaboard/Ventana tables could be merged
into the common table, since the entries differed only in the portion
in one of the tables, not both.
Most pin groups allow configuration of mux, tri-state, and pull. However,
some don't allow pull configuration, which is instead configured by new
groups that only allow pull configuration. This is a reflection of the
true HW capabilities, which weren't fully represented by the old pinmux
driver. This required adding new pull table entries for those new groups,
and setting many other entries' pull configuration to
TEGRA_PINCONFIG_DONT_SET.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra/board-pinmux.h')
-rw-r--r-- | arch/arm/mach-tegra/board-pinmux.h | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/board-pinmux.h b/arch/arm/mach-tegra/board-pinmux.h index e08214d84bd..45b5ad8dc6d 100644 --- a/arch/arm/mach-tegra/board-pinmux.h +++ b/arch/arm/mach-tegra/board-pinmux.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -15,16 +15,37 @@ #ifndef __MACH_TEGRA_BOARD_PINMUX_H #define __MACH_TEGRA_BOARD_PINMUX_H +#include <linux/pinctrl/machine.h> + +#include <mach/pinconf-tegra.h> + #define PINMUX_DEV "tegra-pinmux" -struct tegra_pingroup_config; +#define TEGRA_MAP_MUX(_group_, _function_) \ + PIN_MAP_MUX_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, _function_) -struct tegra_board_pinmux_conf { - struct tegra_pingroup_config *pgs; - int pg_count; +#define TEGRA_MAP_CONF(_group_, _pull_, _drive_) \ + PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, tegra_pincfg_pull##_pull_##_##_drive_) - struct tegra_drive_pingroup_config *drives; - int drive_count; +#define TEGRA_MAP_MUXCONF(_group_, _function_, _pull_, _drive_) \ + TEGRA_MAP_MUX(_group_, _function_), \ + TEGRA_MAP_CONF(_group_, _pull_, _drive_) + +extern unsigned long tegra_pincfg_pullnone_driven[2]; +extern unsigned long tegra_pincfg_pullnone_tristate[2]; +extern unsigned long tegra_pincfg_pullnone_na[1]; +extern unsigned long tegra_pincfg_pullup_driven[2]; +extern unsigned long tegra_pincfg_pullup_tristate[2]; +extern unsigned long tegra_pincfg_pullup_na[1]; +extern unsigned long tegra_pincfg_pulldown_driven[2]; +extern unsigned long tegra_pincfg_pulldown_tristate[2]; +extern unsigned long tegra_pincfg_pulldown_na[1]; +extern unsigned long tegra_pincfg_pullna_driven[1]; +extern unsigned long tegra_pincfg_pullna_tristate[1]; + +struct tegra_board_pinmux_conf { + struct pinctrl_map *maps; + int map_count; }; void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a, |