[9610][7885][7570] wlbt: module param override for HCF path
authorIvan Priest <i.priest@samsung.com>
Tue, 12 Jun 2018 16:03:32 +0000 (17:03 +0100)
committerTarun Karela <t.karela@samsung.com>
Fri, 22 Jun 2018 08:50:03 +0000 (09:50 +0100)
Add the cfg_platform module parameter which allows the
subdirectory containing the HCF files to be overridden.

Use "echo -n <platform>" to override.

Change-Id: I1e2980821d05e35697471a6c7867ae46640243c6
SCSC-Bug-Id: SSB-40752
Signed-off-by: Ivan Priest <i.priest@samsung.com>
(cherry picked from commit cc33db2d54d068505e8cf6998d836b57d19fc48e)

drivers/misc/samsung/scsc/mx140_file.c

index 4beba19706adf14a9a0e7bdbc2e7b77d89142231..4ee6d6ed33162f9a0bd2306f9f634cbbd05624d6 100644 (file)
@@ -118,6 +118,10 @@ static bool use_new_fw_structure = true;
 module_param(use_new_fw_structure, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(use_new_fw_structure, "deprecated");
 
+static char *cfg_platform = "default";
+module_param(cfg_platform, charp, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(cfg_platform, "HCF config subdirectory");
+
 /* Reads a configuration file into memory (f/w profile specific) */
 static int __mx140_file_request_conf(struct scsc_mx *mx,
                const struct firmware **conf,
@@ -150,7 +154,15 @@ int mx140_file_request_conf(struct scsc_mx *mx, const struct firmware **conf, co
 {
        int r;
 
-       /* First search in generic location. This is an override.
+       /* First, if the config subdirectory has been overriden by cfg_platform
+        * module parameter, search only in that location.
+        */
+       if (strcmp(cfg_platform, "default")) {
+               SCSC_TAG_INFO(MX_FILE, "module param cfg_platform = %s\n", cfg_platform);
+               return __mx140_file_request_conf(mx, conf, cfg_platform, config_rel_path);
+       }
+
+       /* Search in generic location. This is an override.
         * e.g. /etc/wifi/mx140/conf/wlan/wlan.hcf
         */
        r = __mx140_file_request_conf(mx, conf, "", config_rel_path);