bluez init: add HW variants for ccimx6

https://jira.digi.com/browse/DEL-1157

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2014-07-30 12:37:18 +02:00
parent 9e8c3630de
commit df97e28cbe
1 changed files with 9 additions and 3 deletions

View File

@ -3,7 +3,7 @@
# #
# bluez # bluez
# #
# Copyright (C) 2012-2013 by Digi International Inc. # Copyright (C) 2012-2014 by Digi International Inc.
# All rights reserved. # All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify it # This program is free software; you can redistribute it and/or modify it
@ -21,7 +21,7 @@ if [ "${1}" != "start" ]; then
exit 0 exit 0
fi fi
SCRIPTNAME="${0}" SCRIPTNAME="$(basename ${0})"
bt_init() { bt_init() {
# #
@ -32,11 +32,17 @@ bt_init() {
MOD_VARIANT="$(cat /proc/device-tree/digi,hwid,variant 2>/dev/null || \ MOD_VARIANT="$(cat /proc/device-tree/digi,hwid,variant 2>/dev/null || \
cat /sys/kernel/${MACHINENAME}/mod_variant)" cat /sys/kernel/${MACHINENAME}/mod_variant)"
if ! echo ${BLUE_TOOTH_VARIANTS} | grep -qs ${MOD_VARIANT}; then if ! echo ${BLUE_TOOTH_VARIANTS} | grep -qs ${MOD_VARIANT}; then
echo "${SCRIPTNAME}: FAILED (variant ${MOD_VARIANT} does not support bluetooth)" echo "${SCRIPTNAME}: variant ${MOD_VARIANT} does not support bluetooth"
exit exit
fi fi
BT_PWR_GPIO_NR="21" BT_PWR_GPIO_NR="21"
elif [ "${MACHINENAME}" = "ccimx6adpt" -o "${MACHINENAME}" = "ccimx6sbc" ]; then elif [ "${MACHINENAME}" = "ccimx6adpt" -o "${MACHINENAME}" = "ccimx6sbc" ]; then
BLUE_TOOTH_VARIANTS="0x02 0x03 0x04 0x06"
MOD_VARIANT="$(cat /proc/device-tree/digi,hwid,variant)"
if ! echo ${BLUE_TOOTH_VARIANTS} | grep -qs ${MOD_VARIANT}; then
echo "${SCRIPTNAME}: variant ${MOD_VARIANT} does not support bluetooth"
exit
fi
BT_PWR_GPIO_NR="244" BT_PWR_GPIO_NR="244"
fi fi