From 19955c3d7453757271d05859958ca1804a5d2d67 Mon Sep 17 00:00:00 2001 From: "Manjunathappa, Prakash" Date: Wed, 19 Jun 2013 14:45:38 +0530 Subject: ARM: davinci: uart: move to devid based clk_get For modules having single clock, clk_get should be done with dev_id. But current davinci implementation handles multiple instances of the UART devices with single platform_device_register. Hence clk_get is based on con_id rather than dev_id, this is not correct. Do platform_device_register for each instance and clk_get on dev_id. Signed-off-by: Manjunathappa, Prakash [nsekhar@ti.com: actually stop using con_id in clk_get(), squash the patch adding OF aux data into this one] Signed-off-by: Sekhar Nori --- arch/arm/mach-davinci/dm365.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'arch/arm/mach-davinci/dm365.c') diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index fa7af5eda52d..b60118989f0c 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -455,8 +455,8 @@ static struct clk_lookup dm365_clks[] = { CLK("vpss", "master", &vpss_master_clk), CLK("vpss", "slave", &vpss_slave_clk), CLK(NULL, "arm", &arm_clk), - CLK(NULL, "uart0", &uart0_clk), - CLK(NULL, "uart1", &uart1_clk), + CLK("serial8250.0", NULL, &uart0_clk), + CLK("serial8250.1", NULL, &uart1_clk), CLK("i2c_davinci.1", NULL, &i2c_clk), CLK("da830-mmc.0", NULL, &mmcsd0_clk), CLK("da830-mmc.1", NULL, &mmcsd1_clk), @@ -1041,7 +1041,7 @@ static struct davinci_timer_info dm365_timer_info = { #define DM365_UART1_BASE (IO_PHYS + 0x106000) -static struct plat_serial8250_port dm365_serial_platform_data[] = { +static struct plat_serial8250_port dm365_serial0_platform_data[] = { { .mapbase = DAVINCI_UART0_BASE, .irq = IRQ_UARTINT0, @@ -1050,6 +1050,11 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = { .iotype = UPIO_MEM, .regshift = 2, }, + { + .flags = 0, + } +}; +static struct plat_serial8250_port dm365_serial1_platform_data[] = { { .mapbase = DM365_UART1_BASE, .irq = IRQ_UARTINT1, @@ -1059,16 +1064,27 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = { .regshift = 2, }, { - .flags = 0 - }, + .flags = 0, + } }; -static struct platform_device dm365_serial_device = { - .name = "serial8250", - .id = PLAT8250_DEV_PLATFORM, - .dev = { - .platform_data = dm365_serial_platform_data, +static struct platform_device dm365_serial_device[] = { + { + .name = "serial8250", + .id = PLAT8250_DEV_PLATFORM, + .dev = { + .platform_data = dm365_serial0_platform_data, + } + }, + { + .name = "serial8250", + .id = PLAT8250_DEV_PLATFORM1, + .dev = { + .platform_data = dm365_serial1_platform_data, + } }, + { + } }; static struct davinci_soc_info davinci_soc_info_dm365 = { @@ -1093,7 +1109,7 @@ static struct davinci_soc_info davinci_soc_info_dm365 = { .gpio_num = 104, .gpio_irq = IRQ_DM365_GPIO0, .gpio_unbanked = 8, /* really 16 ... skip muxed GPIOs */ - .serial_dev = &dm365_serial_device, + .serial_dev = dm365_serial_device, .emac_pdata = &dm365_emac_pdata, .sram_dma = 0x00010000, .sram_len = SZ_32K, -- cgit v1.2.1 From fcf7157ba3b50e57653544421250ebbe81a33d81 Mon Sep 17 00:00:00 2001 From: "Manjunathappa, Prakash" Date: Wed, 19 Jun 2013 14:45:42 +0530 Subject: ARM: davinci: serial: get rid of davinci_uart_config "struct davinci_uart_config" was introduced to specify UART ports brought out or enabled on the board. But none of the boards use it for that purpose and we are not going to add anymore board files, so remove the structure. Signed-off-by: Manjunathappa, Prakash Suggested-by: Sekhar Nori [nsekhar@ti.com: split patch to remove davinci_serial_setup_clk() changes.] Signed-off-by: Sekhar Nori --- arch/arm/mach-davinci/dm365.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-davinci/dm365.c') diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index b60118989f0c..fa5c693cf16b 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -1068,7 +1068,7 @@ static struct plat_serial8250_port dm365_serial1_platform_data[] = { } }; -static struct platform_device dm365_serial_device[] = { +struct platform_device dm365_serial_device[] = { { .name = "serial8250", .id = PLAT8250_DEV_PLATFORM, -- cgit v1.2.1 From 323761bb7518d27c62c1514156cb3243930b55c1 Mon Sep 17 00:00:00 2001 From: "Manjunathappa, Prakash" Date: Wed, 19 Jun 2013 14:45:42 +0530 Subject: ARM: davinci: serial: remove davinci_serial_setup_clk() Get rid of davinci_serial_setup_clk() since its not called from multiple places now. Instead initialize clock in davinci_serial_init() itself. This also helps get rid of "serial_dev" member of struct davinci_soc_info. Signed-off-by: Manjunathappa, Prakash Suggested-by: Sekhar Nori [nsekhar@ti.com: split removal of davinci_serial_setup_clk() into a separate patch.] Signed-off-by: Sekhar Nori --- arch/arm/mach-davinci/dm365.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-davinci/dm365.c') diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index fa5c693cf16b..3a039bcf5337 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -1109,7 +1109,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = { .gpio_num = 104, .gpio_irq = IRQ_DM365_GPIO0, .gpio_unbanked = 8, /* really 16 ... skip muxed GPIOs */ - .serial_dev = dm365_serial_device, .emac_pdata = &dm365_emac_pdata, .sram_dma = 0x00010000, .sram_len = SZ_32K, -- cgit v1.2.1 From 46c1833467c5e555f31cd6f14b342a7383f26885 Mon Sep 17 00:00:00 2001 From: "Lad, Prabhakar" Date: Thu, 15 Aug 2013 11:31:33 +0530 Subject: ARM: davinci: fix clock lookup for mdio device This patch removes the clock alias for mdio device and adds a entry in clock lookup table, this entry can now be used by both DT and non-DT case. Signed-off-by: Lad, Prabhakar Signed-off-by: Sekhar Nori --- arch/arm/mach-davinci/dm365.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm/mach-davinci/dm365.c') diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 3a039bcf5337..278080de9078 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -477,6 +477,7 @@ static struct clk_lookup dm365_clks[] = { CLK(NULL, "timer3", &timer3_clk), CLK(NULL, "usb", &usb_clk), CLK("davinci_emac.1", NULL, &emac_clk), + CLK("davinci_mdio.0", "fck", &emac_clk), CLK("davinci_voicecodec", NULL, &voicecodec_clk), CLK("davinci-mcbsp", NULL, &asp0_clk), CLK(NULL, "rto", &rto_clk), @@ -1422,8 +1423,6 @@ static int __init dm365_init_devices(void) platform_device_register(&dm365_mdio_device); platform_device_register(&dm365_emac_device); - clk_add_alias(NULL, dev_name(&dm365_mdio_device.dev), - NULL, &dm365_emac_device.dev); return 0; } -- cgit v1.2.1