aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2013-08-21 02:48:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-27 19:22:58 -0400
commitbfaddb7d13ffd5db0180f0121447e2ca4ce3020e (patch)
tree592a2eaf46749fc2f41f1d2c0d3baaf2cd46fee0
parentde49df58366f88939009d5de06d71a68c701df08 (diff)
msm_serial: Switch clock consumer strings and simplify code
In downstream kernel we've standardized the clock consumer names that MSM device drivers use. Replace the uart specific clock names in this driver with the more standard 'core' and 'iface' names. Also simplify the code by assuming that clk_prepare_enable and clk_disable_unprepare() will properly check for NULL pointers (it will because MSM uses the common clock framework). Cc: David Brown <davidb@codeaurora.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/arm/mach-msm/devices-msm7x00.c6
-rw-r--r--arch/arm/mach-msm/devices-msm7x30.c2
-rw-r--r--arch/arm/mach-msm/devices-qsd8x50.c6
-rw-r--r--drivers/tty/serial/msm_serial.c19
4 files changed, 12 insertions, 21 deletions
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c
index 6d50fb964863..d83404d4b328 100644
--- a/arch/arm/mach-msm/devices-msm7x00.c
+++ b/arch/arm/mach-msm/devices-msm7x00.c
@@ -456,9 +456,9 @@ static struct clk_pcom_desc msm_clocks_7x01a[] = {
456 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), 456 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0),
457 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 457 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
458 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 458 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
459 CLK_PCOM("uart_clk", UART1_CLK, "msm_serial.0", OFF), 459 CLK_PCOM("core", UART1_CLK, "msm_serial.0", OFF),
460 CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0), 460 CLK_PCOM("core", UART2_CLK, "msm_serial.1", 0),
461 CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF), 461 CLK_PCOM("core", UART3_CLK, "msm_serial.2", OFF),
462 CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF), 462 CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF),
463 CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0), 463 CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0),
464 CLK_PCOM("usb_hs_clk", USB_HS_CLK, "msm_hsusb", OFF), 464 CLK_PCOM("usb_hs_clk", USB_HS_CLK, "msm_hsusb", OFF),
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
index d4db75acff56..14e286948f69 100644
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ b/arch/arm/mach-msm/devices-msm7x30.c
@@ -211,7 +211,7 @@ static struct clk_pcom_desc msm_clocks_7x30[] = {
211 CLK_PCOM("spi_pclk", SPI_P_CLK, NULL, 0), 211 CLK_PCOM("spi_pclk", SPI_P_CLK, NULL, 0),
212 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 212 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
213 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 213 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
214 CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0), 214 CLK_PCOM("core", UART2_CLK, "msm_serial.1", 0),
215 CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), 215 CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0),
216 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), 216 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF),
217 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), 217 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF),
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
index f5518112284b..2ed89b25d304 100644
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ b/arch/arm/mach-msm/devices-qsd8x50.c
@@ -358,9 +358,9 @@ static struct clk_pcom_desc msm_clocks_8x50[] = {
358 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), 358 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0),
359 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 359 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
360 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 360 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
361 CLK_PCOM("uart_clk", UART1_CLK, NULL, OFF), 361 CLK_PCOM("core", UART1_CLK, NULL, OFF),
362 CLK_PCOM("uart_clk", UART2_CLK, NULL, 0), 362 CLK_PCOM("core", UART2_CLK, NULL, 0),
363 CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF), 363 CLK_PCOM("core", UART3_CLK, "msm_serial.2", OFF),
364 CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF), 364 CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF),
365 CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0), 365 CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0),
366 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), 366 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF),
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index cc44ef485a2a..67894354dc2a 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -422,8 +422,7 @@ static void msm_init_clock(struct uart_port *port)
422 struct msm_port *msm_port = UART_TO_MSM(port); 422 struct msm_port *msm_port = UART_TO_MSM(port);
423 423
424 clk_prepare_enable(msm_port->clk); 424 clk_prepare_enable(msm_port->clk);
425 if (!IS_ERR(msm_port->pclk)) 425 clk_prepare_enable(msm_port->pclk);
426 clk_prepare_enable(msm_port->pclk);
427 msm_serial_set_mnd_regs(port); 426 msm_serial_set_mnd_regs(port);
428} 427}
429 428
@@ -701,13 +700,11 @@ static void msm_power(struct uart_port *port, unsigned int state,
701 switch (state) { 700 switch (state) {
702 case 0: 701 case 0:
703 clk_prepare_enable(msm_port->clk); 702 clk_prepare_enable(msm_port->clk);
704 if (!IS_ERR(msm_port->pclk)) 703 clk_prepare_enable(msm_port->pclk);
705 clk_prepare_enable(msm_port->pclk);
706 break; 704 break;
707 case 3: 705 case 3:
708 clk_disable_unprepare(msm_port->clk); 706 clk_disable_unprepare(msm_port->clk);
709 if (!IS_ERR(msm_port->pclk)) 707 clk_disable_unprepare(msm_port->pclk);
710 clk_disable_unprepare(msm_port->pclk);
711 break; 708 break;
712 default: 709 default:
713 printk(KERN_ERR "msm_serial: Unknown PM state %d\n", state); 710 printk(KERN_ERR "msm_serial: Unknown PM state %d\n", state);
@@ -895,18 +892,12 @@ static int __init msm_serial_probe(struct platform_device *pdev)
895 else 892 else
896 msm_port->is_uartdm = 0; 893 msm_port->is_uartdm = 0;
897 894
898 if (msm_port->is_uartdm) { 895 msm_port->clk = devm_clk_get(&pdev->dev, "core");
899 msm_port->clk = devm_clk_get(&pdev->dev, "gsbi_uart_clk");
900 msm_port->pclk = devm_clk_get(&pdev->dev, "gsbi_pclk");
901 } else {
902 msm_port->clk = devm_clk_get(&pdev->dev, "uart_clk");
903 msm_port->pclk = ERR_PTR(-ENOENT);
904 }
905
906 if (IS_ERR(msm_port->clk)) 896 if (IS_ERR(msm_port->clk))
907 return PTR_ERR(msm_port->clk); 897 return PTR_ERR(msm_port->clk);
908 898
909 if (msm_port->is_uartdm) { 899 if (msm_port->is_uartdm) {
900 msm_port->pclk = devm_clk_get(&pdev->dev, "iface");
910 if (IS_ERR(msm_port->pclk)) 901 if (IS_ERR(msm_port->pclk))
911 return PTR_ERR(msm_port->pclk); 902 return PTR_ERR(msm_port->pclk);
912 903