• Martin Blumenstingl's avatar
    Bluetooth: btrtl: add support for retrieving the UART settings · b85b0ee1
    Martin Blumenstingl authored
    The UART settings are embedded in the config blob. This has to be parsed
    to successfully initialize the Bluetooth part of the RTL8723BS (which is
    an SDIO chip, but the Bluetooth part is connected via UART).
    
    The Realtek "rtl8723bs_bt" and "rtl8723ds_bt" userspace Bluetooth UART
    initialization tools (rtk_hciattach) use the following sequence:
    - send H5 sync pattern (already supported by hci_h5)
    - get LMP version (already supported by btrtl)
    - get ROM version (already supported by btrtl)
    - load the firmware and config for the current chipset (already
      supported by btrtl)
    - read UART settings from the config blob (part of this patch)
    - send UART settings via a vendor command to the device (which changes
      the baudrate of the device and enables or disables flow control
      depending on the config)
    - change the baudrate and flow control settings on the host
    - send the firmware and config blob to the device (already supported by
      btrtl)
    
    Sending the last firmware and config blob download command
    (rtl_download_cmd) fails if the UART settings are not updated
    beforehand. This is presumably because the device applies the config
    right after the firmware and config blob download - which means that at
    this point the host is using different UART settings than the device
    (which will obviously result in non-working communication).
    Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
    Signed-off-by: default avatarJeremy Cline <jeremy@jcline.org>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    b85b0ee1
btrtl.c 17.6 KB