Skip to content

Commit

Permalink
ARM: imx: call mxc_device_init() in soc specific function
Browse files Browse the repository at this point in the history
mxc_device_init() is a core_initcall function used to register devices
for mxc_aips_bus and mxc_ahb_bus, which are needed by gpio and dma
device registration.

Instead of being a core_initcall function, we have it called in soc
specific initialization function before gpio and dma devices get
registered, so that it will not be called for other platforms when
we enable multi-platform support for imx.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
  • Loading branch information
Shawn Guo committed Oct 15, 2012
1 parent 1e66210 commit 69ac71d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-imx/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ extern void mxc_arch_reset_init(void __iomem *);
extern int mx53_revision(void);
extern int mx53_display_revision(void);
extern void imx_set_aips(void __iomem *);
extern int mxc_device_init(void);

enum mxc_cpu_pwr_mode {
WAIT_CLOCKED, /* wfi only */
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-imx/devices/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct device mxc_ahb_bus = {
.parent = &platform_bus,
};

static int __init mxc_device_init(void)
int __init mxc_device_init(void)
{
int ret;

Expand All @@ -45,4 +45,3 @@ static int __init mxc_device_init(void)
done:
return ret;
}
core_initcall(mxc_device_init);
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mm-imx21.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ static const struct resource imx21_audmux_res[] __initconst = {

void __init imx21_soc_init(void)
{
mxc_device_init();

mxc_register_gpio("imx21-gpio", 0, MX21_GPIO1_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
mxc_register_gpio("imx21-gpio", 1, MX21_GPIO2_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
mxc_register_gpio("imx21-gpio", 2, MX21_GPIO3_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mm-imx25.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ static const struct resource imx25_audmux_res[] __initconst = {

void __init imx25_soc_init(void)
{
mxc_device_init();

/* i.mx25 has the i.mx35 type gpio */
mxc_register_gpio("imx35-gpio", 0, MX25_GPIO1_BASE_ADDR, SZ_16K, MX25_INT_GPIO1, 0);
mxc_register_gpio("imx35-gpio", 1, MX25_GPIO2_BASE_ADDR, SZ_16K, MX25_INT_GPIO2, 0);
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-imx/mm-imx27.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ static const struct resource imx27_audmux_res[] __initconst = {

void __init imx27_soc_init(void)
{
mxc_device_init();

/* i.mx27 has the i.mx21 type gpio */
mxc_register_gpio("imx21-gpio", 0, MX27_GPIO1_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
mxc_register_gpio("imx21-gpio", 1, MX27_GPIO2_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-imx/mm-imx3.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ void __init imx31_soc_init(void)

imx3_init_l2x0();

mxc_device_init();

mxc_register_gpio("imx31-gpio", 0, MX31_GPIO1_BASE_ADDR, SZ_16K, MX31_INT_GPIO1, 0);
mxc_register_gpio("imx31-gpio", 1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0);
mxc_register_gpio("imx31-gpio", 2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0);
Expand Down Expand Up @@ -271,6 +273,8 @@ void __init imx35_soc_init(void)

imx3_init_l2x0();

mxc_device_init();

mxc_register_gpio("imx35-gpio", 0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0);
mxc_register_gpio("imx35-gpio", 1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0);
mxc_register_gpio("imx35-gpio", 2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0);
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-imx/mm-imx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ static const struct resource imx51_audmux_res[] __initconst = {

void __init imx50_soc_init(void)
{
mxc_device_init();

/* i.mx50 has the i.mx35 type gpio */
mxc_register_gpio("imx35-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
mxc_register_gpio("imx35-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
Expand All @@ -153,6 +155,8 @@ void __init imx50_soc_init(void)

void __init imx51_soc_init(void)
{
mxc_device_init();

/* i.mx51 has the i.mx35 type gpio */
mxc_register_gpio("imx35-gpio", 0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_INT_GPIO1_LOW, MX51_INT_GPIO1_HIGH);
mxc_register_gpio("imx35-gpio", 1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_INT_GPIO2_LOW, MX51_INT_GPIO2_HIGH);
Expand Down

0 comments on commit 69ac71d

Please sign in to comment.