android_kernel_xiaomi_sm8350/drivers/serial
Haavard Skinnemoen 4d5e392c33 [PATCH] atmel_serial: Fix roundoff error in atmel_console_get_options
The atmel_console_get_options() function initializes the baud,
parity and bits settings from the actual hardware setup, in
case it has been initialized by a e.g. boot loader.

The baud rate, however, is not necessarily exactly equal to one of
the standard baud rates (115200, etc.) This means that the baud rate
calculated by this function may be slightly higher or slightly lower
than one of the standard baud rates.

If the baud rate is slightly lower than the target, this causes
problems when uart_set_option() tries to match the detected baud rate
against the standard baud rate, as it will always select a baud rate
that is lower or equal to the target rate. For example if the
detected baud rate is slightly lower than 115200, usart_set_options()
will select 57600.

This patch fixes the problem by subtracting 1 from the value in BRGR
when calculating the baud rate. The detected baud rate will thus
always be higher than the nearest standard baud rate, and
uart_set_options() will end up doing the right thing.

Tested on ATSTK1000 and AT91RM9200-EK boards. Both are broken without
this patch.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-04 10:25:06 -07:00
..
cpm_uart Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
jsm
8250_accent.c
8250_acorn.c [PATCH] ioremap balanced with iounmap for drivers/serial/8250_acorn,c 2006-10-01 00:39:32 -07:00
8250_au1x00.c
8250_boca.c
8250_early.c
8250_fourport.c
8250_gsc.c [PARISC] Clean up asm-parisc/serial.h 2006-10-04 06:47:03 -06:00
8250_hp300.c
8250_hub6.c
8250_mca.c
8250_pci.c [SERIAL] CONFIG_PM=n slim: drivers/serial/8250_pci.c 2006-10-01 17:07:08 +01:00
8250_pnp.c [SERIAL] add PNP IDs for FPI based touchscreens 2006-10-01 21:27:15 +01:00
8250.c Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial 2006-10-03 09:13:29 -07:00
8250.h
21285.c fix file specification in comments 2006-10-03 23:01:26 +02:00
68328serial.c [PATCH] const struct tty_operations 2006-10-02 07:57:14 -07:00
68328serial.h
68360serial.c [PATCH] const struct tty_operations 2006-10-02 07:57:14 -07:00
amba-pl010.c
amba-pl011.c
atmel_serial.c [PATCH] atmel_serial: Fix roundoff error in atmel_console_get_options 2006-10-04 10:25:06 -07:00
atmel_serial.h [PATCH] at91_serial -> atmel_serial: Internal names 2006-10-04 10:25:05 -07:00
clps711x.c
crisv10.c [PATCH] const struct tty_operations 2006-10-02 07:57:14 -07:00
crisv10.h
dz.c
dz.h
icom.c
icom.h
imx.c
ioc3_serial.c
ioc4_serial.c [PATCH] ioremap balanced with iounmap for drivers/serial/ioc4_serial.c 2006-10-01 00:39:32 -07:00
ip22zilog.c [PATCH] ioremap balanced with iounmap for drivers/serial/ip22zilog.c 2006-10-01 00:39:32 -07:00
ip22zilog.h
Kconfig [PATCH] atmel_serial: Support AVR32 2006-10-04 10:25:06 -07:00
m32r_sio_reg.h
m32r_sio.c [SERIAL] Remove m32r_sio dependency on asm/serial.h 2006-10-01 17:06:03 +01:00
m32r_sio.h
Makefile [PATCH] at91_serial -> atmel_serial: Kconfig symbols 2006-10-04 10:25:05 -07:00
mcfserial.c [PATCH] const struct tty_operations 2006-10-02 07:57:14 -07:00
mcfserial.h
mpc52xx_uart.c [PATCH] ioremap balanced with iounmap for drivers/serial/mpc52xx_uart.c 2006-10-01 00:39:32 -07:00
mpsc.c [PATCH] ioremap balanced with iounmap for drivers/serial/mpsc.c 2006-10-01 00:39:32 -07:00
mux.c [PATCH] ioremap balanced with iounmap for drivers/serial/mux.c 2006-10-01 00:39:32 -07:00
netx-serial.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
pmac_zilog.c
pmac_zilog.h
pxa.c
s3c2410.c [ARM] 3793/1: S3C2412: fix wrong serial info struct 2006-09-18 13:30:17 +01:00
sa1100.c
serial_core.c Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial 2006-10-03 09:13:29 -07:00
serial_cs.c [SERIAL] Fix resume handling bug 2006-10-01 17:14:07 +01:00
serial_lh7a40x.c
serial_txx9.c [SERIAL] suspend/resume handlers don't have level arg anymore 2006-10-01 17:06:54 +01:00
sh-sci.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
sh-sci.h Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
sn_console.c
suncore.c
suncore.h
sunhv.c
sunsab.c
sunsab.h
sunsu.c [PATCH] ioremap balanced with iounmap for drivers/serial/sunsu.c 2006-10-01 00:39:32 -07:00
sunzilog.c [SERIAL] sunzilog: Mark sunzilog_init_hw as __devinit. 2006-09-29 16:12:43 -07:00
sunzilog.h
v850e_uart.c
vr41xx_siu.c