* [PATCH v2] Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed
@ 2024-08-20 14:17 Frédéric Danis
2024-08-21 14:50 ` patchwork-bot+bluetooth
0 siblings, 1 reply; 2+ messages in thread
From: Frédéric Danis @ 2024-08-20 14:17 UTC (permalink / raw)
To: linux-bluetooth
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>
---
This has been tested with 5.4 kernel only.
Afaict there's no change in this driver which should be impacted by
this commit in latest kernel.
v1 -> v2: Move speed copy from hci_bcm driver to hci_ldisc to be
more generic
drivers/bluetooth/hci_ldisc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index d307c41a5470..395d66e32a2e 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -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);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-21 14:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 14:17 [PATCH v2] Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed Frédéric Danis
2024-08-21 14:50 ` patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox