a221861d2c76e7f55ae41b3e98b3805b123e6352
[librecmc/package-feed.git] / utils / bluez / patches / 002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch
1 From e145c9621f976063e5c573db1f2053d906f63427 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Tue, 16 Feb 2016 16:39:09 +0000
4 Subject: [PATCH 2/4] bcm43xx: The UART speed must be reset after the firmware
5  download
6
7 ---
8  tools/hciattach_bcm43xx.c | 6 ++----
9  1 file changed, 2 insertions(+), 4 deletions(-)
10
11 --- a/tools/hciattach_bcm43xx.c
12 +++ b/tools/hciattach_bcm43xx.c
13 @@ -366,11 +366,8 @@ int bcm43xx_init(int fd, int def_speed,
14                 return -1;
15  
16         if (bcm43xx_locate_patch(FIRMWARE_DIR, chip_name, fw_path)) {
17 -               fprintf(stderr, "Patch not found, continue anyway\n");
18 +               fprintf(stderr, "Patch not found for %s, continue anyway\n", chip_name);
19         } else {
20 -               if (bcm43xx_set_speed(fd, ti, speed))
21 -                       return -1;
22 -
23                 if (bcm43xx_load_firmware(fd, fw_path))
24                         return -1;
25  
26 @@ -380,6 +377,7 @@ int bcm43xx_init(int fd, int def_speed,
27                         return -1;
28                 }
29  
30 +               sleep(1);
31                 if (bcm43xx_reset(fd))
32                         return -1;
33         }