From 17ded0a89b3b0b6ac626d58d469ef899f21e2d42 Mon Sep 17 00:00:00 2001 From: Kelvin Cheung Date: Tue, 23 Oct 2012 05:17:00 +0000 Subject: MIPS: Loongson1B: use common clock infrastructure instead of private APIs Use common clock infrastructure instead of private APIs. 1. Enable COMMON_CLK in the Kconfig. 2. Remove private clock APIs, which are replaced by the code in drivers/clk/clk-ls1x.c. 3. Modify header file for drivers/clk/clk-ls1x.c. Signed-off-by: Kelvin Cheung Patchwork: http://patchwork.linux-mips.org/patch/4431 Signed-off-by: John Crispin --- arch/mips/include/asm/mach-loongson1/platform.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/mips/include/asm/mach-loongson1/platform.h') diff --git a/arch/mips/include/asm/mach-loongson1/platform.h b/arch/mips/include/asm/mach-loongson1/platform.h index 2f171617bad..f584017eb8a 100644 --- a/arch/mips/include/asm/mach-loongson1/platform.h +++ b/arch/mips/include/asm/mach-loongson1/platform.h @@ -18,6 +18,7 @@ extern struct platform_device ls1x_eth0_device; extern struct platform_device ls1x_ehci_device; extern struct platform_device ls1x_rtc_device; +extern void __init ls1x_clk_init(void); void ls1x_serial_setup(void); #endif /* __ASM_MACH_LOONGSON1_PLATFORM_H */ -- cgit v1.2.3-70-g09d2 From 446076459974ce00f02ce4954c2622fc70cb7597 Mon Sep 17 00:00:00 2001 From: Kelvin Cheung Date: Tue, 23 Oct 2012 05:17:01 +0000 Subject: MIPS: Loongson1B: improve ls1x_serial_setup() Improve ls1x_serial_setup(). Signed-off-by: Kelvin Cheung Patchwork: http://patchwork.linux-mips.org/patch/4432 Signed-off-by: John Crispin --- arch/mips/include/asm/mach-loongson1/platform.h | 2 +- arch/mips/loongson1/common/platform.c | 9 +++++---- arch/mips/loongson1/ls1b/board.c | 5 +---- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'arch/mips/include/asm/mach-loongson1/platform.h') diff --git a/arch/mips/include/asm/mach-loongson1/platform.h b/arch/mips/include/asm/mach-loongson1/platform.h index f584017eb8a..718a1228a4f 100644 --- a/arch/mips/include/asm/mach-loongson1/platform.h +++ b/arch/mips/include/asm/mach-loongson1/platform.h @@ -19,6 +19,6 @@ extern struct platform_device ls1x_ehci_device; extern struct platform_device ls1x_rtc_device; extern void __init ls1x_clk_init(void); -void ls1x_serial_setup(void); +extern void __init ls1x_serial_setup(struct platform_device *pdev); #endif /* __ASM_MACH_LOONGSON1_PLATFORM_H */ diff --git a/arch/mips/loongson1/common/platform.c b/arch/mips/loongson1/common/platform.c index e92d59c4bd7..5ca38dc7708 100644 --- a/arch/mips/loongson1/common/platform.c +++ b/arch/mips/loongson1/common/platform.c @@ -42,16 +42,17 @@ struct platform_device ls1x_uart_device = { }, }; -void __init ls1x_serial_setup(void) +void __init ls1x_serial_setup(struct platform_device *pdev) { struct clk *clk; struct plat_serial8250_port *p; - clk = clk_get(NULL, "dc"); + clk = clk_get(NULL, pdev->name); if (IS_ERR(clk)) - panic("unable to get dc clock, err=%ld", PTR_ERR(clk)); + panic("unable to get %s clock, err=%ld", + pdev->name, PTR_ERR(clk)); - for (p = ls1x_serial8250_port; p->flags != 0; ++p) + for (p = pdev->dev.platform_data; p->flags != 0; ++p) p->uartclk = clk_get_rate(clk); } diff --git a/arch/mips/loongson1/ls1b/board.c b/arch/mips/loongson1/ls1b/board.c index 295b1be893e..1fbd5264f66 100644 --- a/arch/mips/loongson1/ls1b/board.c +++ b/arch/mips/loongson1/ls1b/board.c @@ -9,9 +9,6 @@ #include -#include -#include - static struct platform_device *ls1b_platform_devices[] __initdata = { &ls1x_uart_device, &ls1x_eth0_device, @@ -23,7 +20,7 @@ static int __init ls1b_platform_init(void) { int err; - ls1x_serial_setup(); + ls1x_serial_setup(&ls1x_uart_device); err = platform_add_devices(ls1b_platform_devices, ARRAY_SIZE(ls1b_platform_devices)); -- cgit v1.2.3-70-g09d2