From 32ae76e1cf10ae45b113a7c6587c854254b940d2 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Thu, 23 Jun 2016 14:43:40 +0200 Subject: [PATCH] bluez5-init: rename the CTS gpio name and make the code more robust Signed-off-by: Isaac Hermida --- .../recipes-connectivity/bluez/bluez5-5.33/bluez-init | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 363c7aa3a..583910c9f 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 @@ -38,10 +38,12 @@ bt_init_qca6564() { # 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 - BT_GPIO_CTS="18" - echo "${BT_GPIO_CTS}" > /sys/class/gpio/export - echo "out" > /sys/class/gpio/gpio${BT_GPIO_CTS}/direction - echo "0" > /sys/class/gpio/gpio${BT_GPIO_CTS}/value + BT_CTS_QCA_GPIO_NR="18" + BT_CTS_L="/sys/class/gpio/gpio${BT_CTS_QCA_GPIO_NR}" + [ -d "${BT_CTS_L}" ] || printf "%s" ${BT_CTS_QCA_GPIO_NR} > /sys/class/gpio/export + printf out > ${BT_CTS_L}/direction && sleep .1 + printf 0 > ${BT_CTS_L}/value && sleep .1 + [ -d "${BT_CTS_L}" ] && printf "%s" ${BT_CTS_QCA_GPIO_NR} > /sys/class/gpio/unexport # Reduce the rate to avoid the need for HW flow control BT_RATE="115200" BT_FLOW="noflow"