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 <hector.palacios@digi.com> https://jira.digi.com/browse/DEL-2109
This commit is contained in:
parent
52c8fb836a
commit
84e152f1ca
|
|
@ -22,12 +22,11 @@ if [ "${1}" != "start" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SCRIPTNAME="$(basename "${0}")"
|
SCRIPTNAME="$(basename "${0}")"
|
||||||
MACHINENAME="$(cat /proc/device-tree/digi,machine,name 2>/dev/null)"
|
|
||||||
|
|
||||||
bt_init() {
|
bt_init() {
|
||||||
if [ "${MACHINENAME}" = "ccardimx28" ]; then
|
if grep -qs '\<digi,ccardimx28\>' /proc/device-tree/compatible; then
|
||||||
BT_PWR_GPIO_NR="21"
|
BT_PWR_GPIO_NR="21"
|
||||||
elif [ "${MACHINENAME}" = "ccimx6sbc" ]; then
|
elif grep -qs '\<digi,ccimx6\>' /proc/device-tree/compatible; then
|
||||||
BT_PWR_GPIO_NR="244"
|
BT_PWR_GPIO_NR="244"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue