From a6d0a1d1399a62702d9290e3c07f8334dfbfd282 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Thu, 23 Jun 2016 11:31:24 +0200 Subject: [PATCH] bluez5-init: reset bluetooth qualcomm chip before initialization The power regulator connected to the qca6554 chip is always on, which causes the Bluetooth part to not work correctly after a software-reset. This commit asserts momentarily the BT_EN line during the start-up sequence to reset the Bluetooth controller so that it is in a predictable state after a reset. https://jira.digi.com/browse/DEL-2623 Signed-off-by: Isaac Hermida --- .../recipes-connectivity/bluez/bluez5-5.33/bluez-init | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/bluez-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/bluez-init index 9637792e5..363c7aa3a 100755 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/bluez-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/bluez-init @@ -26,6 +26,15 @@ SCRIPTNAME="$(basename "${0}")" bt_init_qca6564() { MOD_VERSION="$(($(cat /proc/device-tree/digi,hwid,hv 2>/dev/null || true)))" + # Reset the BT_EN line + BT_EN_QCA_GPIO_NR="137" + BT_EN_L="/sys/class/gpio/gpio${BT_EN_QCA_GPIO_NR}" + [ -d "${BT_EN_L}" ] || printf "%s" ${BT_EN_QCA_GPIO_NR} > /sys/class/gpio/export + printf out > ${BT_EN_L}/direction && sleep .1 + printf 0 > ${BT_EN_L}/value && sleep .1 + printf 1 > ${BT_EN_L}/value && sleep .1 + [ -d "${BT_EN_L}" ] && printf "%s" ${BT_EN_QCA_GPIO_NR} > /sys/class/gpio/unexport + # Module version older than revision 4 has swapped TX and RX lines if [ "${MOD_VERSION}" -lt "4" ]; then # Workaround to ignore the CTS flow control line