Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 990f2f22 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

clk: mmp: stop using platform headers



The mmp clock drivers currently hardcode the physical addresses for
the clock registers. This is generally a bad idea, and it also gets in
the way of multiplatform builds, which make the platform header files
inaccessible to device drivers.

To work around the header file problem, this patch changes the calling
convention so the three mmp clock drivers get initialized with the base
addresses as arguments from the platform code.

It would still be useful to have a larger rework of the clock drivers,
with DT integration to let the clocks actually be probed automatically,
and the base addresses passed as DT properties. I am unsure if anyone
is still interested in the mmp platform, so it is possible that this
won't happen.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Chao Xie <chao.xie@marvell.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
parent 31ade3b8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#include <linux/list.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/clk/mmp.h>

#include <mach/addr-map.h>

@@ -105,7 +106,8 @@ static struct clk_lookup mmp2_clkregs[] = {
	INIT_CLKREG(&clk_sdh3, "sdhci-pxav3.3", "PXA-SDHCLK"),
};

void __init mmp2_clk_init(void)
void __init mmp2_clk_init(phys_addr_t mpmu_phys, phys_addr_t apmu_phys,
			  phys_addr_t apbc_phys)
{
	clkdev_add_table(ARRAY_AND_SIZE(mmp2_clkregs));
}
+3 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#include <linux/list.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/clk/mmp.h>

#include <mach/addr-map.h>

@@ -85,7 +86,8 @@ static struct clk_lookup pxa168_clkregs[] = {
	INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
};

void __init pxa168_clk_init(void)
void __init pxa168_clk_init(phys_addr_t mpmu_phys, phys_addr_t apmu_phys,
			    phys_addr_t apbc_phys)
{
	clkdev_add_table(ARRAY_AND_SIZE(pxa168_clkregs));
}
+3 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#include <linux/list.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/clk/mmp.h>

#include <mach/addr-map.h>

@@ -61,7 +62,8 @@ static struct clk_lookup pxa910_clkregs[] = {
	INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
};

void __init pxa910_clk_init(void)
void __init pxa910_clk_init(phys_addr_t mpmu_phys, phys_addr_t apmu_phys,
			    phys_addr_t apbc_phys, phys_addr_t apbcp_phys)
{
	clkdev_add_table(ARRAY_AND_SIZE(pxa910_clkregs));
}
+0 −3
Original line number Diff line number Diff line
@@ -5,6 +5,3 @@ extern void timer_init(int irq);

extern void __init mmp_map_io(void);
extern void mmp_restart(enum reboot_mode, const char *);
extern void __init pxa168_clk_init(void);
extern void __init pxa910_clk_init(void);
extern void __init mmp2_clk_init(void);
+4 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#include <linux/clk/mmp.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -111,7 +112,9 @@ static int __init mmp2_init(void)
		mfp_init_base(MFPR_VIRT_BASE);
		mfp_init_addr(mmp2_addr_map);
		pxa_init_dma(IRQ_MMP2_DMA_RIQ, 16);
		mmp2_clk_init();
		mmp2_clk_init(APB_PHYS_BASE + 0x50000,
			      AXI_PHYS_BASE + 0x82800,
			      APB_PHYS_BASE + 0x15000);
	}

	return 0;
Loading