提交 ecfc5771 编写于 作者: S Shubhrajyoti Datta 提交者: Greg Kroah-Hartman

serial: xuartps: Enable clocks in the pm disable case also

When Power management is disabled then the clocks are not getting
enabled. This patch enables it for the !PM case also.
While at it also pm_runtime_set_active is called before
calling pm_runtime_enable.
Reported-by: NMichal Simek <michal.simek@xilinx.com>
Signed-off-by: NShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 cade3580
...@@ -1521,12 +1521,12 @@ static int cdns_uart_probe(struct platform_device *pdev) ...@@ -1521,12 +1521,12 @@ static int cdns_uart_probe(struct platform_device *pdev)
return PTR_ERR(cdns_uart_data->uartclk); return PTR_ERR(cdns_uart_data->uartclk);
} }
rc = clk_prepare(cdns_uart_data->pclk); rc = clk_prepare_enable(cdns_uart_data->pclk);
if (rc) { if (rc) {
dev_err(&pdev->dev, "Unable to enable pclk clock.\n"); dev_err(&pdev->dev, "Unable to enable pclk clock.\n");
return rc; return rc;
} }
rc = clk_prepare(cdns_uart_data->uartclk); rc = clk_prepare_enable(cdns_uart_data->uartclk);
if (rc) { if (rc) {
dev_err(&pdev->dev, "Unable to enable device clock.\n"); dev_err(&pdev->dev, "Unable to enable device clock.\n");
goto err_out_clk_dis_pclk; goto err_out_clk_dis_pclk;
...@@ -1580,8 +1580,8 @@ static int cdns_uart_probe(struct platform_device *pdev) ...@@ -1580,8 +1580,8 @@ static int cdns_uart_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, UART_AUTOSUSPEND_TIMEOUT); pm_runtime_set_autosuspend_delay(&pdev->dev, UART_AUTOSUSPEND_TIMEOUT);
pm_runtime_enable(&pdev->dev);
pm_runtime_set_active(&pdev->dev); pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
rc = uart_add_one_port(&cdns_uart_uart_driver, port); rc = uart_add_one_port(&cdns_uart_uart_driver, port);
if (rc) { if (rc) {
...@@ -1601,9 +1601,9 @@ static int cdns_uart_probe(struct platform_device *pdev) ...@@ -1601,9 +1601,9 @@ static int cdns_uart_probe(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev); pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev);
clk_unprepare(cdns_uart_data->uartclk); clk_disable_unprepare(cdns_uart_data->uartclk);
err_out_clk_dis_pclk: err_out_clk_dis_pclk:
clk_unprepare(cdns_uart_data->pclk); clk_disable_unprepare(cdns_uart_data->pclk);
return rc; return rc;
} }
...@@ -1627,8 +1627,8 @@ static int cdns_uart_remove(struct platform_device *pdev) ...@@ -1627,8 +1627,8 @@ static int cdns_uart_remove(struct platform_device *pdev)
#endif #endif
rc = uart_remove_one_port(&cdns_uart_uart_driver, port); rc = uart_remove_one_port(&cdns_uart_uart_driver, port);
port->mapbase = 0; port->mapbase = 0;
clk_unprepare(cdns_uart_data->uartclk); clk_disable_unprepare(cdns_uart_data->uartclk);
clk_unprepare(cdns_uart_data->pclk); clk_disable_unprepare(cdns_uart_data->pclk);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev); pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册