]> git.baikalelectronics.ru Git - kernel.git/commit
serial: sh-sci: Use premultiplier to handle half sampling rate
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 4 Jan 2016 13:45:20 +0000 (14:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 06:54:55 +0000 (22:54 -0800)
commite1d08375a35365313921f9973b71b73070f2504b
tree9f7142a3122f0bf40c31e9478e6e283821999283
parent92de49b3650367c381eab4777e35822a303cfa45
serial: sh-sci: Use premultiplier to handle half sampling rate

On SCIx variants different from HSCIF, the bit rate is equal to the
sampling clock rate divided by half the sampling rate. Currently this is
handled by dividing the sampling rate by two, which was OK as it was
always even.

Replace halving the sampling rate by premultiplying the base clock
frequency by 2, to accommodate odd sampling rates on SCIFA/SCIFB later.

Replace the shift value in the BRG divider calculation by a
premultiplication of the base clock frequency too, for consistency.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c