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)
commit7b5c0c08f5e895fb92c1d1d5f905c68eca1df5c0
tree9f7142a3122f0bf40c31e9478e6e283821999283
parent3a964abe1ef1cfbe82d0ae832d70c7750d673728
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