diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-12-16 17:12:31 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2011-12-19 21:03:11 -0500 |
commit | 54862bf00968427cf8f7ffcb6dacf03161eae862 (patch) | |
tree | a8990b08d6380e23f8569d196c234306769f5501 /arch/arm/mach-tegra/board-harmony-pinmux.c | |
parent | b49cae59e12348474f7a82bbec187877f83381a9 (diff) |
arm/tegra: Refactor board-*-pinmux.c to share code
This moves the implementation of *_pinmux_init() into a single location.
The board-specific pinmux data is left in each board's own file. This
will allow future changes that set up the pinmux in a more complex
fashion to do so without duplicating that code in each board's pinmux
file.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra/board-harmony-pinmux.c')
-rw-r--r-- | arch/arm/mach-tegra/board-harmony-pinmux.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c index 7a4a26d5174c..5038f5b130e6 100644 --- a/arch/arm/mach-tegra/board-harmony-pinmux.c +++ b/arch/arm/mach-tegra/board-harmony-pinmux.c | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #include "gpio-names.h" | 23 | #include "gpio-names.h" |
24 | #include "board-harmony.h" | 24 | #include "board-harmony.h" |
25 | #include "devices.h" | 25 | #include "board-pinmux.h" |
26 | 26 | ||
27 | static struct tegra_pingroup_config harmony_pinmux[] = { | 27 | static struct tegra_pingroup_config harmony_pinmux[] = { |
28 | {TEGRA_PINGROUP_ATA, TEGRA_MUX_IDE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 28 | {TEGRA_PINGROUP_ATA, TEGRA_MUX_IDE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
@@ -143,11 +143,6 @@ static struct tegra_pingroup_config harmony_pinmux[] = { | |||
143 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 143 | {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | static struct platform_device *pinmux_devices[] = { | ||
147 | &tegra_gpio_device, | ||
148 | &tegra_pinmux_device, | ||
149 | }; | ||
150 | |||
151 | static struct tegra_gpio_table gpio_table[] = { | 146 | static struct tegra_gpio_table gpio_table[] = { |
152 | { .gpio = TEGRA_GPIO_SD2_CD, .enable = true }, | 147 | { .gpio = TEGRA_GPIO_SD2_CD, .enable = true }, |
153 | { .gpio = TEGRA_GPIO_SD2_WP, .enable = true }, | 148 | { .gpio = TEGRA_GPIO_SD2_WP, .enable = true }, |
@@ -161,13 +156,14 @@ static struct tegra_gpio_table gpio_table[] = { | |||
161 | { .gpio = TEGRA_GPIO_EXT_MIC_EN, .enable = true }, | 156 | { .gpio = TEGRA_GPIO_EXT_MIC_EN, .enable = true }, |
162 | }; | 157 | }; |
163 | 158 | ||
159 | static struct tegra_board_pinmux_conf conf = { | ||
160 | .pgs = harmony_pinmux, | ||
161 | .pg_count = ARRAY_SIZE(harmony_pinmux), | ||
162 | .gpios = gpio_table, | ||
163 | .gpio_count = ARRAY_SIZE(gpio_table), | ||
164 | }; | ||
165 | |||
164 | void harmony_pinmux_init(void) | 166 | void harmony_pinmux_init(void) |
165 | { | 167 | { |
166 | if (!of_machine_is_compatible("nvidia,tegra20")) | 168 | tegra_board_pinmux_init(&conf, NULL); |
167 | platform_add_devices(pinmux_devices, | ||
168 | ARRAY_SIZE(pinmux_devices)); | ||
169 | |||
170 | tegra_pinmux_config_table(harmony_pinmux, ARRAY_SIZE(harmony_pinmux)); | ||
171 | |||
172 | tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table)); | ||
173 | } | 169 | } |