[NEUS7920-133]wlbt: allow BT address to be read from file
authorIvan Priest <i.priest@samsung.com>
Tue, 12 Feb 2019 16:03:18 +0000 (16:03 +0000)
committerYoungmin Nam <youngmin.nam@samsung.com>
Tue, 21 May 2019 10:45:23 +0000 (19:45 +0900)
Some customer platforms provide the BT address in a file,
which may in in procfs, (e.g. to support factory test binary)
Provide a kernel config to allow this to be used.

Change-Id: Icb309a8b2e54b3404eaaa0fc6fa0666bb512f5d6
SCSC-Bug-Id: SSB-49343
Signed-off-by: Ivan Priest <i.priest@samsung.com>
drivers/misc/samsung/scsc_bt/Kconfig
drivers/misc/samsung/scsc_bt/scsc_bt_module.c
drivers/misc/samsung/scsc_bt/scsc_bt_priv.h

index e783055bbcb592b88db88364e8ddc88ffb2ddf1f..9be9a00cd86e15f6d0b989ce8c13c852956889a7 100644 (file)
@@ -13,3 +13,17 @@ config SCSC_ANT
         depends on SCSC_CORE
        ---help---
          This module adds support for using a ANT character device.
+
+config SCSC_BT_ADDRESS_IN_FILE
+       default N
+       tristate "SCSC MX BT support"
+       depends on SCSC_CORE
+       ---help---
+         Allow BT address to be read from a file
+
+config SCSC_BT_ADDRESS_FILENAME
+       string "BT address filename"
+       depends on SCSC_CORE
+       default "/mnt/vendor/efs/bluetooth/bt_addr"
+       ---help---
+         Select the named BT address override file.
index 62365edfa120c245711b1f384d2fd682b567189c..9ae6982b17dbc1eba6edd229b20230fe2b610f9c 100755 (executable)
@@ -81,7 +81,7 @@ static int ant_service_start_count;
 
 static u64 bluetooth_address;
 #ifdef CONFIG_ARCH_EXYNOS
-static char *bluetooth_address_fallback = "00:00:00:00:00:00";
+static char bluetooth_address_fallback[] = "00:00:00:00:00:00";
 #endif
 static u32 bt_info_trigger;
 static u32 bt_info_interrupt;
@@ -100,7 +100,8 @@ MODULE_PARM_DESC(bluetooth_address,
                 "Bluetooth address");
 
 #ifdef CONFIG_ARCH_EXYNOS
-module_param(bluetooth_address_fallback, charp, 0444);
+module_param_string(bluetooth_address_fallback, bluetooth_address_fallback,
+                   sizeof(bluetooth_address_fallback), 0444);
 MODULE_PARM_DESC(bluetooth_address_fallback,
                 "Bluetooth address as proposed by the driver");
 #endif
@@ -639,7 +640,8 @@ static int setup_bhcs(struct scsc_service *service,
                        (bluetooth_address & 0x000000FFFFFF);
        }
 
-       /* Request the EFS Bluetooth address file */
+#ifdef SCSC_BT_ADDR
+       /* Request the Bluetooth address file */
        SCSC_TAG_DEBUG(BT_COMMON,
                "loading Bluetooth address configuration file: "
                SCSC_BT_ADDR "\n");
@@ -682,6 +684,7 @@ static int setup_bhcs(struct scsc_service *service,
                mx140_release_file(common_service.maxwell_core, firm);
                firm = NULL;
        }
+#endif
 
 #ifdef CONFIG_SCSC_DEBUG
        SCSC_TAG_DEBUG(BT_COMMON, "Bluetooth address: %04X:%02X:%06X\n",
index c2c7cc3af241ab2c4bca6bd14e17c5d57cf1b19c..42cc2f682959e21907a5fe9d8506909c831e4634 100755 (executable)
@@ -52,8 +52,8 @@
 #ifdef CONFIG_SCSC_BT_BLUEZ
 #define SCSC_BT_ADDR      "/csa/bluetooth/.bd_addr"
 #define SCSC_BT_ADDR_LEN  (3)
-#else
-#define SCSC_BT_ADDR      "/mnt/vendor/efs/bluetooth/bt_addr"
+#elif defined CONFIG_SCSC_BT_ADDRESS_IN_FILE
+#define SCSC_BT_ADDR      CONFIG_SCSC_BT_ADDRESS_FILENAME
 #define SCSC_BT_ADDR_LEN  (6)
 #endif