From 84e152f1ca8c811c4b4aa70b46b510c8538a7cb5 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 28 Dec 2015 12:22:46 +0100 Subject: [PATCH] bluez-init: get BT power GPIO basing on compatible module The BT power GPIOgpio was determined basing on machine name on device tree. This corresponds to the name of the board, and might be changed by a user that designs his own carrier board to use the module on. Besides, the BT power GPIO is a pin that's routed on the module (both on the ConnectCore 6 and on the ConnectCard for i.MX28) not on the carrier board. This commit determines the BT power GPIO basing on the module string inside the 'compatible' property. This must exactly match the module name and is a required property for using Digi module's BSP. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-2109 --- meta-digi-dey/recipes-connectivity/bluez/bluez5/bluez-init | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5/bluez-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5/bluez-init index dbd5fc7e8..9d1b967a0 100755 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5/bluez-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5/bluez-init @@ -22,12 +22,11 @@ if [ "${1}" != "start" ]; then fi SCRIPTNAME="$(basename "${0}")" -MACHINENAME="$(cat /proc/device-tree/digi,machine,name 2>/dev/null)" bt_init() { - if [ "${MACHINENAME}" = "ccardimx28" ]; then + if grep -qs '\' /proc/device-tree/compatible; then BT_PWR_GPIO_NR="21" - elif [ "${MACHINENAME}" = "ccimx6sbc" ]; then + elif grep -qs '\' /proc/device-tree/compatible; then BT_PWR_GPIO_NR="244" fi