]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
serial: lantiq: Add CCF support
authorSongjun Wu <songjun.wu@linux.intel.com>
Tue, 16 Oct 2018 09:19:10 +0000 (17:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Nov 2018 16:43:27 +0000 (08:43 -0800)
Previous implementation uses platform-dependent API to get the clock.
Those functions are not available for other SoC which uses the same IP.
The CCF (Common Clock Framework) have an abstraction based APIs for
clock. In future, the platform specific code will be removed when the
legacy soc use CCF as well.
Change to use CCF APIs to get clock and rate. So that different SoCs
can use the same driver.

Signed-off-by: Songjun Wu <songjun.wu@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/lantiq.c

index 34b1ef3c12ced22cfc0cdd1a92ce05ea176659e4..88210de00f35adbf0aee0229641bfbb6024680a4 100644 (file)
@@ -744,14 +744,22 @@ lqasc_probe(struct platform_device *pdev)
        port->irq       = irqres[0].start;
        port->mapbase   = mmres->start;
 
-       ltq_port->freqclk = clk_get_fpi();
+       if (IS_ENABLED(CONFIG_LANTIQ) && !IS_ENABLED(CONFIG_COMMON_CLK))
+               ltq_port->freqclk = clk_get_fpi();
+       else
+               ltq_port->freqclk = devm_clk_get(&pdev->dev, "freq");
+
+
        if (IS_ERR(ltq_port->freqclk)) {
                pr_err("failed to get fpi clk\n");
                return -ENOENT;
        }
 
        /* not all asc ports have clock gates, lets ignore the return code */
-       ltq_port->clk = clk_get(&pdev->dev, NULL);
+       if (IS_ENABLED(CONFIG_LANTIQ) && !IS_ENABLED(CONFIG_COMMON_CLK))
+               ltq_port->clk = clk_get(&pdev->dev, NULL);
+       else
+               ltq_port->clk = devm_clk_get(&pdev->dev, "asc");
 
        ltq_port->tx_irq = irqres[0].start;
        ltq_port->rx_irq = irqres[1].start;