OSDN Git Service

soc: qcom: pil: allow to set subsystem firmware name
authorAmir Samuelov <amirs@codeaurora.org>
Fri, 9 Sep 2016 08:42:57 +0000 (11:42 +0300)
committerGerrit - the friendly Code Review server <code-review@localhost>
Fri, 9 Sep 2016 19:54:32 +0000 (12:54 -0700)
Allow the PIL client to set the firmware file name
for a specific subsystem.

Change-Id: Ib410cae212afb067f5df2e5d25f4f23f583ed1f2
Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
drivers/soc/qcom/subsystem_restart.c
include/soc/qcom/subsystem_restart.h

index 0ed8a65..76d941c 100644 (file)
@@ -746,6 +746,28 @@ static void subsys_stop(struct subsys_device *subsys)
        notify_each_subsys_device(&subsys, 1, SUBSYS_AFTER_SHUTDOWN, NULL);
 }
 
+int subsystem_set_fwname(const char *name, const char *fw_name)
+{
+       struct subsys_device *subsys;
+
+       if (!name)
+               return -EINVAL;
+
+       if (!fw_name)
+               return -EINVAL;
+
+       subsys = find_subsys(name);
+       if (!subsys)
+               return -EINVAL;
+
+       pr_debug("Changing subsys [%s] fw_name to [%s]\n", name, fw_name);
+       strlcpy(subsys->desc->fw_name, fw_name,
+               sizeof(subsys->desc->fw_name));
+
+       return 0;
+}
+EXPORT_SYMBOL(subsystem_set_fwname);
+
 void *__subsystem_get(const char *name, const char *fw_name)
 {
        struct subsys_device *subsys;
index 3a5f6e6..780666c 100644 (file)
@@ -113,6 +113,7 @@ extern int subsystem_crashed(const char *name);
 
 extern void *subsystem_get(const char *name);
 extern void *subsystem_get_with_fwname(const char *name, const char *fw_name);
+extern int subsystem_set_fwname(const char *name, const char *fw_name);
 extern void subsystem_put(void *subsystem);
 
 extern struct subsys_device *subsys_register(struct subsys_desc *desc);
@@ -157,6 +158,11 @@ static inline void *subsystem_get_with_fwname(const char *name,
        return NULL;
 }
 
+static inline int subsystem_set_fwname(const char *name,
+                               const char *fw_name) {
+       return 0;
+}
+
 static inline void subsystem_put(void *subsystem) { }
 
 static inline