summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/qcom_geni_serial.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-06 14:29:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-06 14:29:02 +0200
commit0a64f38037cc230e2ad888a74263db6f6588cd90 (patch)
treec67363e894769b28b467de5f483a06d4894c9afe /drivers/tty/serial/qcom_geni_serial.c
parent8508f4cba308f785b2fd4b8c38849c117b407297 (diff)
downloadlinux-stable-0a64f38037cc230e2ad888a74263db6f6588cd90.tar.gz
linux-stable-0a64f38037cc230e2ad888a74263db6f6588cd90.tar.bz2
linux-stable-0a64f38037cc230e2ad888a74263db6f6588cd90.zip
Revert "tty: serial: qcom_geni_serial: Use OPP API to set clk/perf state"
This reverts commit 3d9231e69831551da3a78a618b31702ea4dedd5e Rajendra writes: Greg, there are other patches in the series which have a dependency on this patch [1] would it be possible for you to drop this patch and instead ack it so it can be taken via the msm tree? So dropping it from here. Reported-by: Rajendra Nayak <rnayak@codeaurora.org> Cc: Matthias Kaehlcke <mka@chromium.org> Cc: Akash Asthana <akashast@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/qcom_geni_serial.c')
-rw-r--r--drivers/tty/serial/qcom_geni_serial.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index dd3d1ba38bd9..6119090ce045 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -9,7 +9,6 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
-#include <linux/pm_opp.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/pm_wakeirq.h>
@@ -962,7 +961,7 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport,
goto out_restart_rx;
uport->uartclk = clk_rate;
- dev_pm_opp_set_rate(uport->dev, clk_rate);
+ clk_set_rate(port->se.clk, clk_rate);
ser_clk_cfg = SER_CLK_EN;
ser_clk_cfg |= clk_div << CLK_DIV_SHFT;
@@ -1199,11 +1198,8 @@ static void qcom_geni_serial_pm(struct uart_port *uport,
if (new_state == UART_PM_STATE_ON && old_state == UART_PM_STATE_OFF)
geni_se_resources_on(&port->se);
else if (new_state == UART_PM_STATE_OFF &&
- old_state == UART_PM_STATE_ON) {
- /* Drop the performance state vote */
- dev_pm_opp_set_rate(uport->dev, 0);
+ old_state == UART_PM_STATE_ON)
geni_se_resources_off(&port->se);
- }
}
static const struct uart_ops qcom_geni_console_pops = {
@@ -1322,25 +1318,13 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
if (of_property_read_bool(pdev->dev.of_node, "cts-rts-swap"))
port->cts_rts_swap = true;
- port->se.opp_table = dev_pm_opp_set_clkname(&pdev->dev, "se");
- if (IS_ERR(port->se.opp_table))
- return PTR_ERR(port->se.opp_table);
- /* OPP table is optional */
- ret = dev_pm_opp_of_add_table(&pdev->dev);
- if (!ret) {
- port->se.has_opp_table = true;
- } else if (ret != -ENODEV) {
- dev_err(&pdev->dev, "invalid OPP table in device tree\n");
- return ret;
- }
-
uport->private_data = drv;
platform_set_drvdata(pdev, port);
port->handle_rx = console ? handle_rx_console : handle_rx_uart;
ret = uart_add_one_port(drv, uport);
if (ret)
- goto err;
+ return ret;
irq_set_status_flags(uport->irq, IRQ_NOAUTOEN);
ret = devm_request_irq(uport->dev, uport->irq, qcom_geni_serial_isr,
@@ -1348,7 +1332,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
if (ret) {
dev_err(uport->dev, "Failed to get IRQ ret %d\n", ret);
uart_remove_one_port(drv, uport);
- goto err;
+ return ret;
}
/*
@@ -1365,16 +1349,11 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
if (ret) {
device_init_wakeup(&pdev->dev, false);
uart_remove_one_port(drv, uport);
- goto err;
+ return ret;
}
}
return 0;
-err:
- if (port->se.has_opp_table)
- dev_pm_opp_of_remove_table(&pdev->dev);
- dev_pm_opp_put_clkname(port->se.opp_table);
- return ret;
}
static int qcom_geni_serial_remove(struct platform_device *pdev)
@@ -1382,9 +1361,6 @@ static int qcom_geni_serial_remove(struct platform_device *pdev)
struct qcom_geni_serial_port *port = platform_get_drvdata(pdev);
struct uart_driver *drv = port->uport.private_data;
- if (port->se.has_opp_table)
- dev_pm_opp_of_remove_table(&pdev->dev);
- dev_pm_opp_put_clkname(port->se.opp_table);
dev_pm_clear_wake_irq(&pdev->dev);
device_init_wakeup(&pdev->dev, false);
uart_remove_one_port(drv, &port->uport);