]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed
authorFrédéric Danis <frederic.danis@collabora.com>
Tue, 20 Aug 2024 14:17:16 +0000 (16:17 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 10 Sep 2024 17:05:13 +0000 (13:05 -0400)
Starting a BCM UART controller not defined as a platform device or
a serdev with "btattach -B /dev/ttyS1 -P bcm -S 3000000" works fine
but the serial port remains at the init_speed, i.e. 115200.

The oper_speed is only set if a device is declared in ACPI, device
tree or as a platform device.

This commit copies the serial port speed fixed by hciattach to the
oper_speed on line discipline opening.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/hci_ldisc.c

index d307c41a547012d65942c9bc5d3122d1cc9f5b31..395d66e32a2ea9d02d9c1716436fd09b526a07c6 100644 (file)
@@ -507,6 +507,9 @@ static int hci_uart_tty_open(struct tty_struct *tty)
        hu->alignment = 1;
        hu->padding = 0;
 
+       /* Use serial port speed as oper_speed */
+       hu->oper_speed = tty->termios.c_ospeed;
+
        INIT_WORK(&hu->init_ready, hci_uart_init_work);
        INIT_WORK(&hu->write_work, hci_uart_write_work);