Commit 0383f16a authored by Hans de Goede's avatar Hans de Goede Committed by Marcel Holtmann

Bluetooth: btbcm: Make btbcm_setup_patchram use btbcm_finalize

On UART attached devices we do:

1. btbcm_initialize()
2. Setup UART baudrate, etc.
3. btbcm_finalize()

After our previous changes we can now also use btbcm_finalize() from
the btbcm_setup_patchram() function used on USB devices without any
functional changes. This completes unifying the USB and UART paths
as much as possible.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 2fcdd562
...@@ -502,15 +502,16 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done) ...@@ -502,15 +502,16 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done)
} }
EXPORT_SYMBOL_GPL(btbcm_initialize); EXPORT_SYMBOL_GPL(btbcm_initialize);
int btbcm_finalize(struct hci_dev *hdev) int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done)
{ {
bool fw_load_done = true;
int err; int err;
/* Re-initialize */ /* Re-initialize if necessary */
err = btbcm_initialize(hdev, &fw_load_done); if (*fw_load_done) {
err = btbcm_initialize(hdev, fw_load_done);
if (err) if (err)
return err; return err;
}
btbcm_check_bdaddr(hdev); btbcm_check_bdaddr(hdev);
...@@ -530,20 +531,8 @@ int btbcm_setup_patchram(struct hci_dev *hdev) ...@@ -530,20 +531,8 @@ int btbcm_setup_patchram(struct hci_dev *hdev)
if (err) if (err)
return err; return err;
if (!fw_load_done)
goto done;
/* Re-initialize after loading Patch */ /* Re-initialize after loading Patch */
err = btbcm_initialize(hdev, &fw_load_done); return btbcm_finalize(hdev, &fw_load_done);
if (err)
return err;
done:
btbcm_check_bdaddr(hdev);
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
return 0;
} }
EXPORT_SYMBOL_GPL(btbcm_setup_patchram); EXPORT_SYMBOL_GPL(btbcm_setup_patchram);
......
...@@ -63,7 +63,7 @@ int btbcm_setup_patchram(struct hci_dev *hdev); ...@@ -63,7 +63,7 @@ int btbcm_setup_patchram(struct hci_dev *hdev);
int btbcm_setup_apple(struct hci_dev *hdev); int btbcm_setup_apple(struct hci_dev *hdev);
int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done); int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done);
int btbcm_finalize(struct hci_dev *hdev); int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done);
#else #else
...@@ -109,7 +109,7 @@ static inline int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done) ...@@ -109,7 +109,7 @@ static inline int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done)
return 0; return 0;
} }
static inline int btbcm_finalize(struct hci_dev *hdev) static inline int btbcm_finalize(struct hci_dev *hdev, bool *fw_load_done)
{ {
return 0; return 0;
} }
......
...@@ -606,7 +606,7 @@ static int bcm_setup(struct hci_uart *hu) ...@@ -606,7 +606,7 @@ static int bcm_setup(struct hci_uart *hu)
btbcm_write_pcm_int_params(hu->hdev, &params); btbcm_write_pcm_int_params(hu->hdev, &params);
} }
err = btbcm_finalize(hu->hdev); err = btbcm_finalize(hu->hdev, &fw_load_done);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment