ARM: 6678/1: SPEAr: update padmux code

- compile padmux only for spear3xx
- padmux initialization code rearranged in evaluation board and machine
  files.

Reviewed-by: Stanley Miao <stanley.miao@windriver.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
viresh kumar 2011-02-16 07:40:30 +01:00 committed by Russell King
parent f9324a85c1
commit 53688c51e4
9 changed files with 36 additions and 59 deletions

View File

@ -40,7 +40,6 @@ void __init clk_init(void);
void __init spear3xx_map_io(void);
void __init spear3xx_init_irq(void);
void __init spear3xx_init(void);
void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size);
/* pad mux declarations */
#define PMX_FIRDA_MASK (1 << 14)
@ -133,8 +132,6 @@ extern struct pmx_dev pmx_telecom_sdio_4bit;
extern struct pmx_dev pmx_telecom_sdio_8bit;
extern struct pmx_dev pmx_gpio1;
void spear300_pmx_init(void);
/* Add spear300 machine function declarations here */
void __init spear300_init(void);
@ -154,8 +151,6 @@ extern struct pmx_dev pmx_fsmc;
extern struct pmx_dev pmx_rs485_0_1;
extern struct pmx_dev pmx_tdm0;
void spear310_pmx_init(void);
/* Add spear310 machine function declarations here */
void __init spear310_init(void);
@ -195,8 +190,6 @@ extern struct pmx_dev pmx_smii0;
extern struct pmx_dev pmx_smii1;
extern struct pmx_dev pmx_i2c1;
void spear320_pmx_init(void);
/* Add spear320 machine function declarations here */
void __init spear320_init(void);

View File

@ -459,10 +459,16 @@ void __init spear300_init(void)
if (ret)
printk(KERN_ERR "Error registering Shared IRQ\n");
}
}
void spear300_pmx_init(void)
{
spear_pmx_init(&pmx_driver, SPEAR300_SOC_CONFIG_BASE,
/* pmx initialization */
pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE,
SPEAR300_SOC_CONFIG_SIZE);
if (pmx_driver.base) {
ret = pmx_register(&pmx_driver);
if (ret)
printk(KERN_ERR "padmux: registeration failed. err no"
": %d\n", ret);
/* Free Mapping, device selection already done */
iounmap(pmx_driver.base);
}
}

View File

@ -51,14 +51,13 @@ static void __init spear300_evb_init(void)
{
unsigned int i;
/* call spear300 machine init function */
spear300_init();
/* padmux initialization */
/* padmux initialization, must be done before spear300_init */
pmx_driver.mode = &photo_frame_mode;
pmx_driver.devs = pmx_devs;
pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
spear300_pmx_init();
/* call spear300 machine init function */
spear300_init();
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));

View File

@ -293,10 +293,11 @@ void __init spear310_init(void)
if (ret)
printk(KERN_ERR "Error registering Shared IRQ 4\n");
}
}
void spear310_pmx_init(void)
{
spear_pmx_init(&pmx_driver, SPEAR310_SOC_CONFIG_BASE,
SPEAR310_SOC_CONFIG_SIZE);
/* pmx initialization */
pmx_driver.base = base;
ret = pmx_register(&pmx_driver);
if (ret)
printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
ret);
}

View File

@ -58,14 +58,13 @@ static void __init spear310_evb_init(void)
{
unsigned int i;
/* call spear310 machine init function */
spear310_init();
/* padmux initialization */
/* padmux initialization, must be done before spear310_init */
pmx_driver.mode = NULL;
pmx_driver.devs = pmx_devs;
pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
spear310_pmx_init();
/* call spear310 machine init function */
spear310_init();
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));

View File

@ -540,10 +540,11 @@ void __init spear320_init(void)
if (ret)
printk(KERN_ERR "Error registering Shared IRQ 4\n");
}
}
void spear320_pmx_init(void)
{
spear_pmx_init(&pmx_driver, SPEAR320_SOC_CONFIG_BASE,
SPEAR320_SOC_CONFIG_SIZE);
/* pmx initialization */
pmx_driver.base = base;
ret = pmx_register(&pmx_driver);
if (ret)
printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
ret);
}

View File

@ -55,14 +55,13 @@ static void __init spear320_evb_init(void)
{
unsigned int i;
/* call spear320 machine init function */
spear320_init();
/* padmux initialization */
/* padmux initialization, must be done before spear320_init */
pmx_driver.mode = &auto_net_mii_mode;
pmx_driver.devs = pmx_devs;
pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
spear320_pmx_init();
/* call spear320 machine init function */
spear320_init();
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));

View File

@ -525,24 +525,3 @@ struct pmx_dev pmx_plgpio_45_46_49_50 = {
};
#endif
/* spear padmux initialization function */
void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size)
{
int ret = 0;
/* pad mux initialization */
pmx_driver->base = ioremap(base, size);
if (!pmx_driver->base) {
ret = -ENOMEM;
goto pmx_fail;
}
ret = pmx_register(pmx_driver);
iounmap(pmx_driver->base);
pmx_fail:
if (ret)
printk(KERN_ERR "padmux: registration failed. err no: %d\n",
ret);
}

View File

@ -3,6 +3,6 @@
#
# Common support
obj-y := clock.o padmux.o time.o
obj-y := clock.o time.o
obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o
obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o