diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-06 16:35:12 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-06 16:35:12 -0800 |
| commit | 67e79a6dc2664a3ef85113440e60f7aaca3c7815 (patch) | |
| tree | 206f8a84da0aefca8c588e31f812bd208e7a34a4 /drivers/tty/serial/samsung.c | |
| parent | e266ca36da7de45b64b05698e98e04b578a88888 (diff) | |
| parent | f694936c3b5a4c140ded5b673555d95aedc866b9 (diff) | |
Merge tag 'tty-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial updates from Greg KH:
"Here is the "big" patchset for the tty/serial driver layer for
5.1-rc1.
It's really not all that big, nothing major here.
There are a lot of tiny driver fixes and updates, combined with other
cleanups for different serial drivers and the vt layer. Full details
are in the shortlog.
All of these have been in linux-next with no reported issues"
* tag 'tty-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (70 commits)
tty: xilinx_uartps: Correct return value in probe
serial: sprd: Modify the baud rate calculation formula
dt-bindings: serial: Add Milbeaut serial driver description
serial: 8250_of: assume reg-shift of 2 for mrvl,mmp-uart
serial: 8250_pxa: honor the port number from devicetree
tty: hvc_xen: Mark expected switch fall-through
tty: n_gsm: Mark expected switch fall-throughs
tty: serial: msm_serial: Remove __init from msm_console_setup()
tty: serial: samsung: Enable baud clock during initialisation
serial: uartps: Fix stuck ISR if RX disabled with non-empty FIFO
tty: serial: remove redundant likely annotation
tty/n_hdlc: mark expected switch fall-through
serial: 8250_pci: Have ACCES cards that use the four port Pericom PI7C9X7954 chip use the pci_pericom_setup()
serial: 8250_pci: Fix number of ports for ACCES serial cards
vt: perform safe console erase in the right order
tty/nozomi: use pci_iomap instead of ioremap_nocache
tty/synclink: remove ISA support
serial: 8250_pci: Replace custom code with pci_match_id()
serial: max310x: Correction of the initial setting of the MODE1 bits for various supported ICs.
serial: mps2-uart: Add parentheses around conditional in mps2_uart_shutdown
...
Diffstat (limited to 'drivers/tty/serial/samsung.c')
| -rw-r--r-- | drivers/tty/serial/samsung.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 9fc3559f80d9..83fd51607741 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1694,6 +1694,42 @@ s3c24xx_serial_cpufreq_deregister(struct s3c24xx_uart_port *port) } #endif +static int s3c24xx_serial_enable_baudclk(struct s3c24xx_uart_port *ourport) +{ + struct device *dev = ourport->port.dev; + struct s3c24xx_uart_info *info = ourport->info; + char clk_name[MAX_CLK_NAME_LENGTH]; + unsigned int clk_sel; + struct clk *clk; + int clk_num; + int ret; + + clk_sel = ourport->cfg->clk_sel ? : info->def_clk_sel; + for (clk_num = 0; clk_num < info->num_clks; clk_num++) { + if (!(clk_sel & (1 << clk_num))) + continue; + + sprintf(clk_name, "clk_uart_baud%d", clk_num); + clk = clk_get(dev, clk_name); + if (IS_ERR(clk)) + continue; + + ret = clk_prepare_enable(clk); + if (ret) { + clk_put(clk); + continue; + } + + ourport->baudclk = clk; + ourport->baudclk_rate = clk_get_rate(clk); + s3c24xx_serial_setsource(&ourport->port, clk_num); + + return 0; + } + + return -EINVAL; +} + /* s3c24xx_serial_init_port * * initialise a single serial port from the platform device given @@ -1788,6 +1824,10 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, goto err; } + ret = s3c24xx_serial_enable_baudclk(ourport); + if (ret) + pr_warn("uart: failed to enable baudclk\n"); + /* Keep all interrupts masked and cleared */ if (s3c24xx_serial_has_interrupt_mask(port)) { wr_regl(port, S3C64XX_UINTM, 0xf); @@ -1901,6 +1941,8 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) * and keeps the clock enabled in this case. */ clk_disable_unprepare(ourport->clk); + if (!IS_ERR(ourport->baudclk)) + clk_disable_unprepare(ourport->baudclk); ret = s3c24xx_serial_cpufreq_register(ourport); if (ret < 0) |
