diff options
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"); |