aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/mux.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-09-19 13:46:56 -0400
committerTony Lindgren <tony@atomide.com>2012-09-20 17:54:57 -0400
commit70c494c3122fb3d53518aea53c8cf5d61cad909a (patch)
tree5f3c174d13ad2e459a73902f0d7162d3473e612c /arch/arm/mach-omap1/mux.c
parenta619ca9c4a132472adce3b8d11d0fdafa91ae9dd (diff)
ARM: OMAP1: Make plat/mux.h omap1 only
We are moving omap2+ to use the device tree based pinctrl-single.c and will be removing the old mux framework. This will remove the omap1 specific parts from plat-omap. Acked-by: Felipe Balbi <balbi@ti.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: linux-usb@vger.kernel.org Cc: linux-pcmcia@lists.infradead.org Cc: spi-devel-general@lists.sourceforge.net Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/mux.c')
-rw-r--r--arch/arm/mach-omap1/mux.c58
1 files changed, 56 insertions, 2 deletions
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index e9cc52d4cb28..667ce5027f63 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -29,7 +29,7 @@
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31 31
32#include <plat/mux.h> 32#include <mach/mux.h>
33 33
34#ifdef CONFIG_OMAP_MUX 34#ifdef CONFIG_OMAP_MUX
35 35
@@ -451,6 +451,56 @@ static int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
451#endif 451#endif
452} 452}
453 453
454static struct omap_mux_cfg *mux_cfg;
455
456int __init omap_mux_register(struct omap_mux_cfg *arch_mux_cfg)
457{
458 if (!arch_mux_cfg || !arch_mux_cfg->pins || arch_mux_cfg->size == 0
459 || !arch_mux_cfg->cfg_reg) {
460 printk(KERN_ERR "Invalid pin table\n");
461 return -EINVAL;
462 }
463
464 mux_cfg = arch_mux_cfg;
465
466 return 0;
467}
468
469/*
470 * Sets the Omap MUX and PULL_DWN registers based on the table
471 */
472int __init_or_module omap_cfg_reg(const unsigned long index)
473{
474 struct pin_config *reg;
475
476 if (!cpu_class_is_omap1()) {
477 printk(KERN_ERR "mux: Broken omap_cfg_reg(%lu) entry\n",
478 index);
479 WARN_ON(1);
480 return -EINVAL;
481 }
482
483 if (mux_cfg == NULL) {
484 printk(KERN_ERR "Pin mux table not initialized\n");
485 return -ENODEV;
486 }
487
488 if (index >= mux_cfg->size) {
489 printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n",
490 index, mux_cfg->size);
491 dump_stack();
492 return -ENODEV;
493 }
494
495 reg = &mux_cfg->pins[index];
496
497 if (!mux_cfg->cfg_reg)
498 return -ENODEV;
499
500 return mux_cfg->cfg_reg(reg);
501}
502EXPORT_SYMBOL(omap_cfg_reg);
503
454int __init omap1_mux_init(void) 504int __init omap1_mux_init(void)
455{ 505{
456 if (cpu_is_omap7xx()) { 506 if (cpu_is_omap7xx()) {
@@ -468,4 +518,8 @@ int __init omap1_mux_init(void)
468 return omap_mux_register(&arch_mux_cfg); 518 return omap_mux_register(&arch_mux_cfg);
469} 519}
470 520
471#endif 521#else
522#define omap_mux_init() do {} while(0)
523#define omap_cfg_reg(x) do {} while(0)
524#endif /* CONFIG_OMAP_MUX */
525