diff options
author | Mark A. Greer <mgreer@mvista.com> | 2009-04-15 15:39:48 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-26 11:17:16 -0400 |
commit | 0e585952ac6a06b3c77d6b8eadb9c359766a700d (patch) | |
tree | d8216964e80d9cd3d86b5aa9cb25f035efa26bef /arch/arm/mach-davinci/mux.c | |
parent | d81d188cafecbc9e01df51527ac4c84a5b19e033 (diff) |
davinci: Move pinmux setup info to SoC infrastructure
The pinmux register base and setup can be different for different
SoCs so move the pinmux reg base, pinmux table (and its size) to
the SoC infrastructure.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/mux.c')
-rw-r--r-- | arch/arm/mach-davinci/mux.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/arch/arm/mach-davinci/mux.c b/arch/arm/mach-davinci/mux.c index bbba0b247a44..d310f579aa85 100644 --- a/arch/arm/mach-davinci/mux.c +++ b/arch/arm/mach-davinci/mux.c | |||
@@ -21,18 +21,7 @@ | |||
21 | 21 | ||
22 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
23 | #include <mach/mux.h> | 23 | #include <mach/mux.h> |
24 | 24 | #include <mach/common.h> | |
25 | static const struct mux_config *mux_table; | ||
26 | static unsigned long pin_table_sz; | ||
27 | |||
28 | int __init davinci_mux_register(const struct mux_config *pins, | ||
29 | unsigned long size) | ||
30 | { | ||
31 | mux_table = pins; | ||
32 | pin_table_sz = size; | ||
33 | |||
34 | return 0; | ||
35 | } | ||
36 | 25 | ||
37 | /* | 26 | /* |
38 | * Sets the DAVINCI MUX register based on the table | 27 | * Sets the DAVINCI MUX register based on the table |
@@ -40,23 +29,24 @@ int __init davinci_mux_register(const struct mux_config *pins, | |||
40 | int __init_or_module davinci_cfg_reg(const unsigned long index) | 29 | int __init_or_module davinci_cfg_reg(const unsigned long index) |
41 | { | 30 | { |
42 | static DEFINE_SPINLOCK(mux_spin_lock); | 31 | static DEFINE_SPINLOCK(mux_spin_lock); |
43 | void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE); | 32 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
33 | void __iomem *base = soc_info->pinmux_base; | ||
44 | unsigned long flags; | 34 | unsigned long flags; |
45 | const struct mux_config *cfg; | 35 | const struct mux_config *cfg; |
46 | unsigned int reg_orig = 0, reg = 0; | 36 | unsigned int reg_orig = 0, reg = 0; |
47 | unsigned int mask, warn = 0; | 37 | unsigned int mask, warn = 0; |
48 | 38 | ||
49 | if (!mux_table) | 39 | if (!soc_info->pinmux_pins) |
50 | BUG(); | 40 | BUG(); |
51 | 41 | ||
52 | if (index >= pin_table_sz) { | 42 | if (index >= soc_info->pinmux_pins_num) { |
53 | printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n", | 43 | printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n", |
54 | index, pin_table_sz); | 44 | index, soc_info->pinmux_pins_num); |
55 | dump_stack(); | 45 | dump_stack(); |
56 | return -ENODEV; | 46 | return -ENODEV; |
57 | } | 47 | } |
58 | 48 | ||
59 | cfg = &mux_table[index]; | 49 | cfg = &soc_info->pinmux_pins[index]; |
60 | 50 | ||
61 | if (cfg->name == NULL) { | 51 | if (cfg->name == NULL) { |
62 | printk(KERN_ERR "No entry for the specified index\n"); | 52 | printk(KERN_ERR "No entry for the specified index\n"); |