All of lore.kernel.org
 help / color / mirror / Atom feed
From: davidb@codeaurora.org (David Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/17] ARM: msm: use machine specific hook for late init
Date: Thu, 26 Apr 2012 10:41:24 -0700	[thread overview]
Message-ID: <20120426174124.GA22248@codeaurora.org> (raw)
In-Reply-To: <1335454725-13089-9-git-send-email-shawn.guo@linaro.org>

This should be ok.  I'll forward it on to Saravana Kannan and Stephen
Boyd, since it will affect the clock changes they are working on, but
It's not too difficult to adapt.

David

On Thu, Apr 26, 2012 at 11:38:36PM +0800, Shawn Guo wrote:
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  arch/arm/mach-msm/board-halibut.c      |    7 +++++++
>  arch/arm/mach-msm/board-mahimahi.c     |    7 +++++++
>  arch/arm/mach-msm/board-msm7x27.c      |   10 ++++++++++
>  arch/arm/mach-msm/board-msm7x30.c      |    9 +++++++++
>  arch/arm/mach-msm/board-msm8960.c      |    8 ++++++++
>  arch/arm/mach-msm/board-msm8x60.c      |   11 +++++++++++
>  arch/arm/mach-msm/board-qsd8x50.c      |    8 ++++++++
>  arch/arm/mach-msm/board-sapphire.c     |    7 +++++++
>  arch/arm/mach-msm/board-trout.c        |    7 +++++++
>  arch/arm/mach-msm/clock.c              |    4 +---
>  arch/arm/mach-msm/include/mach/board.h |    7 +++++++
>  arch/arm/mach-msm/smd_debug.c          |    3 +--
>  12 files changed, 83 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c
> index 26aac36..f60944c 100644
> --- a/arch/arm/mach-msm/board-halibut.c
> +++ b/arch/arm/mach-msm/board-halibut.c
> @@ -94,6 +94,12 @@ static void __init halibut_map_io(void)
>  	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
>  }
>  
> +static void __init halibut_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
>  	.atag_offset	= 0x100,
>  	.fixup		= halibut_fixup,
> @@ -101,5 +107,6 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
>  	.init_early	= halibut_init_early,
>  	.init_irq	= halibut_init_irq,
>  	.init_machine	= halibut_init,
> +	.init_late	= halibut_init_late,
>  	.timer		= &msm_timer,
>  MACHINE_END
> diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c
> index 5a4882f..6ee7c9a 100644
> --- a/arch/arm/mach-msm/board-mahimahi.c
> +++ b/arch/arm/mach-msm/board-mahimahi.c
> @@ -71,6 +71,12 @@ static void __init mahimahi_map_io(void)
>  	msm_clock_init();
>  }
>  
> +static void __init mahimahi_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  extern struct sys_timer msm_timer;
>  
>  MACHINE_START(MAHIMAHI, "mahimahi")
> @@ -79,5 +85,6 @@ MACHINE_START(MAHIMAHI, "mahimahi")
>  	.map_io		= mahimahi_map_io,
>  	.init_irq	= msm_init_irq,
>  	.init_machine	= mahimahi_init,
> +	.init_late	= mahimahi_init_late,
>  	.timer		= &msm_timer,
>  MACHINE_END
> diff --git a/arch/arm/mach-msm/board-msm7x27.c b/arch/arm/mach-msm/board-msm7x27.c
> index 6d84ee7..8e8ca0f 100644
> --- a/arch/arm/mach-msm/board-msm7x27.c
> +++ b/arch/arm/mach-msm/board-msm7x27.c
> @@ -128,11 +128,18 @@ static void __init msm7x2x_map_io(void)
>  #endif
>  }
>  
> +static void __init msm7x2x_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
>  	.atag_offset	= 0x100,
>  	.map_io		= msm7x2x_map_io,
>  	.init_irq	= msm7x2x_init_irq,
>  	.init_machine	= msm7x2x_init,
> +	.init_late	= msm7x2x_init_late,
>  	.timer		= &msm_timer,
>  MACHINE_END
>  
> @@ -141,6 +148,7 @@ MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
>  	.map_io		= msm7x2x_map_io,
>  	.init_irq	= msm7x2x_init_irq,
>  	.init_machine	= msm7x2x_init,
> +	.init_late	= msm7x2x_init_late,
>  	.timer		= &msm_timer,
>  MACHINE_END
>  
> @@ -149,6 +157,7 @@ MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
>  	.map_io		= msm7x2x_map_io,
>  	.init_irq	= msm7x2x_init_irq,
>  	.init_machine	= msm7x2x_init,
> +	.init_late	= msm7x2x_init_late,
>  	.timer		= &msm_timer,
>  MACHINE_END
>  
> @@ -157,5 +166,6 @@ MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
>  	.map_io		= msm7x2x_map_io,
>  	.init_irq	= msm7x2x_init_irq,
>  	.init_machine	= msm7x2x_init,
> +	.init_late	= msm7x2x_init_late,
>  	.timer		= &msm_timer,
>  MACHINE_END
> diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
> index db81ed5..a71d8f9 100644
> --- a/arch/arm/mach-msm/board-msm7x30.c
> +++ b/arch/arm/mach-msm/board-msm7x30.c
> @@ -120,6 +120,12 @@ static void __init msm7x30_map_io(void)
>  	msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
>  }
>  
> +static void __init msm7x30_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
>  	.atag_offset = 0x100,
>  	.fixup = msm7x30_fixup,
> @@ -127,6 +133,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
>  	.map_io = msm7x30_map_io,
>  	.init_irq = msm7x30_init_irq,
>  	.init_machine = msm7x30_init,
> +	.init_late = msm7x30_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
>  
> @@ -137,6 +144,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
>  	.map_io = msm7x30_map_io,
>  	.init_irq = msm7x30_init_irq,
>  	.init_machine = msm7x30_init,
> +	.init_late = msm7x30_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
>  
> @@ -147,5 +155,6 @@ MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
>  	.map_io = msm7x30_map_io,
>  	.init_irq = msm7x30_init_irq,
>  	.init_machine = msm7x30_init,
> +	.init_late = msm7x30_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
> diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
> index ed35981..4eb8232 100644
> --- a/arch/arm/mach-msm/board-msm8960.c
> +++ b/arch/arm/mach-msm/board-msm8960.c
> @@ -93,6 +93,12 @@ static void __init msm8960_rumi3_init(void)
>  	platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
>  }
>  
> +static void __init msm8960_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
>  	.fixup = msm8960_fixup,
>  	.reserve = msm8960_reserve,
> @@ -101,6 +107,7 @@ MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
>  	.timer = &msm_timer,
>  	.handle_irq = gic_handle_irq,
>  	.init_machine = msm8960_sim_init,
> +	.init_late = msm8960_init_late,
>  MACHINE_END
>  
>  MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
> @@ -111,5 +118,6 @@ MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
>  	.timer = &msm_timer,
>  	.handle_irq = gic_handle_irq,
>  	.init_machine = msm8960_rumi3_init,
> +	.init_late = msm8960_init_late,
>  MACHINE_END
>  
> diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
> index 962e711..1dd6ce7 100644
> --- a/arch/arm/mach-msm/board-msm8x60.c
> +++ b/arch/arm/mach-msm/board-msm8x60.c
> @@ -68,6 +68,12 @@ static void __init msm8x60_init(void)
>  {
>  }
>  
> +static void __init msm8x60_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  #ifdef CONFIG_OF
>  static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = {
>  	{}
> @@ -106,6 +112,7 @@ MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
>  	.init_irq = msm8x60_init_irq,
>  	.handle_irq = gic_handle_irq,
>  	.init_machine = msm8x60_init,
> +	.init_late = msm8x60_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
>  
> @@ -116,6 +123,7 @@ MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
>  	.init_irq = msm8x60_init_irq,
>  	.handle_irq = gic_handle_irq,
>  	.init_machine = msm8x60_init,
> +	.init_late = msm8x60_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
>  
> @@ -126,6 +134,7 @@ MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
>  	.init_irq = msm8x60_init_irq,
>  	.handle_irq = gic_handle_irq,
>  	.init_machine = msm8x60_init,
> +	.init_late = msm8x60_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
>  
> @@ -136,6 +145,7 @@ MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
>  	.init_irq = msm8x60_init_irq,
>  	.handle_irq = gic_handle_irq,
>  	.init_machine = msm8x60_init,
> +	.init_late = msm8x60_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
>  
> @@ -145,6 +155,7 @@ DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
>  	.map_io = msm8x60_map_io,
>  	.init_irq = msm8x60_init_irq,
>  	.init_machine = msm8x60_dt_init,
> +	.init_late = msm8x60_init_late,
>  	.timer = &msm_timer,
>  	.dt_compat = msm8x60_fluid_match,
>  MACHINE_END
> diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
> index 7e8909c..45ce374 100644
> --- a/arch/arm/mach-msm/board-qsd8x50.c
> +++ b/arch/arm/mach-msm/board-qsd8x50.c
> @@ -191,11 +191,18 @@ static void __init qsd8x50_init(void)
>  	qsd8x50_init_mmc();
>  }
>  
> +static void __init qsd8x50_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
>  	.atag_offset = 0x100,
>  	.map_io = qsd8x50_map_io,
>  	.init_irq = qsd8x50_init_irq,
>  	.init_machine = qsd8x50_init,
> +	.init_late = qsd8x50_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
>  
> @@ -204,5 +211,6 @@ MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
>  	.map_io = qsd8x50_map_io,
>  	.init_irq = qsd8x50_init_irq,
>  	.init_machine = qsd8x50_init,
> +	.init_late = qsd8x50_init_late,
>  	.timer = &msm_timer,
>  MACHINE_END
> diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
> index 4a8ea0d..9ca39ec 100644
> --- a/arch/arm/mach-msm/board-sapphire.c
> +++ b/arch/arm/mach-msm/board-sapphire.c
> @@ -101,6 +101,12 @@ static void __init sapphire_map_io(void)
>  	msm_clock_init();
>  }
>  
> +static void __init sapphire_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  MACHINE_START(SAPPHIRE, "sapphire")
>  /* Maintainer: Brian Swetland <swetland@google.com> */
>  	.atag_offset    = 0x100,
> @@ -108,5 +114,6 @@ MACHINE_START(SAPPHIRE, "sapphire")
>  	.map_io         = sapphire_map_io,
>  	.init_irq       = sapphire_init_irq,
>  	.init_machine   = sapphire_init,
> +	.init_late      = sapphire_init_late,
>  	.timer          = &msm_timer,
>  MACHINE_END
> diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
> index d4060a3..c66bd81 100644
> --- a/arch/arm/mach-msm/board-trout.c
> +++ b/arch/arm/mach-msm/board-trout.c
> @@ -98,6 +98,12 @@ static void __init trout_map_io(void)
>  	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
>  }
>  
> +static void __init trout_init_late(void)
> +{
> +	msm_clock_late_init();
> +	smd_debugfs_init();
> +}
> +
>  MACHINE_START(TROUT, "HTC Dream")
>  	.atag_offset	= 0x100,
>  	.fixup		= trout_fixup,
> @@ -105,5 +111,6 @@ MACHINE_START(TROUT, "HTC Dream")
>  	.init_early	= trout_init_early,
>  	.init_irq	= trout_init_irq,
>  	.init_machine	= trout_init,
> +	.init_late	= trout_init_late,
>  	.timer		= &msm_timer,
>  MACHINE_END
> diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
> index d9145df..4b06db1 100644
> --- a/arch/arm/mach-msm/clock.c
> +++ b/arch/arm/mach-msm/clock.c
> @@ -156,7 +156,7 @@ void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks)
>   * Disable any clocks that belong to us (CLKFLAG_AUTO_OFF) but have
>   * not been explicitly enabled by a clk_enable() call.
>   */
> -static int __init clock_late_init(void)
> +int __init msm_clock_late_init(void)
>  {
>  	unsigned long flags;
>  	struct clk *clk;
> @@ -180,5 +180,3 @@ static int __init clock_late_init(void)
>  	return 0;
>  }
>  
> -late_initcall(clock_late_init);
> -
> diff --git a/arch/arm/mach-msm/include/mach/board.h b/arch/arm/mach-msm/include/mach/board.h
> index 2ce8f1f..ae5a67b 100644
> --- a/arch/arm/mach-msm/include/mach/board.h
> +++ b/arch/arm/mach-msm/include/mach/board.h
> @@ -42,9 +42,16 @@ void __init msm_map_common_io(void);
>  void __init msm_init_irq(void);
>  void __init msm_init_gpio(void);
>  void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks);
> +int __init msm_clock_late_init(void);
>  void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *);
>  int __init msm_add_sdcc(unsigned int controller,
>  			struct msm_mmc_platform_data *plat,
>  			unsigned int stat_irq, unsigned long stat_irq_flags);
>  
> +#if defined(CONFIG_MSM_SMD) && defined(CONFIG_DEBUG_FS)
> +int smd_debugfs_init(void);
> +#else
> +static inline int smd_debugfs_init(void) { return 0; }
> +#endif
> +
>  #endif
> diff --git a/arch/arm/mach-msm/smd_debug.c b/arch/arm/mach-msm/smd_debug.c
> index c56df9e..8056b3e 100644
> --- a/arch/arm/mach-msm/smd_debug.c
> +++ b/arch/arm/mach-msm/smd_debug.c
> @@ -216,7 +216,7 @@ static void debug_create(const char *name, umode_t mode,
>  	debugfs_create_file(name, mode, dent, fill, &debug_ops);
>  }
>  
> -static int smd_debugfs_init(void)
> +int __init smd_debugfs_init(void)
>  {
>  	struct dentry *dent;
>  
> @@ -234,7 +234,6 @@ static int smd_debugfs_init(void)
>  	return 0;
>  }
>  
> -late_initcall(smd_debugfs_init);
>  #endif
>  
>  
> -- 
> 1.7.5.4
> 

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2012-04-26 17:41 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 15:38 [PATCH 00/17] arch/arm/mach-* late_initcall cleanup Shawn Guo
2012-04-26 15:38 ` [PATCH 01/17] ARM: provide a late_initcall hook for platform initialization Shawn Guo
2012-05-02  2:16   ` Rob Lee
2012-04-26 15:38 ` [PATCH 02/17] ARM: at91: use machine specific hook for late init Shawn Guo
2012-04-26 15:29   ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-27 14:07     ` Shawn Guo
2012-04-27 14:26       ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-28  2:30         ` Shawn Guo
2012-04-28  5:30           ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-28  6:53             ` Shawn Guo
2012-04-30  8:46               ` Arnd Bergmann
2012-05-02  2:51                 ` Jean-Christophe PLAGNIOL-VILLARD
2012-05-02  7:22                   ` Shawn Guo
2012-04-26 15:38 ` [PATCH 03/17] ARM: davinci: " Shawn Guo
2012-04-26 15:38 ` [PATCH 04/17] ARM: ep93xx: " Shawn Guo
2012-04-26 21:11   ` Ryan Mallon
2012-04-26 21:49     ` H Hartley Sweeten
2012-04-26 22:12       ` Russell King - ARM Linux
2012-04-26 22:27         ` H Hartley Sweeten
2012-04-26 22:41       ` Ryan Mallon
2012-04-27  8:41         ` Arnd Bergmann
2012-04-27 13:23         ` Shawn Guo
2012-04-26 22:42   ` H Hartley Sweeten
2012-04-27 13:08     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 05/17] ARM: exynos: " Shawn Guo
2012-04-26 15:38 ` [PATCH 06/17] ARM: imx: " Shawn Guo
2012-04-27  9:05   ` Sascha Hauer
2012-04-27 13:05     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 07/17] ARM: kirkwood: " Shawn Guo
2012-04-26 15:38 ` [PATCH 08/17] ARM: msm: " Shawn Guo
2012-04-26 17:41   ` David Brown [this message]
2012-04-27 12:36     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 09/17] ARM: omap1: " Shawn Guo
2012-04-26 15:38 ` [PATCH 10/17] ARM: omap2: " Shawn Guo
2012-04-26 15:38 ` [PATCH 11/17] ARM: pnx4008: " Shawn Guo
2012-04-26 15:38 ` [PATCH 12/17] ARM: prima2: " Shawn Guo
2012-04-29 14:06   ` Barry Song
2012-04-26 15:38 ` [PATCH 13/17] ARM: s3c64xx: " Shawn Guo
2012-04-26 15:38 ` [PATCH 14/17] ARM: sa1100: " Shawn Guo
2012-04-26 15:38 ` [PATCH 15/17] ARM: shmobile: " Shawn Guo
2012-04-27  9:15   ` Magnus Damm
2012-04-29 21:35     ` Rafael J. Wysocki
2012-04-30  0:54       ` Shawn Guo
2012-04-30 21:58         ` Rafael J. Wysocki
2012-05-01  1:56           ` Shawn Guo
2012-05-01 13:35             ` Rafael J. Wysocki
2012-05-01 13:35               ` Shawn Guo
2012-04-26 15:38 ` [PATCH 16/17] ARM: tegra: " Shawn Guo
2012-04-26 15:51   ` Stephen Warren
2012-04-27 12:54     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 17/17] ARM: ux500: " Shawn Guo
2012-04-27  7:08   ` Srinidhi Kasagar
2012-04-27 12:38     ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120426174124.GA22248@codeaurora.org \
    --to=davidb@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.